idnits 2.17.1 draft-ietf-dime-rfc3588bis-12.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- ** It looks like you're using RFC 3978 boilerplate. You should update this to the boilerplate described in the IETF Trust License Policy document (see https://trustee.ietf.org/license-info), which is required now. -- Found old boilerplate from RFC 3978, Section 5.1 on line 20. -- Found old boilerplate from RFC 3978, Section 5.5, updated by RFC 4748 on line 6792. -- Found old boilerplate from RFC 3979, Section 5, paragraph 1 on line 6803. -- Found old boilerplate from RFC 3979, Section 5, paragraph 2 on line 6810. -- Found old boilerplate from RFC 3979, Section 5, paragraph 3 on line 6816. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- == There are 2 instances of lines with non-RFC2606-compliant FQDNs in the document. == There are 2 instances of lines with non-RFC6890-compliant IPv4 addresses in the document. If these are example addresses, they should be changed. -- 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 Copyright Line does not match the current year == Line 4481 has weird spacing: '...ly with wit...' == Line 4689 has weird spacing: '...ealtime user...' == Line 4717 has weird spacing: '... record inter...' == Line 4727 has weird spacing: '...ealtime user...' == Line 4735 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 (September 8, 2008) is 5702 days in the past. Is this intentional? Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) == Missing Reference: 'PXY' is mentioned on line 4196, but not defined -- Possible downref: Non-RFC (?) normative reference: ref. 'FLOATPOINT' -- Possible downref: Non-RFC (?) normative reference: ref. 'IANAADFAM' -- Possible downref: Non-RFC (?) normative reference: ref. 'RADTYPE' ** Obsolete normative reference: RFC 793 (Obsoleted by RFC 9293) ** Obsolete normative reference: RFC 4005 (Obsoleted by RFC 7155) ** Obsolete normative reference: RFC 4006 (Obsoleted by RFC 8506) ** Obsolete normative reference: RFC 4234 (Obsoleted by RFC 5234) ** Obsolete normative reference: RFC 3588 (Obsoleted by RFC 6733) ** Obsolete normative reference: RFC 2434 (Obsoleted by RFC 5226) ** Obsolete normative reference: RFC 4306 (Obsoleted by RFC 5996) ** Obsolete normative reference: RFC 4282 (Obsoleted by RFC 7542) ** Obsolete normative reference: RFC 2960 (Obsoleted by RFC 4960) ** Obsolete normative reference: RFC 4346 (Obsoleted by RFC 5246) ** Obsolete normative reference: RFC 3280 (Obsoleted by RFC 5280) ** Obsolete normative reference: RFC 3490 (Obsoleted by RFC 5890, RFC 5891) ** Obsolete normative reference: RFC 3491 (Obsoleted by RFC 5891) -- Obsolete informational reference (is this intentional?): RFC 3576 (Obsoleted by RFC 5176) -- Obsolete informational reference (is this intentional?): RFC 4330 (Obsoleted by RFC 5905) Summary: 14 errors (**), 0 flaws (~~), 10 warnings (==), 13 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: March 12, 2009 J. Loughney 7 Nokia Research Center 8 G. Zorn 9 NetCube 10 September 8, 2008 12 Diameter Base Protocol 13 draft-ietf-dime-rfc3588bis-12.txt 15 Status of this Memo 17 By submitting this Internet-Draft, each author represents that any 18 applicable patent or other IPR claims of which he or she is aware 19 have been or will be disclosed, and any of which he or she becomes 20 aware will be disclosed, in accordance with Section 6 of BCP 79. 22 Internet-Drafts are working documents of the Internet Engineering 23 Task Force (IETF), its areas, and its working groups. Note that 24 other groups may also distribute working documents as Internet- 25 Drafts. 27 Internet-Drafts are draft documents valid for a maximum of six months 28 and may be updated, replaced, or obsoleted by other documents at any 29 time. It is inappropriate to use Internet-Drafts as reference 30 material or to cite them other than as "work in progress." 32 The list of current Internet-Drafts can be accessed at 33 http://www.ietf.org/ietf/1id-abstracts.txt. 35 The list of Internet-Draft Shadow Directories can be accessed at 36 http://www.ietf.org/shadow.html. 38 This Internet-Draft will expire on March 12, 2009. 40 Copyright Notice 42 Copyright (C) The IETF Trust (2008). 44 Abstract 46 The Diameter base protocol is intended to provide an Authentication, 47 Authorization and Accounting (AAA) framework for applications such as 48 network access or IP mobility. Diameter is also intended to work in 49 both local Authentication, Authorization & Accounting and roaming 50 situations. This document specifies the message format, transport, 51 error reporting, accounting and security services to be used by all 52 Diameter applications. The Diameter base application needs to be 53 supported by all Diameter implementations. 55 Table of Contents 57 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 7 58 1.1. Diameter Protocol . . . . . . . . . . . . . . . . . . . . 9 59 1.1.1. Description of the Document Set . . . . . . . . . . 11 60 1.1.2. Conventions Used in This Document . . . . . . . . . 12 61 1.1.3. Changes from RFC3588 . . . . . . . . . . . . . . . . 12 62 1.2. Approach to Extensibility . . . . . . . . . . . . . . . . 13 63 1.2.1. Defining New AVP Values . . . . . . . . . . . . . . 13 64 1.2.2. Creating New AVPs . . . . . . . . . . . . . . . . . 13 65 1.2.3. Creating New Commands . . . . . . . . . . . . . . . 14 66 1.2.4. Creating New Diameter Applications . . . . . . . . . 14 67 1.3. Terminology . . . . . . . . . . . . . . . . . . . . . . . 15 68 2. Protocol Overview . . . . . . . . . . . . . . . . . . . . . . 22 69 2.1. Transport . . . . . . . . . . . . . . . . . . . . . . . . 23 70 2.1.1. SCTP Guidelines . . . . . . . . . . . . . . . . . . 24 71 2.2. Securing Diameter Messages . . . . . . . . . . . . . . . 24 72 2.3. Diameter Application Compliance . . . . . . . . . . . . . 24 73 2.4. Application Identifiers . . . . . . . . . . . . . . . . . 24 74 2.5. Connections vs. Sessions . . . . . . . . . . . . . . . . 25 75 2.6. Peer Table . . . . . . . . . . . . . . . . . . . . . . . 26 76 2.7. Routing Table . . . . . . . . . . . . . . . . . . . . . . 27 77 2.8. Role of Diameter Agents . . . . . . . . . . . . . . . . . 28 78 2.8.1. Relay Agents . . . . . . . . . . . . . . . . . . . . 30 79 2.8.2. Proxy Agents . . . . . . . . . . . . . . . . . . . . 31 80 2.8.3. Redirect Agents . . . . . . . . . . . . . . . . . . 31 81 2.8.4. Translation Agents . . . . . . . . . . . . . . . . . 32 82 2.9. Diameter Path Authorization . . . . . . . . . . . . . . . 33 83 3. Diameter Header . . . . . . . . . . . . . . . . . . . . . . . 35 84 3.1. Command Codes . . . . . . . . . . . . . . . . . . . . . . 38 85 3.2. Command Code ABNF specification . . . . . . . . . . . . . 38 86 3.3. Diameter Command Naming Conventions . . . . . . . . . . . 40 87 4. Diameter AVPs . . . . . . . . . . . . . . . . . . . . . . . . 42 88 4.1. AVP Header . . . . . . . . . . . . . . . . . . . . . . . 42 89 4.1.1. Optional Header Elements . . . . . . . . . . . . . . 43 90 4.2. Basic AVP Data Formats . . . . . . . . . . . . . . . . . 44 91 4.3. Derived AVP Data Formats . . . . . . . . . . . . . . . . 45 92 4.4. Grouped AVP Values . . . . . . . . . . . . . . . . . . . 52 93 4.4.1. Example AVP with a Grouped Data type . . . . . . . . 53 94 4.5. Diameter Base Protocol AVPs . . . . . . . . . . . . . . . 56 95 5. Diameter Peers . . . . . . . . . . . . . . . . . . . . . . . 59 96 5.1. Peer Connections . . . . . . . . . . . . . . . . . . . . 59 97 5.2. Diameter Peer Discovery . . . . . . . . . . . . . . . . . 59 98 5.3. Capabilities Exchange . . . . . . . . . . . . . . . . . . 62 99 5.3.1. Capabilities-Exchange-Request . . . . . . . . . . . 63 100 5.3.2. Capabilities-Exchange-Answer . . . . . . . . . . . . 64 101 5.3.3. Vendor-Id AVP . . . . . . . . . . . . . . . . . . . 64 102 5.3.4. Firmware-Revision AVP . . . . . . . . . . . . . . . 64 103 5.3.5. Host-IP-Address AVP . . . . . . . . . . . . . . . . 65 104 5.3.6. Supported-Vendor-Id AVP . . . . . . . . . . . . . . 65 105 5.3.7. Product-Name AVP . . . . . . . . . . . . . . . . . . 65 106 5.4. Disconnecting Peer connections . . . . . . . . . . . . . 65 107 5.4.1. Disconnect-Peer-Request . . . . . . . . . . . . . . 66 108 5.4.2. Disconnect-Peer-Answer . . . . . . . . . . . . . . . 66 109 5.4.3. Disconnect-Cause AVP . . . . . . . . . . . . . . . . 67 110 5.5. Transport Failure Detection . . . . . . . . . . . . . . . 67 111 5.5.1. Device-Watchdog-Request . . . . . . . . . . . . . . 67 112 5.5.2. Device-Watchdog-Answer . . . . . . . . . . . . . . . 68 113 5.5.3. Transport Failure Algorithm . . . . . . . . . . . . 68 114 5.5.4. Failover and Failback Procedures . . . . . . . . . . 68 115 5.6. Peer State Machine . . . . . . . . . . . . . . . . . . . 69 116 5.6.1. Incoming connections . . . . . . . . . . . . . . . . 71 117 5.6.2. Events . . . . . . . . . . . . . . . . . . . . . . . 72 118 5.6.3. Actions . . . . . . . . . . . . . . . . . . . . . . 73 119 5.6.4. The Election Process . . . . . . . . . . . . . . . . 75 120 6. Diameter message processing . . . . . . . . . . . . . . . . . 76 121 6.1. Diameter Request Routing Overview . . . . . . . . . . . . 76 122 6.1.1. Originating a Request . . . . . . . . . . . . . . . 77 123 6.1.2. Sending a Request . . . . . . . . . . . . . . . . . 77 124 6.1.3. Receiving Requests . . . . . . . . . . . . . . . . . 78 125 6.1.4. Processing Local Requests . . . . . . . . . . . . . 78 126 6.1.5. Request Forwarding . . . . . . . . . . . . . . . . . 78 127 6.1.6. Request Routing . . . . . . . . . . . . . . . . . . 78 128 6.1.7. Predictive Loop Avoidance . . . . . . . . . . . . . 79 129 6.1.8. Redirecting requests . . . . . . . . . . . . . . . . 79 130 6.1.9. Relaying and Proxying Requests . . . . . . . . . . . 81 131 6.2. Diameter Answer Processing . . . . . . . . . . . . . . . 82 132 6.2.1. Processing received Answers . . . . . . . . . . . . 82 133 6.2.2. Relaying and Proxying Answers . . . . . . . . . . . 82 134 6.3. Origin-Host AVP . . . . . . . . . . . . . . . . . . . . . 83 135 6.4. Origin-Realm AVP . . . . . . . . . . . . . . . . . . . . 83 136 6.5. Destination-Host AVP . . . . . . . . . . . . . . . . . . 83 137 6.6. Destination-Realm AVP . . . . . . . . . . . . . . . . . . 84 138 6.7. Routing AVPs . . . . . . . . . . . . . . . . . . . . . . 84 139 6.7.1. Route-Record AVP . . . . . . . . . . . . . . . . . . 84 140 6.7.2. Proxy-Info AVP . . . . . . . . . . . . . . . . . . . 84 141 6.7.3. Proxy-Host AVP . . . . . . . . . . . . . . . . . . . 85 142 6.7.4. Proxy-State AVP . . . . . . . . . . . . . . . . . . 85 143 6.8. Auth-Application-Id AVP . . . . . . . . . . . . . . . . . 85 144 6.9. Acct-Application-Id AVP . . . . . . . . . . . . . . . . . 85 145 6.10. Inband-Security-Id AVP . . . . . . . . . . . . . . . . . 85 146 6.11. Vendor-Specific-Application-Id AVP . . . . . . . . . . . 86 147 6.12. Redirect-Host AVP . . . . . . . . . . . . . . . . . . . . 87 148 6.13. Redirect-Host-Usage AVP . . . . . . . . . . . . . . . . . 87 149 6.14. Redirect-Max-Cache-Time AVP . . . . . . . . . . . . . . . 88 150 7. Error Handling . . . . . . . . . . . . . . . . . . . . . . . 90 151 7.1. Result-Code AVP . . . . . . . . . . . . . . . . . . . . . 91 152 7.1.1. Informational . . . . . . . . . . . . . . . . . . . 92 153 7.1.2. Success . . . . . . . . . . . . . . . . . . . . . . 92 154 7.1.3. Protocol Errors . . . . . . . . . . . . . . . . . . 93 155 7.1.4. Transient Failures . . . . . . . . . . . . . . . . . 94 156 7.1.5. Permanent Failures . . . . . . . . . . . . . . . . . 95 157 7.2. Error Bit . . . . . . . . . . . . . . . . . . . . . . . . 98 158 7.3. Error-Message AVP . . . . . . . . . . . . . . . . . . . . 98 159 7.4. Error-Reporting-Host AVP . . . . . . . . . . . . . . . . 98 160 7.5. Failed-AVP AVP . . . . . . . . . . . . . . . . . . . . . 99 161 7.6. Experimental-Result AVP . . . . . . . . . . . . . . . . . 100 162 7.7. Experimental-Result-Code AVP . . . . . . . . . . . . . . 100 163 8. Diameter User Sessions . . . . . . . . . . . . . . . . . . . 101 164 8.1. Authorization Session State Machine . . . . . . . . . . . 102 165 8.2. Accounting Session State Machine . . . . . . . . . . . . 107 166 8.3. Server-Initiated Re-Auth . . . . . . . . . . . . . . . . 112 167 8.3.1. Re-Auth-Request . . . . . . . . . . . . . . . . . . 112 168 8.3.2. Re-Auth-Answer . . . . . . . . . . . . . . . . . . . 113 169 8.4. Session Termination . . . . . . . . . . . . . . . . . . . 114 170 8.4.1. Session-Termination-Request . . . . . . . . . . . . 115 171 8.4.2. Session-Termination-Answer . . . . . . . . . . . . . 115 172 8.5. Aborting a Session . . . . . . . . . . . . . . . . . . . 116 173 8.5.1. Abort-Session-Request . . . . . . . . . . . . . . . 117 174 8.5.2. Abort-Session-Answer . . . . . . . . . . . . . . . . 117 175 8.6. Inferring Session Termination from Origin-State-Id . . . 118 176 8.7. Auth-Request-Type AVP . . . . . . . . . . . . . . . . . . 119 177 8.8. Session-Id AVP . . . . . . . . . . . . . . . . . . . . . 119 178 8.9. Authorization-Lifetime AVP . . . . . . . . . . . . . . . 120 179 8.10. Auth-Grace-Period AVP . . . . . . . . . . . . . . . . . . 121 180 8.11. Auth-Session-State AVP . . . . . . . . . . . . . . . . . 121 181 8.12. Re-Auth-Request-Type AVP . . . . . . . . . . . . . . . . 122 182 8.13. Session-Timeout AVP . . . . . . . . . . . . . . . . . . . 122 183 8.14. User-Name AVP . . . . . . . . . . . . . . . . . . . . . . 123 184 8.15. Termination-Cause AVP . . . . . . . . . . . . . . . . . . 123 185 8.16. Origin-State-Id AVP . . . . . . . . . . . . . . . . . . . 124 186 8.17. Session-Binding AVP . . . . . . . . . . . . . . . . . . . 125 187 8.18. Session-Server-Failover AVP . . . . . . . . . . . . . . . 125 188 8.19. Multi-Round-Time-Out AVP . . . . . . . . . . . . . . . . 126 189 8.20. Class AVP . . . . . . . . . . . . . . . . . . . . . . . . 126 190 8.21. Event-Timestamp AVP . . . . . . . . . . . . . . . . . . . 127 191 9. Accounting . . . . . . . . . . . . . . . . . . . . . . . . . 128 192 9.1. Server Directed Model . . . . . . . . . . . . . . . . . . 128 193 9.2. Protocol Messages . . . . . . . . . . . . . . . . . . . . 129 194 9.3. Accounting Application Extension and Requirements . . . . 129 195 9.4. Fault Resilience . . . . . . . . . . . . . . . . . . . . 130 196 9.5. Accounting Records . . . . . . . . . . . . . . . . . . . 130 197 9.6. Correlation of Accounting Records . . . . . . . . . . . . 131 198 9.7. Accounting Command-Codes . . . . . . . . . . . . . . . . 132 199 9.7.1. Accounting-Request . . . . . . . . . . . . . . . . . 132 200 9.7.2. Accounting-Answer . . . . . . . . . . . . . . . . . 133 201 9.8. Accounting AVPs . . . . . . . . . . . . . . . . . . . . . 134 202 9.8.1. Accounting-Record-Type AVP . . . . . . . . . . . . . 134 203 9.8.2. Acct-Interim-Interval AVP . . . . . . . . . . . . . 135 204 9.8.3. Accounting-Record-Number AVP . . . . . . . . . . . . 136 205 9.8.4. Acct-Session-Id AVP . . . . . . . . . . . . . . . . 136 206 9.8.5. Acct-Multi-Session-Id AVP . . . . . . . . . . . . . 136 207 9.8.6. Accounting-Sub-Session-Id AVP . . . . . . . . . . . 136 208 9.8.7. Accounting-Realtime-Required AVP . . . . . . . . . . 137 209 10. AVP Occurrence Table . . . . . . . . . . . . . . . . . . . . 138 210 10.1. Base Protocol Command AVP Table . . . . . . . . . . . . . 138 211 10.2. Accounting AVP Table . . . . . . . . . . . . . . . . . . 139 212 11. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 141 213 11.1. AVP Header . . . . . . . . . . . . . . . . . . . . . . . 141 214 11.1.1. AVP Codes . . . . . . . . . . . . . . . . . . . . . 141 215 11.1.2. AVP Flags . . . . . . . . . . . . . . . . . . . . . 142 216 11.2. Diameter Header . . . . . . . . . . . . . . . . . . . . . 142 217 11.2.1. Command Codes . . . . . . . . . . . . . . . . . . . 142 218 11.2.2. Command Flags . . . . . . . . . . . . . . . . . . . 143 219 11.3. Application Identifiers . . . . . . . . . . . . . . . . . 143 220 11.4. AVP Values . . . . . . . . . . . . . . . . . . . . . . . 144 221 11.4.1. Result-Code AVP Values . . . . . . . . . . . . . . . 144 222 11.4.2. Accounting-Record-Type AVP Values . . . . . . . . . 144 223 11.4.3. Termination-Cause AVP Values . . . . . . . . . . . . 144 224 11.4.4. Redirect-Host-Usage AVP Values . . . . . . . . . . . 144 225 11.4.5. Session-Server-Failover AVP Values . . . . . . . . . 144 226 11.4.6. Session-Binding AVP Values . . . . . . . . . . . . . 144 227 11.4.7. Disconnect-Cause AVP Values . . . . . . . . . . . . 145 228 11.4.8. Auth-Request-Type AVP Values . . . . . . . . . . . . 145 229 11.4.9. Auth-Session-State AVP Values . . . . . . . . . . . 145 230 11.4.10. Re-Auth-Request-Type AVP Values . . . . . . . . . . 145 231 11.4.11. Accounting-Realtime-Required AVP Values . . . . . . 145 232 11.4.12. Inband-Security-Id AVP (code 299) . . . . . . . . . 145 233 11.5. Diameter TCP/SCTP Port Numbers . . . . . . . . . . . . . 145 234 11.6. NAPTR Service Fields . . . . . . . . . . . . . . . . . . 145 236 12. Diameter protocol related configurable parameters . . . . . . 147 237 13. Security Considerations . . . . . . . . . . . . . . . . . . . 148 238 13.1. TLS Usage . . . . . . . . . . . . . . . . . . . . . . . . 148 239 13.2. Peer-to-Peer Considerations . . . . . . . . . . . . . . . 149 240 14. References . . . . . . . . . . . . . . . . . . . . . . . . . 150 241 14.1. Normative References . . . . . . . . . . . . . . . . . . 150 242 14.2. Informational References . . . . . . . . . . . . . . . . 152 243 Appendix A. Acknowledgements . . . . . . . . . . . . . . . . . . 154 244 Appendix B. NAPTR Example . . . . . . . . . . . . . . . . . . . 155 245 Appendix C. Duplicate Detection . . . . . . . . . . . . . . . . 156 246 Appendix D. Internationalized Domain Names . . . . . . . . . . . 158 247 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 159 248 Intellectual Property and Copyright Statements . . . . . . . . . 160 250 1. Introduction 252 Authentication, Authorization and Accounting (AAA) protocols such as 253 TACACS [RFC1492] and RADIUS [RFC2865] were initially deployed to 254 provide dial-up PPP [RFC1661] and terminal server access. Over time, 255 with the growth of the Internet and the introduction of new access 256 technologies (including wireless, DSL, Mobile IP and Ethernet), both 257 the amount and complexity of processing performed by routers and 258 network access servers (NAS) have increased, putting new demands on 259 AAA protocols. 261 Network access requirements for AAA protocols are summarized in 262 [RFC2989]. These include: 264 Failover 266 [RFC2865] does not define failover mechanisms, and as a result, 267 failover behavior differs between implementations. In order to 268 provide well defined failover behavior, Diameter supports 269 application-layer acknowledgements, and defines failover 270 algorithms and the associated state machine. This is described in 271 Section 5.5 and [RFC3539]. 273 Transmission-level security 275 [RFC2865] defines an application-layer authentication and 276 integrity scheme that is required only for use with Response 277 packets. While [RFC2869] defines an additional authentication and 278 integrity mechanism, use is only required during Extensible 279 Authentication Protocol (EAP) sessions. While attribute-hiding is 280 supported, [RFC2865] does not provide support for per-packet 281 confidentiality. In accounting, [RFC2866] assumes that replay 282 protection is provided by the backend billing server, rather than 283 within the protocol itself. 285 While [RFC3162] defines the use of IPsec with RADIUS, support for 286 IPsec is not required. Since within [RFC4306] authentication 287 occurs only within Phase 1 prior to the establishment of IPsec SAs 288 in Phase 2, it is typically not possible to define separate trust 289 or authorization schemes for each application. This limits the 290 usefulness of IPsec in inter-domain AAA applications (such as 291 roaming) where it may be desirable to define a distinct 292 certificate hierarchy for use in a AAA deployment. In order to 293 provide universal support for transmission-level security, and 294 enable both intra- and inter-domain AAA deployments, Diameter 295 provides support for TLS. Security is discussed in Section 13. 297 Reliable transport 299 RADIUS runs over UDP, and does not define retransmission behavior; 300 as a result, reliability varies between implementations. As 301 described in [RFC2975], this is a major issue in accounting, where 302 packet loss may translate directly into revenue loss. In order to 303 provide well defined transport behavior, Diameter runs over 304 reliable transport mechanisms (TCP, SCTP) as defined in [RFC3539]. 306 Agent support 308 [RFC2865] does not provide for explicit support for agents, 309 including Proxies, Redirects and Relays. Since the expected 310 behavior is not defined, it varies between implementations. 311 Diameter defines agent behavior explicitly; this is described in 312 Section 2.8. 314 Server-initiated messages 316 While RADIUS server-initiated messages are defined in [RFC3576], 317 support is optional. This makes it difficult to implement 318 features such as unsolicited disconnect or reauthentication/ 319 reauthorization on demand across a heterogeneous deployment. 320 Support for server-initiated messages is mandatory in Diameter, 321 and is described in Section 8. 323 Transition support 325 While Diameter does not share a common protocol data unit (PDU) 326 with RADIUS, considerable effort has been expended in enabling 327 backward compatibility with RADIUS, so that the two protocols may 328 be deployed in the same network. Initially, it is expected that 329 Diameter will be deployed within new network devices, as well as 330 within gateways enabling communication between legacy RADIUS 331 devices and Diameter agents. This capability, described in 332 [RFC4005], enables Diameter support to be added to legacy 333 networks, by addition of a gateway or server speaking both RADIUS 334 and Diameter. 336 In addition to addressing the above requirements, Diameter also 337 provides support for the following: 339 Capability negotiation 341 RADIUS does not support error messages, capability negotiation, or 342 a mandatory/non-mandatory flag for attributes. Since RADIUS 343 clients and servers are not aware of each other's capabilities, 344 they may not be able to successfully negotiate a mutually 345 acceptable service, or in some cases, even be aware of what 346 service has been implemented. Diameter includes support for error 347 handling (Section 7), capability negotiation (Section 5.3), and 348 mandatory/non-mandatory attribute-value pairs (AVPs) (Section 349 4.1). 351 Peer discovery and configuration 353 RADIUS implementations typically require that the name or address 354 of servers or clients be manually configured, along with the 355 corresponding shared secrets. This results in a large 356 administrative burden, and creates the temptation to reuse the 357 RADIUS shared secret, which can result in major security 358 vulnerabilities if the Request Authenticator is not globally and 359 temporally unique as required in [RFC2865]. Through DNS, Diameter 360 enables dynamic discovery of peers. Derivation of dynamic session 361 keys is enabled via transmission-level security. 363 Over time, the capabilities of Network Access Server (NAS) devices 364 have increased substantially. As a result, while Diameter is a 365 considerably more sophisticated protocol than RADIUS, it remains 366 feasible to implement within embedded devices, given improvements in 367 processor speeds and the widespread availability of embedded TLS 368 implementations. 370 1.1. Diameter Protocol 372 The Diameter base protocol provides the following facilities: 374 o Delivery of AVPs (attribute value pairs) 376 o Capabilities negotiation 378 o Error notification 380 o Extensibility, through addition of new applications, commands and 381 AVPs (required in [RFC2989]). 383 o Basic services necessary for applications, such as handling of 384 user sessions or accounting 386 All data delivered by the protocol is in the form of an AVP. Some of 387 these AVP values are used by the Diameter protocol itself, while 388 others deliver data associated with particular applications that 389 employ Diameter. AVPs may be added arbitrarily to Diameter messages, 390 so long as the requirements of a message's ABNF are met. AVPs are 391 used by the base Diameter protocol to support the following required 392 features: 394 o Transporting of user authentication information, for the purposes 395 of enabling the Diameter server to authenticate the user. 397 o Transporting of service specific authorization information, 398 between client and servers, allowing the peers to decide whether a 399 user's access request should be granted. 401 o Exchanging resource usage information, which MAY be used for 402 accounting purposes, capacity planning, etc. 404 o Relaying, proxying and redirecting of Diameter messages through a 405 server hierarchy. 407 The Diameter base protocol provides the minimum requirements needed 408 for a AAA protocol, as required by [RFC2989]. The base protocol may 409 be used by itself for accounting purposes only, or it may be used 410 with a Diameter application, such as Mobile IPv4 [RFC4004], or 411 network access [RFC4005]. It is also possible for the base protocol 412 to be extended for use in new applications, via the addition of new 413 commands or AVPs. At this time the focus of Diameter is network 414 access and accounting applications. A truly generic AAA protocol 415 used by many applications might provide functionality not provided by 416 Diameter. Therefore, it is imperative that the designers of new 417 applications understand their requirements before using Diameter. 418 See Section 2.4 for more information on Diameter applications. 420 Any node can initiate a request. In that sense, Diameter is a peer- 421 to-peer protocol. In this document, a Diameter Client is a device at 422 the edge of the network that performs access control, such as a 423 Network Access Server (NAS) or a Foreign Agent (FA). A Diameter 424 client generates Diameter messages to request authentication, 425 authorization, and accounting services for the user. A Diameter 426 agent is a node that does not provide local user authentication or 427 authorization services; agents include proxies, redirects and relay 428 agents. A Diameter server performs authentication and/or 429 authorization of the user. A Diameter node MAY act as an agent for 430 certain requests while acting as a server for others. 432 The Diameter protocol also supports server-initiated messages, such 433 as a request to abort service to a particular user. 435 1.1.1. Description of the Document Set 437 Currently, the Diameter specification consists of an updated version 438 of the base protocol specification (this document), Transport Profile 439 [RFC3539] and applications: Mobile IPv4 [RFC4004], NASREQ [RFC4005], 440 Credit Control [RFC4006], EAP [RFC4072] and SIP [RFC4740]. Note that 441 this document obsoletes [RFC3588]. A summary of the base protocol 442 updates included in this document can be found in Section 1.1.3. 444 The Transport Profile document [RFC3539] discusses transport layer 445 issues that arise with AAA protocols and recommendations on how to 446 overcome these issues. This document also defines the Diameter 447 failover algorithm and state machine. 449 The Mobile IPv4 [RFC4004] application defines a Diameter application 450 that allows a Diameter server to perform AAA functions for Mobile 451 IPv4 services to a mobile node. 453 The NASREQ [RFC4005] application defines a Diameter Application that 454 allows a Diameter server to be used in a PPP/SLIP Dial-Up and 455 Terminal Server Access environment. Consideration was given for 456 servers that need to perform protocol conversion between Diameter and 457 RADIUS. 459 The Credit Control [RFC4006] application defines a Diameter 460 Application that can be used to implement real-time credit-control 461 for a variety of end user services such as network access, SIP 462 services, messaging services, and download services. It provides a 463 general solution to real-time cost and credit-control. 465 The EAP [RFC4072] application defines a Diameter Application that can 466 be used to carry EAP packets between the Network Access Server (NAS) 467 working as an EAP authenticator and a back-end authentication server. 468 The Diameter EAP application is based on NASREQ and intended for a 469 similar environment. 471 The SIP [RFC4740] application defines a Diameter Application that 472 allows a Diameter client to request authentication and authorization 473 information to a Diameter server for SIP-based IP multimedia services 474 (see SIP [RFC3261]). 476 In summary, this document defines the base protocol specification for 477 AAA, which includes support for accounting. The applications 478 documents describe applications that use this base specification for 479 Authentication, Authorization and Accounting. 481 1.1.2. Conventions Used in This Document 483 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 484 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 485 document are to be interpreted as described in [RFC2119]. 487 1.1.3. Changes from RFC3588 489 This document deprecates [RFC3588] but is fully backward compatible 490 with that document. The changes introduced in this document focuses 491 on fixing issues that has surfaced during implementation of 492 [RFC3588]. An overview of some the major changes are shown below. 494 o Simplified Security Requirements. The use of a secured transport 495 for exchanging Diameter messages remains mandatory. However, TLS 496 has become the primary method of securing Diameter and IPSec is a 497 secondary alternative. See Section 13 for details. Along with 498 this, support for the End-to-End security framework (E2ESequence 499 AVP and 'P'-bit in the AVP header) has also been deprecated. 501 o Diameter Extensibility Changes. This includes fixes to the 502 Diameter extensibility specification (Section 1.2 and others) to 503 better aid Diameter application designers. It also includes 504 allocation of vendor specific command code space. The new 505 specification relaxes the allocation of command codes for vendor 506 specific uses. See Section 11.2.1 for details. 508 o Application Id Usage. Clarify the proper use of Application Id 509 information which can be found in multiple places within a 510 Diameter message. This includes co-relating Application Ids found 511 in the message headers and AVPs. These changes also clearly 512 specifies the proper Application Id value to use for specific base 513 protocol messages (ASR/ASA, STR/STA) as well as clarifying the 514 content and use of Vendor-Specific-Application-Id. 516 o Routing Fixes. For general routing, specifies much more clearly 517 what information (AVPs and Application Id) can be used for making 518 routing decisions. Prioritization of redirect routing criterias 519 when multiple route entries are found via redirects has also been 520 added (See Section 6.13 for details). 522 o Simplification of Diameter Peer Discovery. The Diameter discovery 523 process now supports only well known discovery schemes. The rest 524 has been deprecated. (See Section 5.2 for details). 526 There are many other many miscellaneous fixes that has been 527 introduced in this document that may not be considered significant 528 but they are important nonetheless. Examples are removal of obsolete 529 types, fixes to command ABNFs, fixes to the state machine, 530 clarification on election process, message validation, fixes to 531 Failed-AVP and Result-Code AVP values etc. A comprehensive list of 532 changes is not shown here for practical reasons. Though, that can be 533 generated via a diff comparison between this document and [RFC3588]. 535 1.2. Approach to Extensibility 537 The Diameter protocol is designed to be extensible, using several 538 mechanisms, including: 540 o Defining new AVP values 542 o Creating new AVPs 544 o Creating new commands 546 o Creating new applications 548 From the point of extensibility Diameter authentication, 549 authorization and accounting applications are treated in the same 550 way. 552 Note: Protocol designer should try to re-use existing functionality, 553 namely AVP values, AVPs, commands, and Diameter applications. Reuse 554 simplifies standardization and implementation. To avoid potential 555 interoperability issues it is important to ensure that the semantics 556 of the re-used features are well understood. 558 1.2.1. Defining New AVP Values 560 In order to allocate a new AVP value for AVPs defined in the Diameter 561 Base protocol, the IETF needs to approve a new RFC that describes the 562 AVP value. IANA considerations for these AVP values are discussed in 563 Section 11.4. 565 The allocation of AVP values for other AVPs is guided by the IANA 566 considerations of the documents that defines those AVPs. Typically, 567 allocation of new values for an AVP defined in an IETF RFC should 568 require IETF Review [RFC2434], where as values for vendor-specific 569 AVPs can be allocated by the vendor. 571 1.2.2. Creating New AVPs 573 A new AVP being defined MUST use one of the data types listed in 574 Section 4.2 or 4.3. If an appropriate derived data type is already 575 defined, it SHOULD be used instead of the base data type to encourage 576 reusability and good design practice. 578 In the event that a logical grouping of AVPs is necessary, and 579 multiple "groups" are possible in a given command, it is recommended 580 that a Grouped AVP be used (see Section 4.4). 582 The creation of new AVPs can happen in various ways. The recommended 583 approach is to define a new general-purpose AVP in a standards track 584 RFC approved by the IETF. However, as described in Section 11.1.1 585 there are also other mechanisms. 587 1.2.3. Creating New Commands 589 A new Command Code MUST be allocated when new required AVPs (those 590 indicated as {AVP}) are added, deleted or are redefined (for example 591 by changing a required AVP into an optional one). 593 Furthermore, when a command is modified with respect to the number of 594 round trips then a new Command Code has to be registered. 596 A change to the ABNF of a command, such as described above, MUST 597 result in the definition of a new Command Code. This subsequently 598 leads to the need to define a new Diameter Application for any 599 application that will use that new Command. 601 The IANA considerations for commands are discussed in Section 11.2.1. 603 1.2.4. Creating New Diameter Applications 605 Every Diameter application specification MUST have an IANA assigned 606 Application Id (see Section 2.4 and Section 11.3). The managed 607 Application ID space is flat and there is no relationship between 608 different Diameter applications with respect to their application 609 IDs. As such, there is no versioning supported provided by these 610 application IDs itself; every Diameter application is a standalone 611 application that may or may not have a semantical relationship with 612 one or more Diameter applications being defined elsewhere. 614 Before describing the rules for creating new Diameter applications it 615 is important to discuss the semantics of the AVPs occurrences as 616 stated in the ABNF and the M-bit flag for an AVP. There is no 617 relationship imposed between the two; they are set independently. 619 o The ABNF indicates what AVPs are placed into a Diameter Command by 620 the sender of that Command. Often, since there are multiple modes 621 of protocol interactions many of the AVPs are indicated as 622 optional. 624 o The M-bit allows the sender to indicate to the receiver whether 625 the semantics of an AVP and it's content has to be understood 626 mandatorily or not. If the M-bit is set by the sender and the 627 receiver does not understand the AVP or the values carried within 628 that AVP then a failure is generated (see Section 7). 630 It is the decision of the protocol designer when to develop a new 631 Diameter application rather than extending Diameter in other ways. 632 However, a new Diameter application MUST be created when one or more 633 of the following criteria are met: 635 M-bit Setting 637 Adding an AVP with the M-bit in the MUST column of the AVP flag 638 table to an existing Command/Application requires a new Diameter 639 Application Id to be assigned to that Application. 641 Adding an AVP with the M-bit in the MAY column of the AVP flag 642 table to an existing Command/Application requires a new Diameter 643 Application Id to be assigned to that Application. 645 Note: The M-bit setting for a given AVP is relevant to an 646 Application and each command within that application which 647 includes the AVP. That is, if an AVP appears in two commands for 648 application Foo and the M-bit settings are different in each 649 command, then there should be two AVP flag tables describing when 650 to set the M-bit. 652 Commands 654 A new command is used within the existing application either 655 because an additional command is added, an existing command has 656 been modified so that a new Command Code had to be registered, or 657 a command has been deleted. 659 An implementation MAY add arbitrary optional AVPs with the M-bit 660 cleared to a command defined in an application, including vendor- 661 specific AVPs without needing to define a new application. This can 662 be done if the commands ABNF allows for it. Please refer to Section 663 11.1.1 for details. 665 1.3. Terminology 667 AAA 669 Authentication, Authorization and Accounting. 671 Accounting 673 The act of collecting information on resource usage for the 674 purpose of capacity planning, auditing, billing or cost 675 allocation. 677 Accounting Record 679 An accounting record represents a summary of the resource 680 consumption of a user over the entire session. Accounting servers 681 creating the accounting record may do so by processing interim 682 accounting events or accounting events from several devices 683 serving the same user. 685 Authentication 687 The act of verifying the identity of an entity (subject). 689 Authorization 691 The act of determining whether a requesting entity (subject) will 692 be allowed access to a resource (object). 694 AVP 696 The Diameter protocol consists of a header followed by one or more 697 Attribute-Value-Pairs (AVPs). An AVP includes a header and is 698 used to encapsulate protocol-specific data (e.g., routing 699 information) as well as authentication, authorization or 700 accounting information. 702 Broker 704 A broker is a business term commonly used in AAA infrastructures. 705 A broker is either a relay, proxy or redirect agent, and MAY be 706 operated by roaming consortiums. Depending on the business model, 707 a broker may either choose to deploy relay agents or proxy agents. 709 Diameter Agent 711 A Diameter Agent is a Diameter node that provides either relay, 712 proxy, redirect or translation services. 714 Diameter Client 716 A Diameter Client is a device at the edge of the network that 717 performs access control. An example of a Diameter client is a 718 Network Access Server (NAS) or a Foreign Agent (FA). By its very 719 nature, a Diameter Client MUST support Diameter client 720 applications in addition to the base protocol. 722 Diameter Node 724 A Diameter node is a host process that implements the Diameter 725 protocol, and acts either as a Client, Agent or Server. 727 Diameter Peer 729 A Diameter Peer is a Diameter Node to which a given Diameter Node 730 has a direct transport connection. 732 Diameter Server 734 A Diameter Server is one that handles authentication, 735 authorization and accounting requests for a particular realm. By 736 its very nature, a Diameter Server MUST support Diameter server 737 applications in addition to the base protocol. 739 Downstream 741 Downstream is used to identify the direction of a particular 742 Diameter message from the home server towards the access device. 744 Home Realm 746 A Home Realm is the administrative domain with which the user 747 maintains an account relationship. 749 Home Server 751 A Diameter Server which serves the Home Realm. 753 Interim accounting 755 An interim accounting message provides a snapshot of usage during 756 a user's session. It is typically implemented in order to provide 757 for partial accounting of a user's session in the case of a device 758 reboot or other network problem prevents the reception of a 759 session summary message or session record. 761 Local Realm 763 A local realm is the administrative domain providing services to a 764 user. An administrative domain MAY act as a local realm for 765 certain users, while being a home realm for others. 767 Multi-session 769 A multi-session represents a logical linking of several sessions. 770 Multi-sessions are tracked by using the Acct-Multi-Session-Id. An 771 example of a multi-session would be a Multi-link PPP bundle. Each 772 leg of the bundle would be a session while the entire bundle would 773 be a multi-session. 775 Network Access Identifier 777 The Network Access Identifier, or NAI [RFC4282], is used in the 778 Diameter protocol to extract a user's identity and realm. The 779 identity is used to identify the user during authentication and/or 780 authorization, while the realm is used for message routing 781 purposes. 783 Proxy Agent or Proxy 785 In addition to forwarding requests and responses, proxies make 786 policy decisions relating to resource usage and provisioning. 787 This is typically accomplished by tracking the state of NAS 788 devices. While proxies typically do not respond to client 789 Requests prior to receiving a Response from the server, they may 790 originate Reject messages in cases where policies are violated. 791 As a result, proxies need to understand the semantics of the 792 messages passing through them, and may not support all Diameter 793 applications. 795 Realm 797 The string in the NAI that immediately follows the '@' character. 798 NAI realm names are required to be unique, and are piggybacked on 799 the administration of the DNS namespace. Diameter makes use of 800 the realm, also loosely referred to as domain, to determine 801 whether messages can be satisfied locally, or whether they must be 802 routed or redirected. In RADIUS, realm names are not necessarily 803 piggybacked on the DNS namespace but may be independent of it. 805 Real-time Accounting 807 Real-time accounting involves the processing of information on 808 resource usage within a defined time window. Time constraints are 809 typically imposed in order to limit financial risk. 811 Relay Agent or Relay 813 Relays forward requests and responses based on routing-related 814 AVPs and routing table entries. Since relays do not make policy 815 decisions, they do not examine or alter non-routing AVPs. As a 816 result, relays never originate messages, do not need to understand 817 the semantics of messages or non-routing AVPs, and are capable of 818 handling any Diameter application or message type. Since relays 819 make decisions based on information in routing AVPs and realm 820 forwarding tables they do not keep state on NAS resource usage or 821 sessions in progress. 823 Redirect Agent 825 Rather than forwarding requests and responses between clients and 826 servers, redirect agents refer clients to servers and allow them 827 to communicate directly. Since redirect agents do not sit in the 828 forwarding path, they do not alter any AVPs transiting between 829 client and server. Redirect agents do not originate messages and 830 are capable of handling any message type, although they may be 831 configured only to redirect messages of certain types, while 832 acting as relay or proxy agents for other types. As with proxy 833 agents, redirect agents do not keep state with respect to sessions 834 or NAS resources. 836 Roaming Relationships 838 Roaming relationships include relationships between companies and 839 ISPs, relationships among peer ISPs within a roaming consortium, 840 and relationships between an ISP and a roaming consortium. 842 Session 844 A session is a related progression of events devoted to a 845 particular activity. Each application SHOULD provide guidelines 846 as to when a session begins and ends. All Diameter packets with 847 the same Session-Id are considered to be part of the same session. 849 Session state 851 A stateful agent is one that maintains session state information, 852 by keeping track of all authorized active sessions. Each 853 authorized session is bound to a particular service, and its state 854 is considered active either until it is notified otherwise, or by 855 expiration. 857 Sub-session 859 A sub-session represents a distinct service (e.g., QoS or data 860 characteristics) provided to a given session. These services may 861 happen concurrently (e.g., simultaneous voice and data transfer 862 during the same session) or serially. These changes in sessions 863 are tracked with the Accounting-Sub-Session-Id. 865 Transaction state 867 The Diameter protocol requires that agents maintain transaction 868 state, which is used for failover purposes. Transaction state 869 implies that upon forwarding a request, the Hop-by-Hop identifier 870 is saved; the field is replaced with a locally unique identifier, 871 which is restored to its original value when the corresponding 872 answer is received. The request's state is released upon receipt 873 of the answer. A stateless agent is one that only maintains 874 transaction state. 876 Translation Agent 878 A translation agent is a stateful Diameter node that performs 879 protocol translation between Diameter and another AAA protocol, 880 such as RADIUS. 882 Transport Connection 884 A transport connection is a TCP or SCTP connection existing 885 directly between two Diameter peers, otherwise known as a Peer- 886 to-Peer Connection. 888 Upstream 890 Upstream is used to identify the direction of a particular 891 Diameter message from the access device towards the home server. 893 User 895 The entity requesting or using some resource, in support of which 896 a Diameter client has generated a request. 898 2. Protocol Overview 900 The base Diameter protocol may be used by itself for accounting 901 applications, but for use in authentication and authorization it is 902 always extended for a particular application. Two Diameter 903 applications are defined by companion documents: NASREQ [RFC4005], 904 Mobile IPv4 [RFC4004]. These applications are introduced in this 905 document but specified elsewhere. Additional Diameter applications 906 MAY be defined in the future (see Section 11.3). 908 Diameter Clients MUST support the base protocol, which includes 909 accounting. In addition, they MUST fully support each Diameter 910 application that is needed to implement the client's service, e.g., 911 NASREQ and/or Mobile IPv4. A Diameter Client that does not support 912 both NASREQ and Mobile IPv4, MUST be referred to as "Diameter X 913 Client" where X is the application which it supports, and not a 914 "Diameter Client". 916 Diameter Servers MUST support the base protocol, which includes 917 accounting. In addition, they MUST fully support each Diameter 918 application that is needed to implement the intended service, e.g., 919 NASREQ and/or Mobile IPv4. A Diameter Server that does not support 920 both NASREQ and Mobile IPv4, MUST be referred to as "Diameter X 921 Server" where X is the application which it supports, and not a 922 "Diameter Server". 924 Diameter Relays and redirect agents are, by definition, protocol 925 transparent, and MUST transparently support the Diameter base 926 protocol, which includes accounting, and all Diameter applications. 928 Diameter proxies MUST support the base protocol, which includes 929 accounting. In addition, they MUST fully support each Diameter 930 application that is needed to implement proxied services, e.g., 931 NASREQ and/or Mobile IPv4. A Diameter proxy which does not support 932 both NASREQ and Mobile IPv4, MUST be referred to as "Diameter X 933 Proxy" where X is the application which it supports, and not a 934 "Diameter Proxy". 936 The base Diameter protocol concerns itself with capabilities 937 negotiation, how messages are sent and how peers may eventually be 938 abandoned. The base protocol also defines certain rules that apply 939 to all exchanges of messages between Diameter nodes. 941 Communication between Diameter peers begins with one peer sending a 942 message to another Diameter peer. The set of AVPs included in the 943 message is determined by a particular Diameter application. One AVP 944 that is included to reference a user's session is the Session-Id. 946 The initial request for authentication and/or authorization of a user 947 would include the Session-Id. The Session-Id is then used in all 948 subsequent messages to identify the user's session (see Section 8 for 949 more information). The communicating party may accept the request, 950 or reject it by returning an answer message with the Result-Code AVP 951 set to indicate an error occurred. The specific behavior of the 952 Diameter server or client receiving a request depends on the Diameter 953 application employed. 955 Session state (associated with a Session-Id) MUST be freed upon 956 receipt of the Session-Termination-Request, Session-Termination- 957 Answer, expiration of authorized service time in the Session-Timeout 958 AVP, and according to rules established in a particular Diameter 959 application. 961 2.1. Transport 963 Transport profile is defined in [RFC3539]. 965 The base Diameter protocol is run on port 3868 of both TCP [RFC793] 966 and SCTP [RFC2960] transport protocols. 968 Diameter clients MUST support either TCP or SCTP, while agents and 969 servers MUST support both. Future versions of this specification MAY 970 mandate that clients support SCTP. 972 A Diameter node MAY initiate connections from a source port other 973 than the one that it declares it accepts incoming connections on, and 974 MUST be prepared to receive connections on port 3868. A given 975 Diameter instance of the peer state machine MUST NOT use more than 976 one transport connection to communicate with a given peer, unless 977 multiple instances exist on the peer in which case a separate 978 connection per process is allowed. 980 When no transport connection exists with a peer, an attempt to 981 connect SHOULD be periodically made. This behavior is handled via 982 the Tc timer, whose recommended value is 30 seconds. There are 983 certain exceptions to this rule, such as when a peer has terminated 984 the transport connection stating that it does not wish to 985 communicate. 987 When connecting to a peer and either zero or more transports are 988 specified, SCTP SHOULD be tried first, followed by TCP. See Section 989 5.2 for more information on peer discovery. 991 Diameter implementations SHOULD be able to interpret ICMP protocol 992 port unreachable messages as explicit indications that the server is 993 not reachable, subject to security policy on trusting such messages. 995 Diameter implementations SHOULD also be able to interpret a reset 996 from the transport and timed-out connection attempts. If Diameter 997 receives data up from TCP that cannot be parsed or identified as a 998 Diameter error made by the peer, the stream is compromised and cannot 999 be recovered. The transport connection MUST be closed using a RESET 1000 call (send a TCP RST bit) or an SCTP ABORT message (graceful closure 1001 is compromised). 1003 2.1.1. SCTP Guidelines 1005 The following are guidelines for Diameter implementations that 1006 support SCTP: 1008 1. For interoperability: All Diameter nodes MUST be prepared to 1009 receive Diameter messages on any SCTP stream in the association. 1011 2. To prevent blocking: All Diameter nodes SHOULD utilize all SCTP 1012 streams available to the association to prevent head-of-the-line 1013 blocking. 1015 2.2. Securing Diameter Messages 1017 Connections between Diameter peers SHOULD be protected by TLS. All 1018 Diameter base protocol implementations MUST support the use of TLS. 1019 If desired, additional security measures that are transparent to and 1020 independent of Diameter, such as IPSec [RFC4301], can be deployed to 1021 secure connections between peers. The Diameter protocol MUST NOT be 1022 used without any security mechanism. 1024 2.3. Diameter Application Compliance 1026 Application Ids are advertised during the capabilities exchange phase 1027 (see Section 5.3). For a given application, advertising support of 1028 an application implies that the sender supports all command codes, 1029 and the AVPs specified in the associated ABNFs, described in the 1030 specification. 1032 An implementation MAY add arbitrary optional AVPs with the M-bit 1033 cleared to a command defined in an application, including vendor- 1034 specific AVPs only if the commands ABNF allows for it. Please refer 1035 to Section 11.1.1 for details. 1037 2.4. Application Identifiers 1039 Each Diameter application MUST have an IANA assigned Application Id 1040 (see Section 11.3). The base protocol does not require an 1041 Application Id since its support is mandatory. During the 1042 capabilities exchange, Diameter nodes inform their peers of locally 1043 supported applications. Furthermore, all Diameter messages contain 1044 an Application Id, which is used in the message forwarding process. 1046 The following Application Id values are defined: 1048 Diameter Common Messages 0 1049 NASREQ 1 [RFC4005] 1050 Mobile-IP 2 [RFC4004] 1051 Diameter Base Accounting 3 1052 Relay 0xffffffff 1054 Relay and redirect agents MUST advertise the Relay Application 1055 Identifier, while all other Diameter nodes MUST advertise locally 1056 supported applications. The receiver of a Capabilities Exchange 1057 message advertising Relay service MUST assume that the sender 1058 supports all current and future applications. 1060 Diameter relay and proxy agents are responsible for finding an 1061 upstream server that supports the application of a particular 1062 message. If none can be found, an error message is returned with the 1063 Result-Code AVP set to DIAMETER_UNABLE_TO_DELIVER. 1065 2.5. Connections vs. Sessions 1067 This section attempts to provide the reader with an understanding of 1068 the difference between connection and session, which are terms used 1069 extensively throughout this document. 1071 A connection is a transport level connection between two peers, used 1072 to send and receive Diameter messages. A session is a logical 1073 concept at the application layer, and is shared between an access 1074 device and a server, and is identified via the Session-Id AVP. 1076 +--------+ +-------+ +--------+ 1077 | Client | | Relay | | Server | 1078 +--------+ +-------+ +--------+ 1079 <----------> <----------> 1080 peer connection A peer connection B 1082 <-----------------------------> 1083 User session x 1085 Figure 1: Diameter connections and sessions 1087 In the example provided in Figure 1, peer connection A is established 1088 between the Client and its local Relay. Peer connection B is 1089 established between the Relay and the Server. User session X spans 1090 from the Client via the Relay to the Server. Each "user" of a 1091 service causes an auth request to be sent, with a unique session 1092 identifier. Once accepted by the server, both the client and the 1093 server are aware of the session. 1095 It is important to note that there is no relationship between a 1096 connection and a session, and that Diameter messages for multiple 1097 sessions are all multiplexed through a single connection. Also note 1098 that Diameter messages pertaining to the session, both application 1099 specific and those that are defined in this document such as ASR/ASA, 1100 RAR/RAA and STR/STA MUST carry the Application Id of the application. 1101 Diameter messages pertaining to peer connection establishment and 1102 maintenance such as CER/CEA, DWR/DWA and DPR/DPA MUST carry an 1103 Application Id of zero (0). 1105 2.6. Peer Table 1107 The Diameter Peer Table is used in message forwarding, and referenced 1108 by the Routing Table. A Peer Table entry contains the following 1109 fields: 1111 Host identity 1113 Following the conventions described for the DiameterIdentity 1114 derived AVP data format in Section 4.4. This field contains the 1115 contents of the Origin-Host (Section 6.3) AVP found in the CER or 1116 CEA message. 1118 StatusT 1120 This is the state of the peer entry, and MUST match one of the 1121 values listed in Section 5.6. 1123 Static or Dynamic 1125 Specifies whether a peer entry was statically configured, or 1126 dynamically discovered. 1128 Expiration time 1130 Specifies the time at which dynamically discovered peer table 1131 entries are to be either refreshed, or expired. 1133 TLS Enabled 1135 Specifies whether TLS is to be used when communicating with the 1136 peer. 1138 Additional security information, when needed (e.g., keys, 1139 certificates) 1141 2.7. Routing Table 1143 All Realm-Based routing lookups are performed against what is 1144 commonly known as the Routing Table (see Section 12). A Routing 1145 Table Entry contains the following fields: 1147 Realm Name 1149 This is the field that is MUST be used as a primary key in the 1150 routing table lookups. Note that some implementations perform 1151 their lookups based on longest-match-from-the-right on the realm 1152 rather than requiring an exact match. 1154 Application Identifier 1156 An application is identified by an Application Id. A route entry 1157 can have a different destination based on the Application Id in 1158 the message header. This field MUST be used as a secondary key 1159 field in routing table lookups. 1161 Local Action 1163 The Local Action field is used to identify how a message should be 1164 treated. The following actions are supported: 1166 1. LOCAL - Diameter messages that resolve to a route entry with 1167 the Local Action set to Local can be satisfied locally, and do 1168 not need to be routed to another server. 1170 2. RELAY - All Diameter messages that fall within this category 1171 MUST be routed to a next hop server, without modifying any 1172 non-routing AVPs. See Section 6.1.9 for relaying guidelines 1174 3. PROXY - All Diameter messages that fall within this category 1175 MUST be routed to a next hop server. The local server MAY 1176 apply its local policies to the message by including new AVPs 1177 to the message prior to routing. See Section 6.1.9 for 1178 proxying guidelines. 1180 4. REDIRECT - Diameter messages that fall within this category 1181 MUST have the identity of the home Diameter server(s) 1182 appended, and returned to the sender of the message. See 1183 Section 6.1.9 for redirect guidelines. 1185 Server Identifier 1187 One or more servers the message is to be routed to. These servers 1188 MUST also be present in the Peer table. When the Local Action is 1189 set to RELAY or PROXY, this field contains the identity of the 1190 server(s) the message must be routed to. When the Local Action 1191 field is set to REDIRECT, this field contains the identity of one 1192 or more servers the message should be redirected to. 1194 Static or Dynamic 1196 Specifies whether a route entry was statically configured, or 1197 dynamically discovered. 1199 Expiration time 1201 Specifies the time which a dynamically discovered route table 1202 entry expires. 1204 It is important to note that Diameter agents MUST support at least 1205 one of the LOCAL, RELAY, PROXY or REDIRECT modes of operation. 1206 Agents do not need to support all modes of operation in order to 1207 conform with the protocol specification, but MUST follow the protocol 1208 compliance guidelines in Section 2. Relay agents MUST NOT reorder 1209 AVPs, and proxies MUST NOT reorder AVPs. 1211 The routing table MAY include a default entry that MUST be used for 1212 any requests not matching any of the other entries. The routing 1213 table MAY consist of only such an entry. 1215 When a request is routed, the target server MUST have advertised the 1216 Application Id (see Section 2.4) for the given message, or have 1217 advertised itself as a relay or proxy agent. Otherwise, an error is 1218 returned with the Result-Code AVP set to DIAMETER_UNABLE_TO_DELIVER. 1220 2.8. Role of Diameter Agents 1222 In addition to client and servers, the Diameter protocol introduces 1223 relay, proxy, redirect, and translation agents, each of which is 1224 defined in Section 1.3. These Diameter agents are useful for several 1225 reasons: 1227 o They can distribute administration of systems to a configurable 1228 grouping, including the maintenance of security associations. 1230 o They can be used for concentration of requests from an number of 1231 co-located or distributed NAS equipment sets to a set of like user 1232 groups. 1234 o They can do value-added processing to the requests or responses. 1236 o They can be used for load balancing. 1238 o A complex network will have multiple authentication sources, they 1239 can sort requests and forward towards the correct target. 1241 The Diameter protocol requires that agents maintain transaction 1242 state, which is used for failover purposes. Transaction state 1243 implies that upon forwarding a request, its Hop-by-Hop identifier is 1244 saved; the field is replaced with a locally unique identifier, which 1245 is restored to its original value when the corresponding answer is 1246 received. The request's state is released upon receipt of the 1247 answer. A stateless agent is one that only maintains transaction 1248 state. 1250 The Proxy-Info AVP allows stateless agents to add local state to a 1251 Diameter request, with the guarantee that the same state will be 1252 present in the answer. However, the protocol's failover procedures 1253 require that agents maintain a copy of pending requests. 1255 A stateful agent is one that maintains session state information; by 1256 keeping track of all authorized active sessions. Each authorized 1257 session is bound to a particular service, and its state is considered 1258 active either until it is notified otherwise, or by expiration. Each 1259 authorized session has an expiration, which is communicated by 1260 Diameter servers via the Session-Timeout AVP. 1262 Maintaining session state MAY be useful in certain applications, such 1263 as: 1265 o Protocol translation (e.g., RADIUS <-> Diameter) 1267 o Limiting resources authorized to a particular user 1269 o Per user or transaction auditing 1271 A Diameter agent MAY act in a stateful manner for some requests and 1272 be stateless for others. A Diameter implementation MAY act as one 1273 type of agent for some requests, and as another type of agent for 1274 others. 1276 2.8.1. Relay Agents 1278 Relay Agents are Diameter agents that accept requests and route 1279 messages to other Diameter nodes based on information found in the 1280 messages (e.g., Destination-Realm). This routing decision is 1281 performed using a list of supported realms, and known peers. This is 1282 known as the Routing Table, as is defined further in Section 2.7. 1284 Relays MAY be used to aggregate requests from multiple Network Access 1285 Servers (NASes) within a common geographical area (POP). The use of 1286 Relays is advantageous since it eliminates the need for NASes to be 1287 configured with the necessary security information they would 1288 otherwise require to communicate with Diameter servers in other 1289 realms. Likewise, this reduces the configuration load on Diameter 1290 servers that would otherwise be necessary when NASes are added, 1291 changed or deleted. 1293 Relays modify Diameter messages by inserting and removing routing 1294 information, but do not modify any other portion of a message. 1295 Relays SHOULD NOT maintain session state but MUST maintain 1296 transaction state. 1298 +------+ ---------> +------+ ---------> +------+ 1299 | | 1. Request | | 2. Request | | 1300 | NAS | | DRL | | HMS | 1301 | | 4. Answer | | 3. Answer | | 1302 +------+ <--------- +------+ <--------- +------+ 1303 example.net example.net example.com 1305 Figure 2: Relaying of Diameter messages 1307 The example provided in Figure 2 depicts a request issued from NAS, 1308 which is an access device, for the user bob@example.com. Prior to 1309 issuing the request, NAS performs a Diameter route lookup, using 1310 "example.com" as the key, and determines that the message is to be 1311 relayed to DRL, which is a Diameter Relay. DRL performs the same 1312 route lookup as NAS, and relays the message to HMS, which is 1313 example.com's Home Diameter Server. HMS identifies that the request 1314 can be locally supported (via the realm), processes the 1315 authentication and/or authorization request, and replies with an 1316 answer, which is routed back to NAS using saved transaction state. 1318 Since Relays do not perform any application level processing, they 1319 provide relaying services for all Diameter applications, and 1320 therefore MUST advertise the Relay Application Id. 1322 2.8.2. Proxy Agents 1324 Similarly to relays, proxy agents route Diameter messages using the 1325 Diameter Routing Table. However, they differ since they modify 1326 messages to implement policy enforcement. This requires that proxies 1327 maintain the state of their downstream peers (e.g., access devices) 1328 to enforce resource usage, provide admission control, and 1329 provisioning. 1331 Proxies MAY be used in call control centers or access ISPs that 1332 provide outsourced connections, they can monitor the number and types 1333 of ports in use, and make allocation and admission decisions 1334 according to their configuration. 1336 Proxies that wish to limit resources MUST maintain session state. 1337 All proxies MUST maintain transaction state. 1339 Since enforcing policies requires an understanding of the service 1340 being provided, Proxies MUST only advertise the Diameter applications 1341 they support. 1343 2.8.3. Redirect Agents 1345 Redirect agents are useful in scenarios where the Diameter routing 1346 configuration needs to be centralized. An example is a redirect 1347 agent that provides services to all members of a consortium, but does 1348 not wish to be burdened with relaying all messages between realms. 1349 This scenario is advantageous since it does not require that the 1350 consortium provide routing updates to its members when changes are 1351 made to a member's infrastructure. 1353 Since redirect agents do not relay messages, and only return an 1354 answer with the information necessary for Diameter agents to 1355 communicate directly, they do not modify messages. Since redirect 1356 agents do not receive answer messages, they cannot maintain session 1357 state. Further, since redirect agents never relay requests, they are 1358 not required to maintain transaction state. 1360 The example provided in Figure 3 depicts a request issued from the 1361 access device, NAS, for the user bob@example.com. The message is 1362 forwarded by the NAS to its relay, DRL, which does not have a routing 1363 entry in its Diameter Routing Table for example.com. DRL has a 1364 default route configured to DRD, which is a redirect agent that 1365 returns a redirect notification to DRL, as well as HMS' contact 1366 information. Upon receipt of the redirect notification, DRL 1367 establishes a transport connection with HMS, if one doesn't already 1368 exist, and forwards the request to it. 1370 +------+ 1371 | | 1372 | DRD | 1373 | | 1374 +------+ 1375 ^ | 1376 2. Request | | 3. Redirection 1377 | | Notification 1378 | v 1379 +------+ ---------> +------+ ---------> +------+ 1380 | | 1. Request | | 4. Request | | 1381 | NAS | | DRL | | HMS | 1382 | | 6. Answer | | 5. Answer | | 1383 +------+ <--------- +------+ <--------- +------+ 1384 example.net example.net example.com 1386 Figure 3: Redirecting a Diameter Message 1388 Since redirect agents do not perform any application level 1389 processing, they provide relaying services for all Diameter 1390 applications, and therefore MUST advertise the Relay Application 1391 Identifier. 1393 2.8.4. Translation Agents 1395 A translation agent is a device that provides translation between two 1396 protocols (e.g., RADIUS<->Diameter, TACACS+<->Diameter). Translation 1397 agents are likely to be used as aggregation servers to communicate 1398 with a Diameter infrastructure, while allowing for the embedded 1399 systems to be migrated at a slower pace. 1401 Given that the Diameter protocol introduces the concept of long-lived 1402 authorized sessions, translation agents MUST be session stateful and 1403 MUST maintain transaction state. 1405 Translation of messages can only occur if the agent recognizes the 1406 application of a particular request, and therefore translation agents 1407 MUST only advertise their locally supported applications. 1409 +------+ ---------> +------+ ---------> +------+ 1410 | | RADIUS Request | | Diameter Request | | 1411 | NAS | | TLA | | HMS | 1412 | | RADIUS Answer | | Diameter Answer | | 1413 +------+ <--------- +------+ <--------- +------+ 1414 example.net example.net example.com 1416 Figure 4: Translation of RADIUS to Diameter 1418 2.9. Diameter Path Authorization 1420 As noted in Section 2.2, Diameter provides transmission level 1421 security for each connection using TLS. Therefore, each connection 1422 can be authenticated, replay and integrity protected. 1424 In addition to authenticating each connection, each connection as 1425 well as the entire session MUST also be authorized. Before 1426 initiating a connection, a Diameter Peer MUST check that its peers 1427 are authorized to act in their roles. For example, a Diameter peer 1428 may be authentic, but that does not mean that it is authorized to act 1429 as a Diameter Server advertising a set of Diameter applications. 1431 Prior to bringing up a connection, authorization checks are performed 1432 at each connection along the path. Diameter capabilities negotiation 1433 (CER/CEA) also MUST be carried out, in order to determine what 1434 Diameter applications are supported by each peer. Diameter sessions 1435 MUST be routed only through authorized nodes that have advertised 1436 support for the Diameter application required by the session. 1438 As noted in Section 6.1.9, a relay or proxy agent MUST append a 1439 Route-Record AVP to all requests forwarded. The AVP contains the 1440 identity of the peer the request was received from. 1442 The home Diameter server, prior to authorizing a session, MUST check 1443 the Route-Record AVPs to make sure that the route traversed by the 1444 request is acceptable. For example, administrators within the home 1445 realm may not wish to honor requests that have been routed through an 1446 untrusted realm. By authorizing a request, the home Diameter server 1447 is implicitly indicating its willingness to engage in the business 1448 transaction as specified by the contractual relationship between the 1449 server and the previous hop. A DIAMETER_AUTHORIZATION_REJECTED error 1450 message (see Section 7.1.5) is sent if the route traversed by the 1451 request is unacceptable. 1453 A home realm may also wish to check that each accounting request 1454 message corresponds to a Diameter response authorizing the session. 1455 Accounting requests without corresponding authorization responses 1456 SHOULD be subjected to further scrutiny, as should accounting 1457 requests indicating a difference between the requested and provided 1458 service. 1460 Forwarding of an authorization response is considered evidence of a 1461 willingness to take on financial risk relative to the session. A 1462 local realm may wish to limit this exposure, for example, by 1463 establishing credit limits for intermediate realms and refusing to 1464 accept responses which would violate those limits. By issuing an 1465 accounting request corresponding to the authorization response, the 1466 local realm implicitly indicates its agreement to provide the service 1467 indicated in the authorization response. If the service cannot be 1468 provided by the local realm, then a DIAMETER_UNABLE_TO_COMPLY error 1469 message MUST be sent within the accounting request; a Diameter client 1470 receiving an authorization response for a service that it cannot 1471 perform MUST NOT substitute an alternate service, and then send 1472 accounting requests for the alternate service instead. 1474 3. Diameter Header 1476 A summary of the Diameter header format is shown below. The fields 1477 are transmitted in network byte order. 1479 0 1 2 3 1480 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 1481 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1482 | Version | Message Length | 1483 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1484 | command flags | Command-Code | 1485 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1486 | Application-ID | 1487 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1488 | Hop-by-Hop Identifier | 1489 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1490 | End-to-End Identifier | 1491 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1492 | AVPs ... 1493 +-+-+-+-+-+-+-+-+-+-+-+-+- 1495 Version 1497 This Version field MUST be set to 1 to indicate Diameter Version 1498 1. 1500 Message Length 1502 The Message Length field is three octets and indicates the length 1503 of the Diameter message including the header fields. 1505 Command Flags 1507 The Command Flags field is eight bits. The following bits are 1508 assigned: 1510 0 1 2 3 4 5 6 7 1511 +-+-+-+-+-+-+-+-+ 1512 |R P E T r r r r| 1513 +-+-+-+-+-+-+-+-+ 1515 R(equest) 1517 If set, the message is a request. If cleared, the message is 1518 an answer. 1520 P(roxiable) 1522 If set, the message MAY be proxied, relayed or redirected. If 1523 cleared, the message MUST be locally processed. 1525 E(rror) 1527 If set, the message contains a protocol error, and the message 1528 will not conform to the ABNF described for this command. 1529 Messages with the 'E' bit set are commonly referred to as error 1530 messages. This bit MUST NOT be set in request messages. See 1531 Section 7.2. 1533 T(Potentially re-transmitted message) 1535 This flag is set after a link failover procedure, to aid the 1536 removal of duplicate requests. It is set when resending 1537 requests not yet acknowledged, as an indication of a possible 1538 duplicate due to a link failure. This bit MUST be cleared when 1539 sending a request for the first time, otherwise the sender MUST 1540 set this flag. Diameter agents only need to be concerned about 1541 the number of requests they send based on a single received 1542 request; retransmissions by other entities need not be tracked. 1543 Diameter agents that receive a request with the T flag set, 1544 MUST keep the T flag set in the forwarded request. This flag 1545 MUST NOT be set if an error answer message (e.g., a protocol 1546 error) has been received for the earlier message. It can be 1547 set only in cases where no answer has been received from the 1548 server for a request and the request is sent again. This flag 1549 MUST NOT be set in answer messages. 1551 r(eserved) 1553 These flag bits are reserved for future use, and MUST be set to 1554 zero, and ignored by the receiver. 1556 Command-Code 1558 The Command-Code field is three octets, and is used in order to 1559 communicate the command associated with the message. The 24-bit 1560 address space is managed by IANA (see Section 11.2.1). 1562 Command-Code values 16,777,214 and 16,777,215 (hexadecimal values 1563 FFFFFE -FFFFFF) are reserved for experimental use (See Section 1564 11.3). 1566 Application-ID 1568 Application-ID is four octets and is used to identify to which 1569 application the message is applicable for. The application can be 1570 an authentication application, an accounting application or a 1571 vendor specific application. See Section 11.3 for the possible 1572 values that the application-id may use. 1574 The value of the application-id field in the header MUST be the 1575 same as any relevant application-id AVPs contained in the message. 1577 Hop-by-Hop Identifier 1579 The Hop-by-Hop Identifier is an unsigned 32-bit integer field (in 1580 network byte order) and aids in matching requests and replies. 1581 The sender MUST ensure that the Hop-by-Hop identifier in a request 1582 is unique on a given connection at any given time, and MAY attempt 1583 to ensure that the number is unique across reboots. The sender of 1584 an Answer message MUST ensure that the Hop-by-Hop Identifier field 1585 contains the same value that was found in the corresponding 1586 request. The Hop-by-Hop identifier is normally a monotonically 1587 increasing number, whose start value was randomly generated. An 1588 answer message that is received with an unknown Hop-by-Hop 1589 Identifier MUST be discarded. 1591 End-to-End Identifier 1593 The End-to-End Identifier is an unsigned 32-bit integer field (in 1594 network byte order) and is used to detect duplicate messages. 1595 Upon reboot implementations MAY set the high order 12 bits to 1596 contain the low order 12 bits of current time, and the low order 1597 20 bits to a random value. Senders of request messages MUST 1598 insert a unique identifier on each message. The identifier MUST 1599 remain locally unique for a period of at least 4 minutes, even 1600 across reboots. The originator of an Answer message MUST ensure 1601 that the End-to-End Identifier field contains the same value that 1602 was found in the corresponding request. The End-to-End Identifier 1603 MUST NOT be modified by Diameter agents of any kind. The 1604 combination of the Origin-Host (see Section 6.3) and this field is 1605 used to detect duplicates. Duplicate requests SHOULD cause the 1606 same answer to be transmitted (modulo the hop-by-hop Identifier 1607 field and any routing AVPs that may be present), and MUST NOT 1608 affect any state that was set when the original request was 1609 processed. Duplicate answer messages that are to be locally 1610 consumed (see Section 6.2) SHOULD be silently discarded. 1612 AVPs 1614 AVPs are a method of encapsulating information relevant to the 1615 Diameter message. See Section 4 for more information on AVPs. 1617 3.1. Command Codes 1619 Each command Request/Answer pair is assigned a command code, and the 1620 sub-type (i.e., request or answer) is identified via the 'R' bit in 1621 the Command Flags field of the Diameter header. 1623 Every Diameter message MUST contain a command code in its header's 1624 Command-Code field, which is used to determine the action that is to 1625 be taken for a particular message. The following Command Codes are 1626 defined in the Diameter base protocol: 1628 Command-Name Abbrev. Code Reference 1629 -------------------------------------------------------- 1630 Abort-Session-Request ASR 274 8.5.1 1631 Abort-Session-Answer ASA 274 8.5.2 1632 Accounting-Request ACR 271 9.7.1 1633 Accounting-Answer ACA 271 9.7.2 1634 Capabilities-Exchange- CER 257 5.3.1 1635 Request 1636 Capabilities-Exchange- CEA 257 5.3.2 1637 Answer 1638 Device-Watchdog-Request DWR 280 5.5.1 1639 Device-Watchdog-Answer DWA 280 5.5.2 1640 Disconnect-Peer-Request DPR 282 5.4.1 1641 Disconnect-Peer-Answer DPA 282 5.4.2 1642 Re-Auth-Request RAR 258 8.3.1 1643 Re-Auth-Answer RAA 258 8.3.2 1644 Session-Termination- STR 275 8.4.1 1645 Request 1646 Session-Termination- STA 275 8.4.2 1647 Answer 1649 3.2. Command Code ABNF specification 1651 Every Command Code defined MUST include a corresponding ABNF 1652 specification, which is used to define the AVPs that MUST or MAY be 1653 present. The following format is used in the definition: 1655 command-def = command-name "::=" diameter-message 1657 command-name = diameter-name 1658 diameter-name = ALPHA *(ALPHA / DIGIT / "-") 1660 diameter-message = header [ *fixed] [ *required] [ *optional] 1662 header = "<" "Diameter Header:" command-id 1663 [r-bit] [p-bit] [e-bit] [application-id] ">" 1665 application-id = 1*DIGIT 1667 command-id = 1*DIGIT 1668 ; The Command Code assigned to the command 1670 r-bit = ", REQ" 1671 ; If present, the 'R' bit in the Command 1672 ; Flags is set, indicating that the message 1673 ; is a request, as opposed to an answer. 1675 p-bit = ", PXY" 1676 ; If present, the 'P' bit in the Command 1677 ; Flags is set, indicating that the message 1678 ; is proxiable. 1680 e-bit = ", ERR" 1681 ; If present, the 'E' bit in the Command 1682 ; Flags is set, indicating that the answer 1683 ; message contains a Result-Code AVP in 1684 ; the "protocol error" class. 1686 fixed = [qual] "<" avp-spec ">" 1687 ; Defines the fixed position of an AVP 1689 required = [qual] "{" avp-spec "}" 1690 ; The AVP MUST be present and can appear 1691 ; anywhere in the message. 1693 optional = [qual] "[" avp-name "]" 1694 ; The avp-name in the 'optional' rule cannot 1695 ; evaluate to any AVP Name which is included 1696 ; in a fixed or required rule. The AVP can 1697 ; appear anywhere in the message. 1699 qual = [min] "*" [max] 1700 ; See ABNF conventions, RFC 4234 Section 6.6. 1701 ; The absence of any qualifiers depends on 1702 ; whether it precedes a fixed, required, or 1703 ; optional rule. If a fixed or required rule has 1704 ; no qualifier, then exactly one such AVP MUST 1705 ; be present. If an optional rule has no 1706 ; qualifier, then 0 or 1 such AVP may be 1707 ; present. If an optional rule has a qualifier, 1708 ; then the value of min MUST be 0 if present. 1709 ; 1710 ; NOTE: "[" and "]" have a different meaning 1711 ; than in ABNF (see the optional rule, above). 1712 ; These braces cannot be used to express 1713 ; optional fixed rules (such as an optional 1714 ; ICV at the end). To do this, the convention 1715 ; is '0*1fixed'. 1717 min = 1*DIGIT 1718 ; The minimum number of times the element may 1719 ; be present. The default value is zero. 1721 max = 1*DIGIT 1722 ; The maximum number of times the element may 1723 ; be present. The default value is infinity. A 1724 ; value of zero implies the AVP MUST NOT be 1725 ; present. 1727 avp-spec = diameter-name 1728 ; The avp-spec has to be an AVP Name, defined 1729 ; in the base or extended Diameter 1730 ; specifications. 1732 avp-name = avp-spec / "AVP" 1733 ; The string "AVP" stands for *any* arbitrary AVP 1734 ; Name, not otherwise listed in that command code 1735 ; definition. Addition this AVP is recommended for 1736 ; all command ABNFs to allow for extensibility. 1738 The following is a definition of a fictitious command code: 1740 Example-Request ::= < Diameter Header: 9999999, REQ, PXY > 1741 { User-Name } 1742 * { Origin-Host } 1743 * [ AVP ] 1745 3.3. Diameter Command Naming Conventions 1747 Diameter command names typically includes one or more English words 1748 followed by the verb Request or Answer. Each English word is 1749 delimited by a hyphen. A three-letter acronym for both the request 1750 and answer is also normally provided. 1752 An example is a message set used to terminate a session. The command 1753 name is Session-Terminate-Request and Session-Terminate-Answer, while 1754 the acronyms are STR and STA, respectively. 1756 Both the request and the answer for a given command share the same 1757 command code. The request is identified by the R(equest) bit in the 1758 Diameter header set to one (1), to ask that a particular action be 1759 performed, such as authorizing a user or terminating a session. Once 1760 the receiver has completed the request it issues the corresponding 1761 answer, which includes a result code that communicates one of the 1762 following: 1764 o The request was successful 1766 o The request failed 1768 o An additional request MUST be sent to provide information the peer 1769 requires prior to returning a successful or failed answer. 1771 o The receiver could not process the request, but provides 1772 information about a Diameter peer that is able to satisfy the 1773 request, known as redirect. 1775 Additional information, encoded within AVPs, MAY also be included in 1776 answer messages. 1778 4. Diameter AVPs 1780 Diameter AVPs carry specific authentication, accounting, 1781 authorization and routing information as well as configuration 1782 details for the request and reply. 1784 Some AVPs MAY be listed more than once. The effect of such an AVP is 1785 specific, and is specified in each case by the AVP description. 1787 Each AVP of type OctetString MUST be padded to align on a 32-bit 1788 boundary, while other AVP types align naturally. A number of zero- 1789 valued bytes are added to the end of the AVP Data field till a word 1790 boundary is reached. The length of the padding is not reflected in 1791 the AVP Length field. 1793 4.1. AVP Header 1795 The fields in the AVP header MUST be sent in network byte order. The 1796 format of the header is: 1798 0 1 2 3 1799 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 1800 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1801 | AVP Code | 1802 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1803 |V M P r r r r r| AVP Length | 1804 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1805 | Vendor-ID (opt) | 1806 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1807 | Data ... 1808 +-+-+-+-+-+-+-+-+ 1810 AVP Code 1812 The AVP Code, combined with the Vendor-Id field, identifies the 1813 attribute uniquely. AVP numbers 1 through 255 are reserved for 1814 backward compatibility with RADIUS, without setting the Vendor-Id 1815 field. AVP numbers 256 and above are used for Diameter, which are 1816 allocated by IANA (see Section 11.1). 1818 AVP Flags 1820 The AVP Flags field informs the receiver how each attribute must 1821 be handled. The 'r' (reserved) bits are unused and SHOULD be set 1822 to 0. Note that subsequent Diameter applications MAY define 1823 additional bits within the AVP Header, and an unrecognized bit 1824 SHOULD be considered an error. The 'P' bit indicates the need for 1825 encryption for end-to-end security. Note that the 'P' bit has 1826 been deprecated and MUST be to zero(0) when sending an AVP and 1827 ignored on receipt of an AVP. 1829 The 'M' Bit, known as the Mandatory bit, indicates whether support 1830 of the AVP is required. If an AVP with the 'M' bit set is 1831 received by a Diameter client, server or translation agent and 1832 either the AVP or its value is unrecognized, the message MUST be 1833 rejected. An exception to this rule applies when the AVP is 1834 embedded within a Grouped AVP. See Section 4.4 for details. 1835 Diameter Relay and redirect agents MUST NOT reject messages with 1836 unrecognized AVPs. 1838 The 'M' bit MUST be set according to the rules defined in the 1839 application specification which introduces or re-uses this AVP. 1840 Within a given application, the M-bit setting for an AVP is either 1841 defined for all command types or for each command type. 1843 AVPs with the 'M' bit cleared are informational only and a 1844 receiver that receives a message with such an AVP that is not 1845 supported, or whose value is not supported, MAY simply ignore the 1846 AVP. 1848 The 'V' bit, known as the Vendor-Specific bit, indicates whether 1849 the optional Vendor-ID field is present in the AVP header. When 1850 set the AVP Code belongs to the specific vendor code address 1851 space. 1853 AVP Length 1855 The AVP Length field is three octets, and indicates the number of 1856 octets in this AVP including the AVP Code, AVP Length, AVP Flags, 1857 Vendor-ID field (if present) and the AVP data. If a message is 1858 received with an invalid attribute length, the message SHOULD be 1859 rejected. 1861 4.1.1. Optional Header Elements 1863 The AVP Header contains one optional field. This field is only 1864 present if the respective bit-flag is enabled. 1866 Vendor-ID 1868 The Vendor-ID field is present if the 'V' bit is set in the AVP 1869 Flags field. The optional four-octet Vendor-ID field contains the 1870 IANA assigned "SMI Network Management Private Enterprise Codes" 1871 [RFC3232] value, encoded in network byte order. Any vendor 1872 wishing to implement a vendor-specific Diameter AVP MUST use their 1873 own Vendor-ID along with their privately managed AVP address 1874 space, guaranteeing that they will not collide with any other 1875 vendor's vendor-specific AVP(s), nor with future IETF 1876 applications. 1878 A vendor ID value of zero (0) corresponds to the IETF adopted AVP 1879 values, as managed by the IANA. Since the absence of the vendor 1880 ID field implies that the AVP in question is not vendor specific, 1881 implementations MUST NOT use the zero (0) vendor ID. 1883 4.2. Basic AVP Data Formats 1885 The Data field is zero or more octets and contains information 1886 specific to the Attribute. The format and length of the Data field 1887 is determined by the AVP Code and AVP Length fields. The format of 1888 the Data field MUST be one of the following base data types or a data 1889 type derived from the base data types. In the event that a new Basic 1890 AVP Data Format is needed, a new version of this RFC MUST be created. 1892 OctetString 1894 The data contains arbitrary data of variable length. Unless 1895 otherwise noted, the AVP Length field MUST be set to at least 8 1896 (12 if the 'V' bit is enabled). AVP Values of this type that are 1897 not a multiple of four-octets in length is followed by the 1898 necessary padding so that the next AVP (if any) will start on a 1899 32-bit boundary. 1901 Integer32 1903 32 bit signed value, in network byte order. The AVP Length field 1904 MUST be set to 12 (16 if the 'V' bit is enabled). 1906 Integer64 1908 64 bit signed value, in network byte order. The AVP Length field 1909 MUST be set to 16 (20 if the 'V' bit is enabled). 1911 Unsigned32 1913 32 bit unsigned value, in network byte order. The AVP Length 1914 field MUST be set to 12 (16 if the 'V' bit is enabled). 1916 Unsigned64 1918 64 bit unsigned value, in network byte order. The AVP Length 1919 field MUST be set to 16 (20 if the 'V' bit is enabled). 1921 Float32 1923 This represents floating point values of single precision as 1924 described by [FLOATPOINT]. The 32-bit value is transmitted in 1925 network byte order. The AVP Length field MUST be set to 12 (16 if 1926 the 'V' bit is enabled). 1928 Float64 1930 This represents floating point values of double precision as 1931 described by [FLOATPOINT]. The 64-bit value is transmitted in 1932 network byte order. The AVP Length field MUST be set to 16 (20 if 1933 the 'V' bit is enabled). 1935 Grouped 1937 The Data field is specified as a sequence of AVPs. Each of these 1938 AVPs follows - in the order in which they are specified - 1939 including their headers and padding. The AVP Length field is set 1940 to 8 (12 if the 'V' bit is enabled) plus the total length of all 1941 included AVPs, including their headers and padding. Thus the AVP 1942 length field of an AVP of type Grouped is always a multiple of 4. 1944 4.3. Derived AVP Data Formats 1946 In addition to using the Basic AVP Data Formats, applications may 1947 define data formats derived from the Basic AVP Data Formats. An 1948 application that defines new AVP Derived Data Formats MUST include 1949 them in a section entitled "AVP Derived Data Formats", using the same 1950 format as the definitions below. Each new definition MUST be either 1951 defined or listed with a reference to the RFC that defines the 1952 format. 1954 The below AVP Derived Data Formats are commonly used by applications. 1956 Address 1958 The Address format is derived from the OctetString AVP Base 1959 Format. It is a discriminated union, representing, for example a 1960 32-bit (IPv4) [RFC791] or 128-bit (IPv6) [RFC4291] address, most 1961 significant octet first. The first two octets of the Address AVP 1962 represents the AddressType, which contains an Address Family 1963 defined in [IANAADFAM]. The AddressType is used to discriminate 1964 the content and format of the remaining octets. 1966 Time 1968 The Time format is derived from the OctetString AVP Base Format. 1969 The string MUST contain four octets, in the same format as the 1970 first four bytes are in the NTP timestamp format. The NTP 1971 Timestamp format is defined in chapter 3 of [RFC4330]. 1973 This represents the number of seconds since 0h on 1 January 1900 1974 with respect to the Coordinated Universal Time (UTC). 1976 On 6h 28m 16s UTC, 7 February 2036 the time value will overflow. 1977 SNTP [RFC4330] describes a procedure to extend the time to 2104. 1978 This procedure MUST be supported by all DIAMETER nodes. 1980 UTF8String 1982 The UTF8String format is derived from the OctetString AVP Base 1983 Format. This is a human readable string represented using the 1984 ISO/IEC IS 10646-1 character set, encoded as an OctetString using 1985 the UTF-8 [RFC3629] transformation format described in RFC 3629. 1987 Since additional code points are added by amendments to the 10646 1988 standard from time to time, implementations MUST be prepared to 1989 encounter any code point from 0x00000001 to 0x7fffffff. Byte 1990 sequences that do not correspond to the valid encoding of a code 1991 point into UTF-8 charset or are outside this range are prohibited. 1993 The use of control codes SHOULD be avoided. When it is necessary 1994 to represent a new line, the control code sequence CR LF SHOULD be 1995 used. 1997 The use of leading or trailing white space SHOULD be avoided. 1999 For code points not directly supported by user interface hardware 2000 or software, an alternative means of entry and display, such as 2001 hexadecimal, MAY be provided. 2003 For information encoded in 7-bit US-ASCII, the UTF-8 charset is 2004 identical to the US-ASCII charset. 2006 UTF-8 may require multiple bytes to represent a single character / 2007 code point; thus the length of an UTF8String in octets may be 2008 different from the number of characters encoded. 2010 Note that the AVP Length field of an UTF8String is measured in 2011 octets, not characters. 2013 DiameterIdentity 2015 The DiameterIdentity format is derived from the OctetString AVP 2016 Base Format. 2018 DiameterIdentity = FQDN 2020 DiameterIdentity value is used to uniquely identify a Diameter 2021 node for purposes of duplicate connection and routing loop 2022 detection. 2024 The contents of the string MUST be the FQDN of the Diameter node. 2025 If multiple Diameter nodes run on the same host, each Diameter 2026 node MUST be assigned a unique DiameterIdentity. If a Diameter 2027 node can be identified by several FQDNs, a single FQDN should be 2028 picked at startup, and used as the only DiameterIdentity for that 2029 node, whatever the connection it is sent on. Note that in this 2030 document, DiameterIdentity is in ASCII form in order to be 2031 compatible with existing DNS infrastructure. See Appendix D for 2032 interactions between the Diameter protocol and Internationalized 2033 Domain Name (IDNs). 2035 DiameterURI 2037 The DiameterURI MUST follow the Uniform Resource Identifiers (URI) 2038 syntax [RFC3986] rules specified below: 2040 "aaa://" FQDN [ port ] [ transport ] [ protocol ] 2042 ; No transport security 2044 "aaas://" FQDN [ port ] [ transport ] [ protocol ] 2046 ; Transport security used 2048 FQDN = Fully Qualified Host Name 2050 port = ":" 1*DIGIT 2052 ; One of the ports used to listen for 2053 ; incoming connections. 2054 ; If absent, 2055 ; the default Diameter port (3868) is 2056 ; assumed. 2058 transport = ";transport=" transport-protocol 2060 ; One of the transports used to listen 2061 ; for incoming connections. If absent, 2062 ; the default SCTP [RFC2960] protocol is 2063 ; assumed. UDP MUST NOT be used when 2064 ; the aaa-protocol field is set to 2065 ; diameter. 2067 transport-protocol = ( "tcp" / "sctp" / "udp" ) 2069 protocol = ";protocol=" aaa-protocol 2071 ; If absent, the default AAA protocol 2072 ; is Diameter. 2074 aaa-protocol = ( "diameter" / "radius" / "tacacs+" ) 2076 The following are examples of valid Diameter host identities: 2078 aaa://host.example.com;transport=tcp 2079 aaa://host.example.com:6666;transport=tcp 2080 aaa://host.example.com;protocol=diameter 2081 aaa://host.example.com:6666;protocol=diameter 2082 aaa://host.example.com:6666;transport=tcp;protocol=diameter 2083 aaa://host.example.com:1813;transport=udp;protocol=radius 2085 Enumerated 2087 Enumerated is derived from the Integer32 AVP Base Format. The 2088 definition contains a list of valid values and their 2089 interpretation and is described in the Diameter application 2090 introducing the AVP. 2092 IPFilterRule 2094 The IPFilterRule format is derived from the OctetString AVP Base 2095 Format and uses the ASCII charset. The rule syntax is a modified 2096 subset of ipfw(8) from FreeBSD. Packets may be filtered based on 2097 the following information that is associated with it: 2099 Direction (in or out) 2100 Source and destination IP address (possibly masked) 2101 Protocol 2102 Source and destination port (lists or ranges) 2103 TCP flags 2104 IP fragment flag 2105 IP options 2106 ICMP types 2108 Rules for the appropriate direction are evaluated in order, with 2109 the first matched rule terminating the evaluation. Each packet is 2110 evaluated once. If no rule matches, the packet is dropped if the 2111 last rule evaluated was a permit, and passed if the last rule was 2112 a deny. 2114 IPFilterRule filters MUST follow the format: 2116 action dir proto from src to dst [options] 2118 action permit - Allow packets that match the rule. 2119 deny - Drop packets that match the rule. 2121 dir "in" is from the terminal, "out" is to the 2122 terminal. 2124 proto An IP protocol specified by number. The "ip" 2125 keyword means any protocol will match. 2127 src and dst
[ports] 2129 The
may be specified as: 2130 ipno An IPv4 or IPv6 number in dotted- 2131 quad or canonical IPv6 form. Only 2132 this exact IP number will match the 2133 rule. 2134 ipno/bits An IP number as above with a mask 2135 width of the form 1.2.3.4/24. In 2136 this case, all IP numbers from 2137 1.2.3.0 to 1.2.3.255 will match. 2138 The bit width MUST be valid for the 2139 IP version and the IP number MUST 2140 NOT have bits set beyond the mask. 2141 For a match to occur, the same IP 2142 version must be present in the 2143 packet that was used in describing 2144 the IP address. To test for a 2145 particular IP version, the bits part 2146 can be set to zero. The keyword 2147 "any" is 0.0.0.0/0 or the IPv6 2148 equivalent. The keyword "assigned" 2149 is the address or set of addresses 2150 assigned to the terminal. For IPv4, 2151 a typical first rule is often "deny 2152 in ip! assigned" 2154 The sense of the match can be inverted by 2155 preceding an address with the not modifier (!), 2156 causing all other addresses to be matched 2157 instead. This does not affect the selection of 2158 port numbers. 2160 With the TCP, UDP and SCTP protocols, optional 2161 ports may be specified as: 2163 {port/port-port}[,ports[,...]] 2165 The '-' notation specifies a range of ports 2166 (including boundaries). 2168 Fragmented packets that have a non-zero offset 2169 (i.e., not the first fragment) will never match 2170 a rule that has one or more port 2171 specifications. See the frag option for 2172 details on matching fragmented packets. 2174 options: 2175 frag Match if the packet is a fragment and this is not 2176 the first fragment of the datagram. frag may not 2177 be used in conjunction with either tcpflags or 2178 TCP/UDP port specifications. 2180 ipoptions spec 2181 Match if the IP header contains the comma 2182 separated list of options specified in spec. The 2183 supported IP options are: 2185 ssrr (strict source route), lsrr (loose source 2186 route), rr (record packet route) and ts 2187 (timestamp). The absence of a particular option 2188 may be denoted with a '!'. 2190 tcpoptions spec 2191 Match if the TCP header contains the comma 2192 separated list of options specified in spec. The 2193 supported TCP options are: 2195 mss (maximum segment size), window (tcp window 2196 advertisement), sack (selective ack), ts (rfc1323 2197 timestamp) and cc (rfc1644 t/tcp connection 2198 count). The absence of a particular option may 2199 be denoted with a '!'. 2201 established 2202 TCP packets only. Match packets that have the RST 2203 or ACK bits set. 2205 setup TCP packets only. Match packets that have the SYN 2206 bit set but no ACK bit. 2208 tcpflags spec 2209 TCP packets only. Match if the TCP header 2210 contains the comma separated list of flags 2211 specified in spec. The supported TCP flags are: 2213 fin, syn, rst, psh, ack and urg. The absence of a 2214 particular flag may be denoted with a '!'. A rule 2215 that contains a tcpflags specification can never 2216 match a fragmented packet that has a non-zero 2217 offset. See the frag option for details on 2218 matching fragmented packets. 2220 icmptypes types 2221 ICMP packets only. Match if the ICMP type is in 2222 the list types. The list may be specified as any 2223 combination of ranges or individual types 2224 separated by commas. Both the numeric values and 2225 the symbolic values listed below can be used. The 2226 supported ICMP types are: 2228 echo reply (0), destination unreachable (3), 2229 source quench (4), redirect (5), echo request 2230 (8), router advertisement (9), router 2231 solicitation (10), time-to-live exceeded (11), IP 2232 header bad (12), timestamp request (13), 2233 timestamp reply (14), information request (15), 2234 information reply (16), address mask request (17) 2235 and address mask reply (18). 2237 There is one kind of packet that the access device MUST always 2238 discard, that is an IP fragment with a fragment offset of one. 2239 This is a valid packet, but it only has one use, to try to 2240 circumvent firewalls. 2242 An access device that is unable to interpret or apply a deny rule 2243 MUST terminate the session. An access device that is unable to 2244 interpret or apply a permit rule MAY apply a more restrictive 2245 rule. An access device MAY apply deny rules of its own before the 2246 supplied rules, for example to protect the access device owner's 2247 infrastructure. 2249 4.4. Grouped AVP Values 2251 The Diameter protocol allows AVP values of type 'Grouped'. This 2252 implies that the Data field is actually a sequence of AVPs. It is 2253 possible to include an AVP with a Grouped type within a Grouped type, 2254 that is, to nest them. AVPs within an AVP of type Grouped have the 2255 same padding requirements as non-Grouped AVPs, as defined in Section 2256 4. 2258 The AVP Code numbering space of all AVPs included in a Grouped AVP is 2259 the same as for non-grouped AVPs. Receivers of a Grouped AVP that 2260 does not have the 'M' (mandatory) bit set and one or more of the 2261 encapsulated AVPs within the group has the 'M' (mandatory) bit set 2262 MAY simply be ignored if the Grouped AVP itself is unrecognized. The 2263 rule applies even if the encapsulated AVP with its 'M' (mandatory) 2264 bit set is further encapsulated within other sub-groups; i.e. other 2265 Grouped AVPs embedded within the Grouped AVP. 2267 Every Grouped AVP defined MUST include a corresponding grammar, using 2268 ABNF [RFC4234] (with modifications), as defined below. 2270 grouped-avp-def = name "::=" avp 2272 name-fmt = ALPHA *(ALPHA / DIGIT / "-") 2274 name = name-fmt 2275 ; The name has to be the name of an AVP, 2276 ; defined in the base or extended Diameter 2277 ; specifications. 2279 avp = header [ *fixed] [ *required] [ *optional] 2281 header = "<" "AVP-Header:" avpcode [vendor] ">" 2283 avpcode = 1*DIGIT 2284 ; The AVP Code assigned to the Grouped AVP 2286 vendor = 1*DIGIT 2287 ; The Vendor-ID assigned to the Grouped AVP. 2288 ; If absent, the default value of zero is 2289 ; used. 2291 4.4.1. Example AVP with a Grouped Data type 2293 The Example-AVP (AVP Code 999999) is of type Grouped and is used to 2294 clarify how Grouped AVP values work. The Grouped Data field has the 2295 following ABNF grammar: 2297 Example-AVP ::= < AVP Header: 999999 > 2298 { Origin-Host } 2299 1*{ Session-Id } 2300 *[ AVP ] 2302 An Example-AVP with Grouped Data follows. 2304 The Origin-Host AVP is required (Section 6.3). In this case: 2306 Origin-Host = "example.com". 2308 One or more Session-Ids must follow. Here there are two: 2310 Session-Id = 2311 "grump.example.com:33041;23432;893;0AF3B81" 2313 Session-Id = 2314 "grump.example.com:33054;23561;2358;0AF3B82" 2316 optional AVPs included are 2318 Recovery-Policy = 2319 2163bc1d0ad82371f6bc09484133c3f09ad74a0dd5346d54195a7cf0b35 2320 2cabc881839a4fdcfbc1769e2677a4c1fb499284c5f70b48f58503a45c5 2321 c2d6943f82d5930f2b7c1da640f476f0e9c9572a50db8ea6e51e1c2c7bd 2322 f8bb43dc995144b8dbe297ac739493946803e1cee3e15d9b765008a1b2a 2323 cf4ac777c80041d72c01e691cf751dbf86e85f509f3988e5875dc905119 2324 26841f00f0e29a6d1ddc1a842289d440268681e052b30fb638045f7779c 2325 1d873c784f054f688f5001559ecff64865ef975f3e60d2fd7966b8c7f92 2327 Futuristic-Acct-Record = 2328 fe19da5802acd98b07a5b86cb4d5d03f0314ab9ef1ad0b67111ff3b90a0 2329 57fe29620bf3585fd2dd9fcc38ce62f6cc208c6163c008f4258d1bc88b8 2330 17694a74ccad3ec69269461b14b2e7a4c111fb239e33714da207983f58c 2331 41d018d56fe938f3cbf089aac12a912a2f0d1923a9390e5f789cb2e5067 2332 d3427475e49968f841 2334 The data for the optional AVPs is represented in hex since the format 2335 of these AVPs is neither known at the time of definition of the 2336 Example-AVP group, nor (likely) at the time when the example instance 2337 of this AVP is interpreted - except by Diameter implementations which 2338 support the same set of AVPs. The encoding example illustrates how 2339 padding is used and how length fields are calculated. Also note that 2340 AVPs may be present in the Grouped AVP value which the receiver 2341 cannot interpret (here, the Recover-Policy and Futuristic-Acct-Record 2342 AVPs). The length of the Example-AVP is the sum of all the length of 2343 the member AVPs including their padding plus the Example-AVP header 2344 size. 2346 This AVP would be encoded as follows: 2348 0 1 2 3 4 5 6 7 2349 +-------+-------+-------+-------+-------+-------+-------+-------+ 2350 0 | Example AVP Header (AVP Code = 999999), Length = 496 | 2351 +-------+-------+-------+-------+-------+-------+-------+-------+ 2352 8 | Origin-Host AVP Header (AVP Code = 264), Length = 19 | 2353 +-------+-------+-------+-------+-------+-------+-------+-------+ 2354 16 | 'e' | 'x' | 'a' | 'm' | 'p' | 'l' | 'e' | '.' | 2355 +-------+-------+-------+-------+-------+-------+-------+-------+ 2356 24 | 'c' | 'o' | 'm' |Padding| Session-Id AVP Header | 2357 +-------+-------+-------+-------+-------+-------+-------+-------+ 2358 32 | (AVP Code = 263), Length = 49 | 'g' | 'r' | 'u' | 'm' | 2359 +-------+-------+-------+-------+-------+-------+-------+-------+ 2360 . . . 2361 +-------+-------+-------+-------+-------+-------+-------+-------+ 2362 72 | 'F' | '3' | 'B' | '8' | '1' |Padding|Padding|Padding| 2363 +-------+-------+-------+-------+-------+-------+-------+-------+ 2364 80 | Session-Id AVP Header (AVP Code = 263), Length = 50 | 2365 +-------+-------+-------+-------+-------+-------+-------+-------+ 2366 88 | 'g' | 'r' | 'u' | 'm' | 'p' | '.' | 'e' | 'x' | 2367 +-------+-------+-------+-------+-------+-------+-------+-------+ 2368 . . . 2369 +-------+-------+-------+-------+-------+-------+-------+-------+ 2370 120| '5' | '8' | ';' | '0' | 'A' | 'F' | '3' | 'B' | 2371 +-------+-------+-------+-------+-------+-------+-------+-------+ 2372 128| '8' | '2' |Padding|Padding| Recovery-Policy Header (AVP | 2373 +-------+-------+-------+-------+-------+-------+-------+-------+ 2374 136| Code = 8341), Length = 223 | 0x21 | 0x63 | 0xbc | 0x1d | 2375 +-------+-------+-------+-------+-------+-------+-------+-------+ 2376 144| 0x0a | 0xd8 | 0x23 | 0x71 | 0xf6 | 0xbc | 0x09 | 0x48 | 2377 +-------+-------+-------+-------+-------+-------+-------+-------+ 2378 . . . 2379 +-------+-------+-------+-------+-------+-------+-------+-------+ 2380 352| 0x8c | 0x7f | 0x92 |Padding| Futuristic-Acct-Record Header | 2381 +-------+-------+-------+-------+-------+-------+-------+-------+ 2382 328|(AVP Code = 15930),Length = 137| 0xfe | 0x19 | 0xda | 0x58 | 2383 +-------+-------+-------+-------+-------+-------+-------+-------+ 2384 336| 0x02 | 0xac | 0xd9 | 0x8b | 0x07 | 0xa5 | 0xb8 | 0xc6 | 2385 +-------+-------+-------+-------+-------+-------+-------+-------+ 2386 . . . 2387 +-------+-------+-------+-------+-------+-------+-------+-------+ 2388 488| 0xe4 | 0x99 | 0x68 | 0xf8 | 0x41 |Padding|Padding|Padding| 2389 +-------+-------+-------+-------+-------+-------+-------+-------+ 2391 4.5. Diameter Base Protocol AVPs 2393 The following table describes the Diameter AVPs defined in the base 2394 protocol, their AVP Code values, types, possible flag values. 2396 Due to space constraints, the short form DiamIdent is used to 2397 represent DiameterIdentity. 2399 +----------+ 2400 | AVP Flag | 2401 | rules | 2402 |----+-----| 2403 AVP Section | |MUST | 2404 Attribute Name Code Defined Data Type |MUST| NOT | 2405 -----------------------------------------|----+-----| 2406 Acct- 85 9.8.2 Unsigned32 | M | V | 2407 Interim-Interval | | | 2408 Accounting- 483 9.8.7 Enumerated | M | V | 2409 Realtime-Required | | | 2410 Acct- 50 9.8.5 UTF8String | M | V | 2411 Multi-Session-Id | | | 2412 Accounting- 485 9.8.3 Unsigned32 | M | V | 2413 Record-Number | | | 2414 Accounting- 480 9.8.1 Enumerated | M | V | 2415 Record-Type | | | 2416 Accounting- 44 9.8.4 OctetString| M | V | 2417 Session-Id | | | 2418 Accounting- 287 9.8.6 Unsigned64 | M | V | 2419 Sub-Session-Id | | | 2420 Acct- 259 6.9 Unsigned32 | M | V | 2421 Application-Id | | | 2422 Auth- 258 6.8 Unsigned32 | M | V | 2423 Application-Id | | | 2424 Auth-Request- 274 8.7 Enumerated | M | V | 2425 Type | | | 2426 Authorization- 291 8.9 Unsigned32 | M | V | 2427 Lifetime | | | 2428 Auth-Grace- 276 8.10 Unsigned32 | M | V | 2429 Period | | | 2430 Auth-Session- 277 8.11 Enumerated | M | V | 2431 State | | | 2432 Re-Auth-Request- 285 8.12 Enumerated | M | V | 2433 Type | | | 2434 Class 25 8.20 OctetString| M | V | 2435 Destination-Host 293 6.5 DiamIdent | M | V | 2436 Destination- 283 6.6 DiamIdent | M | V | 2437 Realm | | | 2438 Disconnect-Cause 273 5.4.3 Enumerated | M | V | 2439 Error-Message 281 7.3 UTF8String | | V,M | 2440 Error-Reporting- 294 7.4 DiamIdent | | V,M | 2441 Host | | | 2442 Event-Timestamp 55 8.21 Time | M | V | 2443 Experimental- 297 7.6 Grouped | M | V | 2444 Result | | | 2445 -----------------------------------------|----+-----| 2446 +----------+ 2447 | AVP Flag | 2448 | rules | 2449 |----+-----| 2450 AVP Section | |MUST | 2451 Attribute Name Code Defined Data Type |MUST| NOT | 2452 -----------------------------------------|----+-----| 2453 Experimental- 298 7.7 Unsigned32 | M | V | 2454 Result-Code | | | 2455 Failed-AVP 279 7.5 Grouped | M | V | 2456 Firmware- 267 5.3.4 Unsigned32 | | V,M | 2457 Revision | | | 2458 Host-IP-Address 257 5.3.5 Address | M | V | 2459 Inband-Security | M | V | 2460 -Id 299 6.10 Unsigned32 | | | 2461 Multi-Round- 272 8.19 Unsigned32 | M | V | 2462 Time-Out | | | 2463 Origin-Host 264 6.3 DiamIdent | M | V | 2464 Origin-Realm 296 6.4 DiamIdent | M | V | 2465 Origin-State-Id 278 8.16 Unsigned32 | M | V | 2466 Product-Name 269 5.3.7 UTF8String | | V,M | 2467 Proxy-Host 280 6.7.3 DiamIdent | M | V | 2468 Proxy-Info 284 6.7.2 Grouped | M | V | 2469 Proxy-State 33 6.7.4 OctetString| M | V | 2470 Redirect-Host 292 6.12 DiamURI | M | V | 2471 Redirect-Host- 261 6.13 Enumerated | M | V | 2472 Usage | | | 2473 Redirect-Max- 262 6.14 Unsigned32 | M | V | 2474 Cache-Time | | | 2475 Result-Code 268 7.1 Unsigned32 | M | V | 2476 Route-Record 282 6.7.1 DiamIdent | M | V | 2477 Session-Id 263 8.8 UTF8String | M | V | 2478 Session-Timeout 27 8.13 Unsigned32 | M | V | 2479 Session-Binding 270 8.17 Unsigned32 | M | V | 2480 Session-Server- 271 8.18 Enumerated | M | V | 2481 Failover | | | 2482 Supported- 265 5.3.6 Unsigned32 | M | V | 2483 Vendor-Id | | | 2484 Termination- 295 8.15 Enumerated | M | V | 2485 Cause | | | 2486 User-Name 1 8.14 UTF8String | M | V | 2487 Vendor-Id 266 5.3.3 Unsigned32 | M | V | 2488 Vendor-Specific- 260 6.11 Grouped | M | V | 2489 Application-Id | | | 2490 -----------------------------------------|----+-----| 2492 5. Diameter Peers 2494 This section describes how Diameter nodes establish connections and 2495 communicate with peers. 2497 5.1. Peer Connections 2499 Although a Diameter node may have many possible peers that it is able 2500 to communicate with, it may not be economical to have an established 2501 connection to all of them. At a minimum, a Diameter node SHOULD have 2502 an established connection with two peers per realm, known as the 2503 primary and secondary peers. Of course, a node MAY have additional 2504 connections, if it is deemed necessary. Typically, all messages for 2505 a realm are sent to the primary peer, but in the event that failover 2506 procedures are invoked, any pending requests are sent to the 2507 secondary peer. However, implementations are free to load balance 2508 requests between a set of peers. 2510 Note that a given peer MAY act as a primary for a given realm, while 2511 acting as a secondary for another realm. 2513 When a peer is deemed suspect, which could occur for various reasons, 2514 including not receiving a DWA within an allotted timeframe, no new 2515 requests should be forwarded to the peer, but failover procedures are 2516 invoked. When an active peer is moved to this mode, additional 2517 connections SHOULD be established to ensure that the necessary number 2518 of active connections exists. 2520 There are two ways that a peer is removed from the suspect peer list: 2522 1. The peer is no longer reachable, causing the transport connection 2523 to be shutdown. The peer is moved to the closed state. 2525 2. Three watchdog messages are exchanged with accepted round trip 2526 times, and the connection to the peer is considered stabilized. 2528 In the event the peer being removed is either the primary or 2529 secondary, an alternate peer SHOULD replace the deleted peer, and 2530 assume the role of either primary or secondary. 2532 5.2. Diameter Peer Discovery 2534 Allowing for dynamic Diameter agent discovery will make it possible 2535 for simpler and more robust deployment of Diameter services. In 2536 order to promote interoperable implementations of Diameter peer 2537 discovery, the following mechanisms are described. These are based 2538 on existing IETF standards. The first option (manual configuration) 2539 MUST be supported by all DIAMETER nodes, while the latter option 2540 (DNS) MAY be supported. 2542 There are two cases where Diameter peer discovery may be performed. 2543 The first is when a Diameter client needs to discover a first-hop 2544 Diameter agent. The second case is when a Diameter agent needs to 2545 discover another agent - for further handling of a Diameter 2546 operation. In both cases, the following 'search order' is 2547 recommended: 2549 1. The Diameter implementation consults its list of static 2550 (manually) configured Diameter agent locations. These will be 2551 used if they exist and respond. 2553 2. The Diameter implementation performs a NAPTR query for a server 2554 in a particular realm. The Diameter implementation has to know 2555 in advance which realm to look for a Diameter agent in. This 2556 could be deduced, for example, from the 'realm' in a NAI that a 2557 Diameter implementation needed to perform a Diameter operation 2558 on. 2560 * The services relevant for the task of transport protocol 2561 selection are those with NAPTR service fields with values 2562 "AAA+D2x", where x is a letter that corresponds to a transport 2563 protocol supported by the domain. This specification defines 2564 D2T for TCP and D2S for SCTP. We also establish an IANA 2565 registry for NAPTR service name to transport protocol 2566 mappings. 2568 These NAPTR records provide a mapping from a domain, to the 2569 SRV record for contacting a server with the specific transport 2570 protocol in the NAPTR services field. The resource record 2571 will contain an empty regular expression and a replacement 2572 value, which is the SRV record for that particular transport 2573 protocol. If the server supports multiple transport 2574 protocols, there will be multiple NAPTR records, each with a 2575 different service value. As per [RFC3403], the client 2576 discards any records whose services fields are not applicable. 2577 For the purposes of this specification, several rules are 2578 defined. 2580 * A client MUST discard any service fields that identify a 2581 resolution service whose value is not "D2X", for values of X 2582 that indicate transport protocols supported by the client. 2583 The NAPTR processing as described in [RFC3403] will result in 2584 discovery of the most preferred transport protocol of the 2585 server that is supported by the client, as well as an SRV 2586 record for the server. 2588 The domain suffixes in the NAPTR replacement field SHOULD 2589 match the domain of the original query. 2591 3. If no NAPTR records are found, the requester queries for those 2592 address records for the destination address, 2593 '_diameter._sctp'.realm or '_diameter._tcp'.realm. Address 2594 records include A RR's, AAAA RR's or other similar records, 2595 chosen according to the requester's network protocol 2596 capabilities. If the DNS server returns no address records, the 2597 requester gives up. 2599 If the server is using a site certificate, the domain name in the 2600 query and the domain name in the replacement field MUST both be 2601 valid based on the site certificate handed out by the server in 2602 the TLS or IKE exchange. Similarly, the domain name in the SRV 2603 query and the domain name in the target in the SRV record MUST 2604 both be valid based on the same site certificate. Otherwise, an 2605 attacker could modify the DNS records to contain replacement 2606 values in a different domain, and the client could not validate 2607 that this was the desired behavior, or the result of an attack 2609 Also, the Diameter Peer MUST check to make sure that the 2610 discovered peers are authorized to act in its role. 2611 Authentication via IKE or TLS, or validation of DNS RRs via 2612 DNSSEC is not sufficient to conclude this. For example, a web 2613 server may have obtained a valid TLS certificate, and secured RRs 2614 may be included in the DNS, but this does not imply that it is 2615 authorized to act as a Diameter Server. 2617 Authorization can be achieved for example, by configuration of a 2618 Diameter Server CA. Alternatively this can be achieved by 2619 definition of OIDs within TLS or IKE certificates so as to 2620 signify Diameter Server authorization. 2622 A dynamically discovered peer causes an entry in the Peer Table (see 2623 Section 2.6) to be created. Note that entries created via DNS MUST 2624 expire (or be refreshed) within the DNS TTL. If a peer is discovered 2625 outside of the local realm, a routing table entry (see Section 2.7) 2626 for the peer's realm is created. The routing table entry's 2627 expiration MUST match the peer's expiration value. 2629 5.3. Capabilities Exchange 2631 When two Diameter peers establish a transport connection, they MUST 2632 exchange the Capabilities Exchange messages, as specified in the peer 2633 state machine (see Section 5.6). This message allows the discovery 2634 of a peer's identity and its capabilities (protocol version number, 2635 supported Diameter applications, security mechanisms, etc.) 2637 The receiver only issues commands to its peers that have advertised 2638 support for the Diameter application that defines the command. A 2639 Diameter node MUST cache the supported applications in order to 2640 ensure that unrecognized commands and/or AVPs are not unnecessarily 2641 sent to a peer. 2643 A receiver of a Capabilities-Exchange-Req (CER) message that does not 2644 have any applications in common with the sender MUST return a 2645 Capabilities-Exchange-Answer (CEA) with the Result-Code AVP set to 2646 DIAMETER_NO_COMMON_APPLICATION, and SHOULD disconnect the transport 2647 layer connection. Note that receiving a CER or CEA from a peer 2648 advertising itself as a Relay (see Section 2.4) MUST be interpreted 2649 as having common applications with the peer. 2651 The receiver of the Capabilities-Exchange-Request (CER) MUST 2652 determine common applications by computing the intersection of its 2653 own set of supported Application Id against all of the application 2654 identifier AVPs (Auth-Application-Id, Acct-Application-Id and Vendor- 2655 Specific-Application-Id) present in the CER. The value of the 2656 Vendor-Id AVP in the Vendor-Specific-Application-Id MUST NOT be used 2657 during computation. The sender of the Capabilities-Exchange-Answer 2658 (CEA) SHOULD include all of its supported applications as a hint to 2659 the receiver regarding all of its application capabilities. 2661 Similarly, a receiver of a Capabilities-Exchange-Req (CER) message 2662 that does not have any security mechanisms in common with the sender 2663 MUST return a Capabilities-Exchange-Answer (CEA) with the Result-Code 2664 AVP set to DIAMETER_NO_COMMON_SECURITY, and SHOULD disconnect the 2665 transport layer connection. 2667 CERs received from unknown peers MAY be silently discarded, or a CEA 2668 MAY be issued with the Result-Code AVP set to DIAMETER_UNKNOWN_PEER. 2669 In both cases, the transport connection is closed. If the local 2670 policy permits receiving CERs from unknown hosts, a successful CEA 2671 MAY be returned. If a CER from an unknown peer is answered with a 2672 successful CEA, the lifetime of the peer entry is equal to the 2673 lifetime of the transport connection. In case of a transport 2674 failure, all the pending transactions destined to the unknown peer 2675 can be discarded. 2677 The CER and CEA messages MUST NOT be proxied, redirected or relayed. 2679 Since the CER/CEA messages cannot be proxied, it is still possible 2680 that an upstream agent receives a message for which it has no 2681 available peers to handle the application that corresponds to the 2682 Command-Code. In such instances, the 'E' bit is set in the answer 2683 message (see Section 7.) with the Result-Code AVP set to 2684 DIAMETER_UNABLE_TO_DELIVER to inform the downstream to take action 2685 (e.g., re-routing request to an alternate peer). 2687 With the exception of the Capabilities-Exchange-Request message, a 2688 message of type Request that includes the Auth-Application-Id or 2689 Acct-Application-Id AVPs, or a message with an application-specific 2690 command code, MAY only be forwarded to a host that has explicitly 2691 advertised support for the application (or has advertised the Relay 2692 Application Id). 2694 5.3.1. Capabilities-Exchange-Request 2696 The Capabilities-Exchange-Request (CER), indicated by the Command- 2697 Code set to 257 and the Command Flags' 'R' bit set, is sent to 2698 exchange local capabilities. Upon detection of a transport failure, 2699 this message MUST NOT be sent to an alternate peer. 2701 When Diameter is run over SCTP [RFC2960], which allows for 2702 connections to span multiple interfaces and multiple IP addresses, 2703 the Capabilities-Exchange-Request message MUST contain one Host-IP- 2704 Address AVP for each potential IP address that MAY be locally used 2705 when transmitting Diameter messages. 2707 Message Format 2709 ::= < Diameter Header: 257, REQ > 2710 { Origin-Host } 2711 { Origin-Realm } 2712 1* { Host-IP-Address } 2713 { Vendor-Id } 2714 { Product-Name } 2715 [ Origin-State-Id ] 2716 * [ Supported-Vendor-Id ] 2717 * [ Auth-Application-Id ] 2718 * [ Inband-Security-Id ] 2719 * [ Acct-Application-Id ] 2720 * [ Vendor-Specific-Application-Id ] 2721 [ Firmware-Revision ] 2722 * [ AVP ] 2724 5.3.2. Capabilities-Exchange-Answer 2726 The Capabilities-Exchange-Answer (CEA), indicated by the Command-Code 2727 set to 257 and the Command Flags' 'R' bit cleared, is sent in 2728 response to a CER message. 2730 When Diameter is run over SCTP [RFC2960], which allows connections to 2731 span multiple interfaces, hence, multiple IP addresses, the 2732 Capabilities-Exchange-Answer message MUST contain one Host-IP-Address 2733 AVP for each potential IP address that MAY be locally used when 2734 transmitting Diameter messages. 2736 Message Format 2738 ::= < Diameter Header: 257 > 2739 { Result-Code } 2740 { Origin-Host } 2741 { Origin-Realm } 2742 1* { Host-IP-Address } 2743 { Vendor-Id } 2744 { Product-Name } 2745 [ Origin-State-Id ] 2746 [ Error-Message ] 2747 [ Failed-AVP ] 2748 * [ Supported-Vendor-Id ] 2749 * [ Auth-Application-Id ] 2750 * [ Inband-Security-Id ] 2751 * [ Acct-Application-Id ] 2752 * [ Vendor-Specific-Application-Id ] 2753 [ Firmware-Revision ] 2754 * [ AVP ] 2756 5.3.3. Vendor-Id AVP 2758 The Vendor-Id AVP (AVP Code 266) is of type Unsigned32 and contains 2759 the IANA "SMI Network Management Private Enterprise Codes" [RFC3232] 2760 value assigned to the vendor of the Diameter device. It is 2761 envisioned that the combination of the Vendor-Id, Product-Name 2762 (Section 5.3.7) and the Firmware-Revision (Section 5.3.4) AVPs may 2763 provide useful debugging information. 2765 A Vendor-Id value of zero in the CER or CEA messages is reserved and 2766 indicates that this field is ignored. 2768 5.3.4. Firmware-Revision AVP 2770 The Firmware-Revision AVP (AVP Code 267) is of type Unsigned32 and is 2771 used to inform a Diameter peer of the firmware revision of the 2772 issuing device. 2774 For devices that do not have a firmware revision (general purpose 2775 computers running Diameter software modules, for instance), the 2776 revision of the Diameter software module may be reported instead. 2778 5.3.5. Host-IP-Address AVP 2780 The Host-IP-Address AVP (AVP Code 257) is of type Address and is used 2781 to inform a Diameter peer of the sender's IP address. All source 2782 addresses that a Diameter node expects to use with SCTP [RFC2960] 2783 MUST be advertised in the CER and CEA messages by including a 2784 Host-IP- Address AVP for each address. This AVP MUST ONLY be used in 2785 the CER and CEA messages. 2787 5.3.6. Supported-Vendor-Id AVP 2789 The Supported-Vendor-Id AVP (AVP Code 265) is of type Unsigned32 and 2790 contains the IANA "SMI Network Management Private Enterprise Codes" 2791 [RFC3232] value assigned to a vendor other than the device vendor but 2792 including the application vendor. This is used in the CER and CEA 2793 messages in order to inform the peer that the sender supports (a 2794 subset of) the vendor-specific AVPs defined by the vendor identified 2795 in this AVP. The value of this AVP SHOULD NOT be set to zero. 2796 Multiple instances of this AVP containing the same value SHOULD NOT 2797 be sent. 2799 5.3.7. Product-Name AVP 2801 The Product-Name AVP (AVP Code 269) is of type UTF8String, and 2802 contains the vendor assigned name for the product. The Product-Name 2803 AVP SHOULD remain constant across firmware revisions for the same 2804 product. 2806 5.4. Disconnecting Peer connections 2808 When a Diameter node disconnects one of its transport connections, 2809 its peer cannot know the reason for the disconnect, and will most 2810 likely assume that a connectivity problem occurred, or that the peer 2811 has rebooted. In these cases, the peer may periodically attempt to 2812 reconnect, as stated in Section 2.1. In the event that the 2813 disconnect was a result of either a shortage of internal resources, 2814 or simply that the node in question has no intentions of forwarding 2815 any Diameter messages to the peer in the foreseeable future, a 2816 periodic connection request would not be welcomed. The 2817 Disconnection-Reason AVP contains the reason the Diameter node issued 2818 the Disconnect-Peer-Request message. 2820 The Disconnect-Peer-Request message is used by a Diameter node to 2821 inform its peer of its intent to disconnect the transport layer, and 2822 that the peer shouldn't reconnect unless it has a valid reason to do 2823 so (e.g., message to be forwarded). Upon receipt of the message, the 2824 Disconnect-Peer-Answer is returned, which SHOULD contain an error if 2825 messages have recently been forwarded, and are likely in flight, 2826 which would otherwise cause a race condition. 2828 The receiver of the Disconnect-Peer-Answer initiates the transport 2829 disconnect. The sender of the Disconnect-Peer-Answer should be able 2830 to detect the transport closure and cleanup the connection. 2832 5.4.1. Disconnect-Peer-Request 2834 The Disconnect-Peer-Request (DPR), indicated by the Command-Code set 2835 to 282 and the Command Flags' 'R' bit set, is sent to a peer to 2836 inform its intentions to shutdown the transport connection. Upon 2837 detection of a transport failure, this message MUST NOT be sent to an 2838 alternate peer. 2840 Message Format 2842 ::= < Diameter Header: 282, REQ > 2843 { Origin-Host } 2844 { Origin-Realm } 2845 { Disconnect-Cause } 2846 * [ AVP ] 2848 5.4.2. Disconnect-Peer-Answer 2850 The Disconnect-Peer-Answer (DPA), indicated by the Command-Code set 2851 to 282 and the Command Flags' 'R' bit cleared, is sent as a response 2852 to the Disconnect-Peer-Request message. Upon receipt of this 2853 message, the transport connection is shutdown. 2855 Message Format 2857 ::= < Diameter Header: 282 > 2858 { Result-Code } 2859 { Origin-Host } 2860 { Origin-Realm } 2861 [ Error-Message ] 2862 [ Failed-AVP ] 2863 * [ AVP ] 2865 5.4.3. Disconnect-Cause AVP 2867 The Disconnect-Cause AVP (AVP Code 273) is of type Enumerated. A 2868 Diameter node MUST include this AVP in the Disconnect-Peer-Request 2869 message to inform the peer of the reason for its intention to 2870 shutdown the transport connection. The following values are 2871 supported: 2873 REBOOTING 0 2874 A scheduled reboot is imminent. Receiver of DPR with above result 2875 code MAY attempt reconnection. 2877 BUSY 1 2878 The peer's internal resources are constrained, and it has 2879 determined that the transport connection needs to be closed. 2880 Receiver of DPR with above result code SHOULD NOT attempt 2881 reconnection. 2883 DO_NOT_WANT_TO_TALK_TO_YOU 2 2884 The peer has determined that it does not see a need for the 2885 transport connection to exist, since it does not expect any 2886 messages to be exchanged in the near future. Receiver of DPR 2887 with above result code SHOULD NOT attempt reconnection. 2889 5.5. Transport Failure Detection 2891 Given the nature of the Diameter protocol, it is recommended that 2892 transport failures be detected as soon as possible. Detecting such 2893 failures will minimize the occurrence of messages sent to unavailable 2894 agents, resulting in unnecessary delays, and will provide better 2895 failover performance. The Device-Watchdog-Request and Device- 2896 Watchdog-Answer messages, defined in this section, are used to pro- 2897 actively detect transport failures. 2899 5.5.1. Device-Watchdog-Request 2901 The Device-Watchdog-Request (DWR), indicated by the Command-Code set 2902 to 280 and the Command Flags' 'R' bit set, is sent to a peer when no 2903 traffic has been exchanged between two peers (see Section 5.5.3). 2904 Upon detection of a transport failure, this message MUST NOT be sent 2905 to an alternate peer. 2907 Message Format 2909 ::= < Diameter Header: 280, REQ > 2910 { Origin-Host } 2911 { Origin-Realm } 2912 [ Origin-State-Id ] 2914 * [ AVP ] 2916 5.5.2. Device-Watchdog-Answer 2918 The Device-Watchdog-Answer (DWA), indicated by the Command-Code set 2919 to 280 and the Command Flags' 'R' bit cleared, is sent as a response 2920 to the Device-Watchdog-Request message. 2922 Message Format 2924 ::= < Diameter Header: 280 > 2925 { Result-Code } 2926 { Origin-Host } 2927 { Origin-Realm } 2928 [ Error-Message ] 2929 [ Failed-AVP ] 2930 [ Origin-State-Id ] 2931 * [ AVP ] 2933 5.5.3. Transport Failure Algorithm 2935 The transport failure algorithm is defined in [RFC3539]. All 2936 Diameter implementations MUST support the algorithm defined in the 2937 specification in order to be compliant to the Diameter base protocol. 2939 5.5.4. Failover and Failback Procedures 2941 In the event that a transport failure is detected with a peer, it is 2942 necessary for all pending request messages to be forwarded to an 2943 alternate agent, if possible. This is commonly referred to as 2944 failover. 2946 In order for a Diameter node to perform failover procedures, it is 2947 necessary for the node to maintain a pending message queue for a 2948 given peer. When an answer message is received, the corresponding 2949 request is removed from the queue. The Hop-by-Hop Identifier field 2950 is used to match the answer with the queued request. 2952 When a transport failure is detected, if possible all messages in the 2953 queue are sent to an alternate agent with the T flag set. On booting 2954 a Diameter client or agent, the T flag is also set on any records 2955 still remaining to be transmitted in non-volatile storage. An 2956 example of a case where it is not possible to forward the message to 2957 an alternate server is when the message has a fixed destination, and 2958 the unavailable peer is the message's final destination (see 2959 Destination-Host AVP). Such an error requires that the agent return 2960 an answer message with the 'E' bit set and the Result-Code AVP set to 2961 DIAMETER_UNABLE_TO_DELIVER. 2963 It is important to note that multiple identical requests or answers 2964 MAY be received as a result of a failover. The End-to-End Identifier 2965 field in the Diameter header along with the Origin-Host AVP MUST be 2966 used to identify duplicate messages. 2968 As described in Section 2.1, a connection request should be 2969 periodically attempted with the failed peer in order to re-establish 2970 the transport connection. Once a connection has been successfully 2971 established, messages can once again be forwarded to the peer. This 2972 is commonly referred to as failback. 2974 5.6. Peer State Machine 2976 This section contains a finite state machine that MUST be observed by 2977 all Diameter implementations. Each Diameter node MUST follow the 2978 state machine described below when communicating with each peer. 2979 Multiple actions are separated by commas, and may continue on 2980 succeeding lines, as space requires. Similarly, state and next state 2981 may also span multiple lines, as space requires. 2983 This state machine is closely coupled with the state machine 2984 described in [RFC3539], which is used to open, close, failover, 2985 probe, and reopen transport connections. Note in particular that 2986 [RFC3539] requires the use of watchdog messages to probe connections. 2987 For Diameter, DWR and DWA messages are to be used. 2989 I- is used to represent the initiator (connecting) connection, while 2990 the R- is used to represent the responder (listening) connection. 2991 The lack of a prefix indicates that the event or action is the same 2992 regardless of the connection on which the event occurred. 2994 The stable states that a state machine may be in are Closed, I-Open 2995 and R-Open; all other states are intermediate. Note that I-Open and 2996 R-Open are equivalent except for whether the initiator or responder 2997 transport connection is used for communication. 2999 A CER message is always sent on the initiating connection immediately 3000 after the connection request is successfully completed. In the case 3001 of an election, one of the two connections will shut down. The 3002 responder connection will survive if the Origin-Host of the local 3003 Diameter entity is higher than that of the peer; the initiator 3004 connection will survive if the peer's Origin-Host is higher. All 3005 subsequent messages are sent on the surviving connection. Note that 3006 the results of an election on one peer are guaranteed to be the 3007 inverse of the results on the other. 3009 For TLS usage, a TLS handshake will begin when both ends are in the 3010 open state. If the TLS handshake is successful, all further messages 3011 will be sent via TLS. If the handshake fails, both ends move to the 3012 closed state. 3014 The state machine constrains only the behavior of a Diameter 3015 implementation as seen by Diameter peers through events on the wire. 3017 Any implementation that produces equivalent results is considered 3018 compliant. 3020 state event action next state 3021 ----------------------------------------------------------------- 3022 Closed Start I-Snd-Conn-Req Wait-Conn-Ack 3023 R-Conn-CER R-Accept, R-Open 3024 Process-CER, 3025 R-Snd-CEA 3027 Wait-Conn-Ack I-Rcv-Conn-Ack I-Snd-CER Wait-I-CEA 3028 I-Rcv-Conn-Nack Cleanup Closed 3029 R-Conn-CER R-Accept, Wait-Conn-Ack/ 3030 Process-CER Elect 3031 Timeout Error Closed 3033 Wait-I-CEA I-Rcv-CEA Process-CEA I-Open 3034 R-Conn-CER R-Accept, Wait-Returns 3035 Process-CER, 3036 Elect 3037 I-Peer-Disc I-Disc Closed 3038 I-Rcv-Non-CEA Error Closed 3039 Timeout Error Closed 3041 Wait-Conn-Ack/ I-Rcv-Conn-Ack I-Snd-CER,Elect Wait-Returns 3042 Elect I-Rcv-Conn-Nack R-Snd-CEA R-Open 3043 R-Peer-Disc R-Disc Wait-Conn-Ack 3044 R-Conn-CER R-Reject Wait-Conn-Ack/ 3045 Elect 3046 Timeout Error Closed 3048 Wait-Returns Win-Election I-Disc,R-Snd-CEA R-Open 3049 I-Peer-Disc I-Disc, R-Open 3050 R-Snd-CEA 3051 I-Rcv-CEA R-Disc I-Open 3052 R-Peer-Disc R-Disc Wait-I-CEA 3053 R-Conn-CER R-Reject Wait-Returns 3054 Timeout Error Closed 3056 R-Open Send-Message R-Snd-Message R-Open 3057 R-Rcv-Message Process R-Open 3058 R-Rcv-DWR Process-DWR, R-Open 3059 R-Snd-DWA 3060 R-Rcv-DWA Process-DWA R-Open 3061 R-Conn-CER R-Reject R-Open 3062 Stop R-Snd-DPR Closing 3063 R-Rcv-DPR R-Snd-DPA, Closed 3064 R-Disc 3065 R-Peer-Disc R-Disc Closed 3067 I-Open Send-Message I-Snd-Message I-Open 3068 I-Rcv-Message Process I-Open 3069 I-Rcv-DWR Process-DWR, I-Open 3070 I-Snd-DWA 3071 I-Rcv-DWA Process-DWA I-Open 3072 R-Conn-CER R-Reject I-Open 3073 Stop I-Snd-DPR Closing 3074 I-Rcv-DPR I-Snd-DPA, Closed 3075 I-Disc 3076 I-Peer-Disc I-Disc Closed 3078 Closing I-Rcv-DPA I-Disc Closed 3079 R-Rcv-DPA R-Disc Closed 3080 Timeout Error Closed 3081 I-Peer-Disc I-Disc Closed 3082 R-Peer-Disc R-Disc Closed 3084 5.6.1. Incoming connections 3086 When a connection request is received from a Diameter peer, it is 3087 not, in the general case, possible to know the identity of that peer 3088 until a CER is received from it. This is because host and port 3089 determine the identity of a Diameter peer; and the source port of an 3090 incoming connection is arbitrary. Upon receipt of CER, the identity 3091 of the connecting peer can be uniquely determined from Origin-Host. 3093 For this reason, a Diameter peer must employ logic separate from the 3094 state machine to receive connection requests, accept them, and await 3095 CER. Once CER arrives on a new connection, the Origin-Host that 3096 identifies the peer is used to locate the state machine associated 3097 with that peer, and the new connection and CER are passed to the 3098 state machine as an R-Conn-CER event. 3100 The logic that handles incoming connections SHOULD close and discard 3101 the connection if any message other than CER arrives, or if an 3102 implementation-defined timeout occurs prior to receipt of CER. 3104 Because handling of incoming connections up to and including receipt 3105 of CER requires logic, separate from that of any individual state 3106 machine associated with a particular peer, it is described separately 3107 in this section rather than in the state machine above. 3109 5.6.2. Events 3111 Transitions and actions in the automaton are caused by events. In 3112 this section, we will ignore the -I and -R prefix, since the actual 3113 event would be identical, but would occur on one of two possible 3114 connections. 3116 Start The Diameter application has signaled that a 3117 connection should be initiated with the peer. 3119 R-Conn-CER An acknowledgement is received stating that the 3120 transport connection has been established, and the 3121 associated CER has arrived. 3123 Rcv-Conn-Ack A positive acknowledgement is received confirming that 3124 the transport connection is established. 3126 Rcv-Conn-Nack A negative acknowledgement was received stating that 3127 the transport connection was not established. 3129 Timeout An application-defined timer has expired while waiting 3130 for some event. 3132 Rcv-CER A CER message from the peer was received. 3134 Rcv-CEA A CEA message from the peer was received. 3136 Rcv-Non-CEA A message other than CEA from the peer was received. 3138 Peer-Disc A disconnection indication from the peer was received. 3140 Rcv-DPR A DPR message from the peer was received. 3142 Rcv-DPA A DPA message from the peer was received. 3144 Win-Election An election was held, and the local node was the 3145 winner. 3147 Send-Message A message is to be sent. 3149 Rcv-Message A message other than CER, CEA, DPR, DPA, DWR or DWA 3150 was received. 3152 Stop The Diameter application has signaled that a 3153 connection should be terminated (e.g., on system 3154 shutdown). 3156 5.6.3. Actions 3158 Actions in the automaton are caused by events and typically indicate 3159 the transmission of packets and/or an action to be taken on the 3160 connection. In this section we will ignore the I- and R-prefix, 3161 since the actual action would be identical, but would occur on one of 3162 two possible connections. 3164 Snd-Conn-Req A transport connection is initiated with the peer. 3166 Accept The incoming connection associated with the R-Conn-CER 3167 is accepted as the responder connection. 3169 Reject The incoming connection associated with the R-Conn-CER 3170 is disconnected. 3172 Process-CER The CER associated with the R-Conn-CER is processed. 3173 Snd-CER A CER message is sent to the peer. 3175 Snd-CEA A CEA message is sent to the peer. 3177 Cleanup If necessary, the connection is shutdown, and any 3178 local resources are freed. 3180 Error The transport layer connection is disconnected, either 3181 politely or abortively, in response to an error 3182 condition. Local resources are freed. 3184 Process-CEA A received CEA is processed. 3186 Snd-DPR A DPR message is sent to the peer. 3188 Snd-DPA A DPA message is sent to the peer. 3190 Disc The transport layer connection is disconnected, and 3191 local resources are freed. 3193 Elect An election occurs (see Section 5.6.4 for more 3194 information). 3196 Snd-Message A message is sent. 3198 Snd-DWR A DWR message is sent. 3200 Snd-DWA A DWA message is sent. 3202 Process-DWR The DWR message is serviced. 3204 Process-DWA The DWA message is serviced. 3206 Process A message is serviced. 3208 5.6.4. The Election Process 3210 The election is performed on the responder. The responder compares 3211 the Origin-Host received in the CER with its own Origin-Host as two 3212 streams of octets. If the local Origin-Host lexicographically 3213 succeeds the received Origin-Host a Win-Election event is issued 3214 locally. Diameter identities are in ASCII form therefore the lexical 3215 comparison is consistent with DNS case insensitivity where octets 3216 that fall in the ASCII range 'a' through 'z' MUST compare equally to 3217 their upper-case counterparts between 'A' and 'Z'. See Appendix D 3218 for interactions between the Diameter protocol and Internationalized 3219 Domain Name (IDNs). 3221 The winner of the election MUST close the connection it initiated. 3222 Historically, maintaining the responder side of a connection was more 3223 efficient than maintaining the initiator side. However, current 3224 practices makes this distinction irrelevant. 3226 6. Diameter message processing 3228 This section describes how Diameter requests and answers are created 3229 and processed. 3231 6.1. Diameter Request Routing Overview 3233 A request is sent towards its final destination using a combination 3234 of the Destination-Realm and Destination-Host AVPs, in one of these 3235 three combinations: 3237 o a request that is not able to be proxied (such as CER) MUST NOT 3238 contain either Destination-Realm or Destination-Host AVPs. 3240 o a request that needs to be sent to a home server serving a 3241 specific realm, but not to a specific server (such as the first 3242 request of a series of round-trips), MUST contain a Destination- 3243 Realm AVP, but MUST NOT contain a Destination-Host AVP. 3245 o otherwise, a request that needs to be sent to a specific home 3246 server among those serving a given realm, MUST contain both the 3247 Destination-Realm and Destination-Host AVPs. 3249 The Destination-Host AVP is used as described above when the 3250 destination of the request is fixed, which includes: 3252 o Authentication requests that span multiple round trips 3254 o A Diameter message that uses a security mechanism that makes use 3255 of a pre-established session key shared between the source and the 3256 final destination of the message. 3258 o Server initiated messages that MUST be received by a specific 3259 Diameter client (e.g., access device), such as the Abort-Session- 3260 Request message, which is used to request that a particular user's 3261 session be terminated. 3263 Note that an agent can forward a request to a host described in the 3264 Destination-Host AVP only if the host in question is included in its 3265 peer table (see Section 2.7). Otherwise, the request is routed based 3266 on the Destination-Realm only (see Sections 6.1.6). 3268 The Destination-Realm AVP MUST be present if the message is 3269 proxiable. A message that MUST NOT be forwarded by Diameter agents 3270 (proxies, redirects or relays) MUST NOT include the Destination-Realm 3271 in its ABNF. For Diameter clients, the value of the Destination- 3272 Realm AVP MAY be extracted from the User-Name AVP, or other 3273 application-specific methods. 3275 When a message is received, the message is processed in the following 3276 order: 3278 o If the message is destined for the local host, the procedures 3279 listed in Section 6.1.4 are followed. 3281 o If the message is intended for a Diameter peer with whom the local 3282 host is able to directly communicate, the procedures listed in 3283 Section 6.1.5 are followed. This is known as Request Forwarding. 3285 o The procedures listed in Section 6.1.6 are followed, which is 3286 known as Request Routing. 3288 o If none of the above is successful, an answer is returned with the 3289 Result-Code set to DIAMETER_UNABLE_TO_DELIVER, with the E-bit set. 3291 For routing of Diameter messages to work within an administrative 3292 domain, all Diameter nodes within the realm MUST be peers. 3294 Note the processing rules contained in this section are intended to 3295 be used as general guidelines to Diameter developers. Certain 3296 implementations MAY use different methods than the ones described 3297 here, and still comply with the protocol specification. See Section 3298 7 for more detail on error handling. 3300 6.1.1. Originating a Request 3302 When creating a request, in addition to any other procedures 3303 described in the application definition for that specific request, 3304 the following procedures MUST be followed: 3306 o the Command-Code is set to the appropriate value 3308 o the 'R' bit is set 3310 o the End-to-End Identifier is set to a locally unique value 3312 o the Origin-Host and Origin-Realm AVPs MUST be set to the 3313 appropriate values, used to identify the source of the message 3315 o the Destination-Host and Destination-Realm AVPs MUST be set to the 3316 appropriate values as described in Section 6.1. 3318 6.1.2. Sending a Request 3320 When sending a request, originated either locally, or as the result 3321 of a forwarding or routing operation, the following procedures MUST 3322 be followed: 3324 o the Hop-by-Hop Identifier should be set to a locally unique value. 3326 o The message should be saved in the list of pending requests. 3328 Other actions to perform on the message based on the particular role 3329 the agent is playing are described in the following sections. 3331 6.1.3. Receiving Requests 3333 A relay or proxy agent MUST check for forwarding loops when receiving 3334 requests. A loop is detected if the server finds its own identity in 3335 a Route-Record AVP. When such an event occurs, the agent MUST answer 3336 with the Result-Code AVP set to DIAMETER_LOOP_DETECTED. 3338 6.1.4. Processing Local Requests 3340 A request is known to be for local consumption when one of the 3341 following conditions occur: 3343 o The Destination-Host AVP contains the local host's identity, 3345 o The Destination-Host AVP is not present, the Destination-Realm AVP 3346 contains a realm the server is configured to process locally, and 3347 the Diameter application is locally supported, or 3349 o Both the Destination-Host and the Destination-Realm are not 3350 present. 3352 When a request is locally processed, the rules in Section 6.2 should 3353 be used to generate the corresponding answer. 3355 6.1.5. Request Forwarding 3357 Request forwarding is done using the Diameter Peer Table. The 3358 Diameter peer table contains all of the peers that the local node is 3359 able to directly communicate with. 3361 When a request is received, and the host encoded in the Destination- 3362 Host AVP is one that is present in the peer table, the message SHOULD 3363 be forwarded to the peer. 3365 6.1.6. Request Routing 3367 Diameter request message routing is done via realms and applications. 3368 A Diameter message that may be forwarded by Diameter agents (proxies, 3369 redirects or relays) MUST include the target realm in the 3370 Destination-Realm AVP. Request routing SHOULD rely on the 3371 Destination-Realm AVP and the Application Id present in the request 3372 message header to aid in the routing decision. The realm MAY be 3373 retrieved from the User-Name AVP, which is in the form of a Network 3374 Access Identifier (NAI). The realm portion of the NAI is inserted in 3375 the Destination-Realm AVP. 3377 Diameter agents MAY have a list of locally supported realms and 3378 applications, and MAY have a list of externally supported realms and 3379 applications. When a request is received that includes a realm 3380 and/or application that is not locally supported, the message is 3381 routed to the peer configured in the Routing Table (see Section 2.7). 3383 Realm names and Application Ids are the minimum supported routing 3384 criteria, additional routing information maybe needed to support 3385 redirect semantics. 3387 6.1.7. Predictive Loop Avoidance 3389 Before forwarding or routing a request, Diameter agents, in addition 3390 to processing done in Section 6.1.3, SHOULD check for the presence of 3391 candidate route's peer identity in any of the Route-Record AVPs. In 3392 an event of the agent detecting the presence of a candidate route's 3393 peer identity in a Route-Record AVP, the agent MUST ignore such route 3394 for the Diameter request message and attempt alternate routes if any. 3395 In case all the candidate routes are eliminated by the above 3396 criteria, the agent SHOULD return DIAMETER_UNABLE_TO_DELIVER message. 3398 6.1.8. Redirecting requests 3400 When a redirect agent receives a request whose routing entry is set 3401 to REDIRECT, it MUST reply with an answer message with the 'E' bit 3402 set, while maintaining the Hop-by-Hop Identifier in the header, and 3403 include the Result-Code AVP to DIAMETER_REDIRECT_INDICATION. Each of 3404 the servers associated with the routing entry are added in separate 3405 Redirect-Host AVP. 3407 +------------------+ 3408 | Diameter | 3409 | Redirect Agent | 3410 +------------------+ 3411 ^ | 2. command + 'E' bit 3412 1. Request | | Result-Code = 3413 joe@example.com | | DIAMETER_REDIRECT_INDICATION + 3414 | | Redirect-Host AVP(s) 3415 | v 3416 +-------------+ 3. Request +-------------+ 3417 | example.com |------------->| example.net | 3418 | Relay | | Diameter | 3419 | Agent |<-------------| Server | 3420 +-------------+ 4. Answer +-------------+ 3422 Figure 5: Diameter Redirect Agent 3424 The receiver of the answer message with the 'E' bit set, and the 3425 Result-Code AVP set to DIAMETER_REDIRECT_INDICATION uses the hop-by- 3426 hop field in the Diameter header to identify the request in the 3427 pending message queue (see Section 5.3) that is to be redirected. If 3428 no transport connection exists with the new agent, one is created, 3429 and the request is sent directly to it. 3431 Multiple Redirect-Host AVPs are allowed. The receiver of the answer 3432 message with the 'E' bit set selects exactly one of these hosts as 3433 the destination of the redirected message. 3435 When the Redirect-Host-Usage AVP included in the answer message has a 3436 non-zero value, a route entry for the redirect indications is created 3437 and cached by the receiver. The redirect usage for such route entry 3438 is set by the value of Redirect-Host-Usage AVP and the lifetime of 3439 the cached route entry is set by Redirect-Max-Cache-Time AVP value. 3441 It is possible that multiple redirect indications can create multiple 3442 cached route entries differing only in their redirect usage and the 3443 peer to forward messages to. As an example, two(2) route entries 3444 that are created by two(2) redirect indications results in two(2) 3445 cached routes for the same realm and Application Id. However, one 3446 has a redirect usage of ALL_SESSION where matching request will be 3447 forwarded to one peer and the other has a redirect usage of ALL_REALM 3448 where request are forwarded to another peer. Therefore, an incoming 3449 request that matches the realm and Application Id of both routes will 3450 need additional resolution. In such a case, a routing precedence 3451 rule MUST be used againts the redirect usage value to resolve the 3452 contention. The precedence rule can be found in Section 6.13. 3454 6.1.9. Relaying and Proxying Requests 3456 A relay or proxy agent MUST append a Route-Record AVP to all requests 3457 forwarded. The AVP contains the identity of the peer the request was 3458 received from. 3460 The Hop-by-Hop identifier in the request is saved, and replaced with 3461 a locally unique value. The source of the request is also saved, 3462 which includes the IP address, port and protocol. 3464 A relay or proxy agent MAY include the Proxy-Info AVP in requests if 3465 it requires access to any local state information when the 3466 corresponding response is received. Proxy-Info AVP has certain 3467 security implications and SHOULD contain an embedded HMAC with a 3468 node-local key. Alternatively, it MAY simply use local storage to 3469 store state information. 3471 The message is then forwarded to the next hop, as identified in the 3472 Routing Table. 3474 Figure 6 provides an example of message routing using the procedures 3475 listed in these sections. 3477 (Origin-Host=nas.mno.net) (Origin-Host=nas.mno.net) 3478 (Origin-Realm=mno.net) (Origin-Realm=mno.net) 3479 (Destination-Realm=example.com) (Destination- 3480 Realm=example.com) 3481 (Route-Record=nas.example.net) 3482 +------+ ------> +------+ ------> +------+ 3483 | | (Request) | | (Request) | | 3484 | NAS +-------------------+ DRL +-------------------+ HMS | 3485 | | | | | | 3486 +------+ <------ +------+ <------ +------+ 3487 example.net (Answer) example.net (Answer) example.com 3488 (Origin-Host=hms.example.com) (Origin-Host=hms.example.com) 3489 (Origin-Realm=example.com) (Origin-Realm=example.com) 3491 Figure 6: Routing of Diameter messages 3493 Relay and proxy agents are not required to perform full validation of 3494 incoming messages. At a minimum, validation of the message header 3495 and relevant routing AVPs has to be done when relaying messages. 3496 Proxy agents may optionally perform more in-depth message validation 3497 for applications it is interested in. 3499 6.2. Diameter Answer Processing 3501 When a request is locally processed, the following procedures MUST be 3502 applied to create the associated answer, in addition to any 3503 additional procedures that MAY be discussed in the Diameter 3504 application defining the command: 3506 o The same Hop-by-Hop identifier in the request is used in the 3507 answer. 3509 o The local host's identity is encoded in the Origin-Host AVP. 3511 o The Destination-Host and Destination-Realm AVPs MUST NOT be 3512 present in the answer message. 3514 o The Result-Code AVP is added with its value indicating success or 3515 failure. 3517 o If the Session-Id is present in the request, it MUST be included 3518 in the answer. 3520 o Any Proxy-Info AVPs in the request MUST be added to the answer 3521 message, in the same order they were present in the request. 3523 o The 'P' bit is set to the same value as the one in the request. 3525 o The same End-to-End identifier in the request is used in the 3526 answer. 3528 Note that the error messages (see Section 7.3) are also subjected to 3529 the above processing rules. 3531 6.2.1. Processing received Answers 3533 A Diameter client or proxy MUST match the Hop-by-Hop Identifier in an 3534 answer received against the list of pending requests. The 3535 corresponding message should be removed from the list of pending 3536 requests. It SHOULD ignore answers received that do not match a 3537 known Hop-by-Hop Identifier. 3539 6.2.2. Relaying and Proxying Answers 3541 If the answer is for a request which was proxied or relayed, the 3542 agent MUST restore the original value of the Diameter header's Hop- 3543 by-Hop Identifier field. 3545 If the last Proxy-Info AVP in the message is targeted to the local 3546 Diameter server, the AVP MUST be removed before the answer is 3547 forwarded. 3549 If a relay or proxy agent receives an answer with a Result-Code AVP 3550 indicating a failure, it MUST NOT modify the contents of the AVP. 3551 Any additional local errors detected SHOULD be logged, but not 3552 reflected in the Result-Code AVP. If the agent receives an answer 3553 message with a Result-Code AVP indicating success, and it wishes to 3554 modify the AVP to indicate an error, it MUST modify the Result-Code 3555 AVP to contain the appropriate error in the message destined towards 3556 the access device as well as include the Error-Reporting-Host AVP and 3557 it MUST issue an STR on behalf of the access device. 3559 The agent MUST then send the answer to the host that it received the 3560 original request from. 3562 6.3. Origin-Host AVP 3564 The Origin-Host AVP (AVP Code 264) is of type DiameterIdentity, and 3565 MUST be present in all Diameter messages. This AVP identifies the 3566 endpoint that originated the Diameter message. Relay agents MUST NOT 3567 modify this AVP. 3569 The value of the Origin-Host AVP is guaranteed to be unique within a 3570 single host. 3572 Note that the Origin-Host AVP may resolve to more than one address as 3573 the Diameter peer may support more than one address. 3575 This AVP SHOULD be placed as close to the Diameter header as 3576 possible. 3578 6.4. Origin-Realm AVP 3580 The Origin-Realm AVP (AVP Code 296) is of type DiameterIdentity. 3581 This AVP contains the Realm of the originator of any Diameter message 3582 and MUST be present in all messages. 3584 This AVP SHOULD be placed as close to the Diameter header as 3585 possible. 3587 6.5. Destination-Host AVP 3589 The Destination-Host AVP (AVP Code 293) is of type DiameterIdentity. 3590 This AVP MUST be present in all unsolicited agent initiated messages, 3591 MAY be present in request messages, and MUST NOT be present in Answer 3592 messages. 3594 The absence of the Destination-Host AVP will cause a message to be 3595 sent to any Diameter server supporting the application within the 3596 realm specified in Destination-Realm AVP. 3598 This AVP SHOULD be placed as close to the Diameter header as 3599 possible. 3601 6.6. Destination-Realm AVP 3603 The Destination-Realm AVP (AVP Code 283) is of type DiameterIdentity, 3604 and contains the realm the message is to be routed to. The 3605 Destination-Realm AVP MUST NOT be present in Answer messages. 3606 Diameter Clients insert the realm portion of the User-Name AVP. 3607 Diameter servers initiating a request message use the value of the 3608 Origin-Realm AVP from a previous message received from the intended 3609 target host (unless it is known a priori). When present, the 3610 Destination-Realm AVP is used to perform message routing decisions. 3612 An ABNF for a request message that includes the Destination-Realm AVP 3613 SHOULD list the Destination-Realm AVP as a required AVP (an AVP 3614 indicated as {AVP}) otherwise the message is inherently a non- 3615 routable messages. 3617 This AVP SHOULD be placed as close to the Diameter header as 3618 possible. 3620 6.7. Routing AVPs 3622 The AVPs defined in this section are Diameter AVPs used for routing 3623 purposes. These AVPs change as Diameter messages are processed by 3624 agents. 3626 6.7.1. Route-Record AVP 3628 The Route-Record AVP (AVP Code 282) is of type DiameterIdentity. The 3629 identity added in this AVP MUST be the same as the one received in 3630 the Origin-Host of the Capabilities Exchange message. 3632 6.7.2. Proxy-Info AVP 3634 The Proxy-Info AVP (AVP Code 284) is of type Grouped. The Grouped 3635 Data field has the following ABNF grammar: 3637 Proxy-Info ::= < AVP Header: 284 > 3638 { Proxy-Host } 3639 { Proxy-State } 3640 * [ AVP ] 3642 6.7.3. Proxy-Host AVP 3644 The Proxy-Host AVP (AVP Code 280) is of type DiameterIdentity. This 3645 AVP contains the identity of the host that added the Proxy-Info AVP. 3647 6.7.4. Proxy-State AVP 3649 The Proxy-State AVP (AVP Code 33) is of type OctetString. It 3650 generally contains information related to the local state of a 3651 Diameter node. It MUST be treated as opaque data. 3653 6.8. Auth-Application-Id AVP 3655 The Auth-Application-Id AVP (AVP Code 258) is of type Unsigned32 and 3656 is used in order to advertise support of the Authentication and 3657 Authorization portion of an application (see Section 2.4). If 3658 present in a message other than CER and CEA, the value of the Auth- 3659 Application-Id AVP MUST match the Application Id present in the 3660 Diameter message header. 3662 6.9. Acct-Application-Id AVP 3664 The Acct-Application-Id AVP (AVP Code 259) is of type Unsigned32 and 3665 is used in order to advertise support of the Accounting portion of an 3666 application (see Section 2.4). If present in a message other than 3667 CER and CEA, the value of the Acct-Application-Id AVP MUST match the 3668 Application Id present in the Diameter message header. 3670 6.10. Inband-Security-Id AVP 3672 The Inband-Security-Id AVP (AVP Code 299) is of type Unsigned32 and 3673 is used in order to advertise support of the Security portion of the 3674 application. 3676 Currently, the following values are supported, but there is ample 3677 room to add new security Ids. 3679 NO_INBAND_SECURITY 0 3681 This peer does not support TLS. This is the default value, if the 3682 AVP is omitted. 3684 TLS 1 3686 This node supports TLS security, as defined by [RFC4346]. 3688 6.11. Vendor-Specific-Application-Id AVP 3690 The Vendor-Specific-Application-Id AVP (AVP Code 260) is of type 3691 Grouped and is used to advertise support of a vendor-specific 3692 Diameter Application. Exactly one instance of either Auth- 3693 Application-Id or Acct-Application-Id AVP MUST be present. The 3694 Application Id carried by either Auth-Application-Id or Acct- 3695 Application-Id AVP MUST comply with vendor specific Application Id 3696 assignment described in Sec 11.3. It MUST also match the Application 3697 Id present in the Diameter header except when used in a CER or CEA 3698 messages. 3700 The Vendor-Id AVP is an informational AVP pertaining to the vendor 3701 who may have authorship of the vendor-specific Diameter application. 3702 It MUST NOT be used as a means of defining a completely separate 3703 vendor-specific Application Id space. 3705 This AVP MUST also be present as the first AVP in all experimental 3706 commands defined in the vendor-specific application. 3708 This AVP SHOULD be placed as close to the Diameter header as 3709 possible. 3711 AVP Format 3713 ::= < AVP Header: 260 > 3714 { Vendor-Id } 3715 [ Auth-Application-Id ] 3716 [ Acct-Application-Id ] 3718 A Vendor-Specific-Application-Id AVP MUST contain exactly one of 3719 either Auth-Application-Id or Acct-Application-Id. If a Vendor- 3720 Specific-Application-Id is received without any of these two AVPs, 3721 then the recipient SHOULD issue an answer with a Result-Code set to 3722 DIAMETER_MISSING_AVP. The answer SHOULD also include a Failed-AVP 3723 which MUST contain an example of an Auth-Application-Id AVP and an 3724 Acct-Application-Id AVP. 3726 If a Vendor-Specific-Application-Id is received that contains both 3727 Auth-Application-Id and Acct-Application-Id, then the recipient 3728 SHOULD issue an answer with Result-Code set to 3729 DIAMETER_AVP_OCCURS_TOO_MANY_TIMES. The answer SHOULD also include a 3730 Failed-AVP which MUST contain the received Auth-Application-Id AVP 3731 and Acct-Application-Id AVP. 3733 6.12. Redirect-Host AVP 3735 One or more of instances of this AVP MUST be present if the answer 3736 message's 'E' bit is set and the Result-Code AVP is set to 3737 DIAMETER_REDIRECT_INDICATION. 3739 Upon receiving the above, the receiving Diameter node SHOULD forward 3740 the request directly to one of the hosts identified in these AVPs. 3741 The server contained in the selected Redirect-Host AVP SHOULD be used 3742 for all messages pertaining to this session. 3744 6.13. Redirect-Host-Usage AVP 3746 The Redirect-Host-Usage AVP (AVP Code 261) is of type Enumerated. 3747 This AVP MAY be present in answer messages whose 'E' bit is set and 3748 the Result-Code AVP is set to DIAMETER_REDIRECT_INDICATION. 3750 When present, this AVP dictates how the routing entry resulting from 3751 the Redirect-Host is to be used. The following values are supported: 3753 DONT_CACHE 0 3755 The host specified in the Redirect-Host AVP should not be cached. 3756 This is the default value. 3758 ALL_SESSION 1 3760 All messages within the same session, as defined by the same value 3761 of the Session-ID AVP MAY be sent to the host specified in the 3762 Redirect-Host AVP. 3764 ALL_REALM 2 3766 All messages destined for the realm requested MAY be sent to the 3767 host specified in the Redirect-Host AVP. 3769 REALM_AND_APPLICATION 3 3771 All messages for the application requested to the realm specified 3772 MAY be sent to the host specified in the Redirect-Host AVP. 3774 ALL_APPLICATION 4 3776 All messages for the application requested MAY be sent to the host 3777 specified in the Redirect-Host AVP. 3779 ALL_HOST 5 3781 All messages that would be sent to the host that generated the 3782 Redirect-Host MAY be sent to the host specified in the Redirect- 3783 Host AVP. 3785 ALL_USER 6 3787 All messages for the user requested MAY be sent to the host 3788 specified in the Redirect-Host AVP. 3790 When multiple cached routes are created by redirect indications and 3791 they differ only in redirect usage and peers to forward requests to 3792 (see Section 6.1.8), a precedence rule MUST be applied to the 3793 redirect usage values of the cached routes during normal routing to 3794 resolve contentions that may occur. The precedence rule is the order 3795 that dictate which redirect usage should be considered before any 3796 other as they appear. The order is as follows: 3798 1. ALL_SESSION 3800 2. ALL_USER 3802 3. REALM_AND_APPLICATION 3804 4. ALL_REALM 3806 5. ALL_APPLICATION 3808 6. ALL_HOST 3810 6.14. Redirect-Max-Cache-Time AVP 3812 The Redirect-Max-Cache-Time AVP (AVP Code 262) is of type Unsigned32. 3813 This AVP MUST be present in answer messages whose 'E' bit is set, the 3814 Result-Code AVP is set to DIAMETER_REDIRECT_INDICATION and the 3815 Redirect-Host-Usage AVP set to a non-zero value. 3817 This AVP contains the maximum number of seconds the peer and route 3818 table entries, created as a result of the Redirect-Host, will be 3819 cached. Note that once a host created due to a redirect indication 3820 is no longer reachable, any associated peer and routing table entries 3821 MUST be deleted. 3823 7. Error Handling 3825 There are two different types of errors in Diameter; protocol and 3826 application errors. A protocol error is one that occurs at the base 3827 protocol level, and MAY require per hop attention (e.g., message 3828 routing error). Application errors, on the other hand, generally 3829 occur due to a problem with a function specified in a Diameter 3830 application (e.g., user authentication, Missing AVP). 3832 Result-Code AVP values that are used to report protocol errors MUST 3833 only be present in answer messages whose 'E' bit is set. When a 3834 request message is received that causes a protocol error, an answer 3835 message is returned with the 'E' bit set, and the Result-Code AVP is 3836 set to the appropriate protocol error value. As the answer is sent 3837 back towards the originator of the request, each proxy or relay agent 3838 MAY take action on the message. 3840 1. Request +---------+ Link Broken 3841 +-------------------------->|Diameter |----///----+ 3842 | +---------------------| | v 3843 +------+--+ | 2. answer + 'E' set | Relay 2 | +--------+ 3844 |Diameter |<-+ (Unable to Forward) +---------+ |Diameter| 3845 | | | Home | 3846 | Relay 1 |--+ +---------+ | Server | 3847 +---------+ | 3. Request |Diameter | +--------+ 3848 +-------------------->| | ^ 3849 | Relay 3 |-----------+ 3850 +---------+ 3852 Figure 7: Example of Protocol Error causing answer message 3854 Figure 7 provides an example of a message forwarded upstream by a 3855 Diameter relay. When the message is received by Relay 2, and it 3856 detects that it cannot forward the request to the home server, an 3857 answer message is returned with the 'E' bit set and the Result-Code 3858 AVP set to DIAMETER_UNABLE_TO_DELIVER. Given that this error falls 3859 within the protocol error category, Relay 1 would take special 3860 action, and given the error, attempt to route the message through its 3861 alternate Relay 3. 3863 +---------+ 1. Request +---------+ 2. Request +---------+ 3864 | Access |------------>|Diameter |------------>|Diameter | 3865 | | | | | Home | 3866 | Device |<------------| Relay |<------------| Server | 3867 +---------+ 4. Answer +---------+ 3. Answer +---------+ 3868 (Missing AVP) (Missing AVP) 3870 Figure 8: Example of Application Error Answer message 3872 Figure 8 provides an example of a Diameter message that caused an 3873 application error. When application errors occur, the Diameter 3874 entity reporting the error clears the 'R' bit in the Command Flags, 3875 and adds the Result-Code AVP with the proper value. Application 3876 errors do not require any proxy or relay agent involvement, and 3877 therefore the message would be forwarded back to the originator of 3878 the request. 3880 There are certain Result-Code AVP application errors that require 3881 additional AVPs to be present in the answer. In these cases, the 3882 Diameter node that sets the Result-Code AVP to indicate the error 3883 MUST add the AVPs. Examples are: 3885 o An unrecognized AVP is received with the 'M' bit (Mandatory bit) 3886 set, causes an answer to be sent with the Result-Code AVP set to 3887 DIAMETER_AVP_UNSUPPORTED, and the Failed-AVP AVP containing the 3888 offending AVP. 3890 o An AVP that is received with an unrecognized value causes an 3891 answer to be returned with the Result-Code AVP set to 3892 DIAMETER_INVALID_AVP_VALUE, with the Failed-AVP AVP containing the 3893 AVP causing the error. 3895 o A command is received that is missing AVP(s) that are defined as 3896 required in the commands ABNF; examples are AVPs indicated as 3897 {AVP}. The receiver issues an answer with the Result-Code set to 3898 DIAMETER_MISSING_AVP, and creates an AVP with the AVP Code and 3899 other fields set as expected in the missing AVP. The created AVP 3900 is then added to the Failed- AVP AVP. 3902 The Result-Code AVP describes the error that the Diameter node 3903 encountered in its processing. In case there are multiple errors, 3904 the Diameter node MUST report only the first error it encountered 3905 (detected possibly in some implementation dependent order). The 3906 specific errors that can be described by this AVP are described in 3907 the following section. 3909 7.1. Result-Code AVP 3911 The Result-Code AVP (AVP Code 268) is of type Unsigned32 and 3912 indicates whether a particular request was completed successfully or 3913 whether an error occurred. All Diameter answer messages defined in 3914 IETF applications MUST include one Result-Code AVP. A non-successful 3915 Result-Code AVP (one containing a non 2xxx value other than 3916 DIAMETER_REDIRECT_INDICATION) MUST include the Error-Reporting-Host 3917 AVP if the host setting the Result-Code AVP is different from the 3918 identity encoded in the Origin-Host AVP. 3920 The Result-Code data field contains an IANA-managed 32-bit address 3921 space representing errors (see Section 11.4). Diameter provides the 3922 following classes of errors, all identified by the thousands digit in 3923 the decimal notation: 3925 o 1xxx (Informational) 3927 o 2xxx (Success) 3929 o 3xxx (Protocol Errors) 3931 o 4xxx (Transient Failures) 3933 o 5xxx (Permanent Failure) 3935 A non-recognized class (one whose first digit is not defined in this 3936 section) MUST be handled as a permanent failure. 3938 7.1.1. Informational 3940 Errors that fall within this category are used to inform the 3941 requester that a request could not be satisfied, and additional 3942 action is required on its part before access is granted. 3944 DIAMETER_MULTI_ROUND_AUTH 1001 3946 This informational error is returned by a Diameter server to 3947 inform the access device that the authentication mechanism being 3948 used requires multiple round trips, and a subsequent request needs 3949 to be issued in order for access to be granted. 3951 7.1.2. Success 3953 Errors that fall within the Success category are used to inform a 3954 peer that a request has been successfully completed. 3956 DIAMETER_SUCCESS 2001 3958 The Request was successfully completed. 3960 DIAMETER_LIMITED_SUCCESS 2002 3962 When returned, the request was successfully completed, but 3963 additional processing is required by the application in order to 3964 provide service to the user. 3966 7.1.3. Protocol Errors 3968 Errors that fall within the Protocol Error category SHOULD be treated 3969 on a per-hop basis, and Diameter proxies MAY attempt to correct the 3970 error, if it is possible. Note that these errors MUST only be used 3971 in answer messages whose 'E' bit is set. To provide backward 3972 compatibility with existing implementations that follow [RFC3588], 3973 some of the error values that have previously been used in this 3974 category by [RFC3588] will not be re-used. Therefore the error 3975 values enumerated here may be non-sequential. 3977 DIAMETER_UNABLE_TO_DELIVER 3002 3979 This error is given when Diameter can not deliver the message to 3980 the destination, either because no host within the realm 3981 supporting the required application was available to process the 3982 request, or because Destination-Host AVP was given without the 3983 associated Destination-Realm AVP. 3985 DIAMETER_REALM_NOT_SERVED 3003 3987 The intended realm of the request is not recognized. 3989 DIAMETER_TOO_BUSY 3004 3991 When returned, a Diameter node SHOULD attempt to send the message 3992 to an alternate peer. This error MUST only be used when a 3993 specific server is requested, and it cannot provide the requested 3994 service. 3996 DIAMETER_LOOP_DETECTED 3005 3998 An agent detected a loop while trying to get the message to the 3999 intended recipient. The message MAY be sent to an alternate peer, 4000 if one is available, but the peer reporting the error has 4001 identified a configuration problem. 4003 DIAMETER_REDIRECT_INDICATION 3006 4005 A redirect agent has determined that the request could not be 4006 satisfied locally and the initiator of the request should direct 4007 the request directly to the server, whose contact information has 4008 been added to the response. When set, the Redirect-Host AVP MUST 4009 be present. 4011 DIAMETER_APPLICATION_UNSUPPORTED 3007 4013 A request was sent for an application that is not supported. 4015 DIAMETER_INVALID_BIT_IN_HEADER 3011 4017 This error is returned when a reserved bit in the Diameter header 4018 is set to one (1) or the bits in the Diameter header defined in 4019 Section 3 are set incorrectly. 4021 DIAMETER_INVALID_MESSAGE_LENGTH 3012 4023 This error is returned when a request is received with an invalid 4024 message length. 4026 7.1.4. Transient Failures 4028 Errors that fall within the transient failures category are used to 4029 inform a peer that the request could not be satisfied at the time it 4030 was received, but MAY be able to satisfy the request in the future. 4031 Note that these errors MUST be used in answer messages whose 'E' bit 4032 is not set. 4034 DIAMETER_AUTHENTICATION_REJECTED 4001 4036 The authentication process for the user failed, most likely due to 4037 an invalid password used by the user. Further attempts MUST only 4038 be tried after prompting the user for a new password. 4040 DIAMETER_OUT_OF_SPACE 4002 4042 A Diameter node received the accounting request but was unable to 4043 commit it to stable storage due to a temporary lack of space. 4045 ELECTION_LOST 4003 4047 The peer has determined that it has lost the election process and 4048 has therefore disconnected the transport connection. 4050 7.1.5. Permanent Failures 4052 Errors that fall within the permanent failures category are used to 4053 inform the peer that the request failed, and should not be attempted 4054 again. Note that these errors SHOULD be used in answer messages 4055 whose 'E' bit is not set. In error conditions where it is not 4056 possible or efficient to compose application specific answer grammar 4057 then answer messages with E-bit set and complying to the grammar 4058 described in 7.2 MAY also be used for permanent errors. 4060 To provide backward compatibility with existing implementations that 4061 follow [RFC3588], some of the error values that have previously been 4062 used in this category by [RFC3588] will not be re-used. Therefore 4063 the error values enumerated here maybe non-sequential. 4065 DIAMETER_AVP_UNSUPPORTED 5001 4067 The peer received a message that contained an AVP that is not 4068 recognized or supported and was marked with the Mandatory bit. A 4069 Diameter message with this error MUST contain one or more Failed- 4070 AVP AVP containing the AVPs that caused the failure. 4072 DIAMETER_UNKNOWN_SESSION_ID 5002 4074 The request contained an unknown Session-Id. 4076 DIAMETER_AUTHORIZATION_REJECTED 5003 4078 A request was received for which the user could not be authorized. 4079 This error could occur if the service requested is not permitted 4080 to the user. 4082 DIAMETER_INVALID_AVP_VALUE 5004 4084 The request contained an AVP with an invalid value in its data 4085 portion. A Diameter message indicating this error MUST include 4086 the offending AVPs within a Failed-AVP AVP. 4088 DIAMETER_MISSING_AVP 5005 4090 The request did not contain an AVP that is required by the Command 4091 Code definition. If this value is sent in the Result-Code AVP, a 4092 Failed-AVP AVP SHOULD be included in the message. The Failed-AVP 4093 AVP MUST contain an example of the missing AVP complete with the 4094 Vendor-Id if applicable. The value field of the missing AVP 4095 should be of correct minimum length and contain zeroes. 4097 DIAMETER_RESOURCES_EXCEEDED 5006 4099 A request was received that cannot be authorized because the user 4100 has already expended allowed resources. An example of this error 4101 condition is a user that is restricted to one dial-up PPP port, 4102 attempts to establish a second PPP connection. 4104 DIAMETER_CONTRADICTING_AVPS 5007 4106 The Home Diameter server has detected AVPs in the request that 4107 contradicted each other, and is not willing to provide service to 4108 the user. The Failed-AVP AVPs MUST be present which contains the 4109 AVPs that contradicted each other. 4111 DIAMETER_AVP_NOT_ALLOWED 5008 4113 A message was received with an AVP that MUST NOT be present. The 4114 Failed-AVP AVP MUST be included and contain a copy of the 4115 offending AVP. 4117 DIAMETER_AVP_OCCURS_TOO_MANY_TIMES 5009 4119 A message was received that included an AVP that appeared more 4120 often than permitted in the message definition. The Failed-AVP 4121 AVP MUST be included and contain a copy of the first instance of 4122 the offending AVP that exceeded the maximum number of occurrences 4124 DIAMETER_NO_COMMON_APPLICATION 5010 4126 This error is returned by a Diameter node that is not acting as a 4127 relay when it receives a CER which advertises a set of 4128 applications that it does not support. 4130 DIAMETER_UNSUPPORTED_VERSION 5011 4132 This error is returned when a request was received, whose version 4133 number is unsupported. 4135 DIAMETER_UNABLE_TO_COMPLY 5012 4137 This error is returned when a request is rejected for unspecified 4138 reasons. 4140 DIAMETER_INVALID_AVP_LENGTH 5014 4142 The request contained an AVP with an invalid length. A Diameter 4143 message indicating this error MUST include the offending AVPs 4144 within a Failed-AVP AVP. In cases where the erroneous avp length 4145 value exceeds the message length or is less than the minimum AVP 4146 header length, it is sufficient to include the offending AVP 4147 header and a zero filled payload of the minimum required length 4148 for the payloads data type. If the AVP is a grouped AVP, the 4149 grouped AVP header with an empty payload would be sufficient to 4150 indicate the offending AVP. In the case where the offending AVP 4151 header cannot be fully decoded when avp length is less than the 4152 minimum AVP header length, it is sufficient to include an 4153 offending AVP header that is formulated by padding the incomplete 4154 AVP header with zero up to the minimum AVP header length. 4156 DIAMETER_NO_COMMON_SECURITY 5017 4158 This error is returned when a CER message is received, and there 4159 are no common security mechanisms supported between the peers. A 4160 Capabilities-Exchange-Answer (CEA) MUST be returned with the 4161 Result-Code AVP set to DIAMETER_NO_COMMON_SECURITY. 4163 DIAMETER_UNKNOWN_PEER 5018 4165 A CER was received from an unknown peer. 4167 DIAMETER_COMMAND_UNSUPPORTED 5019 4169 The Request contained a Command-Code that the receiver did not 4170 recognize or doest not support. 4172 DIAMETER_INVALID_HDR_BITS 5020 4174 A request was received whose bits in the Diameter header were 4175 either set to an invalid combination, or to a value that is 4176 inconsistent with the command code's definition. 4178 DIAMETER_INVALID_AVP_BITS 5021 4180 A request was received that included an AVP whose flag bits are 4181 set to an unrecognized value, or that is inconsistent with the 4182 AVP's definition. 4184 7.2. Error Bit 4186 The 'E' (Error Bit) in the Diameter header is set when the request 4187 caused a protocol-related error (see Section 7.1.3). A message with 4188 the 'E' bit MUST NOT be sent as a response to an answer message. 4189 Note that a message with the 'E' bit set is still subjected to the 4190 processing rules defined in Section 6.2. When set, the answer 4191 message will not conform to the ABNF specification for the command, 4192 and will instead conform to the following ABNF: 4194 Message Format 4196 ::= < Diameter Header: code, ERR [PXY] > 4197 0*1< Session-Id > 4198 { Origin-Host } 4199 { Origin-Realm } 4200 { Result-Code } 4201 [ Origin-State-Id ] 4202 [ Error-Message ] 4203 [ Error-Reporting-Host ] 4204 [ Failed-AVP ] 4205 * [ Proxy-Info ] 4206 * [ AVP ] 4208 Note that the code used in the header is the same than the one found 4209 in the request message, but with the 'R' bit cleared and the 'E' bit 4210 set. The 'P' bit in the header is set to the same value as the one 4211 found in the request message. 4213 7.3. Error-Message AVP 4215 The Error-Message AVP (AVP Code 281) is of type UTF8String. It MAY 4216 accompany a Result-Code AVP as a human readable error message. The 4217 Error-Message AVP is not intended to be useful in real-time, and 4218 SHOULD NOT be expected to be parsed by network entities. 4220 7.4. Error-Reporting-Host AVP 4222 The Error-Reporting-Host AVP (AVP Code 294) is of type 4223 DiameterIdentity. This AVP contains the identity of the Diameter 4224 host that sent the Result-Code AVP to a value other than 2001 4225 (Success), only if the host setting the Result-Code is different from 4226 the one encoded in the Origin-Host AVP. This AVP is intended to be 4227 used for troubleshooting purposes, and MUST be set when the Result- 4228 Code AVP indicates a failure. 4230 7.5. Failed-AVP AVP 4232 The Failed-AVP AVP (AVP Code 279) is of type Grouped and provides 4233 debugging information in cases where a request is rejected or not 4234 fully processed due to erroneous information in a specific AVP. The 4235 value of the Result-Code AVP will provide information on the reason 4236 for the Failed-AVP AVP. A Diameter message SHOULD contain only one 4237 Failed-AVP that corresponds to the error indicated by the Result-Code 4238 AVP. For practical purposes, this Failed-AVP would typically refer 4239 to the first AVP processing error that a Diameter node encounters. 4241 The possible reasons for this AVP are the presence of an improperly 4242 constructed AVP, an unsupported or unrecognized AVP, an invalid AVP 4243 value, the omission of a required AVP, the presence of an explicitly 4244 excluded AVP (see tables in Section 10), or the presence of two or 4245 more occurrences of an AVP which is restricted to 0, 1, or 0-1 4246 occurrences. 4248 A Diameter message SHOULD contain one Failed-AVP AVP, containing the 4249 entire AVP that could not be processed successfully. If the failure 4250 reason is omission of a required AVP, an AVP with the missing AVP 4251 code, the missing vendor id, and a zero filled payload of the minimum 4252 required length for the omitted AVP will be added. If the failure 4253 reason is an invalid AVP length where the reported length is less 4254 than the minimum AVP header length or greater than the reported 4255 message length, a copy of the offending AVP header and a zero filled 4256 payload of the minimum required length SHOULD be added. 4258 In the case where the offending AVP is embedded within a grouped AVP, 4259 the Failed-AVP MAY contain the grouped AVP which in turn contains the 4260 single offending AVP. The same method MAY be employed if the grouped 4261 AVP itself is embedded in yet another grouped AVP and so on. In this 4262 case, the Failed-AVP MAY contain the grouped AVP heirarchy up to the 4263 single offending AVP. This enables the recipient to detect the 4264 location of the offending AVP when embedded in a group. 4266 AVP Format 4268 ::= < AVP Header: 279 > 4269 1* {AVP} 4271 7.6. Experimental-Result AVP 4273 The Experimental-Result AVP (AVP Code 297) is of type Grouped, and 4274 indicates whether a particular vendor-specific request was completed 4275 successfully or whether an error occurred. Its Data field has the 4276 following ABNF grammar: 4278 AVP Format 4280 Experimental-Result ::= < AVP Header: 297 > 4281 { Vendor-Id } 4282 { Experimental-Result-Code } 4284 The Vendor-Id AVP (see Section 5.3.3) in this grouped AVP identifies 4285 the vendor responsible for the assignment of the result code which 4286 follows. All Diameter answer messages defined in vendor-specific 4287 applications MUST include either one Result-Code AVP or one 4288 Experimental-Result AVP. 4290 7.7. Experimental-Result-Code AVP 4292 The Experimental-Result-Code AVP (AVP Code 298) is of type Unsigned32 4293 and contains a vendor-assigned value representing the result of 4294 processing the request. 4296 It is recommended that vendor-specific result codes follow the same 4297 conventions given for the Result-Code AVP regarding the different 4298 types of result codes and the handling of errors (for non 2xxx 4299 values). 4301 8. Diameter User Sessions 4303 In general, Diameter can provide two different types of services to 4304 applications. The first involves authentication and authorization, 4305 and can optionally make use of accounting. The second only makes use 4306 of accounting. 4308 When a service makes use of the authentication and/or authorization 4309 portion of an application, and a user requests access to the network, 4310 the Diameter client issues an auth request to its local server. The 4311 auth request is defined in a service specific Diameter application 4312 (e.g., NASREQ). The request contains a Session-Id AVP, which is used 4313 in subsequent messages (e.g., subsequent authorization, accounting, 4314 etc) relating to the user's session. The Session-Id AVP is a means 4315 for the client and servers to correlate a Diameter message with a 4316 user session. 4318 When a Diameter server authorizes a user to use network resources for 4319 a finite amount of time, and it is willing to extend the 4320 authorization via a future request, it MUST add the Authorization- 4321 Lifetime AVP to the answer message. The Authorization-Lifetime AVP 4322 defines the maximum number of seconds a user MAY make use of the 4323 resources before another authorization request is expected by the 4324 server. The Auth-Grace-Period AVP contains the number of seconds 4325 following the expiration of the Authorization-Lifetime, after which 4326 the server will release all state information related to the user's 4327 session. Note that if payment for services is expected by the 4328 serving realm from the user's home realm, the Authorization-Lifetime 4329 AVP, combined with the Auth-Grace-Period AVP, implies the maximum 4330 length of the session the home realm is willing to be fiscally 4331 responsible for. Services provided past the expiration of the 4332 Authorization-Lifetime and Auth-Grace-Period AVPs are the 4333 responsibility of the access device. Of course, the actual cost of 4334 services rendered is clearly outside the scope of the protocol. 4336 An access device that does not expect to send a re-authorization or a 4337 session termination request to the server MAY include the Auth- 4338 Session-State AVP with the value set to NO_STATE_MAINTAINED as a hint 4339 to the server. If the server accepts the hint, it agrees that since 4340 no session termination message will be received once service to the 4341 user is terminated, it cannot maintain state for the session. If the 4342 answer message from the server contains a different value in the 4343 Auth-Session-State AVP (or the default value if the AVP is absent), 4344 the access device MUST follow the server's directives. Note that the 4345 value NO_STATE_MAINTAINED MUST NOT be set in subsequent re- 4346 authorization requests and answers. 4348 The base protocol does not include any authorization request 4349 messages, since these are largely application-specific and are 4350 defined in a Diameter application document. However, the base 4351 protocol does define a set of messages that is used to terminate user 4352 sessions. These are used to allow servers that maintain state 4353 information to free resources. 4355 When a service only makes use of the Accounting portion of the 4356 Diameter protocol, even in combination with an application, the 4357 Session-Id is still used to identify user sessions. However, the 4358 session termination messages are not used, since a session is 4359 signaled as being terminated by issuing an accounting stop message. 4361 Diameter may also be used for services that cannot be easily 4362 categorized as authentication, authorization or accounting (e.g., 4363 certain 3GPP IMS interfaces). In such cases, the finite state 4364 machine defined in subsequent sections may not be applicable. 4365 Therefore, the applications itself MAY need to define its own finite 4366 state machine. However, such application specific state machines 4367 MUST comply with general Diameter user session requirements such co- 4368 relating all message exchanges via Session-Id AVP. 4370 8.1. Authorization Session State Machine 4372 This section contains a set of finite state machines, representing 4373 the life cycle of Diameter sessions, and which MUST be observed by 4374 all Diameter implementations that make use of the authentication 4375 and/or authorization portion of a Diameter application. The term 4376 Service-Specific below refers to a message defined in a Diameter 4377 application (e.g., Mobile IPv4, NASREQ). 4379 There are four different authorization session state machines 4380 supported in the Diameter base protocol. The first two describe a 4381 session in which the server is maintaining session state, indicated 4382 by the value of the Auth-Session-State AVP (or its absence). One 4383 describes the session from a client perspective, the other from a 4384 server perspective. The second two state machines are used when the 4385 server does not maintain session state. Here again, one describes 4386 the session from a client perspective, the other from a server 4387 perspective. 4389 When a session is moved to the Idle state, any resources that were 4390 allocated for the particular session must be released. Any event not 4391 listed in the state machines MUST be considered as an error 4392 condition, and an answer, if applicable, MUST be returned to the 4393 originator of the message. 4395 In the case that an application does not support re-auth, the state 4396 transitions related to server-initiated re-auth when both client and 4397 server sessions maintains state (e.g., Send RAR, Pending, Receive 4398 RAA) MAY be ignored. 4400 In the state table, the event 'Failure to send X' means that the 4401 Diameter agent is unable to send command X to the desired 4402 destination. This could be due to the peer being down, or due to the 4403 peer sending back a transient failure or temporary protocol error 4404 notification DIAMETER_TOO_BUSY or DIAMETER_LOOP_DETECTED in the 4405 Result-Code AVP of the corresponding Answer command. The event 'X 4406 successfully sent' is the complement of 'Failure to send X'. 4408 The following state machine is observed by a client when state is 4409 maintained on the server: 4411 CLIENT, STATEFUL 4412 State Event Action New State 4413 ------------------------------------------------------------- 4414 Idle Client or Device Requests Send Pending 4415 access service 4416 specific 4417 auth req 4419 Idle ASR Received Send ASA Idle 4420 for unknown session with 4421 Result-Code 4422 = UNKNOWN_ 4423 SESSION_ID 4425 Idle RAR Received Send RAA Idle 4426 for unknown session with 4427 Result-Code 4428 = UNKNOWN_ 4429 SESSION_ID 4431 Pending Successful Service-specific Grant Open 4432 authorization answer Access 4433 received with default 4434 Auth-Session-State value 4436 Pending Successful Service-specific Sent STR Discon 4437 authorization answer received 4438 but service not provided 4440 Pending Error processing successful Sent STR Discon 4441 Service-specific authorization 4442 answer 4444 Pending Failed Service-specific Cleanup Idle 4445 authorization answer received 4447 Open User or client device Send Open 4448 requests access to service service 4449 specific 4450 auth req 4452 Open Successful Service-specific Provide Open 4453 authorization answer received Service 4455 Open Failed Service-specific Discon. Idle 4456 authorization answer user/device 4457 received. 4459 Open RAR received and client will Send RAA Open 4460 perform subsequent re-auth with 4461 Result-Code 4462 = SUCCESS 4464 Open RAR received and client will Send RAA Idle 4465 not perform subsequent with 4466 re-auth Result-Code 4467 != SUCCESS, 4468 Discon. 4469 user/device 4471 Open Session-Timeout Expires on Send STR Discon 4472 Access Device 4474 Open ASR Received, Send ASA Discon 4475 client will comply with with 4476 request to end the session Result-Code 4477 = SUCCESS, 4478 Send STR. 4480 Open ASR Received, Send ASA Open 4481 client will not comply with with 4482 request to end the session Result-Code 4483 != SUCCESS 4485 Open Authorization-Lifetime + Send STR Discon 4486 Auth-Grace-Period expires on 4487 access device 4489 Discon ASR Received Send ASA Discon 4491 Discon STA Received Discon. Idle 4492 user/device 4494 The following state machine is observed by a server when it is 4495 maintaining state for the session: 4497 SERVER, STATEFUL 4498 State Event Action New State 4499 ------------------------------------------------------------- 4500 Idle Service-specific authorization Send Open 4501 request received, and successful 4502 user is authorized serv. 4503 specific 4504 answer 4506 Idle Service-specific authorization Send Idle 4507 request received, and failed serv. 4508 user is not authorized specific 4509 answer 4511 Open Service-specific authorization Send Open 4512 request received, and user successful 4513 is authorized serv. specific 4514 answer 4516 Open Service-specific authorization Send Idle 4517 request received, and user failed serv. 4518 is not authorized specific 4519 answer, 4520 Cleanup 4522 Open Home server wants to confirm Send RAR Pending 4523 authentication and/or 4524 authorization of the user 4526 Pending Received RAA with a failed Cleanup Idle 4527 Result-Code 4529 Pending Received RAA with Result-Code Update Open 4530 = SUCCESS session 4532 Open Home server wants to Send ASR Discon 4533 terminate the service 4535 Open Authorization-Lifetime (and Cleanup Idle 4536 Auth-Grace-Period) expires 4537 on home server. 4539 Open Session-Timeout expires on Cleanup Idle 4540 home server 4542 Discon Failure to send ASR Wait, Discon 4543 resend ASR 4545 Discon ASR successfully sent and Cleanup Idle 4546 ASA Received with Result-Code 4548 Not ASA Received None No Change. 4549 Discon 4551 Any STR Received Send STA, Idle 4552 Cleanup. 4554 The following state machine is observed by a client when state is not 4555 maintained on the server: 4557 CLIENT, STATELESS 4558 State Event Action New State 4559 ------------------------------------------------------------- 4560 Idle Client or Device Requests Send Pending 4561 access service 4562 specific 4563 auth req 4565 Pending Successful Service-specific Grant Open 4566 authorization answer Access 4567 received with Auth-Session- 4568 State set to 4569 NO_STATE_MAINTAINED 4571 Pending Failed Service-specific Cleanup Idle 4572 authorization answer 4573 received 4575 Open Session-Timeout Expires on Discon. Idle 4576 Access Device user/device 4578 Open Service to user is terminated Discon. Idle 4579 user/device 4581 The following state machine is observed by a server when it is not 4582 maintaining state for the session: 4584 SERVER, STATELESS 4585 State Event Action New State 4586 ------------------------------------------------------------- 4587 Idle Service-specific authorization Send serv. Idle 4588 request received, and specific 4589 successfully processed answer 4591 8.2. Accounting Session State Machine 4593 The following state machines MUST be supported for applications that 4594 have an accounting portion or that require only accounting services. 4595 The first state machine is to be observed by clients. 4597 See Section 9.7 for Accounting Command Codes and Section 9.8 for 4598 Accounting AVPs. 4600 The server side in the accounting state machine depends in some cases 4601 on the particular application. The Diameter base protocol defines a 4602 default state machine that MUST be followed by all applications that 4603 have not specified other state machines. This is the second state 4604 machine in this section described below. 4606 The default server side state machine requires the reception of 4607 accounting records in any order and at any time, and does not place 4608 any standards requirement on the processing of these records. 4609 Implementations of Diameter MAY perform checking, ordering, 4610 correlation, fraud detection, and other tasks based on these records. 4611 Both base Diameter AVPs as well as application specific AVPs MAY be 4612 inspected as a part of these tasks. The tasks can happen either 4613 immediately after record reception or in a post-processing phase. 4614 However, as these tasks are typically application or even policy 4615 dependent, they are not standardized by the Diameter specifications. 4616 Applications MAY define requirements on when to accept accounting 4617 records based on the used value of Accounting-Realtime-Required AVP, 4618 credit limits checks, and so on. 4620 However, the Diameter base protocol defines one optional server side 4621 state machine that MAY be followed by applications that require 4622 keeping track of the session state at the accounting server. Note 4623 that such tracking is incompatible with the ability to sustain long 4624 duration connectivity problems. Therefore, the use of this state 4625 machine is recommended only in applications where the value of the 4626 Accounting-Realtime-Required AVP is DELIVER_AND_GRANT, and hence 4627 accounting connectivity problems are required to cause the serviced 4628 user to be disconnected. Otherwise, records produced by the client 4629 may be lost by the server which no longer accepts them after the 4630 connectivity is re-established. This state machine is the third 4631 state machine in this section. The state machine is supervised by a 4632 supervision session timer Ts, which the value should be reasonably 4633 higher than the Acct_Interim_Interval value. Ts MAY be set to two 4634 times the value of the Acct_Interim_Interval so as to avoid the 4635 accounting session in the Diameter server to change to Idle state in 4636 case of short transient network failure. 4638 Any event not listed in the state machines MUST be considered as an 4639 error condition, and a corresponding answer, if applicable, MUST be 4640 returned to the originator of the message. 4642 In the state table, the event 'Failure to send' means that the 4643 Diameter client is unable to communicate with the desired 4644 destination. This could be due to the peer being down, or due to the 4645 peer sending back a transient failure or temporary protocol error 4646 notification DIAMETER_OUT_OF_SPACE, DIAMETER_TOO_BUSY, or 4647 DIAMETER_LOOP_DETECTED in the Result-Code AVP of the Accounting 4648 Answer command. 4650 The event 'Failed answer' means that the Diameter client received a 4651 non-transient failure notification in the Accounting Answer command. 4653 Note that the action 'Disconnect user/dev' MUST have an effect also 4654 to the authorization session state table, e.g., cause the STR message 4655 to be sent, if the given application has both authentication/ 4656 authorization and accounting portions. 4658 The states PendingS, PendingI, PendingL, PendingE and PendingB stand 4659 for pending states to wait for an answer to an accounting request 4660 related to a Start, Interim, Stop, Event or buffered record, 4661 respectively. 4663 CLIENT, ACCOUNTING 4664 State Event Action New State 4665 ------------------------------------------------------------- 4666 Idle Client or device requests Send PendingS 4667 access accounting 4668 start req. 4670 Idle Client or device requests Send PendingE 4671 a one-time service accounting 4672 event req 4674 Idle Records in storage Send PendingB 4675 record 4677 PendingS Successful accounting Open 4678 start answer received 4680 PendingS Failure to send and buffer Store Open 4681 space available and realtime Start 4682 not equal to DELIVER_AND_GRANT Record 4684 PendingS Failure to send and no buffer Open 4685 space available and realtime 4686 equal to GRANT_AND_LOSE 4688 PendingS Failure to send and no buffer Disconnect Idle 4689 space available and realtime user/dev 4690 not equal to 4691 GRANT_AND_LOSE 4693 PendingS Failed accounting start answer Open 4694 received and realtime equal 4695 to GRANT_AND_LOSE 4697 PendingS Failed accounting start answer Disconnect Idle 4698 received and realtime not user/dev 4699 equal to GRANT_AND_LOSE 4701 PendingS User service terminated Store PendingS 4702 stop 4703 record 4705 Open Interim interval elapses Send PendingI 4706 accounting 4707 interim 4708 record 4709 Open User service terminated Send PendingL 4710 accounting 4711 stop req. 4713 PendingI Successful accounting interim Open 4714 answer received 4716 PendingI Failure to send and (buffer Store Open 4717 space available or old record interim 4718 can be overwritten) and record 4719 realtime not equal to 4720 DELIVER_AND_GRANT 4722 PendingI Failure to send and no buffer Open 4723 space available and realtime 4724 equal to GRANT_AND_LOSE 4726 PendingI Failure to send and no buffer Disconnect Idle 4727 space available and realtime user/dev 4728 not equal to GRANT_AND_LOSE 4730 PendingI Failed accounting interim Open 4731 answer received and realtime 4732 equal to GRANT_AND_LOSE 4734 PendingI Failed accounting interim Disconnect Idle 4735 answer received and realtime user/dev 4736 not equal to GRANT_AND_LOSE 4738 PendingI User service terminated Store PendingI 4739 stop 4740 record 4741 PendingE Successful accounting Idle 4742 event answer received 4744 PendingE Failure to send and buffer Store Idle 4745 space available event 4746 record 4748 PendingE Failure to send and no buffer Idle 4749 space available 4751 PendingE Failed accounting event answer Idle 4752 received 4754 PendingB Successful accounting answer Delete Idle 4755 received record 4757 PendingB Failure to send Idle 4759 PendingB Failed accounting answer Delete Idle 4760 received record 4762 PendingL Successful accounting Idle 4763 stop answer received 4765 PendingL Failure to send and buffer Store Idle 4766 space available stop 4767 record 4769 PendingL Failure to send and no buffer Idle 4770 space available 4772 PendingL Failed accounting stop answer Idle 4773 received 4775 SERVER, STATELESS ACCOUNTING 4776 State Event Action New State 4777 ------------------------------------------------------------- 4779 Idle Accounting start request Send Idle 4780 received, and successfully accounting 4781 processed. start 4782 answer 4784 Idle Accounting event request Send Idle 4785 received, and successfully accounting 4786 processed. event 4787 answer 4789 Idle Interim record received, Send Idle 4790 and successfully processed. accounting 4791 interim 4792 answer 4794 Idle Accounting stop request Send Idle 4795 received, and successfully accounting 4796 processed stop answer 4798 Idle Accounting request received, Send Idle 4799 no space left to store accounting 4800 records answer, 4801 Result-Code 4802 = OUT_OF_ 4803 SPACE 4805 SERVER, STATEFUL ACCOUNTING 4806 State Event Action New State 4807 ------------------------------------------------------------- 4809 Idle Accounting start request Send Open 4810 received, and successfully accounting 4811 processed. start 4812 answer, 4813 Start Ts 4815 Idle Accounting event request Send Idle 4816 received, and successfully accounting 4817 processed. event 4818 answer 4820 Idle Accounting request received, Send Idle 4821 no space left to store accounting 4822 records answer, 4823 Result-Code 4824 = OUT_OF_ 4825 SPACE 4827 Open Interim record received, Send Open 4828 and successfully processed. accounting 4829 interim 4830 answer, 4831 Restart Ts 4833 Open Accounting stop request Send Idle 4834 received, and successfully accounting 4835 processed stop answer, 4836 Stop Ts 4838 Open Accounting request received, Send Idle 4839 no space left to store accounting 4840 records answer, 4841 Result-Code 4842 = OUT_OF_ 4843 SPACE, 4844 Stop Ts 4846 Open Session supervision timer Ts Stop Ts Idle 4847 expired 4849 8.3. Server-Initiated Re-Auth 4851 A Diameter server may initiate a re-authentication and/or re- 4852 authorization service for a particular session by issuing a Re-Auth- 4853 Request (RAR). 4855 For example, for pre-paid services, the Diameter server that 4856 originally authorized a session may need some confirmation that the 4857 user is still using the services. 4859 An access device that receives a RAR message with Session-Id equal to 4860 a currently active session MUST initiate a re-auth towards the user, 4861 if the service supports this particular feature. Each Diameter 4862 application MUST state whether service-initiated re-auth is 4863 supported, since some applications do not allow access devices to 4864 prompt the user for re-auth. 4866 8.3.1. Re-Auth-Request 4868 The Re-Auth-Request (RAR), indicated by the Command-Code set to 258 4869 and the message flags' 'R' bit set, may be sent by any server to the 4870 access device that is providing session service, to request that the 4871 user be re-authenticated and/or re-authorized. 4873 Message Format 4875 ::= < Diameter Header: 258, REQ, PXY > 4876 < Session-Id > 4877 { Origin-Host } 4878 { Origin-Realm } 4879 { Destination-Realm } 4880 { Destination-Host } 4881 { Auth-Application-Id } 4882 { Re-Auth-Request-Type } 4883 [ User-Name ] 4884 [ Origin-State-Id ] 4885 * [ Proxy-Info ] 4886 * [ Route-Record ] 4887 * [ AVP ] 4889 8.3.2. Re-Auth-Answer 4891 The Re-Auth-Answer (RAA), indicated by the Command-Code set to 258 4892 and the message flags' 'R' bit clear, is sent in response to the RAR. 4893 The Result-Code AVP MUST be present, and indicates the disposition of 4894 the request. 4896 A successful RAA message MUST be followed by an application-specific 4897 authentication and/or authorization message. 4899 Message Format 4901 ::= < Diameter Header: 258, PXY > 4902 < Session-Id > 4903 { Result-Code } 4904 { Origin-Host } 4905 { Origin-Realm } 4906 [ User-Name ] 4907 [ Origin-State-Id ] 4908 [ Error-Message ] 4909 [ Error-Reporting-Host ] 4910 [ Failed-AVP ] 4911 * [ Redirect-Host ] 4912 [ Redirect-Host-Usage ] 4913 [ Redirect-Max-Cache-Time ] 4914 * [ Proxy-Info ] 4915 * [ AVP ] 4917 8.4. Session Termination 4919 It is necessary for a Diameter server that authorized a session, for 4920 which it is maintaining state, to be notified when that session is no 4921 longer active, both for tracking purposes as well as to allow 4922 stateful agents to release any resources that they may have provided 4923 for the user's session. For sessions whose state is not being 4924 maintained, this section is not used. 4926 When a user session that required Diameter authorization terminates, 4927 the access device that provided the service MUST issue a Session- 4928 Termination-Request (STR) message to the Diameter server that 4929 authorized the service, to notify it that the session is no longer 4930 active. An STR MUST be issued when a user session terminates for any 4931 reason, including user logoff, expiration of Session-Timeout, 4932 administrative action, termination upon receipt of an Abort-Session- 4933 Request (see below), orderly shutdown of the access device, etc. 4935 The access device also MUST issue an STR for a session that was 4936 authorized but never actually started. This could occur, for 4937 example, due to a sudden resource shortage in the access device, or 4938 because the access device is unwilling to provide the type of service 4939 requested in the authorization, or because the access device does not 4940 support a mandatory AVP returned in the authorization, etc. 4942 It is also possible that a session that was authorized is never 4943 actually started due to action of a proxy. For example, a proxy may 4944 modify an authorization answer, converting the result from success to 4945 failure, prior to forwarding the message to the access device. If 4946 the answer did not contain an Auth-Session-State AVP with the value 4947 NO_STATE_MAINTAINED, a proxy that causes an authorized session not to 4948 be started MUST issue an STR to the Diameter server that authorized 4949 the session, since the access device has no way of knowing that the 4950 session had been authorized. 4952 A Diameter server that receives an STR message MUST clean up 4953 resources (e.g., session state) associated with the Session-Id 4954 specified in the STR, and return a Session-Termination-Answer. 4956 A Diameter server also MUST clean up resources when the Session- 4957 Timeout expires, or when the Authorization-Lifetime and the Auth- 4958 Grace-Period AVPs expires without receipt of a re-authorization 4959 request, regardless of whether an STR for that session is received. 4960 The access device is not expected to provide service beyond the 4961 expiration of these timers; thus, expiration of either of these 4962 timers implies that the access device may have unexpectedly shut 4963 down. 4965 8.4.1. Session-Termination-Request 4967 The Session-Termination-Request (STR), indicated by the Command-Code 4968 set to 275 and the Command Flags' 'R' bit set, is sent by the access 4969 device to inform the Diameter Server that an authenticated and/or 4970 authorized session is being terminated. 4972 Message Format 4974 ::= < Diameter Header: 275, REQ, PXY > 4975 < Session-Id > 4976 { Origin-Host } 4977 { Origin-Realm } 4978 { Destination-Realm } 4979 { Auth-Application-Id } 4980 { Termination-Cause } 4981 [ User-Name ] 4982 [ Destination-Host ] 4983 * [ Class ] 4984 [ Origin-State-Id ] 4985 * [ Proxy-Info ] 4986 * [ Route-Record ] 4987 * [ AVP ] 4989 8.4.2. Session-Termination-Answer 4991 The Session-Termination-Answer (STA), indicated by the Command-Code 4992 set to 275 and the message flags' 'R' bit clear, is sent by the 4993 Diameter Server to acknowledge the notification that the session has 4994 been terminated. The Result-Code AVP MUST be present, and MAY 4995 contain an indication that an error occurred while servicing the STR. 4997 Upon sending or receipt of the STA, the Diameter Server MUST release 4998 all resources for the session indicated by the Session-Id AVP. Any 4999 intermediate server in the Proxy-Chain MAY also release any 5000 resources, if necessary. 5002 Message Format 5004 ::= < Diameter Header: 275, PXY > 5005 < Session-Id > 5006 { Result-Code } 5007 { Origin-Host } 5008 { Origin-Realm } 5009 [ User-Name ] 5010 * [ Class ] 5011 [ Error-Message ] 5012 [ Error-Reporting-Host ] 5013 [ Failed-AVP ] 5014 [ Origin-State-Id ] 5015 * [ Redirect-Host ] 5016 [ Redirect-Host-Usage ] 5017 [ Redirect-Max-Cache-Time ] 5018 * [ Proxy-Info ] 5019 * [ AVP ] 5021 8.5. Aborting a Session 5023 A Diameter server may request that the access device stop providing 5024 service for a particular session by issuing an Abort-Session-Request 5025 (ASR). 5027 For example, the Diameter server that originally authorized the 5028 session may be required to cause that session to be stopped for 5029 credit or other reasons that were not anticipated when the session 5030 was first authorized. On the other hand, an operator may maintain a 5031 management server for the purpose of issuing ASRs to administratively 5032 remove users from the network. 5034 An access device that receives an ASR with Session-ID equal to a 5035 currently active session MAY stop the session. Whether the access 5036 device stops the session or not is implementation- and/or 5037 configuration-dependent. For example, an access device may honor 5038 ASRs from certain agents only. In any case, the access device MUST 5039 respond with an Abort-Session-Answer, including a Result-Code AVP to 5040 indicate what action it took. 5042 Note that if the access device does stop the session upon receipt of 5043 an ASR, it issues an STR to the authorizing server (which may or may 5044 not be the agent issuing the ASR) just as it would if the session 5045 were terminated for any other reason. 5047 8.5.1. Abort-Session-Request 5049 The Abort-Session-Request (ASR), indicated by the Command-Code set to 5050 274 and the message flags' 'R' bit set, may be sent by any server to 5051 the access device that is providing session service, to request that 5052 the session identified by the Session-Id be stopped. 5054 Message Format 5056 ::= < Diameter Header: 274, REQ, PXY > 5057 < Session-Id > 5058 { Origin-Host } 5059 { Origin-Realm } 5060 { Destination-Realm } 5061 { Destination-Host } 5062 { Auth-Application-Id } 5063 [ User-Name ] 5064 [ Origin-State-Id ] 5065 * [ Proxy-Info ] 5066 * [ Route-Record ] 5067 * [ AVP ] 5069 8.5.2. Abort-Session-Answer 5071 The Abort-Session-Answer (ASA), indicated by the Command-Code set to 5072 274 and the message flags' 'R' bit clear, is sent in response to the 5073 ASR. The Result-Code AVP MUST be present, and indicates the 5074 disposition of the request. 5076 If the session identified by Session-Id in the ASR was successfully 5077 terminated, Result-Code is set to DIAMETER_SUCCESS. If the session 5078 is not currently active, Result-Code is set to 5079 DIAMETER_UNKNOWN_SESSION_ID. If the access device does not stop the 5080 session for any other reason, Result-Code is set to 5081 DIAMETER_UNABLE_TO_COMPLY. 5083 Message Format 5085 ::= < Diameter Header: 274, PXY > 5086 < Session-Id > 5087 { Result-Code } 5088 { Origin-Host } 5089 { Origin-Realm } 5090 [ User-Name ] 5091 [ Origin-State-Id ] 5092 [ Error-Message ] 5093 [ Error-Reporting-Host ] 5094 [ Failed-AVP ] 5095 * [ Redirect-Host ] 5096 [ Redirect-Host-Usage ] 5097 [ Redirect-Max-Cache-Time ] 5098 * [ Proxy-Info ] 5099 * [ AVP ] 5101 8.6. Inferring Session Termination from Origin-State-Id 5103 Origin-State-Id is used to allow rapid detection of terminated 5104 sessions for which no STR would have been issued, due to 5105 unanticipated shutdown of an access device. 5107 By including Origin-State-Id in CER/CEA messages, an access device 5108 allows a next-hop server to determine immediately upon connection 5109 whether the device has lost its sessions since the last connection. 5111 By including Origin-State-Id in request messages, an access device 5112 also allows a server with which it communicates via proxy to make 5113 such a determination. However, a server that is not directly 5114 connected with the access device will not discover that the access 5115 device has been restarted unless and until it receives a new request 5116 from the access device. Thus, use of this mechanism across proxies 5117 is opportunistic rather than reliable, but useful nonetheless. 5119 When a Diameter server receives an Origin-State-Id that is greater 5120 than the Origin-State-Id previously received from the same issuer, it 5121 may assume that the issuer has lost state since the previous message 5122 and that all sessions that were active under the lower Origin-State- 5123 Id have been terminated. The Diameter server MAY clean up all 5124 session state associated with such lost sessions, and MAY also issues 5125 STRs for all such lost sessions that were authorized on upstream 5126 servers, to allow session state to be cleaned up globally. 5128 8.7. Auth-Request-Type AVP 5130 The Auth-Request-Type AVP (AVP Code 274) is of type Enumerated and is 5131 included in application-specific auth requests to inform the peers 5132 whether a user is to be authenticated only, authorized only or both. 5133 Note any value other than both MAY cause RADIUS interoperability 5134 issues. The following values are defined: 5136 AUTHENTICATE_ONLY 1 5138 The request being sent is for authentication only, and MUST 5139 contain the relevant application specific authentication AVPs that 5140 are needed by the Diameter server to authenticate the user. 5142 AUTHORIZE_ONLY 2 5144 The request being sent is for authorization only, and MUST contain 5145 the application specific authorization AVPs that are necessary to 5146 identify the service being requested/offered. 5148 AUTHORIZE_AUTHENTICATE 3 5150 The request contains a request for both authentication and 5151 authorization. The request MUST include both the relevant 5152 application specific authentication information, and authorization 5153 information necessary to identify the service being requested/ 5154 offered. 5156 8.8. Session-Id AVP 5158 The Session-Id AVP (AVP Code 263) is of type UTF8String and is used 5159 to identify a specific session (see Section 8). All messages 5160 pertaining to a specific session MUST include only one Session-Id AVP 5161 and the same value MUST be used throughout the life of a session. 5162 When present, the Session-Id SHOULD appear immediately following the 5163 Diameter Header (see Section 3). 5165 The Session-Id MUST be globally and eternally unique, as it is meant 5166 to uniquely identify a user session without reference to any other 5167 information, and may be needed to correlate historical authentication 5168 information with accounting information. The Session-Id includes a 5169 mandatory portion and an implementation-defined portion; a 5170 recommended format for the implementation-defined portion is outlined 5171 below. 5173 The Session-Id MUST begin with the sender's identity encoded in the 5174 DiameterIdentity type (see Section 4.4). The remainder of the 5175 Session-Id is delimited by a ";" character, and MAY be any sequence 5176 that the client can guarantee to be eternally unique; however, the 5177 following format is recommended, (square brackets [] indicate an 5178 optional element): 5180 ;;[;] 5182 and are decimal representations of the 5183 high and low 32 bits of a monotonically increasing 64-bit value. The 5184 64-bit value is rendered in two part to simplify formatting by 32-bit 5185 processors. At startup, the high 32 bits of the 64-bit value MAY be 5186 initialized to the time in NTP format [RFC4330], and the low 32 bits 5187 MAY be initialized to zero. This will for practical purposes 5188 eliminate the possibility of overlapping Session-Ids after a reboot, 5189 assuming the reboot process takes longer than a second. 5190 Alternatively, an implementation MAY keep track of the increasing 5191 value in non-volatile memory. 5193 is implementation specific but may include a modem's 5194 device Id, a layer 2 address, timestamp, etc. 5196 Example, in which there is no optional value: 5198 accesspoint7.acme.com;1876543210;523 5200 Example, in which there is an optional value: 5202 accesspoint7.acme.com;1876543210;523;mobile@200.1.1.88 5204 The Session-Id is created by the Diameter application initiating the 5205 session, which in most cases is done by the client. Note that a 5206 Session-Id MAY be used for both the authorization and accounting 5207 commands of a given application. 5209 8.9. Authorization-Lifetime AVP 5211 The Authorization-Lifetime AVP (AVP Code 291) is of type Unsigned32 5212 and contains the maximum number of seconds of service to be provided 5213 to the user before the user is to be re-authenticated and/or re- 5214 authorized. Great care should be taken when the Authorization- 5215 Lifetime value is determined, since a low, non-zero, value could 5216 create significant Diameter traffic, which could congest both the 5217 network and the agents. 5219 A value of zero (0) means that immediate re-auth is necessary by the 5220 access device. This is typically used in cases where multiple 5221 authentication methods are used, and a successful auth response with 5222 this AVP set to zero is used to signal that the next authentication 5223 method is to be immediately initiated. The absence of this AVP, or a 5224 value of all ones (meaning all bits in the 32 bit field are set to 5225 one) means no re-auth is expected. 5227 If both this AVP and the Session-Timeout AVP are present in a 5228 message, the value of the latter MUST NOT be smaller than the 5229 Authorization-Lifetime AVP. 5231 An Authorization-Lifetime AVP MAY be present in re-authorization 5232 messages, and contains the number of seconds the user is authorized 5233 to receive service from the time the re-auth answer message is 5234 received by the access device. 5236 This AVP MAY be provided by the client as a hint of the maximum 5237 lifetime that it is willing to accept. However, the server MAY 5238 return a value that is equal to, or smaller, than the one provided by 5239 the client. 5241 8.10. Auth-Grace-Period AVP 5243 The Auth-Grace-Period AVP (AVP Code 276) is of type Unsigned32 and 5244 contains the number of seconds the Diameter server will wait 5245 following the expiration of the Authorization-Lifetime AVP before 5246 cleaning up resources for the session. 5248 8.11. Auth-Session-State AVP 5250 The Auth-Session-State AVP (AVP Code 277) is of type Enumerated and 5251 specifies whether state is maintained for a particular session. The 5252 client MAY include this AVP in requests as a hint to the server, but 5253 the value in the server's answer message is binding. The following 5254 values are supported: 5256 STATE_MAINTAINED 0 5258 This value is used to specify that session state is being 5259 maintained, and the access device MUST issue a session termination 5260 message when service to the user is terminated. This is the 5261 default value. 5263 NO_STATE_MAINTAINED 1 5265 This value is used to specify that no session termination messages 5266 will be sent by the access device upon expiration of the 5267 Authorization-Lifetime. 5269 8.12. Re-Auth-Request-Type AVP 5271 The Re-Auth-Request-Type AVP (AVP Code 285) is of type Enumerated and 5272 is included in application-specific auth answers to inform the client 5273 of the action expected upon expiration of the Authorization-Lifetime. 5274 If the answer message contains an Authorization-Lifetime AVP with a 5275 positive value, the Re-Auth-Request-Type AVP MUST be present in an 5276 answer message. The following values are defined: 5278 AUTHORIZE_ONLY 0 5280 An authorization only re-auth is expected upon expiration of the 5281 Authorization-Lifetime. This is the default value if the AVP is 5282 not present in answer messages that include the Authorization- 5283 Lifetime. 5285 AUTHORIZE_AUTHENTICATE 1 5287 An authentication and authorization re-auth is expected upon 5288 expiration of the Authorization-Lifetime. 5290 8.13. Session-Timeout AVP 5292 The Session-Timeout AVP (AVP Code 27) [RFC2865] is of type Unsigned32 5293 and contains the maximum number of seconds of service to be provided 5294 to the user before termination of the session. When both the 5295 Session-Timeout and the Authorization-Lifetime AVPs are present in an 5296 answer message, the former MUST be equal to or greater than the value 5297 of the latter. 5299 A session that terminates on an access device due to the expiration 5300 of the Session-Timeout MUST cause an STR to be issued, unless both 5301 the access device and the home server had previously agreed that no 5302 session termination messages would be sent (see Section 8.11). 5304 A Session-Timeout AVP MAY be present in a re-authorization answer 5305 message, and contains the remaining number of seconds from the 5306 beginning of the re-auth. 5308 A value of zero, or the absence of this AVP, means that this session 5309 has an unlimited number of seconds before termination. 5311 This AVP MAY be provided by the client as a hint of the maximum 5312 timeout that it is willing to accept. However, the server MAY return 5313 a value that is equal to, or smaller, than the one provided by the 5314 client. 5316 8.14. User-Name AVP 5318 The User-Name AVP (AVP Code 1) [RFC2865] is of type UTF8String, which 5319 contains the User-Name, in a format consistent with the NAI 5320 specification [RFC4282]. 5322 8.15. Termination-Cause AVP 5324 The Termination-Cause AVP (AVP Code 295) is of type Enumerated, and 5325 is used to indicate the reason why a session was terminated on the 5326 access device. The following values are defined: 5328 DIAMETER_LOGOUT 1 5330 The user initiated a disconnect 5332 DIAMETER_SERVICE_NOT_PROVIDED 2 5334 This value is used when the user disconnected prior to the receipt 5335 of the authorization answer message. 5337 DIAMETER_BAD_ANSWER 3 5339 This value indicates that the authorization answer received by the 5340 access device was not processed successfully. 5342 DIAMETER_ADMINISTRATIVE 4 5344 The user was not granted access, or was disconnected, due to 5345 administrative reasons, such as the receipt of a Abort-Session- 5346 Request message. 5348 DIAMETER_LINK_BROKEN 5 5350 The communication to the user was abruptly disconnected. 5352 DIAMETER_AUTH_EXPIRED 6 5354 The user's access was terminated since its authorized session time 5355 has expired. 5357 DIAMETER_USER_MOVED 7 5359 The user is receiving services from another access device. 5361 DIAMETER_SESSION_TIMEOUT 8 5363 The user's session has timed out, and service has been terminated. 5365 8.16. Origin-State-Id AVP 5367 The Origin-State-Id AVP (AVP Code 278), of type Unsigned32, is a 5368 monotonically increasing value that is advanced whenever a Diameter 5369 entity restarts with loss of previous state, for example upon reboot. 5370 Origin-State-Id MAY be included in any Diameter message, including 5371 CER. 5373 A Diameter entity issuing this AVP MUST create a higher value for 5374 this AVP each time its state is reset. A Diameter entity MAY set 5375 Origin-State-Id to the time of startup, or it MAY use an incrementing 5376 counter retained in non-volatile memory across restarts. 5378 The Origin-State-Id, if present, MUST reflect the state of the entity 5379 indicated by Origin-Host. If a proxy modifies Origin-Host, it MUST 5380 either remove Origin-State-Id or modify it appropriately as well. 5381 Typically, Origin-State-Id is used by an access device that always 5382 starts up with no active sessions; that is, any session active prior 5383 to restart will have been lost. By including Origin-State-Id in a 5384 message, it allows other Diameter entities to infer that sessions 5385 associated with a lower Origin-State-Id are no longer active. If an 5386 access device does not intend for such inferences to be made, it MUST 5387 either not include Origin-State-Id in any message, or set its value 5388 to 0. 5390 8.17. Session-Binding AVP 5392 The Session-Binding AVP (AVP Code 270) is of type Unsigned32, and MAY 5393 be present in application-specific authorization answer messages. If 5394 present, this AVP MAY inform the Diameter client that all future 5395 application-specific re-auth messages for this session MUST be sent 5396 to the same authorization server. This AVP MAY also specify that a 5397 Session-Termination-Request message for this session MUST be sent to 5398 the same authorizing server. 5400 This field is a bit mask, and the following bits have been defined: 5402 RE_AUTH 1 5404 When set, future re-auth messages for this session MUST NOT 5405 include the Destination-Host AVP. When cleared, the default 5406 value, the Destination-Host AVP MUST be present in all re-auth 5407 messages for this session. 5409 STR 2 5411 When set, the STR message for this session MUST NOT include the 5412 Destination-Host AVP. When cleared, the default value, the 5413 Destination-Host AVP MUST be present in the STR message for this 5414 session. 5416 ACCOUNTING 4 5418 When set, all accounting messages for this session MUST NOT 5419 include the Destination-Host AVP. When cleared, the default 5420 value, the Destination-Host AVP, if known, MUST be present in all 5421 accounting messages for this session. 5423 8.18. Session-Server-Failover AVP 5425 The Session-Server-Failover AVP (AVP Code 271) is of type Enumerated, 5426 and MAY be present in application-specific authorization answer 5427 messages that either do not include the Session-Binding AVP or 5428 include the Session-Binding AVP with any of the bits set to a zero 5429 value. If present, this AVP MAY inform the Diameter client that if a 5430 re-auth or STR message fails due to a delivery problem, the Diameter 5431 client SHOULD issue a subsequent message without the Destination-Host 5432 AVP. When absent, the default value is REFUSE_SERVICE. 5434 The following values are supported: 5436 REFUSE_SERVICE 0 5438 If either the re-auth or the STR message delivery fails, terminate 5439 service with the user, and do not attempt any subsequent attempts. 5441 TRY_AGAIN 1 5443 If either the re-auth or the STR message delivery fails, resend 5444 the failed message without the Destination-Host AVP present. 5446 ALLOW_SERVICE 2 5448 If re-auth message delivery fails, assume that re-authorization 5449 succeeded. If STR message delivery fails, terminate the session. 5451 TRY_AGAIN_ALLOW_SERVICE 3 5453 If either the re-auth or the STR message delivery fails, resend 5454 the failed message without the Destination-Host AVP present. If 5455 the second delivery fails for re-auth, assume re-authorization 5456 succeeded. If the second delivery fails for STR, terminate the 5457 session. 5459 8.19. Multi-Round-Time-Out AVP 5461 The Multi-Round-Time-Out AVP (AVP Code 272) is of type Unsigned32, 5462 and SHOULD be present in application-specific authorization answer 5463 messages whose Result-Code AVP is set to DIAMETER_MULTI_ROUND_AUTH. 5464 This AVP contains the maximum number of seconds that the access 5465 device MUST provide the user in responding to an authentication 5466 request. 5468 8.20. Class AVP 5470 The Class AVP (AVP Code 25) is of type OctetString and is used by 5471 Diameter servers to return state information to the access device. 5472 When one or more Class AVPs are present in application-specific 5473 authorization answer messages, they MUST be present in subsequent re- 5474 authorization, session termination and accounting messages. Class 5475 AVPs found in a re-authorization answer message override the ones 5476 found in any previous authorization answer message. Diameter server 5477 implementations SHOULD NOT return Class AVPs that require more than 5478 4096 bytes of storage on the Diameter client. A Diameter client that 5479 receives Class AVPs whose size exceeds local available storage MUST 5480 terminate the session. 5482 8.21. Event-Timestamp AVP 5484 The Event-Timestamp (AVP Code 55) is of type Time, and MAY be 5485 included in an Accounting-Request and Accounting-Answer messages to 5486 record the time that the reported event occurred, in seconds since 5487 January 1, 1900 00:00 UTC. 5489 9. Accounting 5491 This accounting protocol is based on a server directed model with 5492 capabilities for real-time delivery of accounting information. 5493 Several fault resilience methods [RFC2975] have been built in to the 5494 protocol in order minimize loss of accounting data in various fault 5495 situations and under different assumptions about the capabilities of 5496 the used devices. 5498 9.1. Server Directed Model 5500 The server directed model means that the device generating the 5501 accounting data gets information from either the authorization server 5502 (if contacted) or the accounting server regarding the way accounting 5503 data shall be forwarded. This information includes accounting record 5504 timeliness requirements. 5506 As discussed in [RFC2975], real-time transfer of accounting records 5507 is a requirement, such as the need to perform credit limit checks and 5508 fraud detection. Note that batch accounting is not a requirement, 5509 and is therefore not supported by Diameter. Should batched 5510 accounting be required in the future, a new Diameter application will 5511 need to be created, or it could be handled using another protocol. 5512 Note, however, that even if at the Diameter layer accounting requests 5513 are processed one by one, transport protocols used under Diameter 5514 typically batch several requests in the same packet under heavy 5515 traffic conditions. This may be sufficient for many applications. 5517 The authorization server (chain) directs the selection of proper 5518 transfer strategy, based on its knowledge of the user and 5519 relationships of roaming partnerships. The server (or agents) uses 5520 the Acct-Interim-Interval and Accounting-Realtime-Required AVPs to 5521 control the operation of the Diameter peer operating as a client. 5522 The Acct-Interim-Interval AVP, when present, instructs the Diameter 5523 node acting as a client to produce accounting records continuously 5524 even during a session. Accounting-Realtime-Required AVP is used to 5525 control the behavior of the client when the transfer of accounting 5526 records from the Diameter client is delayed or unsuccessful. 5528 The Diameter accounting server MAY override the interim interval or 5529 the realtime requirements by including the Acct-Interim-Interval or 5530 Accounting-Realtime-Required AVP in the Accounting-Answer message. 5531 When one of these AVPs is present, the latest value received SHOULD 5532 be used in further accounting activities for the same session. 5534 9.2. Protocol Messages 5536 A Diameter node that receives a successful authentication and/or 5537 authorization messages from the Home AAA server MUST collect 5538 accounting information for the session. The Accounting-Request 5539 message is used to transmit the accounting information to the Home 5540 AAA server, which MUST reply with the Accounting-Answer message to 5541 confirm reception. The Accounting-Answer message includes the 5542 Result-Code AVP, which MAY indicate that an error was present in the 5543 accounting message. A rejected Accounting-Request message MAY cause 5544 the user's session to be terminated, depending on the value of the 5545 Accounting-Realtime-Required AVP received earlier for the session in 5546 question. 5548 Each Diameter Accounting protocol message MAY be compressed, in order 5549 to reduce network bandwidth usage. If TLS is used to secure the 5550 Diameter session, then TLS compression [RFC4346] MAY be used. 5552 9.3. Accounting Application Extension and Requirements 5554 Each Diameter application (e.g., NASREQ, MobileIP), MUST define their 5555 Service-Specific AVPs that MUST be present in the Accounting-Request 5556 message in a section entitled "Accounting AVPs". The application 5557 MUST assume that the AVPs described in this document will be present 5558 in all Accounting messages, so only their respective service-specific 5559 AVPs need to be defined in this section. 5561 Applications have the option of using one or both of the following 5562 accounting application extension models: 5564 Split Accounting Service 5566 The accounting message will carry the Application Id of the 5567 Diameter base accounting application (see Section 2.4). 5568 Accounting messages maybe routed to Diameter nodes other than the 5569 corresponding Diameter application. These nodes might be 5570 centralized accounting servers that provide accounting service for 5571 multiple different Diameter applications. These nodes MUST 5572 advertise the Diameter base accounting Application Id during 5573 capabilities exchange. 5575 Coupled Accounting Service 5577 The accounting messages will carry the Application Id of the 5578 application that is using it. The application itself will process 5579 the received accounting records or forward them to an accounting 5580 server. There is no accounting application advertisement required 5581 during capabilities exchange and the accounting messages will be 5582 routed the same as any of the other application messages. 5584 In cases where an application does not define its own accounting 5585 service, it is preferred that the split accounting model be used. 5587 9.4. Fault Resilience 5589 Diameter Base protocol mechanisms are used to overcome small message 5590 loss and network faults of temporary nature. 5592 Diameter peers acting as clients MUST implement the use of failover 5593 to guard against server failures and certain network failures. 5594 Diameter peers acting as agents or related off-line processing 5595 systems MUST detect duplicate accounting records caused by the 5596 sending of same record to several servers and duplication of messages 5597 in transit. This detection MUST be based on the inspection of the 5598 Session-Id and Accounting-Record-Number AVP pairs. Appendix C 5599 discusses duplicate detection needs and implementation issues. 5601 Diameter clients MAY have non-volatile memory for the safe storage of 5602 accounting records over reboots or extended network failures, network 5603 partitions, and server failures. If such memory is available, the 5604 client SHOULD store new accounting records there as soon as the 5605 records are created and until a positive acknowledgement of their 5606 reception from the Diameter Server has been received. Upon a reboot, 5607 the client MUST starting sending the records in the non-volatile 5608 memory to the accounting server with appropriate modifications in 5609 termination cause, session length, and other relevant information in 5610 the records. 5612 A further application of this protocol may include AVPs to control 5613 how many accounting records may at most be stored in the Diameter 5614 client without committing them to the non-volatile memory or 5615 transferring them to the Diameter server. 5617 The client SHOULD NOT remove the accounting data from any of its 5618 memory areas before the correct Accounting-Answer has been received. 5619 The client MAY remove oldest, undelivered or yet unacknowledged 5620 accounting data if it runs out of resources such as memory. It is an 5621 implementation dependent matter for the client to accept new sessions 5622 under this condition. 5624 9.5. Accounting Records 5626 In all accounting records, the Session-Id AVP MUST be present; the 5627 User-Name AVP MUST be present if it is available to the Diameter 5628 client. 5630 Different types of accounting records are sent depending on the 5631 actual type of accounted service and the authorization server's 5632 directions for interim accounting. If the accounted service is a 5633 one-time event, meaning that the start and stop of the event are 5634 simultaneous, then the Accounting-Record-Type AVP MUST be present and 5635 set to the value EVENT_RECORD. 5637 If the accounted service is of a measurable length, then the AVP MUST 5638 use the values START_RECORD, STOP_RECORD, and possibly, 5639 INTERIM_RECORD. If the authorization server has not directed interim 5640 accounting to be enabled for the session, two accounting records MUST 5641 be generated for each service of type session. When the initial 5642 Accounting-Request for a given session is sent, the Accounting- 5643 Record-Type AVP MUST be set to the value START_RECORD. When the last 5644 Accounting-Request is sent, the value MUST be STOP_RECORD. 5646 If the authorization server has directed interim accounting to be 5647 enabled, the Diameter client MUST produce additional records between 5648 the START_RECORD and STOP_RECORD, marked INTERIM_RECORD. The 5649 production of these records is directed by Acct-Interim-Interval as 5650 well as any re-authentication or re-authorization of the session. 5651 The Diameter client MUST overwrite any previous interim accounting 5652 records that are locally stored for delivery, if a new record is 5653 being generated for the same session. This ensures that only one 5654 pending interim record can exist on an access device for any given 5655 session. 5657 A particular value of Accounting-Sub-Session-Id MUST appear only in 5658 one sequence of accounting records from a DIAMETER client, except for 5659 the purposes of retransmission. The one sequence that is sent MUST 5660 be either one record with Accounting-Record-Type AVP set to the value 5661 EVENT_RECORD, or several records starting with one having the value 5662 START_RECORD, followed by zero or more INTERIM_RECORD and a single 5663 STOP_RECORD. A particular Diameter application specification MUST 5664 define the type of sequences that MUST be used. 5666 9.6. Correlation of Accounting Records 5668 The Diameter protocol's Session-Id AVP, which is globally unique (see 5669 Section 8.8), is used during the authorization phase to identify a 5670 particular session. Services that do not require any authorization 5671 still use the Session-Id AVP to identify sessions. Accounting 5672 messages MAY use a different Session-Id from that sent in 5673 authorization messages. Specific applications MAY require different 5674 a Session-ID for accounting messages. 5676 However, there are certain applications that require multiple 5677 accounting sub-sessions. Such applications would send messages with 5678 a constant Session-Id AVP, but a different Accounting-Sub-Session-Id 5679 AVP. In these cases, correlation is performed using the Session-Id. 5680 It is important to note that receiving a STOP_RECORD with no 5681 Accounting-Sub-Session-Id AVP when sub-sessions were originally used 5682 in the START_RECORD messages implies that all sub-sessions are 5683 terminated. 5685 Furthermore, there are certain applications where a user receives 5686 service from different access devices (e.g., Mobile IPv4), each with 5687 their own unique Session-Id. In such cases, the Acct-Multi-Session- 5688 Id AVP is used for correlation. During authorization, a server that 5689 determines that a request is for an existing session SHOULD include 5690 the Acct-Multi-Session-Id AVP, which the access device MUST include 5691 in all subsequent accounting messages. 5693 The Acct-Multi-Session-Id AVP MAY include the value of the original 5694 Session-Id. It's contents are implementation specific, but MUST be 5695 globally unique across other Acct-Multi-Session-Id, and MUST NOT 5696 change during the life of a session. 5698 A Diameter application document MUST define the exact concept of a 5699 session that is being accounted, and MAY define the concept of a 5700 multi-session. For instance, the NASREQ DIAMETER application treats 5701 a single PPP connection to a Network Access Server as one session, 5702 and a set of Multilink PPP sessions as one multi-session. 5704 9.7. Accounting Command-Codes 5706 This section defines Command-Code values that MUST be supported by 5707 all Diameter implementations that provide Accounting services. 5709 9.7.1. Accounting-Request 5711 The Accounting-Request (ACR) command, indicated by the Command-Code 5712 field set to 271 and the Command Flags' 'R' bit set, is sent by a 5713 Diameter node, acting as a client, in order to exchange accounting 5714 information with a peer. 5716 One of Acct-Application-Id and Vendor-Specific-Application-Id AVPs 5717 MUST be present. If the Vendor-Specific-Application-Id grouped AVP 5718 is present, it MUST include an Acct-Application-Id AVP. 5720 The AVP listed below SHOULD include service specific accounting AVPs, 5721 as described in Section 9.3. 5723 Message Format 5725 ::= < Diameter Header: 271, REQ, PXY > 5726 < Session-Id > 5727 { Origin-Host } 5728 { Origin-Realm } 5729 { Destination-Realm } 5730 { Accounting-Record-Type } 5731 { Accounting-Record-Number } 5732 [ Acct-Application-Id ] 5733 [ Vendor-Specific-Application-Id ] 5734 [ User-Name ] 5735 [ Destination-Host ] 5736 [ Accounting-Sub-Session-Id ] 5737 [ Acct-Session-Id ] 5738 [ Acct-Multi-Session-Id ] 5739 [ Acct-Interim-Interval ] 5740 [ Accounting-Realtime-Required ] 5741 [ Origin-State-Id ] 5742 [ Event-Timestamp ] 5743 * [ Proxy-Info ] 5744 * [ Route-Record ] 5745 * [ AVP ] 5747 9.7.2. Accounting-Answer 5749 The Accounting-Answer (ACA) command, indicated by the Command-Code 5750 field set to 271 and the Command Flags' 'R' bit cleared, is used to 5751 acknowledge an Accounting-Request command. The Accounting-Answer 5752 command contains the same Session-Id as the corresponding request. 5754 Only the target Diameter Server, known as the home Diameter Server, 5755 SHOULD respond with the Accounting-Answer command. 5757 One of Acct-Application-Id and Vendor-Specific-Application-Id AVPs 5758 MUST be present. If the Vendor-Specific-Application-Id grouped AVP 5759 is present, it MUST contain an Acct-Application-Id AVP. 5761 The AVP listed below SHOULD include service specific accounting AVPs, 5762 as described in Section 9.3. 5764 Message Format 5766 ::= < Diameter Header: 271, PXY > 5767 < Session-Id > 5768 { Result-Code } 5769 { Origin-Host } 5770 { Origin-Realm } 5771 { Accounting-Record-Type } 5772 { Accounting-Record-Number } 5773 [ Acct-Application-Id ] 5774 [ Vendor-Specific-Application-Id ] 5775 [ User-Name ] 5776 [ Accounting-Sub-Session-Id ] 5777 [ Acct-Session-Id ] 5778 [ Acct-Multi-Session-Id ] 5779 [ Error-Message ] 5780 [ Error-Reporting-Host ] 5781 [ Failed-AVP ] 5782 [ Acct-Interim-Interval ] 5783 [ Accounting-Realtime-Required ] 5784 [ Origin-State-Id ] 5785 [ Event-Timestamp ] 5786 * [ Proxy-Info ] 5787 * [ AVP ] 5789 9.8. Accounting AVPs 5791 This section contains AVPs that describe accounting usage information 5792 related to a specific session. 5794 9.8.1. Accounting-Record-Type AVP 5796 The Accounting-Record-Type AVP (AVP Code 480) is of type Enumerated 5797 and contains the type of accounting record being sent. The following 5798 values are currently defined for the Accounting-Record-Type AVP: 5800 EVENT_RECORD 1 5802 An Accounting Event Record is used to indicate that a one-time 5803 event has occurred (meaning that the start and end of the event 5804 are simultaneous). This record contains all information relevant 5805 to the service, and is the only record of the service. 5807 START_RECORD 2 5809 An Accounting Start, Interim, and Stop Records are used to 5810 indicate that a service of a measurable length has been given. An 5811 Accounting Start Record is used to initiate an accounting session, 5812 and contains accounting information that is relevant to the 5813 initiation of the session. 5815 INTERIM_RECORD 3 5817 An Interim Accounting Record contains cumulative accounting 5818 information for an existing accounting session. Interim 5819 Accounting Records SHOULD be sent every time a re-authentication 5820 or re-authorization occurs. Further, additional interim record 5821 triggers MAY be defined by application-specific Diameter 5822 applications. The selection of whether to use INTERIM_RECORD 5823 records is done by the Acct-Interim-Interval AVP. 5825 STOP_RECORD 4 5827 An Accounting Stop Record is sent to terminate an accounting 5828 session and contains cumulative accounting information relevant to 5829 the existing session. 5831 9.8.2. Acct-Interim-Interval AVP 5833 The Acct-Interim-Interval AVP (AVP Code 85) is of type Unsigned32 and 5834 is sent from the Diameter home authorization server to the Diameter 5835 client. The client uses information in this AVP to decide how and 5836 when to produce accounting records. With different values in this 5837 AVP, service sessions can result in one, two, or two+N accounting 5838 records, based on the needs of the home-organization. The following 5839 accounting record production behavior is directed by the inclusion of 5840 this AVP: 5842 1. The omission of the Acct-Interim-Interval AVP or its inclusion 5843 with Value field set to 0 means that EVENT_RECORD, START_RECORD, 5844 and STOP_RECORD are produced, as appropriate for the service. 5846 2. The inclusion of the AVP with Value field set to a non-zero value 5847 means that INTERIM_RECORD records MUST be produced between the 5848 START_RECORD and STOP_RECORD records. The Value field of this 5849 AVP is the nominal interval between these records in seconds. 5851 The Diameter node that originates the accounting information, 5852 known as the client, MUST produce the first INTERIM_RECORD record 5853 roughly at the time when this nominal interval has elapsed from 5854 the START_RECORD, the next one again as the interval has elapsed 5855 once more, and so on until the session ends and a STOP_RECORD 5856 record is produced. 5858 The client MUST ensure that the interim record production times 5859 are randomized so that large accounting message storms are not 5860 created either among records or around a common service start 5861 time. 5863 9.8.3. Accounting-Record-Number AVP 5865 The Accounting-Record-Number AVP (AVP Code 485) is of type Unsigned32 5866 and identifies this record within one session. As Session-Id AVPs 5867 are globally unique, the combination of Session-Id and Accounting- 5868 Record-Number AVPs is also globally unique, and can be used in 5869 matching accounting records with confirmations. An easy way to 5870 produce unique numbers is to set the value to 0 for records of type 5871 EVENT_RECORD and START_RECORD, and set the value to 1 for the first 5872 INTERIM_RECORD, 2 for the second, and so on until the value for 5873 STOP_RECORD is one more than for the last INTERIM_RECORD. 5875 9.8.4. Acct-Session-Id AVP 5877 The Acct-Session-Id AVP (AVP Code 44) is of type OctetString is only 5878 used when RADIUS/Diameter translation occurs. This AVP contains the 5879 contents of the RADIUS Acct-Session-Id attribute. 5881 9.8.5. Acct-Multi-Session-Id AVP 5883 The Acct-Multi-Session-Id AVP (AVP Code 50) is of type UTF8String, 5884 following the format specified in Section 8.8. The Acct-Multi- 5885 Session-Id AVP is used to link together multiple related accounting 5886 sessions, where each session would have a unique Session-Id, but the 5887 same Acct-Multi-Session-Id AVP. This AVP MAY be returned by the 5888 Diameter server in an authorization answer, and MUST be used in all 5889 accounting messages for the given session. 5891 9.8.6. Accounting-Sub-Session-Id AVP 5893 The Accounting-Sub-Session-Id AVP (AVP Code 287) is of type 5894 Unsigned64 and contains the accounting sub-session identifier. The 5895 combination of the Session-Id and this AVP MUST be unique per sub- 5896 session, and the value of this AVP MUST be monotonically increased by 5897 one for all new sub-sessions. The absence of this AVP implies no 5898 sub-sessions are in use, with the exception of an Accounting-Request 5899 whose Accounting-Record-Type is set to STOP_RECORD. A STOP_RECORD 5900 message with no Accounting-Sub-Session-Id AVP present will signal the 5901 termination of all sub-sessions for a given Session-Id. 5903 9.8.7. Accounting-Realtime-Required AVP 5905 The Accounting-Realtime-Required AVP (AVP Code 483) is of type 5906 Enumerated and is sent from the Diameter home authorization server to 5907 the Diameter client or in the Accounting-Answer from the accounting 5908 server. The client uses information in this AVP to decide what to do 5909 if the sending of accounting records to the accounting server has 5910 been temporarily prevented due to, for instance, a network problem. 5912 DELIVER_AND_GRANT 1 5914 The AVP with Value field set to DELIVER_AND_GRANT means that the 5915 service MUST only be granted as long as there is a connection to 5916 an accounting server. Note that the set of alternative accounting 5917 servers are treated as one server in this sense. Having to move 5918 the accounting record stream to a backup server is not a reason to 5919 discontinue the service to the user. 5921 GRANT_AND_STORE 2 5923 The AVP with Value field set to GRANT_AND_STORE means that service 5924 SHOULD be granted if there is a connection, or as long as records 5925 can still be stored as described in Section 9.4. 5927 This is the default behavior if the AVP isn't included in the 5928 reply from the authorization server. 5930 GRANT_AND_LOSE 3 5932 The AVP with Value field set to GRANT_AND_LOSE means that service 5933 SHOULD be granted even if the records can not be delivered or 5934 stored. 5936 10. AVP Occurrence Table 5938 The following tables presents the AVPs defined in this document, and 5939 specifies in which Diameter messages they MAY be present or not. 5940 AVPs that occur only inside a Grouped AVP are not shown in this 5941 table. 5943 The table uses the following symbols: 5945 0 The AVP MUST NOT be present in the message. 5947 0+ Zero or more instances of the AVP MAY be present in the 5948 message. 5950 0-1 Zero or one instance of the AVP MAY be present in the message. 5951 It is considered an error if there are more than one instance of 5952 the AVP. 5954 1 One instance of the AVP MUST be present in the message. 5956 1+ At least one instance of the AVP MUST be present in the 5957 message. 5959 10.1. Base Protocol Command AVP Table 5961 The table in this section is limited to the non-accounting Command 5962 Codes defined in this specification. 5964 +-----------------------------------------------+ 5965 | Command-Code | 5966 +---+---+---+---+---+---+---+---+---+---+---+---+ 5967 Attribute Name |CER|CEA|DPR|DPA|DWR|DWA|RAR|RAA|ASR|ASA|STR|STA| 5968 --------------------+---+---+---+---+---+---+---+---+---+---+---+---+ 5969 Acct-Interim- |0 |0 |0 |0 |0 |0 |0-1|0 |0 |0 |0 |0 | 5970 Interval | | | | | | | | | | | | | 5971 Accounting-Realtime-|0 |0 |0 |0 |0 |0 |0-1|0 |0 |0 |0 |0 | 5972 Required | | | | | | | | | | | | | 5973 Acct-Application-Id |0+ |0+ |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 | 5974 Auth-Application-Id |0+ |0+ |0 |0 |0 |0 |1 |0 |1 |0 |1 |0 | 5975 Auth-Grace-Period |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 | 5976 Auth-Request-Type |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 | 5977 Auth-Session-State |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 | 5978 Authorization- |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 | 5979 Lifetime | | | | | | | | | | | | | 5980 Class |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0+ |0+ | 5981 Destination-Host |0 |0 |0 |0 |0 |0 |1 |0 |1 |0 |0-1|0 | 5982 Destination-Realm |0 |0 |0 |0 |0 |0 |1 |0 |1 |0 |1 |0 | 5983 Disconnect-Cause |0 |0 |1 |0 |0 |0 |0 |0 |0 |0 |0 |0 | 5984 Error-Message |0 |0-1|0 |0-1|0 |0-1|0 |0-1|0 |0-1|0 |0-1| 5985 Error-Reporting-Host|0 |0 |0 |0 |0 |0 |0 |0-1|0 |0-1|0 |0-1| 5986 Failed-AVP |0 |0+ |0 |0+ |0 |0+ |0 |0+ |0 |0+ |0 |0+ | 5987 Firmware-Revision |0-1|0-1|0 |0 |0 |0 |0 |0 |0 |0 |0 |0 | 5988 Host-IP-Address |1+ |1+ |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 | 5989 Inband-Security-Id |0+ |0+ |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 | 5990 Multi-Round-Time-Out|0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 | 5991 Origin-Host |1 |1 |1 |1 |1 |1 |1 |1 |1 |1 |1 |1 | 5992 Origin-Realm |1 |1 |1 |1 |1 |1 |1 |1 |1 |1 |1 |1 | 5993 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| 5994 Product-Name |1 |1 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 | 5995 Proxy-Info |0 |0 |0 |0 |0 |0 |0+ |0+ |0+ |0+ |0+ |0+ | 5996 Redirect-Host |0 |0 |0 |0 |0 |0 |0 |0+ |0 |0+ |0 |0+ | 5997 Redirect-Host-Usage |0 |0 |0 |0 |0 |0 |0 |0-1|0 |0-1|0 |0-1| 5998 Redirect-Max-Cache- |0 |0 |0 |0 |0 |0 |0 |0-1|0 |0-1|0 |0-1| 5999 Time | | | | | | | | | | | | | 6000 Result-Code |0 |1 |0 |1 |0 |1 |0 |1 |0 |1 |0 |1 | 6001 Re-Auth-Request-Type|0 |0 |0 |0 |0 |0 |1 |0 |0 |0 |0 |0 | 6002 Route-Record |0 |0 |0 |0 |0 |0 |0+ |0 |0+ |0 |0+ |0 | 6003 Session-Binding |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 | 6004 Session-Id |0 |0 |0 |0 |0 |0 |1 |1 |1 |1 |1 |1 | 6005 Session-Server- |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 | 6006 Failover | | | | | | | | | | | | | 6007 Session-Timeout |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 | 6008 Supported-Vendor-Id |0+ |0+ |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 | 6009 Termination-Cause |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |1 |0 | 6010 User-Name |0 |0 |0 |0 |0 |0 |0-1|0-1|0-1|0-1|0-1|0-1| 6011 Vendor-Id |1 |1 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 | 6012 Vendor-Specific- |0+ |0+ |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 | 6013 Application-Id | | | | | | | | | | | | | 6014 --------------------+---+---+---+---+---+---+---+---+---+---+---+---+ 6016 10.2. Accounting AVP Table 6018 The table in this section is used to represent which AVPs defined in 6019 this document are to be present in the Accounting messages. These 6020 AVP occurrence requirements are guidelines, which may be expanded, 6021 and/or overridden by application-specific requirements in the 6022 Diameter applications documents. 6024 +-----------+ 6025 | Command | 6026 | Code | 6027 +-----+-----+ 6028 Attribute Name | ACR | ACA | 6029 ------------------------------+-----+-----+ 6030 Acct-Interim-Interval | 0-1 | 0-1 | 6031 Acct-Multi-Session-Id | 0-1 | 0-1 | 6032 Accounting-Record-Number | 1 | 1 | 6033 Accounting-Record-Type | 1 | 1 | 6034 Acct-Session-Id | 0-1 | 0-1 | 6035 Accounting-Sub-Session-Id | 0-1 | 0-1 | 6036 Accounting-Realtime-Required | 0-1 | 0-1 | 6037 Acct-Application-Id | 0-1 | 0-1 | 6038 Auth-Application-Id | 0 | 0 | 6039 Class | 0+ | 0+ | 6040 Destination-Host | 0-1 | 0 | 6041 Destination-Realm | 1 | 0 | 6042 Error-Reporting-Host | 0 | 0+ | 6043 Event-Timestamp | 0-1 | 0-1 | 6044 Origin-Host | 1 | 1 | 6045 Origin-Realm | 1 | 1 | 6046 Proxy-Info | 0+ | 0+ | 6047 Route-Record | 0+ | 0 | 6048 Result-Code | 0 | 1 | 6049 Session-Id | 1 | 1 | 6050 Termination-Cause | 0 | 0 | 6051 User-Name | 0-1 | 0-1 | 6052 Vendor-Specific-Application-Id| 0-1 | 0-1 | 6053 ------------------------------+-----+-----+ 6055 11. IANA Considerations 6057 This section provides guidance to the Internet Assigned Numbers 6058 Authority (IANA) regarding registration of values related to the 6059 Diameter protocol, in accordance with BCP 26 [RFC2434]. The 6060 following policies are used here with the meanings defined in BCP 26: 6061 "Private Use", "First Come First Served", "Expert Review", 6062 "Specification Required", "IETF Review", "Standards Action". 6064 This section explains the criteria to be used by the IANA for 6065 assignment of numbers within namespaces defined within this document. 6067 Diameter is not intended as a general purpose protocol, and 6068 allocations SHOULD NOT be made for purposes unrelated to 6069 authentication, authorization or accounting. 6071 For registration requests where a Designated Expert should be 6072 consulted, the responsible IESG area director should appoint the 6073 Designated Expert. For Designated Expert with Specification 6074 Required, the request is posted to the DIME WG mailing list (or, if 6075 it has been disbanded, a successor designated by the Area Director) 6076 for comment and review, and MUST include a pointer to a public 6077 specification. Before a period of 30 days has passed, the Designated 6078 Expert will either approve or deny the registration request and 6079 publish a notice of the decision to the DIME WG mailing list or its 6080 successor. A denial notice MUST be justified by an explanation and, 6081 in the cases where it is possible, concrete suggestions on how the 6082 request can be modified so as to become acceptable. 6084 11.1. AVP Header 6086 As defined in Section 4, the AVP header contains three fields that 6087 requires IANA namespace management; the AVP Code, Vendor-ID and Flags 6088 field. 6090 11.1.1. AVP Codes 6092 The AVP Code namespace is used to identify attributes. There are 6093 multiple namespaces. Vendors can have their own AVP Codes namespace 6094 which will be identified by their Vendor-ID (also known as 6095 Enterprise-Number) and they control the assignments of their vendor- 6096 specific AVP codes within their own namespace. The absence of a 6097 Vendor-ID or a Vendor-ID value of zero (0) identifies the IETF IANA 6098 controlled AVP Codes namespace. The AVP Codes and sometimes also 6099 possible values in an AVP are controlled and maintained by IANA. 6101 AVP Code 0 is not used. AVP Codes 1-255 are managed separately as 6102 RADIUS Attribute Types [RADTYPE]. This document defines the AVP 6103 Codes 257-274, 276-285, 287, 291-300, 480, 483 and 485-486. See 6104 Section 4.5 for the assignment of the namespace in this 6105 specification. 6107 AVPs may be allocated following Designated Expert with Specification 6108 Required [RFC2434]. Release of blocks of AVPs (more than 3 at a time 6109 for a given purpose) should require IETF Review. 6111 Note that Diameter defines a mechanism for Vendor-Specific AVPs, 6112 where the Vendor-Id field in the AVP header is set to a non-zero 6113 value. Vendor-Specific AVPs codes are for Private Use and should be 6114 encouraged instead of allocation of global attribute types, for 6115 functions specific only to one vendor's implementation of Diameter, 6116 where no interoperability is deemed useful. Where a Vendor-Specific 6117 AVP is implemented by more than one vendor, allocation of global AVPs 6118 should be encouraged instead. 6120 11.1.2. AVP Flags 6122 There are 8 bits in the AVP Flags field of the AVP header, defined in 6123 Section 4. This document assigns bit 0 ('V'endor Specific), bit 1 6124 ('M'andatory) and bit 2 ('P'rotected). The remaining bits should 6125 only be assigned via a Standards Action [RFC2434]. 6127 11.2. Diameter Header 6129 As defined in Section 3, the Diameter header contains two fields that 6130 require IANA namespace management; Command Code and Command Flags. 6132 11.2.1. Command Codes 6134 The Command Code namespace is used to identify Diameter commands. 6135 The values 0-255 (0x00-0xff) are reserved for RADIUS backward 6136 compatibility, and are defined as "RADIUS Packet Type Codes" in 6137 [RADTYPE]. Values 256 - 8,388,607 (0x100 to 0x7fffff) are for 6138 permanent, standard commands, allocated by IETF Review [RFC2434]. 6139 This document defines the Command Codes 257, 258, 271, 274-275, 280 6140 and 282. See Section 3.1 for the assignment of the namespace in this 6141 specification. 6143 The values 8,388,608 - 16,777,213 (0x800000 - 0xfffffd) are reserved 6144 for vendor-specific command codes, to be allocated on a First Come, 6145 First Served basis by IANA [RFC2434]. The request to IANA for a 6146 Vendor-Specific Command Code SHOULD include a reference to a publicly 6147 available specification which documents the command in sufficient 6148 detail to aid in interoperability between independent 6149 implementations. If the specification cannot be made publicly 6150 available, the request for a vendor-specific command code MUST 6151 include the contact information of persons and/or entities 6152 responsible for authoring and maintaining the command. 6154 The values 16,777,214 and 16,777,215 (hexadecimal values 0xfffffe - 6155 0xffffff) are reserved for experimental commands. As these codes are 6156 only for experimental and testing purposes, no guarantee is made for 6157 interoperability between Diameter peers using experimental commands, 6158 as outlined in [IANA-EXP]. 6160 11.2.2. Command Flags 6162 There are eight bits in the Command Flags field of the Diameter 6163 header. This document assigns bit 0 ('R'equest), bit 1 ('P'roxy), 6164 bit 2 ('E'rror) and bit 3 ('T'). Bits 4 through 7 MUST only be 6165 assigned via a Standards Action [RFC2434]. 6167 11.3. Application Identifiers 6169 As defined in Section 2.4, the Application Id is used to identify a 6170 specific Diameter Application. There are standards-track Application 6171 Ids and vendor specific Application Ids. 6173 IANA [RFC2434] has assigned the range 0x00000001 to 0x00ffffff for 6174 standards-track applications; and 0x01000000 - 0xfffffffe for vendor 6175 specific applications, on a first-come, first-served basis. The 6176 following values are allocated. 6178 Diameter Common Messages 0 6179 NASREQ 1 [RFC4005] 6180 Mobile-IP 2 [RFC4004] 6181 Diameter Base Accounting 3 6182 Relay 0xffffffff 6184 Assignment of standards-track Application Ids are by Designated 6185 Expert with Specification Required [RFC2434]. 6187 Both Auth-Application-Id and Acct-Application-Id AVPs use the same 6188 Application Id space. A Diameter node advertising itself as a relay 6189 agent MUST set either Application-Id or Acct-Application-Id to 6190 0xffffffff. 6192 Vendor-Specific Application Ids, are for Private Use. Vendor-Specific 6193 Application Ids are assigned on a First Come, First Served basis by 6194 IANA. 6196 11.4. AVP Values 6198 Certain AVPs in Diameter define a list of values with various 6199 meanings. For attributes other than those specified in this section, 6200 adding additional values to the list can be done on a First Come, 6201 First Served basis by IANA. 6203 11.4.1. Result-Code AVP Values 6205 As defined in Section 7.1, the Result-Code AVP (AVP Code 268) defines 6206 the values 1001, 2001-2002, 3001-3012, 4001-4003 and 5001-5021. 6208 All remaining values are available for assignment via IETF Review 6209 [RFC2434]. 6211 11.4.2. Accounting-Record-Type AVP Values 6213 As defined in Section 9.8.1, the Accounting-Record-Type AVP (AVP Code 6214 480) defines the values 1-4. All remaining values are available for 6215 assignment via IETF Review [RFC2434]. 6217 11.4.3. Termination-Cause AVP Values 6219 As defined in Section 8.15, the Termination-Cause AVP (AVP Code 295) 6220 defines the values 1-8. All remaining values are available for 6221 assignment via IETF Review [RFC2434]. 6223 11.4.4. Redirect-Host-Usage AVP Values 6225 As defined in Section 6.13, the Redirect-Host-Usage AVP (AVP Code 6226 261) defines the values 0-5. All remaining values are available for 6227 assignment via IETF Review [RFC2434]. 6229 11.4.5. Session-Server-Failover AVP Values 6231 As defined in Section 8.18, the Session-Server-Failover AVP (AVP Code 6232 271) defines the values 0-3. All remaining values are available for 6233 assignment via IETF Review [RFC2434]. 6235 11.4.6. Session-Binding AVP Values 6237 As defined in Section 8.17, the Session-Binding AVP (AVP Code 270) 6238 defines the bits 1-4. All remaining bits are available for 6239 assignment via IETF Review [RFC2434]. 6241 11.4.7. Disconnect-Cause AVP Values 6243 As defined in Section 5.4.3, the Disconnect-Cause AVP (AVP Code 273) 6244 defines the values 0-2. All remaining values are available for 6245 assignment via IETF Review [RFC2434]. 6247 11.4.8. Auth-Request-Type AVP Values 6249 As defined in Section 8.7, the Auth-Request-Type AVP (AVP Code 274) 6250 defines the values 1-3. All remaining values are available for 6251 assignment via IETF Review [RFC2434]. 6253 11.4.9. Auth-Session-State AVP Values 6255 As defined in Section 8.11, the Auth-Session-State AVP (AVP Code 277) 6256 defines the values 0-1. All remaining values are available for 6257 assignment via IETF Review [RFC2434]. 6259 11.4.10. Re-Auth-Request-Type AVP Values 6261 As defined in Section 8.12, the Re-Auth-Request-Type AVP (AVP Code 6262 285) defines the values 0-1. All remaining values are available for 6263 assignment via IETF Review [RFC2434]. 6265 11.4.11. Accounting-Realtime-Required AVP Values 6267 As defined in Section 9.8.7, the Accounting-Realtime-Required AVP 6268 (AVP Code 483) defines the values 1-3. All remaining values are 6269 available for assignment via IETF Review [RFC2434]. 6271 11.4.12. Inband-Security-Id AVP (code 299) 6273 As defined in Section 6.10, the Inband-Security-Id AVP (AVP Code 299) 6274 defines the values 0-1. All remaining values are available for 6275 assignment via IETF Review [RFC2434]. 6277 11.5. Diameter TCP/SCTP Port Numbers 6279 The IANA has assigned TCP and SCTP port number 3868 to Diameter. 6281 11.6. NAPTR Service Fields 6283 The registration in the RFC MUST include the following information: 6285 Service Field: The service field being registered. An example for a 6286 new fictitious transport protocol called NCTP might be "AAA+D2N". 6288 Protocol: The specific transport protocol associated with that 6289 service field. This MUST include the name and acronym for the 6290 protocol, along with reference to a document that describes the 6291 transport protocol. For example - "New Connectionless Transport 6292 Protocol (NCTP), RFC XYZ". 6294 Name and Contact Information: The name, address, email address and 6295 telephone number for the person performing the registration. 6297 The following values have been placed into the registry: 6299 Services Field Protocol 6301 AAA+D2T TCP 6302 AAA+D2S SCTP 6304 12. Diameter protocol related configurable parameters 6306 This section contains the configurable parameters that are found 6307 throughout this document: 6309 Diameter Peer 6311 A Diameter entity MAY communicate with peers that are statically 6312 configured. A statically configured Diameter peer would require 6313 that either the IP address or the fully qualified domain name 6314 (FQDN) be supplied, which would then be used to resolve through 6315 DNS. 6317 Routing Table 6319 A Diameter proxy server routes messages based on the realm portion 6320 of a Network Access Identifier (NAI). The server MUST have a 6321 table of Realm Names, and the address of the peer to which the 6322 message must be forwarded to. The routing table MAY also include 6323 a "default route", which is typically used for all messages that 6324 cannot be locally processed. 6326 Tc timer 6328 The Tc timer controls the frequency that transport connection 6329 attempts are done to a peer with whom no active transport 6330 connection exists. The recommended value is 30 seconds. 6332 13. Security Considerations 6334 The Diameter base protocol messages SHOULD be secured by using TLS 6335 [RFC4346]. Additional security measures that are transparent to and 6336 independent of Diameter, such as IPSec [RFC4301], can also be 6337 deployed to secure connections between peers. 6339 During deployment, connections between Diameter nodes SHOULD be 6340 protected by TLS. All Diameter base protocol implementations MUST 6341 support the use of TLS. The Diameter protocol MUST NOT be used 6342 without any security mechanism. 6344 If a Diameter connection is to be protected via TLS, then the CER/CEA 6345 exchange MUST include an Inband-Security-ID AVP with a value of TLS. 6346 For TLS usage, a TLS handshake will begin when both ends are in the 6347 open state, after completion of the CER/CEA exchange. If the TLS 6348 handshake is successful, all further messages will be sent via TLS. 6349 If the handshake fails, both ends move to the closed state. See 6350 Sections 13.1 for more details. 6352 13.1. TLS Usage 6354 A Diameter node that initiates a connection to another Diameter node 6355 acts as a TLS client according to [RFC4346], and a Diameter node that 6356 accepts a connection acts as a TLS server. Diameter nodes 6357 implementing TLS for security MUST mutually authenticate as part of 6358 TLS session establishment. In order to ensure mutual authentication, 6359 the Diameter node acting as TLS server MUST request a certificate 6360 from the Diameter node acting as TLS client, and the Diameter node 6361 acting as TLS client MUST be prepared to supply a certificate on 6362 request. 6364 Diameter nodes MUST be able to negotiate the following TLS cipher 6365 suites: 6367 TLS_RSA_WITH_RC4_128_MD5 6368 TLS_RSA_WITH_RC4_128_SHA 6369 TLS_RSA_WITH_3DES_EDE_CBC_SHA 6371 Diameter nodes SHOULD be able to negotiate the following TLS cipher 6372 suite: 6374 TLS_RSA_WITH_AES_128_CBC_SHA 6376 Diameter nodes MAY negotiate other TLS cipher suites. 6378 Upon receiving the peers certificate, Diameter nodes SHOULD further 6379 validate the identity of the peer by matching the received Origin- 6380 Host and/or Origin-Realm in the CER and CEA exchange against the 6381 content of the peers certificate. Diameter peer hostname and/or 6382 realm validation can be performed in the following order: 6384 o If one or more 'Subject Alternate Name (subjectAltName)' extension 6385 of type dNSName is present in the certificate (See [RFC3280]), 6386 then the Origin-Host value can be used to find a matching 6387 extension. 6389 o If there are no matches found, then the Origin-Realm value can be 6390 used to find a matching subjectAltName extension. 6392 o Otherwise, the Origin-Host value should be found within the 6393 'Common Name (CN)' field in the Subject field of the certificate 6394 (See [RFC3280]). 6396 Identity validation MAY be omitted by a Diameter node if the 6397 information contained in the certificate cannot be correlated or 6398 mapped to the Origin-Host and Origin-Realm presented by a peer. 6399 However, the Diameter node SHOULD have external information or other 6400 means to validate the identity of a peer. 6402 13.2. Peer-to-Peer Considerations 6404 As with any peer-to-peer protocol, proper configuration of the trust 6405 model within a Diameter peer is essential to security. When 6406 certificates are used, it is necessary to configure the root 6407 certificate authorities trusted by the Diameter peer. These root CAs 6408 are likely to be unique to Diameter usage and distinct from the root 6409 CAs that might be trusted for other purposes such as Web browsing. 6410 In general, it is expected that those root CAs will be configured so 6411 as to reflect the business relationships between the organization 6412 hosting the Diameter peer and other organizations. As a result, a 6413 Diameter peer will typically not be configured to allow connectivity 6414 with any arbitrary peer. With certificate authentication, Diameter 6415 peers may not be known beforehand and therefore peer discovery may be 6416 required. 6418 14. References 6420 14.1. Normative References 6422 [FLOATPOINT] 6423 Institute of Electrical and Electronics Engineers, "IEEE 6424 Standard for Binary Floating-Point Arithmetic, ANSI/IEEE 6425 Standard 754-1985", August 1985. 6427 [IANAADFAM] 6428 IANA,, "Address Family Numbers", 6429 http://www.iana.org/assignments/address-family-numbers. 6431 [RADTYPE] IANA,, "RADIUS Types", 6432 http://www.iana.org/assignments/radius-types. 6434 [RFC791] Postel, J., "Internet Protocol", RFC 791, September 1981. 6436 [RFC793] Postel, J., "Transmission Control Protocol", RFC 793, 6437 January 1981. 6439 [RFC3539] Aboba, B. and J. Wood, "Authentication, Authorization and 6440 Accounting (AAA) Transport Profile", RFC 3539, June 2003. 6442 [RFC4004] Calhoun, P., Johansson, T., Perkins, C., Hiller, T., and 6443 P. McCann, "Diameter Mobile IPv4 Application", RFC 4004, 6444 August 2005. 6446 [RFC4005] Calhoun, P., Zorn, G., Spence, D., and D. Mitton, 6447 "Diameter Network Access Server Application", RFC 4005, 6448 August 2005. 6450 [RFC4006] Hakala, H., Mattila, L., Koskinen, J-P., Stura, M., and J. 6451 Loughney, "Diameter Credit-Control Application", RFC 4006, 6452 August 2005. 6454 [RFC4072] Eronen, P., Hiller, T., and G. Zorn, "Diameter Extensible 6455 Authentication Protocol (EAP) Application", RFC 4072, 6456 August 2005. 6458 [RFC4740] Garcia-Martin, M., Belinchon, M., Pallares-Lopez, M., 6459 Canales-Valenzuela, C., and K. Tammi, "Diameter Session 6460 Initiation Protocol (SIP) Application", RFC 4740, 6461 November 2006. 6463 [RFC4234] Crocker, D., Ed. and P. Overell, "Augmented BNF for Syntax 6464 Specifications: ABNF", RFC 4234, October 2005. 6466 [RFC3588] Calhoun, P., Loughney, J., Guttman, E., Zorn, G., and J. 6467 Arkko, "Diameter Base Protocol", RFC 3588, September 2003. 6469 [RFC2434] Narten, T. and H. Alvestrand, "Guidelines for Writing an 6470 IANA Considerations Section in RFCs", BCP 26, RFC 2434, 6471 October 1998. 6473 [RFC4306] Kaufman, C., "Internet Key Exchange (IKEv2) Protocol", 6474 RFC 4306, December 2005. 6476 [RFC4291] Hinden, R. and S. Deering, "IP Version 6 Addressing 6477 Architecture", RFC 4291, February 2006. 6479 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 6480 Requirement Levels", BCP 14, RFC 2119, March 1997. 6482 [RFC4282] Aboba, B., Beadles, M., Arkko, J., and P. Eronen, "The 6483 Network Access Identifier", RFC 4282, December 2005. 6485 [RFC3403] Mealling, M., "Dynamic Delegation Discovery System (DDDS) 6486 Part Three: The Domain Name System (DNS) Database", 6487 RFC 3403, October 2002. 6489 [RFC3261] Rosenberg, J., Schulzrinne, H., Camarillo, G., Johnston, 6490 A., Peterson, J., Sparks, R., Handley, M., and E. 6491 Schooler, "SIP: Session Initiation Protocol", RFC 3261, 6492 June 2002. 6494 [RFC2960] Stewart, R., Xie, Q., Morneault, K., Sharp, C., 6495 Schwarzbauer, H., Taylor, T., Rytina, I., Kalla, M., 6496 Zhang, L., and V. Paxson, "Stream Control Transmission 6497 Protocol", RFC 2960, October 2000. 6499 [RFC4346] Dierks, T. and E. Rescorla, "The Transport Layer Security 6500 (TLS) Protocol Version 1.1", RFC 4346, April 2006. 6502 [RFC3986] Berners-Lee, T., Fielding, R., and L. Masinter, "Uniform 6503 Resource Identifier (URI): Generic Syntax", STD 66, 6504 RFC 3986, January 2005. 6506 [RFC3629] Yergeau, F., "UTF-8, a transformation format of ISO 6507 10646", STD 63, RFC 3629, November 2003. 6509 [RFC3280] Housley, R., Polk, W., Ford, W., and D. Solo, "Internet 6510 X.509 Public Key Infrastructure Certificate and 6511 Certificate Revocation List (CRL) Profile", RFC 3280, 6512 April 2002. 6514 [RFC3490] Faltstrom, P., Hoffman, P., and A. Costello, 6515 "Internationalizing Domain Names in Applications (IDNA)", 6516 RFC 3490, March 2003. 6518 [RFC3491] Hoffman, P. and M. Blanchet, "Nameprep: A Stringprep 6519 Profile for Internationalized Domain Names (IDN)", 6520 RFC 3491, March 2003. 6522 [RFC3492] Costello, A., "Punycode: A Bootstring encoding of Unicode 6523 for Internationalized Domain Names in Applications 6524 (IDNA)", RFC 3492, March 2003. 6526 14.2. Informational References 6528 [RFC2989] Aboba, B., Calhoun, P., Glass, S., Hiller, T., McCann, P., 6529 Shiino, H., Zorn, G., Dommety, G., C.Perkins, B.Patil, 6530 D.Mitton, S.Manning, M.Beadles, P.Walsh, X.Chen, 6531 S.Sivalingham, A.Hameed, M.Munson, S.Jacobs, B.Lim, 6532 B.Hirschman, R.Hsu, Y.Xu, E.Campell, S.Baba, and E.Jaques, 6533 "Criteria for Evaluating AAA Protocols for Network 6534 Access", RFC 2989, November 2000. 6536 [RFC2975] Aboba, B., Arkko, J., and D. Harrington, "Introduction to 6537 Accounting Management", RFC 2975, October 2000. 6539 [RFC3232] Reynolds, J., "Assigned Numbers: RFC 1700 is Replaced by 6540 an On-line Database", RFC 3232, January 2002. 6542 [RFC3576] Chiba, M., Dommety, G., Eklund, M., Mitton, D., and B. 6543 Aboba, "Dynamic Authorization Extensions to Remote 6544 Authentication Dial In User Service (RADIUS)", RFC 3576, 6545 July 2003. 6547 [RFC1661] Simpson, W., "The Point-to-Point Protocol (PPP)", STD 51, 6548 RFC 1661, July 1994. 6550 [RFC2866] Rigney, C., "RADIUS Accounting", RFC 2866, June 2000. 6552 [RFC2869] Rigney, C., Willats, W., and P. Calhoun, "RADIUS 6553 Extensions", RFC 2869, June 2000. 6555 [RFC2865] Rigney, C., Willens, S., Rubens, A., and W. Simpson, 6556 "Remote Authentication Dial In User Service (RADIUS)", 6557 RFC 2865, June 2000. 6559 [RFC3162] Aboba, B., Zorn, G., and D. Mitton, "RADIUS and IPv6", 6560 RFC 3162, August 2001. 6562 [RFC4301] Kent, S. and K. Seo, "Security Architecture for the 6563 Internet Protocol", RFC 4301, December 2005. 6565 [RFC4330] Mills, D., "Simple Network Time Protocol (SNTP) Version 4 6566 for IPv4, IPv6 and OSI", RFC 4330, January 2006. 6568 [RFC1492] Finseth, C., "An Access Control Protocol, Sometimes Called 6569 TACACS", RFC 1492, July 1993. 6571 [RFC4690] Klensin, J., Faltstrom, P., Karp, C., and IAB, "Review and 6572 Recommendations for Internationalized Domain Names 6573 (IDNs)", RFC 4690, September 2006. 6575 [IANA-EXP] 6576 Narten, T., "Assigning Experimental and Testing Numbers 6577 Considered Useful, Work in Progress.". 6579 Appendix A. Acknowledgements 6581 The authors would like to thank the following people that have 6582 provided proposals and contributions to this document: 6584 To Vishnu Ram and Satendra Gera for their contributions on 6585 Capabilities Updates, Predictive Loop Avoidance as well as many other 6586 technical proposals. To Tolga Asveren for his insights and 6587 contributions on almost all of the proposed solutions incorporated 6588 into this document. To Timothy Smith for helping on the Capabilities 6589 Updates and other topics. To Tony Zhang for providing fixes to loop 6590 holes on composing Failed-AVPs as well as many other issues and 6591 topics. To Jan Nordqvist for clearly stating the usage of 6592 Application Ids. To Anders Kristensen for providing needed technical 6593 opinions. To David Frascone for providing invaluable review of the 6594 document. To Mark Jones for providing clarifying text on vendor 6595 command codes and other vendor specific indicators. 6597 Special thanks also to people who have provided invaluable comments 6598 and inputs especially in resolving controversial issues: 6600 Glen Zorn, Yoshihiro Ohba, Marco Stura, and Pasi Eronen. 6602 Finally, we would like to thank the original authors of this 6603 document: 6605 Pat Calhoun, John Loughney, Jari Arkko, Erik Guttman and Glen Zorn. 6607 Their invaluable knowledge and experience has given us a robust and 6608 flexible AAA protocol that many people have seen great value in 6609 adopting. We greatly appreciate their support and stewardship for 6610 the continued improvements of Diameter as a protocol. We would also 6611 like to extend our gratitude to folks aside from the authors who have 6612 assisted and contributed to the original version of this document. 6613 Their efforts significantly contributed to the success of Diameter. 6615 Appendix B. NAPTR Example 6617 As an example, consider a client that wishes to resolve aaa:ex.com. 6618 The client performs a NAPTR query for that domain, and the following 6619 NAPTR records are returned: 6621 ;; order pref flags service regexp replacement 6622 IN NAPTR 50 50 "s" "AAA+D2S" "" _diameter._sctp.example.com 6623 IN NAPTR 100 50 "s" "AAA+D2T" "" _aaa._tcp.example.com 6625 This indicates that the server supports SCTP, and TCP, in that order. 6626 If the client supports over SCTP, SCTP will be used, targeted to a 6627 host determined by an SRV lookup of _diameter._sctp.ex.com. That 6628 lookup would return: 6630 ;; Priority Weight Port Target 6631 IN SRV 0 1 5060 server1.example.com 6632 IN SRV 0 2 5060 server2.example.com 6634 Appendix C. Duplicate Detection 6636 As described in Section 9.4, accounting record duplicate detection is 6637 based on session identifiers. Duplicates can appear for various 6638 reasons: 6640 o Failover to an alternate server. Where close to real-time 6641 performance is required, failover thresholds need to be kept low 6642 and this may lead to an increased likelihood of duplicates. 6643 Failover can occur at the client or within Diameter agents. 6645 o Failure of a client or agent after sending of a record from non- 6646 volatile memory, but prior to receipt of an application layer ACK 6647 and deletion of the record. record to be sent. This will result 6648 in retransmission of the record soon after the client or agent has 6649 rebooted. 6651 o Duplicates received from RADIUS gateways. Since the 6652 retransmission behavior of RADIUS is not defined within [RFC2865], 6653 the likelihood of duplication will vary according to the 6654 implementation. 6656 o Implementation problems and misconfiguration. 6658 The T flag is used as an indication of an application layer 6659 retransmission event, e.g., due to failover to an alternate server. 6660 It is defined only for request messages sent by Diameter clients or 6661 agents. For instance, after a reboot, a client may not know whether 6662 it has already tried to send the accounting records in its non- 6663 volatile memory before the reboot occurred. Diameter servers MAY use 6664 the T flag as an aid when processing requests and detecting duplicate 6665 messages. However, servers that do this MUST ensure that duplicates 6666 are found even when the first transmitted request arrives at the 6667 server after the retransmitted request. It can be used only in cases 6668 where no answer has been received from the Server for a request and 6669 the request is sent again, (e.g., due to a failover to an alternate 6670 peer, due to a recovered primary peer or due to a client re-sending a 6671 stored record from non-volatile memory such as after reboot of a 6672 client or agent). 6674 In some cases the Diameter accounting server can delay the duplicate 6675 detection and accounting record processing until a post-processing 6676 phase takes place. At that time records are likely to be sorted 6677 according to the included User-Name and duplicate elimination is easy 6678 in this case. In other situations it may be necessary to perform 6679 real-time duplicate detection, such as when credit limits are imposed 6680 or real-time fraud detection is desired. 6682 In general, only generation of duplicates due to failover or re- 6683 sending of records in non-volatile storage can be reliably detected 6684 by Diameter clients or agents. In such cases the Diameter client or 6685 agents can mark the message as possible duplicate by setting the T 6686 flag. Since the Diameter server is responsible for duplicate 6687 detection, it can choose to make use of the T flag or not, in order 6688 to optimize duplicate detection. Since the T flag does not affect 6689 interoperability, and may not be needed by some servers, generation 6690 of the T flag is REQUIRED for Diameter clients and agents, but MAY be 6691 implemented by Diameter servers. 6693 As an example, it can be usually be assumed that duplicates appear 6694 within a time window of longest recorded network partition or device 6695 fault, perhaps a day. So only records within this time window need 6696 to be looked at in the backward direction. Secondly, hashing 6697 techniques or other schemes, such as the use of the T flag in the 6698 received messages, may be used to eliminate the need to do a full 6699 search even in this set except for rare cases. 6701 The following is an example of how the T flag may be used by the 6702 server to detect duplicate requests. 6704 A Diameter server MAY check the T flag of the received message to 6705 determine if the record is a possible duplicate. If the T flag is 6706 set in the request message, the server searches for a duplicate 6707 within a configurable duplication time window backward and 6708 forward. This limits database searching to those records where 6709 the T flag is set. In a well run network, network partitions and 6710 device faults will presumably be rare events, so this approach 6711 represents a substantial optimization of the duplicate detection 6712 process. During failover, it is possible for the original record 6713 to be received after the T flag marked record, due to differences 6714 in network delays experienced along the path by the original and 6715 duplicate transmissions. The likelihood of this occurring 6716 increases as the failover interval is decreased. In order to be 6717 able to detect out of order duplicates, the Diameter server should 6718 use backward and forward time windows when performing duplicate 6719 checking for the T flag marked request. For example, in order to 6720 allow time for the original record to exit the network and be 6721 recorded by the accounting server, the Diameter server can delay 6722 processing records with the T flag set until a time period 6723 TIME_WAIT + RECORD_PROCESSING_TIME has elapsed after the closing 6724 of the original transport connection. After this time period has 6725 expired, then it may check the T flag marked records against the 6726 database with relative assurance that the original records, if 6727 sent, have been received and recorded. 6729 Appendix D. Internationalized Domain Names 6731 To be compatible with the existing DNS infrastructure and simplify 6732 host and domain name comparison, Diameter identities (FQDNs) are 6733 represented in ASCII form. This allows the Diameter protocol to fall 6734 in-line with the DNS strategy of being transparent from the effects 6735 of Internationalized Domain Names (IDNs) by following the 6736 recommnedations in [RFC4690] and [RFC3490]. Applications that 6737 provide support for IDNs outside of the Diameter protocol but 6738 interacting with it SHOULD use the representation and conversion 6739 framework described in [RFC3490], [RFC3491] and [RFC3492]. 6741 Authors' Addresses 6743 Victor Fajardo (editor) 6744 Toshiba America Research 6745 One Telcordia Drive, 1S-222 6746 Piscataway, NJ 08854 6747 USA 6749 Phone: 1 908-421-1845 6750 Email: vfajardo@tari.toshiba.com 6752 Jari Arkko 6753 Ericsson Research 6754 02420 Jorvas 6755 Finland 6757 Phone: +358 40 5079256 6758 Email: jari.arkko@ericsson.com 6760 John Loughney 6761 Nokia Research Center 6762 955 Page Mill Road 6763 Palo Alto, CA 94304 6764 US 6766 Phone: 1-650-283-8068 6767 Email: john.loughney@nokia.com 6769 Glenn Zorn 6770 NetCube 6771 1310 East Thomas Street, #306 6772 Seattle, WA 98102 6773 US 6775 Phone: 6776 Email: glenzorn@comcast.net 6778 Full Copyright Statement 6780 Copyright (C) The IETF Trust (2008). 6782 This document is subject to the rights, licenses and restrictions 6783 contained in BCP 78, and except as set forth therein, the authors 6784 retain all their rights. 6786 This document and the information contained herein are provided on an 6787 "AS IS" basis and THE CONTRIBUTOR, THE ORGANIZATION HE/SHE REPRESENTS 6788 OR IS SPONSORED BY (IF ANY), THE INTERNET SOCIETY, THE IETF TRUST AND 6789 THE INTERNET ENGINEERING TASK FORCE DISCLAIM ALL WARRANTIES, EXPRESS 6790 OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF 6791 THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED 6792 WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. 6794 Intellectual Property 6796 The IETF takes no position regarding the validity or scope of any 6797 Intellectual Property Rights or other rights that might be claimed to 6798 pertain to the implementation or use of the technology described in 6799 this document or the extent to which any license under such rights 6800 might or might not be available; nor does it represent that it has 6801 made any independent effort to identify any such rights. Information 6802 on the procedures with respect to rights in RFC documents can be 6803 found in BCP 78 and BCP 79. 6805 Copies of IPR disclosures made to the IETF Secretariat and any 6806 assurances of licenses to be made available, or the result of an 6807 attempt made to obtain a general license or permission for the use of 6808 such proprietary rights by implementers or users of this 6809 specification can be obtained from the IETF on-line IPR repository at 6810 http://www.ietf.org/ipr. 6812 The IETF invites any interested party to bring to its attention any 6813 copyrights, patents or patent applications, or other proprietary 6814 rights that may cover technology that may be required to implement 6815 this standard. Please address the information to the IETF at 6816 ietf-ipr@ietf.org. 6818 Acknowledgment 6820 Funding for the RFC Editor function is provided by the IETF 6821 Administrative Support Activity (IASA).