idnits 2.17.1 draft-ietf-dime-rfc3588bis-14.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 6812. -- Found old boilerplate from RFC 3979, Section 5, paragraph 1 on line 6823. -- Found old boilerplate from RFC 3979, Section 5, paragraph 2 on line 6830. -- Found old boilerplate from RFC 3979, Section 5, paragraph 3 on line 6836. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- == There are 2 instances of lines with non-RFC6890-compliant IPv4 addresses in the document. If these are example addresses, they should be changed. -- The draft header indicates that this document obsoletes RFC3588, but the abstract doesn't seem to mention this, which it should. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust Copyright Line does not match the current year == Line 4489 has weird spacing: '...ly with wit...' == Line 4696 has weird spacing: '...ealtime user...' == Line 4724 has weird spacing: '... record inter...' == Line 4734 has weird spacing: '...ealtime user...' == Line 4742 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 (November 24, 2008) is 5603 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 4202, 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 (~~), 9 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: May 28, 2009 J. Loughney 7 Nokia Research Center 8 G. Zorn 9 NetCube 10 November 24, 2008 12 Diameter Base Protocol 13 draft-ietf-dime-rfc3588bis-14.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 May 28, 2009. 40 Abstract 42 The Diameter base protocol is intended to provide an Authentication, 43 Authorization and Accounting (AAA) framework for applications such as 44 network access or IP mobility. Diameter is also intended to work in 45 both local Authentication, Authorization & Accounting and roaming 46 situations. This document specifies the message format, transport, 47 error reporting, accounting and security services to be used by all 48 Diameter applications. The Diameter base application needs to be 49 supported by all Diameter implementations. 51 Table of Contents 53 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 7 54 1.1. Diameter Protocol . . . . . . . . . . . . . . . . . . . . 9 55 1.1.1. Description of the Document Set . . . . . . . . . . 11 56 1.1.2. Conventions Used in This Document . . . . . . . . . 12 57 1.1.3. Changes from RFC3588 . . . . . . . . . . . . . . . . 12 58 1.2. Approach to Extensibility . . . . . . . . . . . . . . . . 13 59 1.2.1. Defining New AVP Values . . . . . . . . . . . . . . 13 60 1.2.2. Creating New AVPs . . . . . . . . . . . . . . . . . 13 61 1.2.3. Creating New Commands . . . . . . . . . . . . . . . 14 62 1.2.4. Creating New Diameter Applications . . . . . . . . . 14 63 1.3. Terminology . . . . . . . . . . . . . . . . . . . . . . . 15 64 2. Protocol Overview . . . . . . . . . . . . . . . . . . . . . . 22 65 2.1. Transport . . . . . . . . . . . . . . . . . . . . . . . . 23 66 2.1.1. SCTP Guidelines . . . . . . . . . . . . . . . . . . 24 67 2.2. Securing Diameter Messages . . . . . . . . . . . . . . . 24 68 2.3. Diameter Application Compliance . . . . . . . . . . . . . 24 69 2.4. Application Identifiers . . . . . . . . . . . . . . . . . 24 70 2.5. Connections vs. Sessions . . . . . . . . . . . . . . . . 25 71 2.6. Peer Table . . . . . . . . . . . . . . . . . . . . . . . 26 72 2.7. Routing Table . . . . . . . . . . . . . . . . . . . . . . 27 73 2.8. Role of Diameter Agents . . . . . . . . . . . . . . . . . 28 74 2.8.1. Relay Agents . . . . . . . . . . . . . . . . . . . . 30 75 2.8.2. Proxy Agents . . . . . . . . . . . . . . . . . . . . 31 76 2.8.3. Redirect Agents . . . . . . . . . . . . . . . . . . 31 77 2.8.4. Translation Agents . . . . . . . . . . . . . . . . . 32 78 2.9. Diameter Path Authorization . . . . . . . . . . . . . . . 33 79 3. Diameter Header . . . . . . . . . . . . . . . . . . . . . . . 35 80 3.1. Command Codes . . . . . . . . . . . . . . . . . . . . . . 38 81 3.2. Command Code ABNF specification . . . . . . . . . . . . . 38 82 3.3. Diameter Command Naming Conventions . . . . . . . . . . . 41 83 4. Diameter AVPs . . . . . . . . . . . . . . . . . . . . . . . . 42 84 4.1. AVP Header . . . . . . . . . . . . . . . . . . . . . . . 42 85 4.1.1. Optional Header Elements . . . . . . . . . . . . . . 43 86 4.2. Basic AVP Data Formats . . . . . . . . . . . . . . . . . 44 87 4.3. Derived AVP Data Formats . . . . . . . . . . . . . . . . 45 88 4.4. Grouped AVP Values . . . . . . . . . . . . . . . . . . . 52 89 4.4.1. Example AVP with a Grouped Data type . . . . . . . . 53 90 4.5. Diameter Base Protocol AVPs . . . . . . . . . . . . . . . 56 91 5. Diameter Peers . . . . . . . . . . . . . . . . . . . . . . . 59 92 5.1. Peer Connections . . . . . . . . . . . . . . . . . . . . 59 93 5.2. Diameter Peer Discovery . . . . . . . . . . . . . . . . . 59 94 5.3. Capabilities Exchange . . . . . . . . . . . . . . . . . . 62 95 5.3.1. Capabilities-Exchange-Request . . . . . . . . . . . 63 96 5.3.2. Capabilities-Exchange-Answer . . . . . . . . . . . . 64 97 5.3.3. Vendor-Id AVP . . . . . . . . . . . . . . . . . . . 64 98 5.3.4. Firmware-Revision AVP . . . . . . . . . . . . . . . 64 99 5.3.5. Host-IP-Address AVP . . . . . . . . . . . . . . . . 65 100 5.3.6. Supported-Vendor-Id AVP . . . . . . . . . . . . . . 65 101 5.3.7. Product-Name AVP . . . . . . . . . . . . . . . . . . 65 102 5.4. Disconnecting Peer connections . . . . . . . . . . . . . 65 103 5.4.1. Disconnect-Peer-Request . . . . . . . . . . . . . . 66 104 5.4.2. Disconnect-Peer-Answer . . . . . . . . . . . . . . . 66 105 5.4.3. Disconnect-Cause AVP . . . . . . . . . . . . . . . . 67 106 5.5. Transport Failure Detection . . . . . . . . . . . . . . . 67 107 5.5.1. Device-Watchdog-Request . . . . . . . . . . . . . . 67 108 5.5.2. Device-Watchdog-Answer . . . . . . . . . . . . . . . 68 109 5.5.3. Transport Failure Algorithm . . . . . . . . . . . . 68 110 5.5.4. Failover and Failback Procedures . . . . . . . . . . 68 111 5.6. Peer State Machine . . . . . . . . . . . . . . . . . . . 69 112 5.6.1. Incoming connections . . . . . . . . . . . . . . . . 71 113 5.6.2. Events . . . . . . . . . . . . . . . . . . . . . . . 72 114 5.6.3. Actions . . . . . . . . . . . . . . . . . . . . . . 73 115 5.6.4. The Election Process . . . . . . . . . . . . . . . . 75 116 6. Diameter message processing . . . . . . . . . . . . . . . . . 76 117 6.1. Diameter Request Routing Overview . . . . . . . . . . . . 76 118 6.1.1. Originating a Request . . . . . . . . . . . . . . . 77 119 6.1.2. Sending a Request . . . . . . . . . . . . . . . . . 77 120 6.1.3. Receiving Requests . . . . . . . . . . . . . . . . . 78 121 6.1.4. Processing Local Requests . . . . . . . . . . . . . 78 122 6.1.5. Request Forwarding . . . . . . . . . . . . . . . . . 78 123 6.1.6. Request Routing . . . . . . . . . . . . . . . . . . 78 124 6.1.7. Predictive Loop Avoidance . . . . . . . . . . . . . 79 125 6.1.8. Redirecting Requests . . . . . . . . . . . . . . . . 79 126 6.1.9. Relaying and Proxying Requests . . . . . . . . . . . 80 127 6.2. Diameter Answer Processing . . . . . . . . . . . . . . . 82 128 6.2.1. Processing received Answers . . . . . . . . . . . . 82 129 6.2.2. Relaying and Proxying Answers . . . . . . . . . . . 82 130 6.3. Origin-Host AVP . . . . . . . . . . . . . . . . . . . . . 83 131 6.4. Origin-Realm AVP . . . . . . . . . . . . . . . . . . . . 83 132 6.5. Destination-Host AVP . . . . . . . . . . . . . . . . . . 83 133 6.6. Destination-Realm AVP . . . . . . . . . . . . . . . . . . 84 134 6.7. Routing AVPs . . . . . . . . . . . . . . . . . . . . . . 84 135 6.7.1. Route-Record AVP . . . . . . . . . . . . . . . . . . 84 136 6.7.2. Proxy-Info AVP . . . . . . . . . . . . . . . . . . . 84 137 6.7.3. Proxy-Host AVP . . . . . . . . . . . . . . . . . . . 85 138 6.7.4. Proxy-State AVP . . . . . . . . . . . . . . . . . . 85 139 6.8. Auth-Application-Id AVP . . . . . . . . . . . . . . . . . 85 140 6.9. Acct-Application-Id AVP . . . . . . . . . . . . . . . . . 85 141 6.10. Inband-Security-Id AVP . . . . . . . . . . . . . . . . . 85 142 6.11. Vendor-Specific-Application-Id AVP . . . . . . . . . . . 86 143 6.12. Redirect-Host AVP . . . . . . . . . . . . . . . . . . . . 87 144 6.13. Redirect-Host-Usage AVP . . . . . . . . . . . . . . . . . 87 145 6.14. Redirect-Max-Cache-Time AVP . . . . . . . . . . . . . . . 88 146 7. Error Handling . . . . . . . . . . . . . . . . . . . . . . . 90 147 7.1. Result-Code AVP . . . . . . . . . . . . . . . . . . . . . 91 148 7.1.1. Informational . . . . . . . . . . . . . . . . . . . 92 149 7.1.2. Success . . . . . . . . . . . . . . . . . . . . . . 92 150 7.1.3. Protocol Errors . . . . . . . . . . . . . . . . . . 93 151 7.1.4. Transient Failures . . . . . . . . . . . . . . . . . 94 152 7.1.5. Permanent Failures . . . . . . . . . . . . . . . . . 95 153 7.2. Error Bit . . . . . . . . . . . . . . . . . . . . . . . . 98 154 7.3. Error-Message AVP . . . . . . . . . . . . . . . . . . . . 98 155 7.4. Error-Reporting-Host AVP . . . . . . . . . . . . . . . . 98 156 7.5. Failed-AVP AVP . . . . . . . . . . . . . . . . . . . . . 99 157 7.6. Experimental-Result AVP . . . . . . . . . . . . . . . . . 100 158 7.7. Experimental-Result-Code AVP . . . . . . . . . . . . . . 100 159 8. Diameter User Sessions . . . . . . . . . . . . . . . . . . . 101 160 8.1. Authorization Session State Machine . . . . . . . . . . . 102 161 8.2. Accounting Session State Machine . . . . . . . . . . . . 107 162 8.3. Server-Initiated Re-Auth . . . . . . . . . . . . . . . . 112 163 8.3.1. Re-Auth-Request . . . . . . . . . . . . . . . . . . 112 164 8.3.2. Re-Auth-Answer . . . . . . . . . . . . . . . . . . . 113 165 8.4. Session Termination . . . . . . . . . . . . . . . . . . . 114 166 8.4.1. Session-Termination-Request . . . . . . . . . . . . 115 167 8.4.2. Session-Termination-Answer . . . . . . . . . . . . . 115 168 8.5. Aborting a Session . . . . . . . . . . . . . . . . . . . 116 169 8.5.1. Abort-Session-Request . . . . . . . . . . . . . . . 116 170 8.5.2. Abort-Session-Answer . . . . . . . . . . . . . . . . 117 171 8.6. Inferring Session Termination from Origin-State-Id . . . 118 172 8.7. Auth-Request-Type AVP . . . . . . . . . . . . . . . . . . 118 173 8.8. Session-Id AVP . . . . . . . . . . . . . . . . . . . . . 119 174 8.9. Authorization-Lifetime AVP . . . . . . . . . . . . . . . 120 175 8.10. Auth-Grace-Period AVP . . . . . . . . . . . . . . . . . . 121 176 8.11. Auth-Session-State AVP . . . . . . . . . . . . . . . . . 121 177 8.12. Re-Auth-Request-Type AVP . . . . . . . . . . . . . . . . 121 178 8.13. Session-Timeout AVP . . . . . . . . . . . . . . . . . . . 122 179 8.14. User-Name AVP . . . . . . . . . . . . . . . . . . . . . . 122 180 8.15. Termination-Cause AVP . . . . . . . . . . . . . . . . . . 122 181 8.16. Origin-State-Id AVP . . . . . . . . . . . . . . . . . . . 124 182 8.17. Session-Binding AVP . . . . . . . . . . . . . . . . . . . 124 183 8.18. Session-Server-Failover AVP . . . . . . . . . . . . . . . 125 184 8.19. Multi-Round-Time-Out AVP . . . . . . . . . . . . . . . . 126 185 8.20. Class AVP . . . . . . . . . . . . . . . . . . . . . . . . 126 186 8.21. Event-Timestamp AVP . . . . . . . . . . . . . . . . . . . 126 187 9. Accounting . . . . . . . . . . . . . . . . . . . . . . . . . 127 188 9.1. Server Directed Model . . . . . . . . . . . . . . . . . . 127 189 9.2. Protocol Messages . . . . . . . . . . . . . . . . . . . . 128 190 9.3. Accounting Application Extension and Requirements . . . . 128 191 9.4. Fault Resilience . . . . . . . . . . . . . . . . . . . . 129 192 9.5. Accounting Records . . . . . . . . . . . . . . . . . . . 129 193 9.6. Correlation of Accounting Records . . . . . . . . . . . . 130 194 9.7. Accounting Command-Codes . . . . . . . . . . . . . . . . 131 195 9.7.1. Accounting-Request . . . . . . . . . . . . . . . . . 131 196 9.7.2. Accounting-Answer . . . . . . . . . . . . . . . . . 132 197 9.8. Accounting AVPs . . . . . . . . . . . . . . . . . . . . . 133 198 9.8.1. Accounting-Record-Type AVP . . . . . . . . . . . . . 133 199 9.8.2. Acct-Interim-Interval AVP . . . . . . . . . . . . . 134 200 9.8.3. Accounting-Record-Number AVP . . . . . . . . . . . . 135 201 9.8.4. Acct-Session-Id AVP . . . . . . . . . . . . . . . . 135 202 9.8.5. Acct-Multi-Session-Id AVP . . . . . . . . . . . . . 135 203 9.8.6. Accounting-Sub-Session-Id AVP . . . . . . . . . . . 135 204 9.8.7. Accounting-Realtime-Required AVP . . . . . . . . . . 136 205 10. AVP Occurrence Table . . . . . . . . . . . . . . . . . . . . 137 206 10.1. Base Protocol Command AVP Table . . . . . . . . . . . . . 137 207 10.2. Accounting AVP Table . . . . . . . . . . . . . . . . . . 138 208 11. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 140 209 11.1. AVP Header . . . . . . . . . . . . . . . . . . . . . . . 140 210 11.1.1. AVP Codes . . . . . . . . . . . . . . . . . . . . . 140 211 11.1.2. AVP Flags . . . . . . . . . . . . . . . . . . . . . 141 212 11.2. Diameter Header . . . . . . . . . . . . . . . . . . . . . 141 213 11.2.1. Command Codes . . . . . . . . . . . . . . . . . . . 141 214 11.2.2. Command Flags . . . . . . . . . . . . . . . . . . . 142 215 11.3. Application Identifiers . . . . . . . . . . . . . . . . . 142 216 11.4. AVP Values . . . . . . . . . . . . . . . . . . . . . . . 142 217 11.4.1. Result-Code AVP Values . . . . . . . . . . . . . . . 143 218 11.4.2. Accounting-Record-Type AVP Values . . . . . . . . . 143 219 11.4.3. Termination-Cause AVP Values . . . . . . . . . . . . 143 220 11.4.4. Redirect-Host-Usage AVP Values . . . . . . . . . . . 143 221 11.4.5. Session-Server-Failover AVP Values . . . . . . . . . 143 222 11.4.6. Session-Binding AVP Values . . . . . . . . . . . . . 143 223 11.4.7. Disconnect-Cause AVP Values . . . . . . . . . . . . 143 224 11.4.8. Auth-Request-Type AVP Values . . . . . . . . . . . . 143 225 11.4.9. Auth-Session-State AVP Values . . . . . . . . . . . 144 226 11.4.10. Re-Auth-Request-Type AVP Values . . . . . . . . . . 144 227 11.4.11. Accounting-Realtime-Required AVP Values . . . . . . 144 228 11.4.12. Inband-Security-Id AVP (code 299) . . . . . . . . . 144 229 11.5. Diameter TCP/SCTP Port Numbers . . . . . . . . . . . . . 144 230 11.6. NAPTR Service Fields . . . . . . . . . . . . . . . . . . 144 232 12. Diameter protocol related configurable parameters . . . . . . 146 233 13. Security Considerations . . . . . . . . . . . . . . . . . . . 147 234 13.1. TLS Usage . . . . . . . . . . . . . . . . . . . . . . . . 147 235 13.2. Peer-to-Peer Considerations . . . . . . . . . . . . . . . 148 236 14. References . . . . . . . . . . . . . . . . . . . . . . . . . 149 237 14.1. Normative References . . . . . . . . . . . . . . . . . . 149 238 14.2. Informational References . . . . . . . . . . . . . . . . 151 239 Appendix A. Acknowledgements . . . . . . . . . . . . . . . . . . 153 240 A.1. RFC3588bis . . . . . . . . . . . . . . . . . . . . . . . 153 241 A.2. RFC3588 . . . . . . . . . . . . . . . . . . . . . . . . . 154 242 Appendix B. NAPTR Example . . . . . . . . . . . . . . . . . . . 155 243 Appendix C. Duplicate Detection . . . . . . . . . . . . . . . . 156 244 Appendix D. Internationalized Domain Names . . . . . . . . . . . 158 245 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 159 246 Intellectual Property and Copyright Statements . . . . . . . . . 160 248 1. Introduction 250 Authentication, Authorization and Accounting (AAA) protocols such as 251 TACACS [RFC1492] and RADIUS [RFC2865] were initially deployed to 252 provide dial-up PPP [RFC1661] and terminal server access. Over time, 253 with the growth of the Internet and the introduction of new access 254 technologies (including wireless, DSL, Mobile IP and Ethernet), both 255 the amount and complexity of processing performed by routers and 256 network access servers (NAS) have increased, putting new demands on 257 AAA protocols. 259 Network access requirements for AAA protocols are summarized in 260 [RFC2989]. These include: 262 Failover 264 [RFC2865] does not define failover mechanisms, and as a result, 265 failover behavior differs between implementations. In order to 266 provide well defined failover behavior, Diameter supports 267 application-layer acknowledgements, and defines failover 268 algorithms and the associated state machine. This is described in 269 Section 5.5 and [RFC3539]. 271 Transmission-level security 273 [RFC2865] defines an application-layer authentication and 274 integrity scheme that is required only for use with Response 275 packets. While [RFC2869] defines an additional authentication and 276 integrity mechanism, use is only required during Extensible 277 Authentication Protocol (EAP) sessions. While attribute-hiding is 278 supported, [RFC2865] does not provide support for per-packet 279 confidentiality. In accounting, [RFC2866] assumes that replay 280 protection is provided by the backend billing server, rather than 281 within the protocol itself. 283 While [RFC3162] defines the use of IPsec with RADIUS, support for 284 IPsec is not required. Since within [RFC4306] authentication 285 occurs only within Phase 1 prior to the establishment of IPsec SAs 286 in Phase 2, it is typically not possible to define separate trust 287 or authorization schemes for each application. This limits the 288 usefulness of IPsec in inter-domain AAA applications (such as 289 roaming) where it may be desirable to define a distinct 290 certificate hierarchy for use in a AAA deployment. In order to 291 provide universal support for transmission-level security, and 292 enable both intra- and inter-domain AAA deployments, Diameter 293 provides support for TLS. Security is discussed in Section 13. 295 Reliable transport 297 RADIUS runs over UDP, and does not define retransmission behavior; 298 as a result, reliability varies between implementations. As 299 described in [RFC2975], this is a major issue in accounting, where 300 packet loss may translate directly into revenue loss. In order to 301 provide well defined transport behavior, Diameter runs over 302 reliable transport mechanisms (TCP, SCTP) as defined in [RFC3539]. 304 Agent support 306 [RFC2865] does not provide for explicit support for agents, 307 including Proxies, Redirects and Relays. Since the expected 308 behavior is not defined, it varies between implementations. 309 Diameter defines agent behavior explicitly; this is described in 310 Section 2.8. 312 Server-initiated messages 314 While RADIUS server-initiated messages are defined in [RFC3576], 315 support is optional. This makes it difficult to implement 316 features such as unsolicited disconnect or reauthentication/ 317 reauthorization on demand across a heterogeneous deployment. 318 Support for server-initiated messages is mandatory in Diameter, 319 and is described in Section 8. 321 Transition support 323 While Diameter does not share a common protocol data unit (PDU) 324 with RADIUS, considerable effort has been expended in enabling 325 backward compatibility with RADIUS, so that the two protocols may 326 be deployed in the same network. Initially, it is expected that 327 Diameter will be deployed within new network devices, as well as 328 within gateways enabling communication between legacy RADIUS 329 devices and Diameter agents. This capability, described in 330 [RFC4005], enables Diameter support to be added to legacy 331 networks, by addition of a gateway or server speaking both RADIUS 332 and Diameter. 334 In addition to addressing the above requirements, Diameter also 335 provides support for the following: 337 Capability negotiation 339 RADIUS does not support error messages, capability negotiation, or 340 a mandatory/non-mandatory flag for attributes. Since RADIUS 341 clients and servers are not aware of each other's capabilities, 342 they may not be able to successfully negotiate a mutually 343 acceptable service, or in some cases, even be aware of what 344 service has been implemented. Diameter includes support for error 345 handling (Section 7), capability negotiation (Section 5.3), and 346 mandatory/non-mandatory attribute-value pairs (AVPs) (Section 347 4.1). 349 Peer discovery and configuration 351 RADIUS implementations typically require that the name or address 352 of servers or clients be manually configured, along with the 353 corresponding shared secrets. This results in a large 354 administrative burden, and creates the temptation to reuse the 355 RADIUS shared secret, which can result in major security 356 vulnerabilities if the Request Authenticator is not globally and 357 temporally unique as required in [RFC2865]. Through DNS, Diameter 358 enables dynamic discovery of peers. Derivation of dynamic session 359 keys is enabled via transmission-level security. 361 Over time, the capabilities of Network Access Server (NAS) devices 362 have increased substantially. As a result, while Diameter is a 363 considerably more sophisticated protocol than RADIUS, it remains 364 feasible to implement within embedded devices, given improvements in 365 processor speeds and the widespread availability of embedded TLS 366 implementations. 368 1.1. Diameter Protocol 370 The Diameter base protocol provides the following facilities: 372 o Delivery of AVPs (attribute value pairs) 374 o Capabilities negotiation 376 o Error notification 378 o Extensibility, through addition of new applications, commands and 379 AVPs (required in [RFC2989]). 381 o Basic services necessary for applications, such as handling of 382 user sessions or accounting 384 All data delivered by the protocol is in the form of an AVP. Some of 385 these AVP values are used by the Diameter protocol itself, while 386 others deliver data associated with particular applications that 387 employ Diameter. AVPs may be added arbitrarily to Diameter messages, 388 so long as the requirements of a message's ABNF are met. AVPs are 389 used by the base Diameter protocol to support the following required 390 features: 392 o Transporting of user authentication information, for the purposes 393 of enabling the Diameter server to authenticate the user. 395 o Transporting of service specific authorization information, 396 between client and servers, allowing the peers to decide whether a 397 user's access request should be granted. 399 o Exchanging resource usage information, which may be used for 400 accounting purposes, capacity planning, etc. 402 o Relaying, proxying and redirecting of Diameter messages through a 403 server hierarchy. 405 The Diameter base protocol provides the minimum requirements needed 406 for a AAA protocol, as required by [RFC2989]. The base protocol may 407 be used by itself for accounting purposes only, or it may be used 408 with a Diameter application, such as Mobile IPv4 [RFC4004], or 409 network access [RFC4005]. It is also possible for the base protocol 410 to be extended for use in new applications, via the addition of new 411 commands or AVPs. At this time the focus of Diameter is network 412 access and accounting applications. A truly generic AAA protocol 413 used by many applications might provide functionality not provided by 414 Diameter. Therefore, it is imperative that the designers of new 415 applications understand their requirements before using Diameter. 416 See Section 2.4 for more information on Diameter applications. 418 Any node can initiate a request. In that sense, Diameter is a peer- 419 to-peer protocol. In this document, a Diameter Client is a device at 420 the edge of the network that performs access control, such as a 421 Network Access Server (NAS) or a Foreign Agent (FA). A Diameter 422 client generates Diameter messages to request authentication, 423 authorization, and accounting services for the user. A Diameter 424 agent is a node that does not provide local user authentication or 425 authorization services; agents include proxies, redirects and relay 426 agents. A Diameter server performs authentication and/or 427 authorization of the user. A Diameter node may act as an agent for 428 certain requests while acting as a server for others. 430 The Diameter protocol also supports server-initiated messages, such 431 as a request to abort service to a particular user. 433 1.1.1. Description of the Document Set 435 Currently, the Diameter specification consists of an updated version 436 of the base protocol specification (this document), Transport Profile 437 [RFC3539] and applications: Mobile IPv4 [RFC4004], NASREQ [RFC4005], 438 Credit Control [RFC4006], EAP [RFC4072] and SIP [RFC4740]. Note that 439 this document obsoletes [RFC3588]. A summary of the base protocol 440 updates included in this document can be found in Section 1.1.3. 442 The Transport Profile document [RFC3539] discusses transport layer 443 issues that arise with AAA protocols and recommendations on how to 444 overcome these issues. This document also defines the Diameter 445 failover algorithm and state machine. 447 The Mobile IPv4 [RFC4004] application defines a Diameter application 448 that allows a Diameter server to perform AAA functions for Mobile 449 IPv4 services to a mobile node. 451 The NASREQ [RFC4005] application defines a Diameter Application that 452 allows a Diameter server to be used in a PPP/SLIP Dial-Up and 453 Terminal Server Access environment. Consideration was given for 454 servers that need to perform protocol conversion between Diameter and 455 RADIUS. 457 The Credit Control [RFC4006] application defines a Diameter 458 Application that can be used to implement real-time credit-control 459 for a variety of end user services such as network access, SIP 460 services, messaging services, and download services. It provides a 461 general solution to real-time cost and credit-control. 463 The EAP [RFC4072] application defines a Diameter Application that can 464 be used to carry EAP packets between the Network Access Server (NAS) 465 working as an EAP authenticator and a back-end authentication server. 466 The Diameter EAP application is based on NASREQ and intended for a 467 similar environment. 469 The SIP [RFC4740] application defines a Diameter Application that 470 allows a Diameter client to request authentication and authorization 471 information to a Diameter server for SIP-based IP multimedia services 472 (see SIP [RFC3261]). 474 In summary, this document defines the base protocol specification for 475 AAA, which includes support for accounting. The applications 476 documents describe applications that use this base specification for 477 Authentication, Authorization and Accounting. 479 1.1.2. Conventions Used in This Document 481 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 482 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 483 document are to be interpreted as described in [RFC2119]. 485 1.1.3. Changes from RFC3588 487 This document deprecates [RFC3588] but is fully backward compatible 488 with that document. The changes introduced in this document focuses 489 on fixing issues that have surfaced during implementation of 490 [RFC3588]. An overview of some the major changes are shown below. 492 o Simplified Security Requirements. The use of a secured transport 493 for exchanging Diameter messages remains mandatory. However, TLS 494 has become the primary method of securing Diameter and IPsec is a 495 secondary alternative. See Section 13 for details. Along with 496 this, the support for the End-to-End security framework 497 (E2ESequence AVP and 'P'-bit in the AVP header) has also been 498 deprecated. 500 o Diameter Extensibility Changes. This includes fixes to the 501 Diameter extensibility description (Section 1.2 and others) to 502 better aid Diameter application designers. It also includes 503 allocation of vendor specific command code space. The new 504 specification relaxes the allocation of command codes for vendor 505 specific uses. See Section 11.2.1 for details. 507 o Application Id Usage. Clarify the proper use of Application Id 508 information which can be found in multiple places within a 509 Diameter message. This includes co-relating Application Ids found 510 in the message headers and AVPs. These changes also clearly 511 specifies the proper Application Id value to use for specific base 512 protocol messages (ASR/ASA, STR/STA) as well as clarifying the 513 content and use of Vendor-Specific-Application-Id. 515 o Routing Fixes. For general routing, specifies much more clearly 516 what information (AVPs and Application Id) can be used for making 517 routing decisions. Prioritization of redirect routing criterias 518 when multiple route entries are found via redirects has also been 519 added (See Section 6.13 for details). 521 o Simplification of Diameter Peer Discovery. The Diameter discovery 522 process now supports only well known discovery schemes. The rest 523 has been deprecated. (See Section 5.2 for details). 525 There are many other many miscellaneous fixes that has been 526 introduced in this document that may not be considered significant 527 but they are important nonetheless. Examples are removal of obsolete 528 types, fixes to command ABNFs, fixes to the state machine, 529 clarification on election process, message validation, fixes to 530 Failed-AVP and Result-Code AVP values etc. A comprehensive list of 531 changes is not shown here for practical reasons. Though, that can be 532 generated via a diff comparison between this document and [RFC3588]. 534 1.2. Approach to Extensibility 536 The Diameter protocol is designed to be extensible, using several 537 mechanisms, including: 539 o Defining new AVP values 541 o Creating new AVPs 543 o Creating new commands 545 o Creating new applications 547 From the point of extensibility Diameter authentication, 548 authorization and accounting applications are treated in the same 549 way. 551 Note: Protocol designer should try to re-use existing functionality, 552 namely AVP values, AVPs, commands, and Diameter applications. Reuse 553 simplifies standardization and implementation. To avoid potential 554 interoperability issues it is important to ensure that the semantics 555 of the re-used features are well understood. 557 1.2.1. Defining New AVP Values 559 In order to allocate a new AVP value for AVPs defined in the Diameter 560 Base protocol, the IETF needs to approve a new RFC that describes the 561 AVP value. IANA considerations for these AVP values are discussed in 562 Section 11.4. 564 The allocation of AVP values for other AVPs is guided by the IANA 565 considerations of the documents that defines those AVPs. Typically, 566 allocation of new values for an AVP defined in an IETF RFC should 567 require IETF Review [RFC2434], where as values for vendor-specific 568 AVPs can be allocated by the vendor. 570 1.2.2. Creating New AVPs 572 A new AVP being defined MUST use one of the data types listed in 573 Section 4.2 or 4.3. If an appropriate derived data type is already 574 defined, it SHOULD be used instead of the base data type to encourage 575 reusability and good design practice. 577 In the event that a logical grouping of AVPs is necessary, and 578 multiple "groups" are possible in a given command, it is recommended 579 that a Grouped AVP be used (see Section 4.4). 581 The creation of new AVPs can happen in various ways. The recommended 582 approach is to define a new general-purpose AVP in a standards track 583 RFC approved by the IETF. However, as described in Section 11.1.1 584 there are also other mechanisms. 586 1.2.3. Creating New Commands 588 A new Command Code MUST be allocated when new required AVPs (those 589 indicated as {AVP}) are added, deleted or are redefined (for example 590 by changing a required AVP into an optional one). 592 Furthermore, when a command is modified with respect to the number of 593 round trips then a new Command Code has to be registered. 595 A change to the ABNF of a command, such as described above, MUST 596 result in the definition of a new Command Code. This subsequently 597 leads to the need to define a new Diameter Application for any 598 application that will use that new Command. 600 The IANA considerations for commands are discussed in Section 11.2.1. 602 1.2.4. Creating New Diameter Applications 604 Every Diameter application specification MUST have an IANA assigned 605 Application Id (see Section 2.4 and Section 11.3). The managed 606 Application ID space is flat and there is no relationship between 607 different Diameter applications with respect to their application 608 IDs. As such, there is no versioning supported provided by these 609 application IDs itself; every Diameter application is a standalone 610 application that may or may not have a semantical relationship with 611 one or more Diameter applications being defined elsewhere. 613 Before describing the rules for creating new Diameter applications it 614 is important to discuss the semantics of the AVPs occurrences as 615 stated in the ABNF and the M-bit flag for an AVP. There is no 616 relationship imposed between the two; they are set independently. 618 o The ABNF indicates what AVPs are placed into a Diameter Command by 619 the sender of that Command. Often, since there are multiple modes 620 of protocol interactions many of the AVPs are indicated as 621 optional. 623 o The M-bit allows the sender to indicate to the receiver whether 624 the semantics of an AVP and it's content has to be understood 625 mandatorily or not. If the M-bit is set by the sender and the 626 receiver does not understand the AVP or the values carried within 627 that AVP then a failure is generated (see Section 7). 629 It is the decision of the protocol designer when to develop a new 630 Diameter application rather than extending Diameter in other ways. 631 However, a new Diameter application MUST be created when one or more 632 of the following criteria are met: 634 M-bit Setting 636 Adding an AVP with the M-bit in the MUST column of the AVP flag 637 table to an existing Command/Application requires a new Diameter 638 Application Id to be assigned to that Application. 640 Adding an AVP with the M-bit in the MAY column of the AVP flag 641 table to an existing Command/Application requires a new Diameter 642 Application Id to be assigned to that Application. 644 Note: The M-bit setting for a given AVP is relevant to an 645 Application and each command within that application which 646 includes the AVP. That is, if an AVP appears in two commands for 647 application Foo and the M-bit settings are different in each 648 command, then there should be two AVP flag tables describing when 649 to set the M-bit. 651 Commands 653 A new command is used within the existing application either 654 because an additional command is added, an existing command has 655 been modified so that a new Command Code had to be registered, or 656 a command has been deleted. 658 An implementation MAY add arbitrary optional AVPs with the M-bit 659 cleared to a command defined in an application, including vendor- 660 specific AVPs without needing to define a new application. This can 661 be done if the commands ABNF allows for it. Please refer to Section 662 11.1.1 for details. 664 1.3. Terminology 665 AAA 667 Authentication, Authorization and Accounting. 669 Accounting 671 The act of collecting information on resource usage for the 672 purpose of capacity planning, auditing, billing or cost 673 allocation. 675 Accounting Record 677 An accounting record represents a summary of the resource 678 consumption of a user over the entire session. Accounting servers 679 creating the accounting record may do so by processing interim 680 accounting events or accounting events from several devices 681 serving the same user. 683 Authentication 685 The act of verifying the identity of an entity (subject). 687 Authorization 689 The act of determining whether a requesting entity (subject) will 690 be allowed access to a resource (object). 692 AVP 694 The Diameter protocol consists of a header followed by one or more 695 Attribute-Value-Pairs (AVPs). An AVP includes a header and is 696 used to encapsulate protocol-specific data (e.g., routing 697 information) as well as authentication, authorization or 698 accounting information. 700 Broker 702 A broker is a business term commonly used in AAA infrastructures. 703 A broker is either a relay, proxy or redirect agent, and may be 704 operated by roaming consortiums. Depending on the business model, 705 a broker may either choose to deploy relay agents or proxy agents. 707 Diameter Agent 709 A Diameter Agent is a Diameter node that provides either relay, 710 proxy, redirect or translation services. 712 Diameter Client 714 A Diameter Client is a device at the edge of the network that 715 performs access control. An example of a Diameter client is a 716 Network Access Server (NAS) or a Foreign Agent (FA). By its very 717 nature, a Diameter Client must support Diameter client 718 applications in addition to the base protocol. 720 Diameter Node 722 A Diameter node is a host process that implements the Diameter 723 protocol, and acts either as a Client, Agent or Server. 725 Diameter Peer 727 A Diameter Peer is a Diameter Node to which a given Diameter Node 728 has a direct transport connection. 730 Diameter Server 732 A Diameter Server is one that handles authentication, 733 authorization and accounting requests for a particular realm. By 734 its very nature, a Diameter Server must support Diameter server 735 applications in addition to the base protocol. 737 Downstream 739 Downstream is used to identify the direction of a particular 740 Diameter message from the home server towards the access device. 742 Home Realm 744 A Home Realm is the administrative domain with which the user 745 maintains an account relationship. 747 Home Server 749 A Diameter Server which serves the Home Realm. 751 Interim accounting 753 An interim accounting message provides a snapshot of usage during 754 a user's session. It is typically implemented in order to provide 755 for partial accounting of a user's session in the case of a device 756 reboot or other network problem prevents the reception of a 757 session summary message or session record. 759 Local Realm 761 A local realm is the administrative domain providing services to a 762 user. An administrative domain may act as a local realm for 763 certain users, while being a home realm for others. 765 Multi-session 767 A multi-session represents a logical linking of several sessions. 768 Multi-sessions are tracked by using the Acct-Multi-Session-Id. An 769 example of a multi-session would be a Multi-link PPP bundle. Each 770 leg of the bundle would be a session while the entire bundle would 771 be a multi-session. 773 Network Access Identifier 775 The Network Access Identifier, or NAI [RFC4282], is used in the 776 Diameter protocol to extract a user's identity and realm. The 777 identity is used to identify the user during authentication and/or 778 authorization, while the realm is used for message routing 779 purposes. 781 Proxy Agent or Proxy 783 In addition to forwarding requests and responses, proxies make 784 policy decisions relating to resource usage and provisioning. 785 This is typically accomplished by tracking the state of NAS 786 devices. While proxies typically do not respond to client 787 Requests prior to receiving a Response from the server, they may 788 originate Reject messages in cases where policies are violated. 789 As a result, proxies need to understand the semantics of the 790 messages passing through them, and may not support all Diameter 791 applications. 793 Realm 795 The string in the NAI that immediately follows the '@' character. 796 NAI realm names are required to be unique, and are piggybacked on 797 the administration of the DNS namespace. Diameter makes use of 798 the realm, also loosely referred to as domain, to determine 799 whether messages can be satisfied locally, or whether they must be 800 routed or redirected. In RADIUS, realm names are not necessarily 801 piggybacked on the DNS namespace but may be independent of it. 803 Real-time Accounting 805 Real-time accounting involves the processing of information on 806 resource usage within a defined time window. Time constraints are 807 typically imposed in order to limit financial risk. The Diameter 808 Credit Control Application [RFC4006] is the application that 809 defines real-time accounting functionality. 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. Diameter application documents provide 846 guidelines as to when a session begins and ends. All Diameter 847 packets with the same Session-Id are considered to be part of the 848 same session. 850 Session state 852 A stateful agent is one that maintains session state information, 853 by keeping track of all authorized active sessions. Each 854 authorized session is bound to a particular service, and its state 855 is considered active either until it is notified otherwise, or by 856 expiration. 858 Sub-session 860 A sub-session represents a distinct service (e.g., QoS or data 861 characteristics) provided to a given session. These services may 862 happen concurrently (e.g., simultaneous voice and data transfer 863 during the same session) or serially. These changes in sessions 864 are tracked with the Accounting-Sub-Session-Id. 866 Transaction state 868 The Diameter protocol requires that agents maintain transaction 869 state, which is used for failover purposes. Transaction state 870 implies that upon forwarding a request, the Hop-by-Hop identifier 871 is saved; the field is replaced with a locally unique identifier, 872 which is restored to its original value when the corresponding 873 answer is received. The request's state is released upon receipt 874 of the answer. A stateless agent is one that only maintains 875 transaction state. 877 Translation Agent 879 A translation agent is a stateful Diameter node that performs 880 protocol translation between Diameter and another AAA protocol, 881 such as RADIUS. 883 Transport Connection 885 A transport connection is a TCP or SCTP connection existing 886 directly between two Diameter peers, otherwise known as a Peer-to- 887 Peer Connection. 889 Upstream 891 Upstream is used to identify the direction of a particular 892 Diameter message from the access device towards the home server. 894 User 896 The entity or client device requesting or using some resource, in 897 support of which a Diameter client has generated a request. 899 2. Protocol Overview 901 The base Diameter protocol concerns itself with capabilities 902 negotiation, how messages are sent and how peers may eventually be 903 abandoned. The base protocol also defines certain rules that apply 904 to all exchanges of messages between Diameter nodes. 906 Communication between Diameter peers begins with one peer sending a 907 message to another Diameter peer. The set of AVPs included in the 908 message is determined by a particular Diameter application. One AVP 909 that is included to reference a user's session is the Session-Id. 911 The initial request for authentication and/or authorization of a user 912 would include the Session-Id. The Session-Id is then used in all 913 subsequent messages to identify the user's session (see Section 8 for 914 more information). The communicating party may accept the request, 915 or reject it by returning an answer message with the Result-Code AVP 916 set to indicate an error occurred. The specific behavior of the 917 Diameter server or client receiving a request depends on the Diameter 918 application employed. 920 Session state (associated with a Session-Id) MUST be freed upon 921 receipt of the Session-Termination-Request, Session-Termination- 922 Answer, expiration of authorized service time in the Session-Timeout 923 AVP, and according to rules established in a particular Diameter 924 application. 926 The base Diameter protocol may be used by itself for accounting 927 applications. For authentication and authorization, it is always 928 extended for a particular application. 930 Diameter Clients MUST support the base protocol, which includes 931 accounting. In addition, they MUST fully support each Diameter 932 application that is needed to implement the client's service, e.g., 933 NASREQ and/or Mobile IPv4. A Diameter Client that does not support 934 both NASREQ and Mobile IPv4, MUST be referred to as "Diameter X 935 Client" where X is the application which it supports, and not a 936 "Diameter Client". 938 Diameter Servers MUST support the base protocol, which includes 939 accounting. In addition, they MUST fully support each Diameter 940 application that is needed to implement the intended service, e.g., 941 NASREQ and/or Mobile IPv4. A Diameter Server that does not support 942 both NASREQ and Mobile IPv4, MUST be referred to as "Diameter X 943 Server" where X is the application which it supports, and not a 944 "Diameter Server". 946 Diameter Relays and redirect agents are, by definition, protocol 947 transparent, and MUST transparently support the Diameter base 948 protocol, which includes accounting, and all Diameter applications. 950 Diameter proxies MUST support the base protocol, which includes 951 accounting. In addition, they MUST fully support each Diameter 952 application that is needed to implement proxied services, e.g., 953 NASREQ and/or Mobile IPv4. A Diameter proxy which does not support 954 both NASREQ and Mobile IPv4, MUST be referred to as "Diameter X 955 Proxy" where X is the application which it supports, and not a 956 "Diameter Proxy". 958 2.1. Transport 960 The Diameter Transport profile is defined in [RFC3539]. 962 The base Diameter protocol is run on port 3868 of both TCP [RFC793] 963 and SCTP [RFC2960]. 965 Diameter clients MUST support either TCP or SCTP, while agents and 966 servers SHOULD support both. 968 A Diameter node MAY initiate connections from a source port other 969 than the one that it declares it accepts incoming connections on, and 970 MUST be prepared to receive connections on port 3868. A given 971 Diameter instance of the peer state machine MUST NOT use more than 972 one transport connection to communicate with a given peer, unless 973 multiple instances exist on the peer in which case a separate 974 connection per process is allowed. 976 When no transport connection exists with a peer, an attempt to 977 connect SHOULD be periodically made. This behavior is handled via 978 the Tc timer, whose recommended value is 30 seconds. There are 979 certain exceptions to this rule, such as when a peer has terminated 980 the transport connection stating that it does not wish to 981 communicate. 983 When connecting to a peer and either zero or more transports are 984 specified, TCP SHOULD be tried first, followed by SCTP. See Section 985 5.2 for more information on peer discovery. 987 Diameter implementations SHOULD be able to interpret ICMP protocol 988 port unreachable messages as explicit indications that the server is 989 not reachable, subject to security policy on trusting such messages. 990 Diameter implementations SHOULD also be able to interpret a reset 991 from the transport and timed-out connection attempts. If Diameter 992 receives data up from TCP that cannot be parsed or identified as a 993 Diameter error made by the peer, the stream is compromised and cannot 994 be recovered. The transport connection MUST be closed using a RESET 995 call (send a TCP RST bit) or an SCTP ABORT message (graceful closure 996 is compromised). 998 2.1.1. SCTP Guidelines 1000 The following are guidelines for Diameter implementations that 1001 support SCTP: 1003 1. For interoperability: All Diameter nodes MUST be prepared to 1004 receive Diameter messages on any SCTP stream in the association. 1006 2. To prevent blocking: All Diameter nodes SHOULD utilize all SCTP 1007 streams available to the association to prevent head-of-the-line 1008 blocking. 1010 2.2. Securing Diameter Messages 1012 Connections between Diameter peers SHOULD be protected by TLS. All 1013 Diameter base protocol implementations MUST support the use of TLS. 1014 If desired, additional security measures that are transparent to and 1015 independent of Diameter, such as IPsec [RFC4301], can be deployed to 1016 secure connections between peers. The Diameter protocol MUST NOT be 1017 used without any security mechanism. 1019 2.3. Diameter Application Compliance 1021 Application Ids are advertised during the capabilities exchange phase 1022 (see Section 5.3). For a given application, advertising support of 1023 an application implies that the sender supports the functionality 1024 specified in the respective Diameter application specification. 1026 An implementation MAY add arbitrary optional AVPs with the M-bit 1027 cleared to a command defined in an application, including vendor- 1028 specific AVPs only if the commands ABNF allows for it. Please refer 1029 to Section 11.1.1 for details. 1031 2.4. Application Identifiers 1033 Each Diameter application MUST have an IANA assigned Application Id 1034 (see Section 11.3). The base protocol does not require an 1035 Application Id since its support is mandatory. During the 1036 capabilities exchange, Diameter nodes inform their peers of locally 1037 supported applications. Furthermore, all Diameter messages contain 1038 an Application Id, which is used in the message forwarding process. 1040 The following Application Id values are defined: 1042 Diameter Common Messages 0 1043 Diameter Base Accounting 3 1044 Relay 0xffffffff 1046 Relay and redirect agents MUST advertise the Relay Application 1047 Identifier, while all other Diameter nodes MUST advertise locally 1048 supported applications. The receiver of a Capabilities Exchange 1049 message advertising Relay service MUST assume that the sender 1050 supports all current and future applications. 1052 Diameter relay and proxy agents are responsible for finding an 1053 upstream server that supports the application of a particular 1054 message. If none can be found, an error message is returned with the 1055 Result-Code AVP set to DIAMETER_UNABLE_TO_DELIVER. 1057 2.5. Connections vs. Sessions 1059 This section attempts to provide the reader with an understanding of 1060 the difference between connection and session, which are terms used 1061 extensively throughout this document. 1063 A connection refers to a transport level connection between two peers 1064 that is used to send and receive Diameter messages. A session is a 1065 logical concept at the application layer, it spawns from the Diameter 1066 client to the Diameter server and is identified via the Session-Id 1067 AVP. 1069 +--------+ +-------+ +--------+ 1070 | Client | | Relay | | Server | 1071 +--------+ +-------+ +--------+ 1072 <----------> <----------> 1073 peer connection A peer connection B 1075 <-----------------------------> 1076 User session x 1078 Figure 1: Diameter connections and sessions 1080 In the example provided in Figure 1, peer connection A is established 1081 between the Client and the Relay. Peer connection B is established 1082 between the Relay and the Server. User session X spans from the 1083 Client via the Relay to the Server. Each "user" of a service causes 1084 an auth request to be sent, with a unique session identifier. Once 1085 accepted by the server, both the client and the server are aware of 1086 the session. 1088 It is important to note that there is no relationship between a 1089 connection and a session, and that Diameter messages for multiple 1090 sessions are all multiplexed through a single connection. Also note 1091 that Diameter messages pertaining to the session, both application 1092 specific and those that are defined in this document such as ASR/ASA, 1093 RAR/RAA and STR/STA MUST carry the Application Id of the application. 1094 Diameter messages pertaining to peer connection establishment and 1095 maintenance such as CER/CEA, DWR/DWA and DPR/DPA MUST carry an 1096 Application Id of zero (0). 1098 2.6. Peer Table 1100 The Diameter Peer Table is used in message forwarding, and referenced 1101 by the Routing Table. A Peer Table entry contains the following 1102 fields: 1104 Host identity 1106 Following the conventions described for the DiameterIdentity 1107 derived AVP data format in Section 4.4. This field contains the 1108 contents of the Origin-Host (Section 6.3) AVP found in the CER or 1109 CEA message. 1111 StatusT 1113 This is the state of the peer entry, and MUST match one of the 1114 values listed in Section 5.6. 1116 Static or Dynamic 1118 Specifies whether a peer entry was statically configured, or 1119 dynamically discovered. 1121 Expiration time 1123 Specifies the time at which dynamically discovered peer table 1124 entries are to be either refreshed, or expired. 1126 TLS Enabled 1128 Specifies whether TLS is to be used when communicating with the 1129 peer. 1131 Additional security information, when needed (e.g., keys, 1132 certificates) 1134 2.7. Routing Table 1136 All Realm-Based routing lookups are performed against what is 1137 commonly known as the Routing Table (see Section 12). A Routing 1138 Table Entry contains the following fields: 1140 Realm Name 1142 This is the field that is MUST be used as a primary key in the 1143 routing table lookups. Note that some implementations perform 1144 their lookups based on longest-match-from-the-right on the realm 1145 rather than requiring an exact match. 1147 Application Identifier 1149 An application is identified by an Application Id. A route entry 1150 can have a different destination based on the Application Id in 1151 the message header. This field MUST be used as a secondary key 1152 field in routing table lookups. 1154 Local Action 1156 The Local Action field is used to identify how a message should be 1157 treated. The following actions are supported: 1159 1. LOCAL - Diameter messages that can be satisfied locally, and 1160 do not need to be routed to another Diameter entity. 1162 2. RELAY - All Diameter messages that fall within this category 1163 MUST be routed to a next hop Diameter entity that is indicated 1164 by the identifier described below. Routing is done without 1165 modifying any non-routing AVPs. See Section 6.1.9 for 1166 relaying guidelines 1168 3. PROXY - All Diameter messages that fall within this category 1169 MUST be routed to a next Diameter entity that is indicated by 1170 the identifier described below. The local server MAY apply 1171 its local policies to the message by including new AVPs to the 1172 message prior to routing. See Section 6.1.9 for proxying 1173 guidelines. 1175 4. REDIRECT - Diameter messages that fall within this category 1176 MUST have the identity of the home Diameter server(s) 1177 appended, and returned to the sender of the message. See 1178 Section 6.1.9 for redirect guidelines. 1180 Server Identifier 1182 One or more servers the message is to be routed to. These servers 1183 MUST also be present in the Peer table. When the Local Action is 1184 set to RELAY or PROXY, this field contains the identity of the 1185 server(s) the message MUST be routed to. When the Local Action 1186 field is set to REDIRECT, this field contains the identity of one 1187 or more servers the message MUST be redirected to. 1189 Static or Dynamic 1191 Specifies whether a route entry was statically configured, or 1192 dynamically discovered. 1194 Expiration time 1196 Specifies the time which a dynamically discovered route table 1197 entry expires. 1199 It is important to note that Diameter agents MUST support at least 1200 one of the LOCAL, RELAY, PROXY or REDIRECT modes of operation. 1201 Agents do not need to support all modes of operation in order to 1202 conform with the protocol specification, but MUST follow the protocol 1203 compliance guidelines in Section 2. Relay agents and proxies MUST 1204 NOT reorder AVPs. 1206 The routing table MAY include a default entry that MUST be used for 1207 any requests not matching any of the other entries. The routing 1208 table MAY consist of only such an entry. 1210 When a request is routed, the target server MUST have advertised the 1211 Application Id (see Section 2.4) for the given message, or have 1212 advertised itself as a relay or proxy agent. Otherwise, an error is 1213 returned with the Result-Code AVP set to DIAMETER_UNABLE_TO_DELIVER. 1215 2.8. Role of Diameter Agents 1217 In addition to client and servers, the Diameter protocol introduces 1218 relay, proxy, redirect, and translation agents, each of which is 1219 defined in Section 1.3. These Diameter agents are useful for several 1220 reasons: 1222 o They can distribute administration of systems to a configurable 1223 grouping, including the maintenance of security associations. 1225 o They can be used for concentration of requests from an number of 1226 co-located or distributed NAS equipment sets to a set of like user 1227 groups. 1229 o They can do value-added processing to the requests or responses. 1231 o They can be used for load balancing. 1233 o A complex network will have multiple authentication sources, they 1234 can sort requests and forward towards the correct target. 1236 The Diameter protocol requires that agents maintain transaction 1237 state, which is used for failover purposes. Transaction state 1238 implies that upon forwarding a request, its Hop-by-Hop identifier is 1239 saved; the field is replaced with a locally unique identifier, which 1240 is restored to its original value when the corresponding answer is 1241 received. The request's state is released upon receipt of the 1242 answer. A stateless agent is one that only maintains transaction 1243 state. 1245 The Proxy-Info AVP allows stateless agents to add local state to a 1246 Diameter request, with the guarantee that the same state will be 1247 present in the answer. However, the protocol's failover procedures 1248 require that agents maintain a copy of pending requests. 1250 A stateful agent is one that maintains session state information; by 1251 keeping track of all authorized active sessions. Each authorized 1252 session is bound to a particular service, and its state is considered 1253 active either until it is notified otherwise, or by expiration. Each 1254 authorized session has an expiration, which is communicated by 1255 Diameter servers via the Session-Timeout AVP. 1257 Maintaining session state may be useful in certain applications, such 1258 as: 1260 o Protocol translation (e.g., RADIUS <-> Diameter) 1262 o Limiting resources authorized to a particular user 1264 o Per user or transaction auditing 1266 A Diameter agent MAY act in a stateful manner for some requests and 1267 be stateless for others. A Diameter implementation MAY act as one 1268 type of agent for some requests, and as another type of agent for 1269 others. 1271 2.8.1. Relay Agents 1273 Relay Agents are Diameter agents that accept requests and route 1274 messages to other Diameter nodes based on information found in the 1275 messages (e.g., Destination-Realm). This routing decision is 1276 performed using a list of supported realms, and known peers. This is 1277 known as the Routing Table, as is defined further in Section 2.7. 1279 Relays may, for example, be used to aggregate requests from multiple 1280 Network Access Servers (NASes) within a common geographical area 1281 (POP). The use of Relays is advantageous since it eliminates the 1282 need for NASes to be configured with the necessary security 1283 information they would otherwise require to communicate with Diameter 1284 servers in other realms. Likewise, this reduces the configuration 1285 load on Diameter servers that would otherwise be necessary when NASes 1286 are added, changed or deleted. 1288 Relays modify Diameter messages by inserting and removing routing 1289 information, but do not modify any other portion of a message. 1290 Relays SHOULD NOT maintain session state but MUST maintain 1291 transaction state. 1293 +------+ ---------> +------+ ---------> +------+ 1294 | | 1. Request | | 2. Request | | 1295 | NAS | | DRL | | HMS | 1296 | | 4. Answer | | 3. Answer | | 1297 +------+ <--------- +------+ <--------- +------+ 1298 example.net example.net example.com 1300 Figure 2: Relaying of Diameter messages 1302 The example provided in Figure 2 depicts a request issued from NAS, 1303 which is an access device, for the user bob@example.com. Prior to 1304 issuing the request, NAS performs a Diameter route lookup, using 1305 "example.com" as the key, and determines that the message is to be 1306 relayed to DRL, which is a Diameter Relay. DRL performs the same 1307 route lookup as NAS, and relays the message to HMS, which is 1308 example.com's Home Diameter Server. HMS identifies that the request 1309 can be locally supported (via the realm), processes the 1310 authentication and/or authorization request, and replies with an 1311 answer, which is routed back to NAS using saved transaction state. 1313 Since Relays do not perform any application level processing, they 1314 provide relaying services for all Diameter applications, and 1315 therefore MUST advertise the Relay Application Id. 1317 2.8.2. Proxy Agents 1319 Similarly to relays, proxy agents route Diameter messages using the 1320 Diameter Routing Table. However, they differ since they modify 1321 messages to implement policy enforcement. This requires that proxies 1322 maintain the state of their downstream peers (e.g., access devices) 1323 to enforce resource usage, provide admission control, and 1324 provisioning. 1326 Proxies may, for example, be used in call control centers or access 1327 ISPs that provide outsourced connections, they can monitor the number 1328 and types of ports in use, and make allocation and admission 1329 decisions according to their configuration. 1331 Since enforcing policies requires an understanding of the service 1332 being provided, Proxies MUST only advertise the Diameter applications 1333 they support. 1335 2.8.3. Redirect Agents 1337 Redirect agents are useful in scenarios where the Diameter routing 1338 configuration needs to be centralized. An example is a redirect 1339 agent that provides services to all members of a consortium, but does 1340 not wish to be burdened with relaying all messages between realms. 1341 This scenario is advantageous since it does not require that the 1342 consortium provide routing updates to its members when changes are 1343 made to a member's infrastructure. 1345 Since redirect agents do not relay messages, and only return an 1346 answer with the information necessary for Diameter agents to 1347 communicate directly, they do not modify messages. Since redirect 1348 agents do not receive answer messages, they cannot maintain session 1349 state. 1351 The example provided in Figure 3 depicts a request issued from the 1352 access device, NAS, for the user bob@example.com. The message is 1353 forwarded by the NAS to its relay, DRL, which does not have a routing 1354 entry in its Diameter Routing Table for example.com. DRL has a 1355 default route configured to DRD, which is a redirect agent that 1356 returns a redirect notification to DRL, as well as HMS' contact 1357 information. Upon receipt of the redirect notification, DRL 1358 establishes a transport connection with HMS, if one doesn't already 1359 exist, and forwards the request to it. 1361 +------+ 1362 | | 1363 | DRD | 1364 | | 1365 +------+ 1366 ^ | 1367 2. Request | | 3. Redirection 1368 | | Notification 1369 | v 1370 +------+ ---------> +------+ ---------> +------+ 1371 | | 1. Request | | 4. Request | | 1372 | NAS | | DRL | | HMS | 1373 | | 6. Answer | | 5. Answer | | 1374 +------+ <--------- +------+ <--------- +------+ 1375 example.net example.net example.com 1377 Figure 3: Redirecting a Diameter Message 1379 Since redirect agents do not perform any application level 1380 processing, they provide relaying services for all Diameter 1381 applications, and therefore MUST advertise the Relay Application 1382 Identifier. 1384 2.8.4. Translation Agents 1386 A translation agent is a device that provides translation between two 1387 protocols (e.g., RADIUS<->Diameter, TACACS+<->Diameter). Translation 1388 agents are likely to be used as aggregation servers to communicate 1389 with a Diameter infrastructure, while allowing for the embedded 1390 systems to be migrated at a slower pace. 1392 Given that the Diameter protocol introduces the concept of long-lived 1393 authorized sessions, translation agents MUST be session stateful and 1394 MUST maintain transaction state. 1396 Translation of messages can only occur if the agent recognizes the 1397 application of a particular request, and therefore translation agents 1398 MUST only advertise their locally supported applications. 1400 +------+ ---------> +------+ ---------> +------+ 1401 | | RADIUS Request | | Diameter Request | | 1402 | NAS | | TLA | | HMS | 1403 | | RADIUS Answer | | Diameter Answer | | 1404 +------+ <--------- +------+ <--------- +------+ 1405 example.net example.net example.com 1407 Figure 4: Translation of RADIUS to Diameter 1409 2.9. Diameter Path Authorization 1411 As noted in Section 2.2, Diameter provides transmission level 1412 security for each connection using TLS. Therefore, each connection 1413 can be authenticated, replay and integrity protected. 1415 In addition to authenticating each connection, each connection as 1416 well as the entire session MUST also be authorized. Before 1417 initiating a connection, a Diameter Peer MUST check that its peers 1418 are authorized to act in their roles. For example, a Diameter peer 1419 may be authentic, but that does not mean that it is authorized to act 1420 as a Diameter Server advertising a set of Diameter applications. 1422 Prior to bringing up a connection, authorization checks are performed 1423 at each connection along the path. Diameter capabilities negotiation 1424 (CER/CEA) also MUST be carried out, in order to determine what 1425 Diameter applications are supported by each peer. Diameter sessions 1426 MUST be routed only through authorized nodes that have advertised 1427 support for the Diameter application required by the session. 1429 As noted in Section 6.1.9, a relay or proxy agent MUST append a 1430 Route-Record AVP to all requests forwarded. The AVP contains the 1431 identity of the peer the request was received from. 1433 The home Diameter server, prior to authorizing a session, MUST check 1434 the Route-Record AVPs to make sure that the route traversed by the 1435 request is acceptable. For example, administrators within the home 1436 realm may not wish to honor requests that have been routed through an 1437 untrusted realm. By authorizing a request, the home Diameter server 1438 is implicitly indicating its willingness to engage in the business 1439 transaction as specified by the contractual relationship between the 1440 server and the previous hop. A DIAMETER_AUTHORIZATION_REJECTED error 1441 message (see Section 7.1.5) is sent if the route traversed by the 1442 request is unacceptable. 1444 A home realm may also wish to check that each accounting request 1445 message corresponds to a Diameter response authorizing the session. 1446 Accounting requests without corresponding authorization responses 1447 SHOULD be subjected to further scrutiny, as should accounting 1448 requests indicating a difference between the requested and provided 1449 service. 1451 Forwarding of an authorization response is considered evidence of a 1452 willingness to take on financial risk relative to the session. A 1453 local realm may wish to limit this exposure, for example, by 1454 establishing credit limits for intermediate realms and refusing to 1455 accept responses which would violate those limits. By issuing an 1456 accounting request corresponding to the authorization response, the 1457 local realm implicitly indicates its agreement to provide the service 1458 indicated in the authorization response. If the service cannot be 1459 provided by the local realm, then a DIAMETER_UNABLE_TO_COMPLY error 1460 message MUST be sent within the accounting request; a Diameter client 1461 receiving an authorization response for a service that it cannot 1462 perform MUST NOT substitute an alternate service, and then send 1463 accounting requests for the alternate service instead. 1465 3. Diameter Header 1467 A summary of the Diameter header format is shown below. The fields 1468 are transmitted in network byte order. 1470 0 1 2 3 1471 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 1472 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1473 | Version | Message Length | 1474 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1475 | command flags | Command-Code | 1476 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1477 | Application-ID | 1478 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1479 | Hop-by-Hop Identifier | 1480 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1481 | End-to-End Identifier | 1482 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1483 | AVPs ... 1484 +-+-+-+-+-+-+-+-+-+-+-+-+- 1486 Version 1488 This Version field MUST be set to 1 to indicate Diameter Version 1489 1. 1491 Message Length 1493 The Message Length field is three octets and indicates the length 1494 of the Diameter message including the header fields. 1496 Command Flags 1498 The Command Flags field is eight bits. The following bits are 1499 assigned: 1501 0 1 2 3 4 5 6 7 1502 +-+-+-+-+-+-+-+-+ 1503 |R P E T r r r r| 1504 +-+-+-+-+-+-+-+-+ 1506 R(equest) 1508 If set, the message is a request. If cleared, the message is 1509 an answer. 1511 P(roxiable) 1513 If set, the message MAY be proxied, relayed or redirected. If 1514 cleared, the message MUST be locally processed. 1516 E(rror) 1518 If set, the message contains a protocol error, and the message 1519 will not conform to the ABNF described for this command. 1520 Messages with the 'E' bit set are commonly referred to as error 1521 messages. This bit MUST NOT be set in request messages. See 1522 Section 7.2. 1524 T(Potentially re-transmitted message) 1526 This flag is set after a link failover procedure, to aid the 1527 removal of duplicate requests. It is set when resending 1528 requests not yet acknowledged, as an indication of a possible 1529 duplicate due to a link failure. This bit MUST be cleared when 1530 sending a request for the first time, otherwise the sender MUST 1531 set this flag. Diameter agents only need to be concerned about 1532 the number of requests they send based on a single received 1533 request; retransmissions by other entities need not be tracked. 1534 Diameter agents that receive a request with the T flag set, 1535 MUST keep the T flag set in the forwarded request. This flag 1536 MUST NOT be set if an error answer message (e.g., a protocol 1537 error) has been received for the earlier message. It can be 1538 set only in cases where no answer has been received from the 1539 server for a request and the request is sent again. This flag 1540 MUST NOT be set in answer messages. 1542 r(eserved) 1544 These flag bits are reserved for future use, and MUST be set to 1545 zero, and ignored by the receiver. 1547 Command-Code 1549 The Command-Code field is three octets, and is used in order to 1550 communicate the command associated with the message. The 24-bit 1551 address space is managed by IANA (see Section 11.2.1). 1553 Command-Code values 16,777,214 and 16,777,215 (hexadecimal values 1554 FFFFFE -FFFFFF) are reserved for experimental use (See Section 1555 11.3). 1557 Application-ID 1559 Application-ID is four octets and is used to identify to which 1560 application the message is applicable for. The application can be 1561 an authentication application, an accounting application or a 1562 vendor specific application. See Section 11.3 for the possible 1563 values that the application-id may use. 1565 The value of the application-id field in the header MUST be the 1566 same as any relevant application-id AVPs contained in the message. 1568 Hop-by-Hop Identifier 1570 The Hop-by-Hop Identifier is an unsigned 32-bit integer field (in 1571 network byte order) and aids in matching requests and replies. 1572 The sender MUST ensure that the Hop-by-Hop identifier in a request 1573 is unique on a given connection at any given time, and MAY attempt 1574 to ensure that the number is unique across reboots. The sender of 1575 an Answer message MUST ensure that the Hop-by-Hop Identifier field 1576 contains the same value that was found in the corresponding 1577 request. The Hop-by-Hop identifier is normally a monotonically 1578 increasing number, whose start value was randomly generated. An 1579 answer message that is received with an unknown Hop-by-Hop 1580 Identifier MUST be discarded. 1582 End-to-End Identifier 1584 The End-to-End Identifier is an unsigned 32-bit integer field (in 1585 network byte order) and is used to detect duplicate messages. 1586 Upon reboot implementations MAY set the high order 12 bits to 1587 contain the low order 12 bits of current time, and the low order 1588 20 bits to a random value. Senders of request messages MUST 1589 insert a unique identifier on each message. The identifier MUST 1590 remain locally unique for a period of at least 4 minutes, even 1591 across reboots. The originator of an Answer message MUST ensure 1592 that the End-to-End Identifier field contains the same value that 1593 was found in the corresponding request. The End-to-End Identifier 1594 MUST NOT be modified by Diameter agents of any kind. The 1595 combination of the Origin-Host (see Section 6.3) and this field is 1596 used to detect duplicates. Duplicate requests SHOULD cause the 1597 same answer to be transmitted (modulo the hop-by-hop Identifier 1598 field and any routing AVPs that may be present), and MUST NOT 1599 affect any state that was set when the original request was 1600 processed. Duplicate answer messages that are to be locally 1601 consumed (see Section 6.2) SHOULD be silently discarded. 1603 AVPs 1605 AVPs are a method of encapsulating information relevant to the 1606 Diameter message. See Section 4 for more information on AVPs. 1608 3.1. Command Codes 1610 Each command Request/Answer pair is assigned a command code, and the 1611 sub-type (i.e., request or answer) is identified via the 'R' bit in 1612 the Command Flags field of the Diameter header. 1614 Every Diameter message MUST contain a command code in its header's 1615 Command-Code field, which is used to determine the action that is to 1616 be taken for a particular message. The following Command Codes are 1617 defined in the Diameter base protocol: 1619 Command-Name Abbrev. Code Reference 1620 -------------------------------------------------------- 1621 Abort-Session-Request ASR 274 8.5.1 1622 Abort-Session-Answer ASA 274 8.5.2 1623 Accounting-Request ACR 271 9.7.1 1624 Accounting-Answer ACA 271 9.7.2 1625 Capabilities-Exchange- CER 257 5.3.1 1626 Request 1627 Capabilities-Exchange- CEA 257 5.3.2 1628 Answer 1629 Device-Watchdog-Request DWR 280 5.5.1 1630 Device-Watchdog-Answer DWA 280 5.5.2 1631 Disconnect-Peer-Request DPR 282 5.4.1 1632 Disconnect-Peer-Answer DPA 282 5.4.2 1633 Re-Auth-Request RAR 258 8.3.1 1634 Re-Auth-Answer RAA 258 8.3.2 1635 Session-Termination- STR 275 8.4.1 1636 Request 1637 Session-Termination- STA 275 8.4.2 1638 Answer 1640 3.2. Command Code ABNF specification 1642 Every Command Code defined MUST include a corresponding ABNF 1643 specification, which is used to define the AVPs that MUST or MAY be 1644 present when sending the message. The following format is used in 1645 the definition: 1647 command-def = command-name "::=" diameter-message 1649 command-name = diameter-name 1650 diameter-name = ALPHA *(ALPHA / DIGIT / "-") 1652 diameter-message = header [ *fixed] [ *required] [ *optional] 1654 header = "<" "Diameter Header:" command-id 1655 [r-bit] [p-bit] [e-bit] [application-id] ">" 1657 application-id = 1*DIGIT 1659 command-id = 1*DIGIT 1660 ; The Command Code assigned to the command 1662 r-bit = ", REQ" 1663 ; If present, the 'R' bit in the Command 1664 ; Flags is set, indicating that the message 1665 ; is a request, as opposed to an answer. 1667 p-bit = ", PXY" 1668 ; If present, the 'P' bit in the Command 1669 ; Flags is set, indicating that the message 1670 ; is proxiable. 1672 e-bit = ", ERR" 1673 ; If present, the 'E' bit in the Command 1674 ; Flags is set, indicating that the answer 1675 ; message contains a Result-Code AVP in 1676 ; the "protocol error" class. 1678 fixed = [qual] "<" avp-spec ">" 1679 ; Defines the fixed position of an AVP 1681 required = [qual] "{" avp-spec "}" 1682 ; The AVP MUST be present and can appear 1683 ; anywhere in the message. 1685 optional = [qual] "[" avp-name "]" 1686 ; The avp-name in the 'optional' rule cannot 1687 ; evaluate to any AVP Name which is included 1688 ; in a fixed or required rule. The AVP can 1689 ; appear anywhere in the message. 1691 qual = [min] "*" [max] 1692 ; See ABNF conventions, RFC 4234 Section 6.6. 1693 ; The absence of any qualifiers depends on 1694 ; whether it precedes a fixed, required, or 1695 ; optional rule. If a fixed or required rule has 1696 ; no qualifier, then exactly one such AVP MUST 1697 ; be present. If an optional rule has no 1698 ; qualifier, then 0 or 1 such AVP may be 1699 ; present. If an optional rule has a qualifier, 1700 ; then the value of min MUST be 0 if present. 1701 ; 1702 ; NOTE: "[" and "]" have a different meaning 1703 ; than in ABNF (see the optional rule, above). 1704 ; These braces cannot be used to express 1705 ; optional fixed rules (such as an optional 1706 ; ICV at the end). To do this, the convention 1707 ; is '0*1fixed'. 1709 min = 1*DIGIT 1710 ; The minimum number of times the element may 1711 ; be present. The default value is zero for 1712 ; fixed and optional rules. The default value 1713 ; is one for required rules. The value of zero 1714 ; is not allowed for required rules. 1716 max = 1*DIGIT 1717 ; The maximum number of times the element may 1718 ; be present. The default value is infinity. A 1719 ; value of zero implies the AVP MUST NOT be 1720 ; present. 1722 avp-spec = diameter-name 1723 ; The avp-spec has to be an AVP Name, defined 1724 ; in the base or extended Diameter 1725 ; specifications. 1727 avp-name = avp-spec / "AVP" 1728 ; The string "AVP" stands for *any* arbitrary AVP 1729 ; Name, not otherwise listed in that command code 1730 ; definition. Addition this AVP is recommended for 1731 ; all command ABNFs to allow for extensibility. 1733 The following is a definition of a fictitious command code: 1735 Example-Request ::= < Diameter Header: 9999999, REQ, PXY > 1736 { User-Name } 1737 * { Origin-Host } 1738 * [ AVP ] 1740 3.3. Diameter Command Naming Conventions 1742 Diameter command names typically includes one or more English words 1743 followed by the verb Request or Answer. Each English word is 1744 delimited by a hyphen. A three-letter acronym for both the request 1745 and answer is also normally provided. 1747 An example is a message set used to terminate a session. The command 1748 name is Session-Terminate-Request and Session-Terminate-Answer, while 1749 the acronyms are STR and STA, respectively. 1751 Both the request and the answer for a given command share the same 1752 command code. The request is identified by the R(equest) bit in the 1753 Diameter header set to one (1), to ask that a particular action be 1754 performed, such as authorizing a user or terminating a session. Once 1755 the receiver has completed the request it issues the corresponding 1756 answer, which includes a result code that communicates one of the 1757 following: 1759 o The request was successful 1761 o The request failed 1763 o An additional request has to be sent to provide information the 1764 peer requires prior to returning a successful or failed answer. 1766 o The receiver could not process the request, but provides 1767 information about a Diameter peer that is able to satisfy the 1768 request, known as redirect. 1770 Additional information, encoded within AVPs, may also be included in 1771 answer messages. 1773 4. Diameter AVPs 1775 Diameter AVPs carry specific authentication, accounting, 1776 authorization and routing information as well as configuration 1777 details for the request and reply. 1779 Each AVP of type OctetString MUST be padded to align on a 32-bit 1780 boundary, while other AVP types align naturally. A number of zero- 1781 valued bytes are added to the end of the AVP Data field till a word 1782 boundary is reached. The length of the padding is not reflected in 1783 the AVP Length field. 1785 4.1. AVP Header 1787 The fields in the AVP header MUST be sent in network byte order. The 1788 format of the header is: 1790 0 1 2 3 1791 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 1792 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1793 | AVP Code | 1794 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1795 |V M P r r r r r| AVP Length | 1796 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1797 | Vendor-ID (opt) | 1798 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1799 | Data ... 1800 +-+-+-+-+-+-+-+-+ 1802 AVP Code 1804 The AVP Code, combined with the Vendor-Id field, identifies the 1805 attribute uniquely. AVP numbers 1 through 255 are reserved for 1806 backward compatibility with RADIUS, without setting the Vendor-Id 1807 field. AVP numbers 256 and above are used for Diameter, which are 1808 allocated by IANA (see Section 11.1). 1810 AVP Flags 1812 The AVP Flags field informs the receiver how each attribute must 1813 be handled. The 'r' (reserved) bits are unused and SHOULD be set 1814 to 0. Note that subsequent Diameter applications MAY define 1815 additional bits within the AVP Header, and an unrecognized bit 1816 SHOULD be considered an error. The 'P' bit has been reserved for 1817 future usage of end-to-end security. At the time of writing there 1818 are no end-to-end security mechanisms specified therefore the 'P' 1819 bit SHOULD be set to 0. 1821 The 'M' Bit, known as the Mandatory bit, indicates whether the 1822 receiver of the AVP MUST parse and understand the semantic of the 1823 AVP including its content. The receiving entity MUST return an 1824 appropriate error message if it receives an AVP that has the M-bit 1825 set but does not understand it. An exception applies when the AVP 1826 is embedded within a Grouped AVP. See Section 4.4 for details. 1827 Diameter Relay and redirect agents MUST NOT reject messages with 1828 unrecognized AVPs. 1830 The 'M' bit MUST be set according to the rules defined in the 1831 application specification which introduces or re-uses this AVP. 1832 Within a given application, the M-bit setting for an AVP is either 1833 defined for all command types or for each command type. 1835 AVPs with the 'M' bit cleared are informational only and a 1836 receiver that receives a message with such an AVP that is not 1837 supported, or whose value is not supported, MAY simply ignore the 1838 AVP. 1840 The 'V' bit, known as the Vendor-Specific bit, indicates whether 1841 the optional Vendor-ID field is present in the AVP header. When 1842 set the AVP Code belongs to the specific vendor code address 1843 space. 1845 AVP Length 1847 The AVP Length field is three octets, and indicates the number of 1848 octets in this AVP including the AVP Code, AVP Length, AVP Flags, 1849 Vendor-ID field (if present) and the AVP data. If a message is 1850 received with an invalid attribute length, the message MUST be 1851 rejected. 1853 4.1.1. Optional Header Elements 1855 The AVP Header contains one optional field. This field is only 1856 present if the respective bit-flag is enabled. 1858 Vendor-ID 1860 The Vendor-ID field is present if the 'V' bit is set in the AVP 1861 Flags field. The optional four-octet Vendor-ID field contains the 1862 IANA assigned "SMI Network Management Private Enterprise Codes" 1863 [RFC3232] value, encoded in network byte order. Any vendor or 1864 standardization organization that are also treated like vendors in 1865 the IANA managed"SMI Network Management Private Enterprise Codes" 1866 space wishing to implement a vendor-specific Diameter AVP MUST use 1867 their own Vendor-ID along with their privately managed AVP address 1868 space, guaranteeing that they will not collide with any other 1869 vendor's vendor-specific AVP(s), nor with future IETF AVPs. 1871 A vendor ID value of zero (0) corresponds to the IETF adopted AVP 1872 values, as managed by the IANA. Since the absence of the vendor 1873 ID field implies that the AVP in question is not vendor specific, 1874 implementations MUST NOT use the zero (0) vendor ID. 1876 4.2. Basic AVP Data Formats 1878 The Data field is zero or more octets and contains information 1879 specific to the Attribute. The format and length of the Data field 1880 is determined by the AVP Code and AVP Length fields. The format of 1881 the Data field MUST be one of the following base data types or a data 1882 type derived from the base data types. In the event that a new Basic 1883 AVP Data Format is needed, a new version of this RFC MUST be created. 1885 OctetString 1887 The data contains arbitrary data of variable length. Unless 1888 otherwise noted, the AVP Length field MUST be set to at least 8 1889 (12 if the 'V' bit is enabled). AVP Values of this type that are 1890 not a multiple of four-octets in length is followed by the 1891 necessary padding so that the next AVP (if any) will start on a 1892 32-bit boundary. 1894 Integer32 1896 32 bit signed value, in network byte order. The AVP Length field 1897 MUST be set to 12 (16 if the 'V' bit is enabled). 1899 Integer64 1901 64 bit signed value, in network byte order. The AVP Length field 1902 MUST be set to 16 (20 if the 'V' bit is enabled). 1904 Unsigned32 1906 32 bit unsigned value, in network byte order. The AVP Length 1907 field MUST be set to 12 (16 if the 'V' bit is enabled). 1909 Unsigned64 1911 64 bit unsigned value, in network byte order. The AVP Length 1912 field MUST be set to 16 (20 if the 'V' bit is enabled). 1914 Float32 1916 This represents floating point values of single precision as 1917 described by [FLOATPOINT]. The 32-bit value is transmitted in 1918 network byte order. The AVP Length field MUST be set to 12 (16 if 1919 the 'V' bit is enabled). 1921 Float64 1923 This represents floating point values of double precision as 1924 described by [FLOATPOINT]. The 64-bit value is transmitted in 1925 network byte order. The AVP Length field MUST be set to 16 (20 if 1926 the 'V' bit is enabled). 1928 Grouped 1930 The Data field is specified as a sequence of AVPs. Each of these 1931 AVPs follows - in the order in which they are specified - 1932 including their headers and padding. The AVP Length field is set 1933 to 8 (12 if the 'V' bit is enabled) plus the total length of all 1934 included AVPs, including their headers and padding. Thus the AVP 1935 length field of an AVP of type Grouped is always a multiple of 4. 1937 4.3. Derived AVP Data Formats 1939 In addition to using the Basic AVP Data Formats, applications may 1940 define data formats derived from the Basic AVP Data Formats. An 1941 application that defines new AVP Derived Data Formats MUST include 1942 them in a section entitled "AVP Derived Data Formats", using the same 1943 format as the definitions below. Each new definition MUST be either 1944 defined or listed with a reference to the RFC that defines the 1945 format. 1947 The below AVP Derived Data Formats are commonly used by applications. 1949 Address 1951 The Address format is derived from the OctetString AVP Base 1952 Format. It is a discriminated union, representing, for example a 1953 32-bit (IPv4) [RFC791] or 128-bit (IPv6) [RFC4291] address, most 1954 significant octet first. The first two octets of the Address AVP 1955 represents the AddressType, which contains an Address Family 1956 defined in [IANAADFAM]. The AddressType is used to discriminate 1957 the content and format of the remaining octets. 1959 Time 1961 The Time format is derived from the OctetString AVP Base Format. 1962 The string MUST contain four octets, in the same format as the 1963 first four bytes are in the NTP timestamp format. The NTP 1964 Timestamp format is defined in Chapter 3 of [RFC4330]. 1966 This represents the number of seconds since 0h on 1 January 1900 1967 with respect to the Coordinated Universal Time (UTC). 1969 On 6h 28m 16s UTC, 7 February 2036 the time value will overflow. 1970 SNTP [RFC4330] describes a procedure to extend the time to 2104. 1971 This procedure MUST be supported by all Diameter nodes. 1973 UTF8String 1975 The UTF8String format is derived from the OctetString AVP Base 1976 Format. This is a human readable string represented using the 1977 ISO/IEC IS 10646-1 character set, encoded as an OctetString using 1978 the UTF-8 [RFC3629] transformation format described in RFC 3629. 1980 Since additional code points are added by amendments to the 10646 1981 standard from time to time, implementations MUST be prepared to 1982 encounter any code point from 0x00000001 to 0x7fffffff. Byte 1983 sequences that do not correspond to the valid encoding of a code 1984 point into UTF-8 charset or are outside this range are prohibited. 1986 The use of control codes SHOULD be avoided. When it is necessary 1987 to represent a new line, the control code sequence CR LF SHOULD be 1988 used. 1990 The use of leading or trailing white space SHOULD be avoided. 1992 For code points not directly supported by user interface hardware 1993 or software, an alternative means of entry and display, such as 1994 hexadecimal, MAY be provided. 1996 For information encoded in 7-bit US-ASCII, the UTF-8 charset is 1997 identical to the US-ASCII charset. 1999 UTF-8 may require multiple bytes to represent a single character / 2000 code point; thus the length of an UTF8String in octets may be 2001 different from the number of characters encoded. 2003 Note that the AVP Length field of an UTF8String is measured in 2004 octets, not characters. 2006 DiameterIdentity 2008 The DiameterIdentity format is derived from the OctetString AVP 2009 Base Format. 2011 DiameterIdentity = FQDN 2013 DiameterIdentity value is used to uniquely identify a Diameter 2014 node for purposes of duplicate connection and routing loop 2015 detection. 2017 The contents of the string MUST be the FQDN of the Diameter node. 2018 If multiple Diameter nodes run on the same host, each Diameter 2019 node MUST be assigned a unique DiameterIdentity. If a Diameter 2020 node can be identified by several FQDNs, a single FQDN should be 2021 picked at startup, and used as the only DiameterIdentity for that 2022 node, whatever the connection it is sent on. Note that in this 2023 document, DiameterIdentity is in ASCII form in order to be 2024 compatible with existing DNS infrastructure. See Appendix D for 2025 interactions between the Diameter protocol and Internationalized 2026 Domain Name (IDNs). 2028 DiameterURI 2030 The DiameterURI MUST follow the Uniform Resource Identifiers (URI) 2031 syntax [RFC3986] rules specified below: 2033 "aaa://" FQDN [ port ] [ transport ] [ protocol ] 2035 ; No transport security 2037 "aaas://" FQDN [ port ] [ transport ] [ protocol ] 2039 ; Transport security used 2041 FQDN = Fully Qualified Host Name 2043 port = ":" 1*DIGIT 2045 ; One of the ports used to listen for 2046 ; incoming connections. 2047 ; If absent, 2048 ; the default Diameter port (3868) is 2049 ; assumed. 2051 transport = ";transport=" transport-protocol 2053 ; One of the transports used to listen 2054 ; for incoming connections. If absent, 2055 ; the default protocol is assumed to be TCP. 2056 ; UDP MUST NOT be used when the aaa-protocol 2057 ; field is set to diameter. 2059 transport-protocol = ( "tcp" / "sctp" / "udp" ) 2061 protocol = ";protocol=" aaa-protocol 2063 ; If absent, the default AAA protocol 2064 ; is Diameter. 2066 aaa-protocol = ( "diameter" / "radius" / "tacacs+" ) 2068 The following are examples of valid Diameter host identities: 2070 aaa://host.example.com;transport=tcp 2071 aaa://host.example.com:6666;transport=tcp 2072 aaa://host.example.com;protocol=diameter 2073 aaa://host.example.com:6666;protocol=diameter 2074 aaa://host.example.com:6666;transport=tcp;protocol=diameter 2075 aaa://host.example.com:1813;transport=udp;protocol=radius 2077 Enumerated 2079 Enumerated is derived from the Integer32 AVP Base Format. The 2080 definition contains a list of valid values and their 2081 interpretation and is described in the Diameter application 2082 introducing the AVP. 2084 IPFilterRule 2086 The IPFilterRule format is derived from the OctetString AVP Base 2087 Format and uses the ASCII charset. The rule syntax is a modified 2088 subset of ipfw(8) from FreeBSD. Packets may be filtered based on 2089 the following information that is associated with it: 2091 Direction (in or out) 2092 Source and destination IP address (possibly masked) 2093 Protocol 2094 Source and destination port (lists or ranges) 2095 TCP flags 2096 IP fragment flag 2097 IP options 2098 ICMP types 2100 Rules for the appropriate direction are evaluated in order, with 2101 the first matched rule terminating the evaluation. Each packet is 2102 evaluated once. If no rule matches, the packet is dropped if the 2103 last rule evaluated was a permit, and passed if the last rule was 2104 a deny. 2106 IPFilterRule filters MUST follow the format: 2108 action dir proto from src to dst [options] 2110 action permit - Allow packets that match the rule. 2111 deny - Drop packets that match the rule. 2113 dir "in" is from the terminal, "out" is to the 2114 terminal. 2116 proto An IP protocol specified by number. The "ip" 2117 keyword means any protocol will match. 2119 src and dst
[ports] 2121 The
may be specified as: 2122 ipno An IPv4 or IPv6 number in dotted- 2123 quad or canonical IPv6 form. Only 2124 this exact IP number will match the 2125 rule. 2126 ipno/bits An IP number as above with a mask 2127 width of the form 1.2.3.4/24. In 2128 this case, all IP numbers from 2129 1.2.3.0 to 1.2.3.255 will match. 2130 The bit width MUST be valid for the 2131 IP version and the IP number MUST 2132 NOT have bits set beyond the mask. 2133 For a match to occur, the same IP 2134 version must be present in the 2135 packet that was used in describing 2136 the IP address. To test for a 2137 particular IP version, the bits part 2138 can be set to zero. The keyword 2139 "any" is 0.0.0.0/0 or the IPv6 2140 equivalent. The keyword "assigned" 2141 is the address or set of addresses 2142 assigned to the terminal. For IPv4, 2143 a typical first rule is often "deny 2144 in ip! assigned" 2146 The sense of the match can be inverted by 2147 preceding an address with the not modifier (!), 2148 causing all other addresses to be matched 2149 instead. This does not affect the selection of 2150 port numbers. 2152 With the TCP, UDP and SCTP protocols, optional 2153 ports may be specified as: 2155 {port/port-port}[,ports[,...]] 2157 The '-' notation specifies a range of ports 2158 (including boundaries). 2160 Fragmented packets that have a non-zero offset 2161 (i.e., not the first fragment) will never match 2162 a rule that has one or more port 2163 specifications. See the frag option for 2164 details on matching fragmented packets. 2166 options: 2167 frag Match if the packet is a fragment and this is not 2168 the first fragment of the datagram. frag may not 2169 be used in conjunction with either tcpflags or 2170 TCP/UDP port specifications. 2172 ipoptions spec 2173 Match if the IP header contains the comma 2174 separated list of options specified in spec. The 2175 supported IP options are: 2177 ssrr (strict source route), lsrr (loose source 2178 route), rr (record packet route) and ts 2179 (timestamp). The absence of a particular option 2180 may be denoted with a '!'. 2182 tcpoptions spec 2183 Match if the TCP header contains the comma 2184 separated list of options specified in spec. The 2185 supported TCP options are: 2187 mss (maximum segment size), window (tcp window 2188 advertisement), sack (selective ack), ts (rfc1323 2189 timestamp) and cc (rfc1644 t/tcp connection 2190 count). The absence of a particular option may 2191 be denoted with a '!'. 2193 established 2194 TCP packets only. Match packets that have the RST 2195 or ACK bits set. 2197 setup TCP packets only. Match packets that have the SYN 2198 bit set but no ACK bit. 2200 tcpflags spec 2201 TCP packets only. Match if the TCP header 2202 contains the comma separated list of flags 2203 specified in spec. The supported TCP flags are: 2205 fin, syn, rst, psh, ack and urg. The absence of a 2206 particular flag may be denoted with a '!'. A rule 2207 that contains a tcpflags specification can never 2208 match a fragmented packet that has a non-zero 2209 offset. See the frag option for details on 2210 matching fragmented packets. 2212 icmptypes types 2213 ICMP packets only. Match if the ICMP type is in 2214 the list types. The list may be specified as any 2215 combination of ranges or individual types 2216 separated by commas. Both the numeric values and 2217 the symbolic values listed below can be used. The 2218 supported ICMP types are: 2220 echo reply (0), destination unreachable (3), 2221 source quench (4), redirect (5), echo request 2222 (8), router advertisement (9), router 2223 solicitation (10), time-to-live exceeded (11), IP 2224 header bad (12), timestamp request (13), 2225 timestamp reply (14), information request (15), 2226 information reply (16), address mask request (17) 2227 and address mask reply (18). 2229 There is one kind of packet that the access device MUST always 2230 discard, that is an IP fragment with a fragment offset of one. 2231 This is a valid packet, but it only has one use, to try to 2232 circumvent firewalls. 2234 An access device that is unable to interpret or apply a deny rule 2235 MUST terminate the session. An access device that is unable to 2236 interpret or apply a permit rule MAY apply a more restrictive 2237 rule. An access device MAY apply deny rules of its own before the 2238 supplied rules, for example to protect the access device owner's 2239 infrastructure. 2241 4.4. Grouped AVP Values 2243 The Diameter protocol allows AVP values of type 'Grouped'. This 2244 implies that the Data field is actually a sequence of AVPs. It is 2245 possible to include an AVP with a Grouped type within a Grouped type, 2246 that is, to nest them. AVPs within an AVP of type Grouped have the 2247 same padding requirements as non-Grouped AVPs, as defined in Section 2248 4. 2250 The AVP Code numbering space of all AVPs included in a Grouped AVP is 2251 the same as for non-grouped AVPs. Receivers of a Grouped AVP that 2252 does not have the 'M' (mandatory) bit set and one or more of the 2253 encapsulated AVPs within the group has the 'M' (mandatory) bit set 2254 MAY simply be ignored if the Grouped AVP itself is unrecognized. The 2255 rule applies even if the encapsulated AVP with its 'M' (mandatory) 2256 bit set is further encapsulated within other sub-groups; i.e. other 2257 Grouped AVPs embedded within the Grouped AVP. 2259 Every Grouped AVP defined MUST include a corresponding grammar, using 2260 ABNF [RFC4234] (with modifications), as defined below. 2262 grouped-avp-def = name "::=" avp 2264 name-fmt = ALPHA *(ALPHA / DIGIT / "-") 2266 name = name-fmt 2267 ; The name has to be the name of an AVP, 2268 ; defined in the base or extended Diameter 2269 ; specifications. 2271 avp = header [ *fixed] [ *required] [ *optional] 2273 header = "<" "AVP-Header:" avpcode [vendor] ">" 2275 avpcode = 1*DIGIT 2276 ; The AVP Code assigned to the Grouped AVP 2278 vendor = 1*DIGIT 2279 ; The Vendor-ID assigned to the Grouped AVP. 2280 ; If absent, the default value of zero is 2281 ; used. 2283 4.4.1. Example AVP with a Grouped Data type 2285 The Example-AVP (AVP Code 999999) is of type Grouped and is used to 2286 clarify how Grouped AVP values work. The Grouped Data field has the 2287 following ABNF grammar: 2289 Example-AVP ::= < AVP Header: 999999 > 2290 { Origin-Host } 2291 1*{ Session-Id } 2292 *[ AVP ] 2294 An Example-AVP with Grouped Data follows. 2296 The Origin-Host AVP is required (Section 6.3). In this case: 2298 Origin-Host = "example.com". 2300 One or more Session-Ids must follow. Here there are two: 2302 Session-Id = 2303 "grump.example.com:33041;23432;893;0AF3B81" 2305 Session-Id = 2306 "grump.example.com:33054;23561;2358;0AF3B82" 2308 optional AVPs included are 2310 Recovery-Policy = 2311 2163bc1d0ad82371f6bc09484133c3f09ad74a0dd5346d54195a7cf0b35 2312 2cabc881839a4fdcfbc1769e2677a4c1fb499284c5f70b48f58503a45c5 2313 c2d6943f82d5930f2b7c1da640f476f0e9c9572a50db8ea6e51e1c2c7bd 2314 f8bb43dc995144b8dbe297ac739493946803e1cee3e15d9b765008a1b2a 2315 cf4ac777c80041d72c01e691cf751dbf86e85f509f3988e5875dc905119 2316 26841f00f0e29a6d1ddc1a842289d440268681e052b30fb638045f7779c 2317 1d873c784f054f688f5001559ecff64865ef975f3e60d2fd7966b8c7f92 2319 Futuristic-Acct-Record = 2320 fe19da5802acd98b07a5b86cb4d5d03f0314ab9ef1ad0b67111ff3b90a0 2321 57fe29620bf3585fd2dd9fcc38ce62f6cc208c6163c008f4258d1bc88b8 2322 17694a74ccad3ec69269461b14b2e7a4c111fb239e33714da207983f58c 2323 41d018d56fe938f3cbf089aac12a912a2f0d1923a9390e5f789cb2e5067 2324 d3427475e49968f841 2326 The data for the optional AVPs is represented in hex since the format 2327 of these AVPs is neither known at the time of definition of the 2328 Example-AVP group, nor (likely) at the time when the example instance 2329 of this AVP is interpreted - except by Diameter implementations which 2330 support the same set of AVPs. The encoding example illustrates how 2331 padding is used and how length fields are calculated. Also note that 2332 AVPs may be present in the Grouped AVP value which the receiver 2333 cannot interpret (here, the Recover-Policy and Futuristic-Acct-Record 2334 AVPs). The length of the Example-AVP is the sum of all the length of 2335 the member AVPs including their padding plus the Example-AVP header 2336 size. 2338 This AVP would be encoded as follows: 2340 0 1 2 3 4 5 6 7 2341 +-------+-------+-------+-------+-------+-------+-------+-------+ 2342 0 | Example AVP Header (AVP Code = 999999), Length = 496 | 2343 +-------+-------+-------+-------+-------+-------+-------+-------+ 2344 8 | Origin-Host AVP Header (AVP Code = 264), Length = 19 | 2345 +-------+-------+-------+-------+-------+-------+-------+-------+ 2346 16 | 'e' | 'x' | 'a' | 'm' | 'p' | 'l' | 'e' | '.' | 2347 +-------+-------+-------+-------+-------+-------+-------+-------+ 2348 24 | 'c' | 'o' | 'm' |Padding| Session-Id AVP Header | 2349 +-------+-------+-------+-------+-------+-------+-------+-------+ 2350 32 | (AVP Code = 263), Length = 49 | 'g' | 'r' | 'u' | 'm' | 2351 +-------+-------+-------+-------+-------+-------+-------+-------+ 2352 . . . 2353 +-------+-------+-------+-------+-------+-------+-------+-------+ 2354 72 | 'F' | '3' | 'B' | '8' | '1' |Padding|Padding|Padding| 2355 +-------+-------+-------+-------+-------+-------+-------+-------+ 2356 80 | Session-Id AVP Header (AVP Code = 263), Length = 50 | 2357 +-------+-------+-------+-------+-------+-------+-------+-------+ 2358 88 | 'g' | 'r' | 'u' | 'm' | 'p' | '.' | 'e' | 'x' | 2359 +-------+-------+-------+-------+-------+-------+-------+-------+ 2360 . . . 2361 +-------+-------+-------+-------+-------+-------+-------+-------+ 2362 120| '5' | '8' | ';' | '0' | 'A' | 'F' | '3' | 'B' | 2363 +-------+-------+-------+-------+-------+-------+-------+-------+ 2364 128| '8' | '2' |Padding|Padding| Recovery-Policy Header (AVP | 2365 +-------+-------+-------+-------+-------+-------+-------+-------+ 2366 136| Code = 8341), Length = 223 | 0x21 | 0x63 | 0xbc | 0x1d | 2367 +-------+-------+-------+-------+-------+-------+-------+-------+ 2368 144| 0x0a | 0xd8 | 0x23 | 0x71 | 0xf6 | 0xbc | 0x09 | 0x48 | 2369 +-------+-------+-------+-------+-------+-------+-------+-------+ 2370 . . . 2371 +-------+-------+-------+-------+-------+-------+-------+-------+ 2372 352| 0x8c | 0x7f | 0x92 |Padding| Futuristic-Acct-Record Header | 2373 +-------+-------+-------+-------+-------+-------+-------+-------+ 2374 328|(AVP Code = 15930),Length = 137| 0xfe | 0x19 | 0xda | 0x58 | 2375 +-------+-------+-------+-------+-------+-------+-------+-------+ 2376 336| 0x02 | 0xac | 0xd9 | 0x8b | 0x07 | 0xa5 | 0xb8 | 0xc6 | 2377 +-------+-------+-------+-------+-------+-------+-------+-------+ 2378 . . . 2379 +-------+-------+-------+-------+-------+-------+-------+-------+ 2380 488| 0xe4 | 0x99 | 0x68 | 0xf8 | 0x41 |Padding|Padding|Padding| 2381 +-------+-------+-------+-------+-------+-------+-------+-------+ 2383 4.5. Diameter Base Protocol AVPs 2385 The following table describes the Diameter AVPs defined in the base 2386 protocol, their AVP Code values, types, possible flag values. 2388 Due to space constraints, the short form DiamIdent is used to 2389 represent DiameterIdentity. 2391 +----------+ 2392 | AVP Flag | 2393 | rules | 2394 |----+-----| 2395 AVP Section | |MUST | 2396 Attribute Name Code Defined Data Type |MUST| NOT | 2397 -----------------------------------------|----+-----| 2398 Acct- 85 9.8.2 Unsigned32 | M | V | 2399 Interim-Interval | | | 2400 Accounting- 483 9.8.7 Enumerated | M | V | 2401 Realtime-Required | | | 2402 Acct- 50 9.8.5 UTF8String | M | V | 2403 Multi-Session-Id | | | 2404 Accounting- 485 9.8.3 Unsigned32 | M | V | 2405 Record-Number | | | 2406 Accounting- 480 9.8.1 Enumerated | M | V | 2407 Record-Type | | | 2408 Accounting- 44 9.8.4 OctetString| M | V | 2409 Session-Id | | | 2410 Accounting- 287 9.8.6 Unsigned64 | M | V | 2411 Sub-Session-Id | | | 2412 Acct- 259 6.9 Unsigned32 | M | V | 2413 Application-Id | | | 2414 Auth- 258 6.8 Unsigned32 | M | V | 2415 Application-Id | | | 2416 Auth-Request- 274 8.7 Enumerated | M | V | 2417 Type | | | 2418 Authorization- 291 8.9 Unsigned32 | M | V | 2419 Lifetime | | | 2420 Auth-Grace- 276 8.10 Unsigned32 | M | V | 2421 Period | | | 2422 Auth-Session- 277 8.11 Enumerated | M | V | 2423 State | | | 2424 Re-Auth-Request- 285 8.12 Enumerated | M | V | 2425 Type | | | 2426 Class 25 8.20 OctetString| M | V | 2427 Destination-Host 293 6.5 DiamIdent | M | V | 2428 Destination- 283 6.6 DiamIdent | M | V | 2429 Realm | | | 2430 Disconnect-Cause 273 5.4.3 Enumerated | M | V | 2431 Error-Message 281 7.3 UTF8String | | V,M | 2432 Error-Reporting- 294 7.4 DiamIdent | | V,M | 2433 Host | | | 2434 Event-Timestamp 55 8.21 Time | M | V | 2435 Experimental- 297 7.6 Grouped | M | V | 2436 Result | | | 2437 -----------------------------------------|----+-----| 2438 +----------+ 2439 | AVP Flag | 2440 | rules | 2441 |----+-----| 2442 AVP Section | |MUST | 2443 Attribute Name Code Defined Data Type |MUST| NOT | 2444 -----------------------------------------|----+-----| 2445 Experimental- 298 7.7 Unsigned32 | M | V | 2446 Result-Code | | | 2447 Failed-AVP 279 7.5 Grouped | M | V | 2448 Firmware- 267 5.3.4 Unsigned32 | | V,M | 2449 Revision | | | 2450 Host-IP-Address 257 5.3.5 Address | M | V | 2451 Inband-Security | M | V | 2452 -Id 299 6.10 Unsigned32 | | | 2453 Multi-Round- 272 8.19 Unsigned32 | M | V | 2454 Time-Out | | | 2455 Origin-Host 264 6.3 DiamIdent | M | V | 2456 Origin-Realm 296 6.4 DiamIdent | M | V | 2457 Origin-State-Id 278 8.16 Unsigned32 | M | V | 2458 Product-Name 269 5.3.7 UTF8String | | V,M | 2459 Proxy-Host 280 6.7.3 DiamIdent | M | V | 2460 Proxy-Info 284 6.7.2 Grouped | M | V | 2461 Proxy-State 33 6.7.4 OctetString| M | V | 2462 Redirect-Host 292 6.12 DiamURI | M | V | 2463 Redirect-Host- 261 6.13 Enumerated | M | V | 2464 Usage | | | 2465 Redirect-Max- 262 6.14 Unsigned32 | M | V | 2466 Cache-Time | | | 2467 Result-Code 268 7.1 Unsigned32 | M | V | 2468 Route-Record 282 6.7.1 DiamIdent | M | V | 2469 Session-Id 263 8.8 UTF8String | M | V | 2470 Session-Timeout 27 8.13 Unsigned32 | M | V | 2471 Session-Binding 270 8.17 Unsigned32 | M | V | 2472 Session-Server- 271 8.18 Enumerated | M | V | 2473 Failover | | | 2474 Supported- 265 5.3.6 Unsigned32 | M | V | 2475 Vendor-Id | | | 2476 Termination- 295 8.15 Enumerated | M | V | 2477 Cause | | | 2478 User-Name 1 8.14 UTF8String | M | V | 2479 Vendor-Id 266 5.3.3 Unsigned32 | M | V | 2480 Vendor-Specific- 260 6.11 Grouped | M | V | 2481 Application-Id | | | 2482 -----------------------------------------|----+-----| 2484 5. Diameter Peers 2486 This section describes how Diameter nodes establish connections and 2487 communicate with peers. 2489 5.1. Peer Connections 2491 Although a Diameter node may have many possible peers that it is able 2492 to communicate with, it may not be economical to have an established 2493 connection to all of them. At a minimum, a Diameter node SHOULD have 2494 an established connection with two peers per realm, known as the 2495 primary and secondary peers. Of course, a node MAY have additional 2496 connections, if it is deemed necessary. Typically, all messages for 2497 a realm are sent to the primary peer, but in the event that failover 2498 procedures are invoked, any pending requests are sent to the 2499 secondary peer. However, implementations are free to load balance 2500 requests between a set of peers. 2502 Note that a given peer MAY act as a primary for a given realm, while 2503 acting as a secondary for another realm. 2505 When a peer is deemed suspect, which could occur for various reasons, 2506 including not receiving a DWA within an allotted timeframe, no new 2507 requests should be forwarded to the peer, but failover procedures are 2508 invoked. When an active peer is moved to this mode, additional 2509 connections SHOULD be established to ensure that the necessary number 2510 of active connections exists. 2512 There are two ways that a peer is removed from the suspect peer list: 2514 1. The peer is no longer reachable, causing the transport connection 2515 to be shutdown. The peer is moved to the closed state. 2517 2. Three watchdog messages are exchanged with accepted round trip 2518 times, and the connection to the peer is considered stabilized. 2520 In the event the peer being removed is either the primary or 2521 secondary, an alternate peer SHOULD replace the deleted peer, and 2522 assume the role of either primary or secondary. 2524 5.2. Diameter Peer Discovery 2526 Allowing for dynamic Diameter agent discovery will make it possible 2527 for simpler and more robust deployment of Diameter services. In 2528 order to promote interoperable implementations of Diameter peer 2529 discovery, the following mechanisms are described. These are based 2530 on existing IETF standards. The first option (manual configuration) 2531 MUST be supported by all Diameter nodes, while the latter option 2532 (DNS) MAY be supported. 2534 There are two cases where Diameter peer discovery may be performed. 2535 The first is when a Diameter client needs to discover a first-hop 2536 Diameter agent. The second case is when a Diameter agent needs to 2537 discover another agent - for further handling of a Diameter 2538 operation. In both cases, the following 'search order' is 2539 recommended: 2541 1. The Diameter implementation consults its list of static 2542 (manually) configured Diameter agent locations. These will be 2543 used if they exist and respond. 2545 2. The Diameter implementation performs a NAPTR query for a server 2546 in a particular realm. The Diameter implementation has to know 2547 in advance which realm to look for a Diameter agent in. This 2548 could be deduced, for example, from the 'realm' in a NAI that a 2549 Diameter implementation needed to perform a Diameter operation 2550 on. 2552 * The services relevant for the task of transport protocol 2553 selection are those with NAPTR service fields with values 2554 "AAA+D2x", where x is a letter that corresponds to a transport 2555 protocol supported by the domain. This specification defines 2556 D2T for TCP and D2S for SCTP. An IANA registry for NAPTR 2557 service name to transport protocol mappings is defined in 2558 Section 11.6. 2560 These NAPTR records provide a mapping from a domain, to the 2561 SRV record for contacting a server with the specific transport 2562 protocol in the NAPTR services field. The resource record 2563 will contain an empty regular expression and the replacement 2564 value will contain the SRV record for that particular 2565 transport protocol. If the server supports multiple transport 2566 protocols, there will be multiple NAPTR records, each with a 2567 different service value. As per [RFC3403], the client 2568 discards any records whose services fields are not applicable. 2569 For the purposes of this specification, several rules are 2570 defined. 2572 * A client MUST discard any service fields that identify a 2573 resolution service whose value is not "D2X", for values of X 2574 that indicate transport protocols supported by the client. 2575 The NAPTR processing as described in [RFC3403] will result in 2576 discovery of the most preferred transport protocol of the 2577 server that is supported by the client, as well as an SRV 2578 record for the server. 2580 The domain suffixes in the NAPTR replacement field SHOULD 2581 match the domain of the original query. 2583 3. If no NAPTR records are found, the requester directly queries for 2584 SRV records '_diameter._sctp'.realm or '_diameter._tcp'.realm 2585 depending on the requesters network protocol capabilities. If 2586 SRV records are found then the requester can perform address 2587 record query (A RR's and/or AAAA RR's) for the target hostname 2588 specified in the SRV records. If no SRV records are found, the 2589 requester gives up. 2591 If the server is using a site certificate, the domain name in the 2592 NAPTR query and the domain name in the replacement field MUST both be 2593 valid based on the site certificate handed out by the server in the 2594 TLS or IKE exchange. Similarly, the domain name in the SRV query and 2595 the domain name in the target in the SRV record MUST both be valid 2596 based on the same site certificate. Otherwise, an attacker could 2597 modify the DNS records to contain replacement values in a different 2598 domain, and the client could not validate that this was the desired 2599 behavior, or the result of an attack. 2601 Also, the Diameter Peer MUST check to make sure that the discovered 2602 peers are authorized to act in its role. Authentication via IKE or 2603 TLS, or validation of DNS RRs via DNSSEC is not sufficient to 2604 conclude this. For example, a web server may have obtained a valid 2605 TLS certificate, and secured RRs may be included in the DNS, but this 2606 does not imply that it is authorized to act as a Diameter Server. 2608 Authorization can be achieved for example, by configuration of a 2609 Diameter Server CA. Alternatively this can be achieved by definition 2610 of OIDs within TLS or IKE certificates so as to signify Diameter 2611 Server authorization. 2613 A dynamically discovered peer causes an entry in the Peer Table (see 2614 Section 2.6) to be created. Note that entries created via DNS MUST 2615 expire (or be refreshed) within the DNS TTL. If a peer is discovered 2616 outside of the local realm, a routing table entry (see Section 2.7) 2617 for the peer's realm is created. The routing table entry's 2618 expiration MUST match the peer's expiration value. 2620 5.3. Capabilities Exchange 2622 When two Diameter peers establish a transport connection, they MUST 2623 exchange the Capabilities Exchange messages, as specified in the peer 2624 state machine (see Section 5.6). This message allows the discovery 2625 of a peer's identity and its capabilities (protocol version number, 2626 supported Diameter applications, security mechanisms, etc.) 2628 The receiver only issues commands to its peers that have advertised 2629 support for the Diameter application that defines the command. A 2630 Diameter node MUST cache the supported applications in order to 2631 ensure that unrecognized commands and/or AVPs are not unnecessarily 2632 sent to a peer. 2634 A receiver of a Capabilities-Exchange-Req (CER) message that does not 2635 have any applications in common with the sender MUST return a 2636 Capabilities-Exchange-Answer (CEA) with the Result-Code AVP set to 2637 DIAMETER_NO_COMMON_APPLICATION, and SHOULD disconnect the transport 2638 layer connection. Note that receiving a CER or CEA from a peer 2639 advertising itself as a Relay (see Section 2.4) MUST be interpreted 2640 as having common applications with the peer. 2642 The receiver of the Capabilities-Exchange-Request (CER) MUST 2643 determine common applications by computing the intersection of its 2644 own set of supported Application Id against all of the application 2645 identifier AVPs (Auth-Application-Id, Acct-Application-Id and Vendor- 2646 Specific-Application-Id) present in the CER. The value of the 2647 Vendor-Id AVP in the Vendor-Specific-Application-Id MUST NOT be used 2648 during computation. The sender of the Capabilities-Exchange-Answer 2649 (CEA) SHOULD include all of its supported applications as a hint to 2650 the receiver regarding all of its application capabilities. 2652 Similarly, a receiver of a Capabilities-Exchange-Req (CER) message 2653 that does not have any security mechanisms in common with the sender 2654 MUST return a Capabilities-Exchange-Answer (CEA) with the Result-Code 2655 AVP set to DIAMETER_NO_COMMON_SECURITY, and SHOULD disconnect the 2656 transport layer connection. 2658 CERs received from unknown peers MAY be silently discarded, or a CEA 2659 MAY be issued with the Result-Code AVP set to DIAMETER_UNKNOWN_PEER. 2660 In both cases, the transport connection is closed. If the local 2661 policy permits receiving CERs from unknown hosts, a successful CEA 2662 MAY be returned. If a CER from an unknown peer is answered with a 2663 successful CEA, the lifetime of the peer entry is equal to the 2664 lifetime of the transport connection. In case of a transport 2665 failure, all the pending transactions destined to the unknown peer 2666 can be discarded. 2668 The CER and CEA messages MUST NOT be proxied, redirected or relayed. 2670 Since the CER/CEA messages cannot be proxied, it is still possible 2671 that an upstream agent receives a message for which it has no 2672 available peers to handle the application that corresponds to the 2673 Command-Code. In such instances, the 'E' bit is set in the answer 2674 message (see Section 7.) with the Result-Code AVP set to 2675 DIAMETER_UNABLE_TO_DELIVER to inform the downstream to take action 2676 (e.g., re-routing request to an alternate peer). 2678 With the exception of the Capabilities-Exchange-Request message, a 2679 message of type Request that includes the Auth-Application-Id or 2680 Acct-Application-Id AVPs, or a message with an application-specific 2681 command code, MAY only be forwarded to a host that has explicitly 2682 advertised support for the application (or has advertised the Relay 2683 Application Id). 2685 5.3.1. Capabilities-Exchange-Request 2687 The Capabilities-Exchange-Request (CER), indicated by the Command- 2688 Code set to 257 and the Command Flags' 'R' bit set, is sent to 2689 exchange local capabilities. Upon detection of a transport failure, 2690 this message MUST NOT be sent to an alternate peer. 2692 When Diameter is run over SCTP [RFC2960], which allows for 2693 connections to span multiple interfaces and multiple IP addresses, 2694 the Capabilities-Exchange-Request message MUST contain one Host-IP- 2695 Address AVP for each potential IP address that MAY be locally used 2696 when transmitting Diameter messages. 2698 Message Format 2700 ::= < Diameter Header: 257, REQ > 2701 { Origin-Host } 2702 { Origin-Realm } 2703 1* { Host-IP-Address } 2704 { Vendor-Id } 2705 { Product-Name } 2706 [ Origin-State-Id ] 2707 * [ Supported-Vendor-Id ] 2708 * [ Auth-Application-Id ] 2709 * [ Inband-Security-Id ] 2710 * [ Acct-Application-Id ] 2711 * [ Vendor-Specific-Application-Id ] 2712 [ Firmware-Revision ] 2713 * [ AVP ] 2715 5.3.2. Capabilities-Exchange-Answer 2717 The Capabilities-Exchange-Answer (CEA), indicated by the Command-Code 2718 set to 257 and the Command Flags' 'R' bit cleared, is sent in 2719 response to a CER message. 2721 When Diameter is run over SCTP [RFC2960], which allows connections to 2722 span multiple interfaces, hence, multiple IP addresses, the 2723 Capabilities-Exchange-Answer message MUST contain one Host-IP-Address 2724 AVP for each potential IP address that MAY be locally used when 2725 transmitting Diameter messages. 2727 Message Format 2729 ::= < Diameter Header: 257 > 2730 { Result-Code } 2731 { Origin-Host } 2732 { Origin-Realm } 2733 1* { Host-IP-Address } 2734 { Vendor-Id } 2735 { Product-Name } 2736 [ Origin-State-Id ] 2737 [ Error-Message ] 2738 [ Failed-AVP ] 2739 * [ Supported-Vendor-Id ] 2740 * [ Auth-Application-Id ] 2741 * [ Inband-Security-Id ] 2742 * [ Acct-Application-Id ] 2743 * [ Vendor-Specific-Application-Id ] 2744 [ Firmware-Revision ] 2745 * [ AVP ] 2747 5.3.3. Vendor-Id AVP 2749 The Vendor-Id AVP (AVP Code 266) is of type Unsigned32 and contains 2750 the IANA "SMI Network Management Private Enterprise Codes" [RFC3232] 2751 value assigned to the vendor of the Diameter device. It is 2752 envisioned that the combination of the Vendor-Id, Product-Name 2753 (Section 5.3.7) and the Firmware-Revision (Section 5.3.4) AVPs may 2754 provide useful debugging information. 2756 A Vendor-Id value of zero in the CER or CEA messages is reserved and 2757 indicates that this field is ignored. 2759 5.3.4. Firmware-Revision AVP 2761 The Firmware-Revision AVP (AVP Code 267) is of type Unsigned32 and is 2762 used to inform a Diameter peer of the firmware revision of the 2763 issuing device. 2765 For devices that do not have a firmware revision (general purpose 2766 computers running Diameter software modules, for instance), the 2767 revision of the Diameter software module may be reported instead. 2769 5.3.5. Host-IP-Address AVP 2771 The Host-IP-Address AVP (AVP Code 257) is of type Address and is used 2772 to inform a Diameter peer of the sender's IP address. All source 2773 addresses that a Diameter node expects to use with SCTP [RFC2960] 2774 MUST be advertised in the CER and CEA messages by including a Host- 2775 IP-Address AVP for each address. 2777 5.3.6. Supported-Vendor-Id AVP 2779 The Supported-Vendor-Id AVP (AVP Code 265) is of type Unsigned32 and 2780 contains the IANA "SMI Network Management Private Enterprise Codes" 2781 [RFC3232] value assigned to a vendor other than the device vendor but 2782 including the application vendor. This is used in the CER and CEA 2783 messages in order to inform the peer that the sender supports (a 2784 subset of) the vendor-specific AVPs defined by the vendor identified 2785 in this AVP. The value of this AVP MUST NOT be set to zero. 2786 Multiple instances of this AVP containing the same value SHOULD NOT 2787 be sent. 2789 5.3.7. Product-Name AVP 2791 The Product-Name AVP (AVP Code 269) is of type UTF8String, and 2792 contains the vendor assigned name for the product. The Product-Name 2793 AVP SHOULD remain constant across firmware revisions for the same 2794 product. 2796 5.4. Disconnecting Peer connections 2798 When a Diameter node disconnects one of its transport connections, 2799 its peer cannot know the reason for the disconnect, and will most 2800 likely assume that a connectivity problem occurred, or that the peer 2801 has rebooted. In these cases, the peer may periodically attempt to 2802 reconnect, as stated in Section 2.1. In the event that the 2803 disconnect was a result of either a shortage of internal resources, 2804 or simply that the node in question has no intentions of forwarding 2805 any Diameter messages to the peer in the foreseeable future, a 2806 periodic connection request would not be welcomed. The 2807 Disconnection-Reason AVP contains the reason the Diameter node issued 2808 the Disconnect-Peer-Request message. 2810 The Disconnect-Peer-Request message is used by a Diameter node to 2811 inform its peer of its intent to disconnect the transport layer, and 2812 that the peer shouldn't reconnect unless it has a valid reason to do 2813 so (e.g., message to be forwarded). Upon receipt of the message, the 2814 Disconnect-Peer-Answer is returned, which SHOULD contain an error if 2815 messages have recently been forwarded, and are likely in flight, 2816 which would otherwise cause a race condition. 2818 The receiver of the Disconnect-Peer-Answer initiates the transport 2819 disconnect. The sender of the Disconnect-Peer-Answer should be able 2820 to detect the transport closure and cleanup the connection. 2822 5.4.1. Disconnect-Peer-Request 2824 The Disconnect-Peer-Request (DPR), indicated by the Command-Code set 2825 to 282 and the Command Flags' 'R' bit set, is sent to a peer to 2826 inform its intentions to shutdown the transport connection. Upon 2827 detection of a transport failure, this message MUST NOT be sent to an 2828 alternate peer. 2830 Message Format 2832 ::= < Diameter Header: 282, REQ > 2833 { Origin-Host } 2834 { Origin-Realm } 2835 { Disconnect-Cause } 2836 * [ AVP ] 2838 5.4.2. Disconnect-Peer-Answer 2840 The Disconnect-Peer-Answer (DPA), indicated by the Command-Code set 2841 to 282 and the Command Flags' 'R' bit cleared, is sent as a response 2842 to the Disconnect-Peer-Request message. Upon receipt of this 2843 message, the transport connection is shutdown. 2845 Message Format 2847 ::= < Diameter Header: 282 > 2848 { Result-Code } 2849 { Origin-Host } 2850 { Origin-Realm } 2851 [ Error-Message ] 2852 [ Failed-AVP ] 2853 * [ AVP ] 2855 5.4.3. Disconnect-Cause AVP 2857 The Disconnect-Cause AVP (AVP Code 273) is of type Enumerated. A 2858 Diameter node MUST include this AVP in the Disconnect-Peer-Request 2859 message to inform the peer of the reason for its intention to 2860 shutdown the transport connection. The following values are 2861 supported: 2863 REBOOTING 0 2864 A scheduled reboot is imminent. Receiver of DPR with above result 2865 code MAY attempt reconnection. 2867 BUSY 1 2868 The peer's internal resources are constrained, and it has 2869 determined that the transport connection needs to be closed. 2870 Receiver of DPR with above result code SHOULD NOT attempt 2871 reconnection. 2873 DO_NOT_WANT_TO_TALK_TO_YOU 2 2874 The peer has determined that it does not see a need for the 2875 transport connection to exist, since it does not expect any 2876 messages to be exchanged in the near future. Receiver of DPR 2877 with above result code SHOULD NOT attempt reconnection. 2879 5.5. Transport Failure Detection 2881 Given the nature of the Diameter protocol, it is recommended that 2882 transport failures be detected as soon as possible. Detecting such 2883 failures will minimize the occurrence of messages sent to unavailable 2884 agents, resulting in unnecessary delays, and will provide better 2885 failover performance. The Device-Watchdog-Request and Device- 2886 Watchdog-Answer messages, defined in this section, are used to pro- 2887 actively detect transport failures. 2889 5.5.1. Device-Watchdog-Request 2891 The Device-Watchdog-Request (DWR), indicated by the Command-Code set 2892 to 280 and the Command Flags' 'R' bit set, is sent to a peer when no 2893 traffic has been exchanged between two peers (see Section 5.5.3). 2894 Upon detection of a transport failure, this message MUST NOT be sent 2895 to an alternate peer. 2897 Message Format 2899 ::= < Diameter Header: 280, REQ > 2900 { Origin-Host } 2901 { Origin-Realm } 2902 [ Origin-State-Id ] 2904 * [ AVP ] 2906 5.5.2. Device-Watchdog-Answer 2908 The Device-Watchdog-Answer (DWA), indicated by the Command-Code set 2909 to 280 and the Command Flags' 'R' bit cleared, is sent as a response 2910 to the Device-Watchdog-Request message. 2912 Message Format 2914 ::= < Diameter Header: 280 > 2915 { Result-Code } 2916 { Origin-Host } 2917 { Origin-Realm } 2918 [ Error-Message ] 2919 [ Failed-AVP ] 2920 [ Origin-State-Id ] 2921 * [ AVP ] 2923 5.5.3. Transport Failure Algorithm 2925 The transport failure algorithm is defined in [RFC3539]. All 2926 Diameter implementations MUST support the algorithm defined in the 2927 specification in order to be compliant to the Diameter base protocol. 2929 5.5.4. Failover and Failback Procedures 2931 In the event that a transport failure is detected with a peer, it is 2932 necessary for all pending request messages to be forwarded to an 2933 alternate agent, if possible. This is commonly referred to as 2934 failover. 2936 In order for a Diameter node to perform failover procedures, it is 2937 necessary for the node to maintain a pending message queue for a 2938 given peer. When an answer message is received, the corresponding 2939 request is removed from the queue. The Hop-by-Hop Identifier field 2940 is used to match the answer with the queued request. 2942 When a transport failure is detected, if possible all messages in the 2943 queue are sent to an alternate agent with the T flag set. On booting 2944 a Diameter client or agent, the T flag is also set on any records 2945 still remaining to be transmitted in non-volatile storage. An 2946 example of a case where it is not possible to forward the message to 2947 an alternate server is when the message has a fixed destination, and 2948 the unavailable peer is the message's final destination (see 2949 Destination-Host AVP). Such an error requires that the agent return 2950 an answer message with the 'E' bit set and the Result-Code AVP set to 2951 DIAMETER_UNABLE_TO_DELIVER. 2953 It is important to note that multiple identical requests or answers 2954 MAY be received as a result of a failover. The End-to-End Identifier 2955 field in the Diameter header along with the Origin-Host AVP MUST be 2956 used to identify duplicate messages. 2958 As described in Section 2.1, a connection request should be 2959 periodically attempted with the failed peer in order to re-establish 2960 the transport connection. Once a connection has been successfully 2961 established, messages can once again be forwarded to the peer. This 2962 is commonly referred to as failback. 2964 5.6. Peer State Machine 2966 This section contains a finite state machine that MUST be observed by 2967 all Diameter implementations. Each Diameter node MUST follow the 2968 state machine described below when communicating with each peer. 2969 Multiple actions are separated by commas, and may continue on 2970 succeeding lines, as space requires. Similarly, state and next state 2971 may also span multiple lines, as space requires. 2973 This state machine is closely coupled with the state machine 2974 described in [RFC3539], which is used to open, close, failover, 2975 probe, and reopen transport connections. Note in particular that 2976 [RFC3539] requires the use of watchdog messages to probe connections. 2977 For Diameter, DWR and DWA messages are to be used. 2979 I- is used to represent the initiator (connecting) connection, while 2980 the R- is used to represent the responder (listening) connection. 2981 The lack of a prefix indicates that the event or action is the same 2982 regardless of the connection on which the event occurred. 2984 The stable states that a state machine may be in are Closed, I-Open 2985 and R-Open; all other states are intermediate. Note that I-Open and 2986 R-Open are equivalent except for whether the initiator or responder 2987 transport connection is used for communication. 2989 A CER message is always sent on the initiating connection immediately 2990 after the connection request is successfully completed. In the case 2991 of an election, one of the two connections will shut down. The 2992 responder connection will survive if the Origin-Host of the local 2993 Diameter entity is higher than that of the peer; the initiator 2994 connection will survive if the peer's Origin-Host is higher. All 2995 subsequent messages are sent on the surviving connection. Note that 2996 the results of an election on one peer are guaranteed to be the 2997 inverse of the results on the other. 2999 For TLS usage, a TLS handshake will begin when both ends are in the 3000 open state. If the TLS handshake is successful, all further messages 3001 will be sent via TLS. If the handshake fails, both ends move to the 3002 closed state. 3004 The state machine constrains only the behavior of a Diameter 3005 implementation as seen by Diameter peers through events on the wire. 3007 Any implementation that produces equivalent results is considered 3008 compliant. 3010 state event action next state 3011 ----------------------------------------------------------------- 3012 Closed Start I-Snd-Conn-Req Wait-Conn-Ack 3013 R-Conn-CER R-Accept, R-Open 3014 Process-CER, 3015 R-Snd-CEA 3017 Wait-Conn-Ack I-Rcv-Conn-Ack I-Snd-CER Wait-I-CEA 3018 I-Rcv-Conn-Nack Cleanup Closed 3019 R-Conn-CER R-Accept, Wait-Conn-Ack/ 3020 Process-CER Elect 3021 Timeout Error Closed 3023 Wait-I-CEA I-Rcv-CEA Process-CEA I-Open 3024 R-Conn-CER R-Accept, Wait-Returns 3025 Process-CER, 3026 Elect 3027 I-Peer-Disc I-Disc Closed 3028 I-Rcv-Non-CEA Error Closed 3029 Timeout Error Closed 3031 Wait-Conn-Ack/ I-Rcv-Conn-Ack I-Snd-CER,Elect Wait-Returns 3032 Elect I-Rcv-Conn-Nack R-Snd-CEA R-Open 3033 R-Peer-Disc R-Disc Wait-Conn-Ack 3034 R-Conn-CER R-Reject Wait-Conn-Ack/ 3035 Elect 3036 Timeout Error Closed 3038 Wait-Returns Win-Election I-Disc,R-Snd-CEA R-Open 3039 I-Peer-Disc I-Disc, R-Open 3040 R-Snd-CEA 3041 I-Rcv-CEA R-Disc I-Open 3042 R-Peer-Disc R-Disc Wait-I-CEA 3043 R-Conn-CER R-Reject Wait-Returns 3044 Timeout Error Closed 3046 R-Open Send-Message R-Snd-Message R-Open 3047 R-Rcv-Message Process R-Open 3048 R-Rcv-DWR Process-DWR, R-Open 3049 R-Snd-DWA 3050 R-Rcv-DWA Process-DWA R-Open 3051 R-Conn-CER R-Reject R-Open 3052 Stop R-Snd-DPR Closing 3053 R-Rcv-DPR R-Snd-DPA, Closed 3054 R-Disc 3055 R-Peer-Disc R-Disc Closed 3057 I-Open Send-Message I-Snd-Message I-Open 3058 I-Rcv-Message Process I-Open 3059 I-Rcv-DWR Process-DWR, I-Open 3060 I-Snd-DWA 3061 I-Rcv-DWA Process-DWA I-Open 3062 R-Conn-CER R-Reject I-Open 3063 Stop I-Snd-DPR Closing 3064 I-Rcv-DPR I-Snd-DPA, Closed 3065 I-Disc 3066 I-Peer-Disc I-Disc Closed 3068 Closing I-Rcv-DPA I-Disc Closed 3069 R-Rcv-DPA R-Disc Closed 3070 Timeout Error Closed 3071 I-Peer-Disc I-Disc Closed 3072 R-Peer-Disc R-Disc Closed 3074 5.6.1. Incoming connections 3076 When a connection request is received from a Diameter peer, it is 3077 not, in the general case, possible to know the identity of that peer 3078 until a CER is received from it. This is because host and port 3079 determine the identity of a Diameter peer; and the source port of an 3080 incoming connection is arbitrary. Upon receipt of CER, the identity 3081 of the connecting peer can be uniquely determined from Origin-Host. 3083 For this reason, a Diameter peer must employ logic separate from the 3084 state machine to receive connection requests, accept them, and await 3085 CER. Once CER arrives on a new connection, the Origin-Host that 3086 identifies the peer is used to locate the state machine associated 3087 with that peer, and the new connection and CER are passed to the 3088 state machine as an R-Conn-CER event. 3090 The logic that handles incoming connections SHOULD close and discard 3091 the connection if any message other than CER arrives, or if an 3092 implementation-defined timeout occurs prior to receipt of CER. 3094 Because handling of incoming connections up to and including receipt 3095 of CER requires logic, separate from that of any individual state 3096 machine associated with a particular peer, it is described separately 3097 in this section rather than in the state machine above. 3099 5.6.2. Events 3101 Transitions and actions in the automaton are caused by events. In 3102 this section, we will ignore the -I and -R prefix, since the actual 3103 event would be identical, but would occur on one of two possible 3104 connections. 3106 Start The Diameter application has signaled that a 3107 connection should be initiated with the peer. 3109 R-Conn-CER An acknowledgement is received stating that the 3110 transport connection has been established, and the 3111 associated CER has arrived. 3113 Rcv-Conn-Ack A positive acknowledgement is received confirming that 3114 the transport connection is established. 3116 Rcv-Conn-Nack A negative acknowledgement was received stating that 3117 the transport connection was not established. 3119 Timeout An application-defined timer has expired while waiting 3120 for some event. 3122 Rcv-CER A CER message from the peer was received. 3124 Rcv-CEA A CEA message from the peer was received. 3126 Rcv-Non-CEA A message other than CEA from the peer was received. 3128 Peer-Disc A disconnection indication from the peer was received. 3130 Rcv-DPR A DPR message from the peer was received. 3132 Rcv-DPA A DPA message from the peer was received. 3134 Win-Election An election was held, and the local node was the 3135 winner. 3137 Send-Message A message is to be sent. 3139 Rcv-Message A message other than CER, CEA, DPR, DPA, DWR or DWA 3140 was received. 3142 Stop The Diameter application has signaled that a 3143 connection should be terminated (e.g., on system 3144 shutdown). 3146 5.6.3. Actions 3148 Actions in the automaton are caused by events and typically indicate 3149 the transmission of packets and/or an action to be taken on the 3150 connection. In this section we will ignore the I- and R-prefix, 3151 since the actual action would be identical, but would occur on one of 3152 two possible connections. 3154 Snd-Conn-Req A transport connection is initiated with the peer. 3156 Accept The incoming connection associated with the R-Conn-CER 3157 is accepted as the responder connection. 3159 Reject The incoming connection associated with the R-Conn-CER 3160 is disconnected. 3162 Process-CER The CER associated with the R-Conn-CER is processed. 3163 Snd-CER A CER message is sent to the peer. 3165 Snd-CEA A CEA message is sent to the peer. 3167 Cleanup If necessary, the connection is shutdown, and any 3168 local resources are freed. 3170 Error The transport layer connection is disconnected, 3171 either politely or abortively, in response to 3172 an error condition. Local resources are freed. 3174 Process-CEA A received CEA is processed. 3176 Snd-DPR A DPR message is sent to the peer. 3178 Snd-DPA A DPA message is sent to the peer. 3180 Disc The transport layer connection is disconnected, 3181 and local resources are freed. 3183 Elect An election occurs (see Section 5.6.4 for more 3184 information). 3186 Snd-Message A message is sent. 3188 Snd-DWR A DWR message is sent. 3190 Snd-DWA A DWA message is sent. 3192 Process-DWR The DWR message is serviced. 3194 Process-DWA The DWA message is serviced. 3196 Process A message is serviced. 3198 5.6.4. The Election Process 3200 The election is performed on the responder. The responder compares 3201 the Origin-Host received in the CER with its own Origin-Host as two 3202 streams of octets. If the local Origin-Host lexicographically 3203 succeeds the received Origin-Host a Win-Election event is issued 3204 locally. Diameter identities are in ASCII form therefore the lexical 3205 comparison is consistent with DNS case insensitivity where octets 3206 that fall in the ASCII range 'a' through 'z' MUST compare equally to 3207 their upper-case counterparts between 'A' and 'Z'. See Appendix D 3208 for interactions between the Diameter protocol and Internationalized 3209 Domain Name (IDNs). 3211 The winner of the election MUST close the connection it initiated. 3212 Historically, maintaining the responder side of a connection was more 3213 efficient than maintaining the initiator side. However, current 3214 practices makes this distinction irrelevant. 3216 6. Diameter message processing 3218 This section describes how Diameter requests and answers are created 3219 and processed. 3221 6.1. Diameter Request Routing Overview 3223 A request is sent towards its final destination using a combination 3224 of the Destination-Realm and Destination-Host AVPs, in one of these 3225 three combinations: 3227 o a request that is not able to be proxied (such as CER) MUST NOT 3228 contain either Destination-Realm or Destination-Host AVPs. 3230 o a request that needs to be sent to a home server serving a 3231 specific realm, but not to a specific server (such as the first 3232 request of a series of round-trips), MUST contain a Destination- 3233 Realm AVP, but MUST NOT contain a Destination-Host AVP. For 3234 Diameter clients, the value of the Destination-Realm AVP MAY be 3235 extracted from the User-Name AVP, or other methods. 3237 o otherwise, a request that needs to be sent to a specific home 3238 server among those serving a given realm, MUST contain both the 3239 Destination-Realm and Destination-Host AVPs. 3241 The Destination-Host AVP is used as described above when the 3242 destination of the request is fixed, which includes: 3244 o Authentication requests that span multiple round trips 3246 o A Diameter message that uses a security mechanism that makes use 3247 of a pre-established session key shared between the source and the 3248 final destination of the message. 3250 o Server initiated messages that MUST be received by a specific 3251 Diameter client (e.g., access device), such as the Abort-Session- 3252 Request message, which is used to request that a particular user's 3253 session be terminated. 3255 Note that an agent can forward a request to a host described in the 3256 Destination-Host AVP only if the host in question is included in its 3257 peer table (see Section 2.7). Otherwise, the request is routed based 3258 on the Destination-Realm only (see Sections 6.1.6). 3260 When a message is received, the message is processed in the following 3261 order: 3263 o If the message is destined for the local host, the procedures 3264 listed in Section 6.1.4 are followed. 3266 o If the message is intended for a Diameter peer with whom the local 3267 host is able to directly communicate, the procedures listed in 3268 Section 6.1.5 are followed. This is known as Request Forwarding. 3270 o The procedures listed in Section 6.1.6 are followed, which is 3271 known as Request Routing. 3273 o If none of the above is successful, an answer is returned with the 3274 Result-Code set to DIAMETER_UNABLE_TO_DELIVER, with the E-bit set. 3276 For routing of Diameter messages to work within an administrative 3277 domain, all Diameter nodes within the realm MUST be peers. 3279 Note the processing rules contained in this section are intended to 3280 be used as general guidelines to Diameter developers. Certain 3281 implementations MAY use different methods than the ones described 3282 here, and still comply with the protocol specification. See Section 3283 7 for more detail on error handling. 3285 6.1.1. Originating a Request 3287 When creating a request, in addition to any other procedures 3288 described in the application definition for that specific request, 3289 the following procedures MUST be followed: 3291 o the Command-Code is set to the appropriate value 3293 o the 'R' bit is set 3295 o the End-to-End Identifier is set to a locally unique value 3297 o the Origin-Host and Origin-Realm AVPs MUST be set to the 3298 appropriate values, used to identify the source of the message 3300 o the Destination-Host and Destination-Realm AVPs MUST be set to the 3301 appropriate values as described in Section 6.1. 3303 6.1.2. Sending a Request 3305 When sending a request, originated either locally, or as the result 3306 of a forwarding or routing operation, the following procedures SHOULD 3307 be followed: 3309 o The Hop-by-Hop Identifier SHOULD be set to a locally unique value. 3311 o The message SHOULD be saved in the list of pending requests. 3313 Other actions to perform on the message based on the particular role 3314 the agent is playing are described in the following sections. 3316 6.1.3. Receiving Requests 3318 A relay or proxy agent MUST check for forwarding loops when receiving 3319 requests. A loop is detected if the server finds its own identity in 3320 a Route-Record AVP. When such an event occurs, the agent MUST answer 3321 with the Result-Code AVP set to DIAMETER_LOOP_DETECTED. 3323 6.1.4. Processing Local Requests 3325 A request is known to be for local consumption when one of the 3326 following conditions occur: 3328 o The Destination-Host AVP contains the local host's identity, 3330 o The Destination-Host AVP is not present, the Destination-Realm AVP 3331 contains a realm the server is configured to process locally, and 3332 the Diameter application is locally supported, or 3334 o Both the Destination-Host and the Destination-Realm are not 3335 present. 3337 When a request is locally processed, the rules in Section 6.2 should 3338 be used to generate the corresponding answer. 3340 6.1.5. Request Forwarding 3342 Request forwarding is done using the Diameter Peer Table. The 3343 Diameter peer table contains all of the peers that the local node is 3344 able to directly communicate with. 3346 When a request is received, and the host encoded in the Destination- 3347 Host AVP is one that is present in the peer table, the message SHOULD 3348 be forwarded to the peer. 3350 6.1.6. Request Routing 3352 Diameter request message routing is done via realms and application 3353 identifiers. A Diameter message that may be forwarded by Diameter 3354 agents (proxies, redirect or relay agents) MUST include the target 3355 realm in the Destination-Realm AVP. Request routing SHOULD rely on 3356 the Destination-Realm AVP and the Application Id present in the 3357 request message header to aid in the routing decision. The realm MAY 3358 be retrieved from the User-Name AVP, which is in the form of a 3359 Network Access Identifier (NAI). The realm portion of the NAI is 3360 inserted in the Destination-Realm AVP. 3362 Diameter agents MAY have a list of locally supported realms and 3363 applications, and MAY have a list of externally supported realms and 3364 applications. When a request is received that includes a realm 3365 and/or application that is not locally supported, the message is 3366 routed to the peer configured in the Routing Table (see Section 2.7). 3368 Realm names and Application Ids are the minimum supported routing 3369 criteria, additional information maybe needed to support redirect 3370 semantics. 3372 6.1.7. Predictive Loop Avoidance 3374 Before forwarding or routing a request, Diameter agents, in addition 3375 to processing done in Section 6.1.3, SHOULD check for the presence of 3376 candidate route's peer identity in any of the Route-Record AVPs. In 3377 an event of the agent detecting the presence of a candidate route's 3378 peer identity in a Route-Record AVP, the agent MUST ignore such route 3379 for the Diameter request message and attempt alternate routes if any. 3380 In case all the candidate routes are eliminated by the above 3381 criteria, the agent SHOULD return DIAMETER_UNABLE_TO_DELIVER message. 3383 6.1.8. Redirecting Requests 3385 When a redirect agent receives a request whose routing entry is set 3386 to REDIRECT, it MUST reply with an answer message with the 'E' bit 3387 set, while maintaining the Hop-by-Hop Identifier in the header, and 3388 include the Result-Code AVP to DIAMETER_REDIRECT_INDICATION. Each of 3389 the servers associated with the routing entry are added in separate 3390 Redirect-Host AVP. 3392 +------------------+ 3393 | Diameter | 3394 | Redirect Agent | 3395 +------------------+ 3396 ^ | 2. command + 'E' bit 3397 1. Request | | Result-Code = 3398 joe@example.com | | DIAMETER_REDIRECT_INDICATION + 3399 | | Redirect-Host AVP(s) 3400 | v 3401 +-------------+ 3. Request +-------------+ 3402 | example.com |------------->| example.net | 3403 | Relay | | Diameter | 3404 | Agent |<-------------| Server | 3405 +-------------+ 4. Answer +-------------+ 3406 Figure 5: Diameter Redirect Agent 3408 The receiver of the answer message with the 'E' bit set, and the 3409 Result-Code AVP set to DIAMETER_REDIRECT_INDICATION uses the hop-by- 3410 hop field in the Diameter header to identify the request in the 3411 pending message queue (see Section 5.3) that is to be redirected. If 3412 no transport connection exists with the new agent, one is created, 3413 and the request is sent directly to it. 3415 Multiple Redirect-Host AVPs are allowed. The receiver of the answer 3416 message with the 'E' bit set selects exactly one of these hosts as 3417 the destination of the redirected message. 3419 When the Redirect-Host-Usage AVP included in the answer message has a 3420 non-zero value, a route entry for the redirect indications is created 3421 and cached by the receiver. The redirect usage for such route entry 3422 is set by the value of Redirect-Host-Usage AVP and the lifetime of 3423 the cached route entry is set by Redirect-Max-Cache-Time AVP value. 3425 It is possible that multiple redirect indications can create multiple 3426 cached route entries differing only in their redirect usage and the 3427 peer to forward messages to. As an example, two(2) route entries 3428 that are created by two(2) redirect indications results in two(2) 3429 cached routes for the same realm and Application Id. However, one 3430 has a redirect usage of ALL_SESSION where matching request will be 3431 forwarded to one peer and the other has a redirect usage of ALL_REALM 3432 where request are forwarded to another peer. Therefore, an incoming 3433 request that matches the realm and Application Id of both routes will 3434 need additional resolution. In such a case, a routing precedence 3435 rule MUST be used againts the redirect usage value to resolve the 3436 contention. The precedence rule can be found in Section 6.13. 3438 6.1.9. Relaying and Proxying Requests 3440 A relay or proxy agent MUST append a Route-Record AVP to all requests 3441 forwarded. The AVP contains the identity of the peer the request was 3442 received from. 3444 The Hop-by-Hop identifier in the request is saved, and replaced with 3445 a locally unique value. The source of the request is also saved, 3446 which includes the IP address, port and protocol. 3448 A relay or proxy agent MAY include the Proxy-Info AVP in requests if 3449 it requires access to any local state information when the 3450 corresponding response is received. The Proxy-Info AVP has security 3451 implications as state information is distribute to other entities. 3452 As such, it is RECOMMMENDED to protect the content of the Proxy-Info 3453 AVP with cryptographic mechanisms, for example by using a keyed 3454 message digest. Such a mechanism, however, requires the management 3455 of keys, although only locally at the Diameter server. Still, a full 3456 description of the management of the keys used to protect the Proxy- 3457 Info AVP is beyond the scope of this document. Below is a list of 3458 commonly recommended: 3460 o The keys should be generated securely following the randomness 3461 recommendations in [RFC4086]. 3463 o The keys and cryptographic protection algorithms should be at 3464 least 128 bits in strength. 3466 o The keys should not be used for any other purpose than generating 3467 and verifying tickets. 3469 o The keys should be changed regularly. 3471 o The keys should be changed if the ticket format or cryptographic 3472 protection algorithms change. 3474 The message is then forwarded to the next hop, as identified in the 3475 Routing Table. 3477 Figure 6 provides an example of message routing using the procedures 3478 listed in these sections. 3480 (Origin-Host=nas.mno.net) (Origin-Host=nas.mno.net) 3481 (Origin-Realm=mno.net) (Origin-Realm=mno.net) 3482 (Destination-Realm=example.com) (Destination- 3483 Realm=example.com) 3484 (Route-Record=nas.example.net) 3485 +------+ ------> +------+ ------> +------+ 3486 | | (Request) | | (Request) | | 3487 | NAS +-------------------+ DRL +-------------------+ HMS | 3488 | | | | | | 3489 +------+ <------ +------+ <------ +------+ 3490 example.net (Answer) example.net (Answer) example.com 3491 (Origin-Host=hms.example.com) (Origin-Host=hms.example.com) 3492 (Origin-Realm=example.com) (Origin-Realm=example.com) 3494 Figure 6: Routing of Diameter messages 3496 Relay and proxy agents are not required to perform full inspection of 3497 incoming messages. At a minimum, validation of the message header 3498 and relevant routing AVPs has to be done when relaying messages. 3499 Proxy agents may optionally perform more in-depth message validation 3500 for applications it is interested in. 3502 6.2. Diameter Answer Processing 3504 When a request is locally processed, the following procedures MUST be 3505 applied to create the associated answer, in addition to any 3506 additional procedures that MAY be discussed in the Diameter 3507 application defining the command: 3509 o The same Hop-by-Hop identifier in the request is used in the 3510 answer. 3512 o The local host's identity is encoded in the Origin-Host AVP. 3514 o The Destination-Host and Destination-Realm AVPs MUST NOT be 3515 present in the answer message. 3517 o The Result-Code AVP is added with its value indicating success or 3518 failure. 3520 o If the Session-Id is present in the request, it MUST be included 3521 in the answer. 3523 o Any Proxy-Info AVPs in the request MUST be added to the answer 3524 message, in the same order they were present in the request. 3526 o The 'P' bit is set to the same value as the one in the request. 3528 o The same End-to-End identifier in the request is used in the 3529 answer. 3531 Note that the error messages (see Section 7.3) are also subjected to 3532 the above processing rules. 3534 6.2.1. Processing received Answers 3536 A Diameter client or proxy MUST match the Hop-by-Hop Identifier in an 3537 answer received against the list of pending requests. The 3538 corresponding message should be removed from the list of pending 3539 requests. It SHOULD ignore answers received that do not match a 3540 known Hop-by-Hop Identifier. 3542 6.2.2. Relaying and Proxying Answers 3544 If the answer is for a request which was proxied or relayed, the 3545 agent MUST restore the original value of the Diameter header's Hop- 3546 by-Hop Identifier field. 3548 If the last Proxy-Info AVP in the message is targeted to the local 3549 Diameter server, the AVP MUST be removed before the answer is 3550 forwarded. 3552 If a relay or proxy agent receives an answer with a Result-Code AVP 3553 indicating a failure, it MUST NOT modify the contents of the AVP. 3554 Any additional local errors detected SHOULD be logged, but not 3555 reflected in the Result-Code AVP. If the agent receives an answer 3556 message with a Result-Code AVP indicating success, and it wishes to 3557 modify the AVP to indicate an error, it MUST modify the Result-Code 3558 AVP to contain the appropriate error in the message destined towards 3559 the access device as well as include the Error-Reporting-Host AVP and 3560 it MUST issue an STR on behalf of the access device towards the 3561 Diameter server. 3563 The agent MUST then send the answer to the host that it received the 3564 original request from. 3566 6.3. Origin-Host AVP 3568 The Origin-Host AVP (AVP Code 264) is of type DiameterIdentity, and 3569 MUST be present in all Diameter messages. This AVP identifies the 3570 endpoint that originated the Diameter message. Relay agents MUST NOT 3571 modify this AVP. 3573 The value of the Origin-Host AVP is guaranteed to be unique within a 3574 single host. 3576 Note that the Origin-Host AVP may resolve to more than one address as 3577 the Diameter peer may support more than one address. 3579 This AVP SHOULD be placed as close to the Diameter header as 3580 possible. 3582 6.4. Origin-Realm AVP 3584 The Origin-Realm AVP (AVP Code 296) is of type DiameterIdentity. 3585 This AVP contains the Realm of the originator of any Diameter message 3586 and MUST be present in all messages. 3588 This AVP SHOULD be placed as close to the Diameter header as 3589 possible. 3591 6.5. Destination-Host AVP 3593 The Destination-Host AVP (AVP Code 293) is of type DiameterIdentity. 3594 This AVP MUST be present in all unsolicited agent initiated messages, 3595 MAY be present in request messages, and MUST NOT be present in Answer 3596 messages. 3598 The absence of the Destination-Host AVP will cause a message to be 3599 sent to any Diameter server supporting the application within the 3600 realm specified in Destination-Realm AVP. 3602 This AVP SHOULD be placed as close to the Diameter header as 3603 possible. 3605 6.6. Destination-Realm AVP 3607 The Destination-Realm AVP (AVP Code 283) is of type DiameterIdentity, 3608 and contains the realm the message is to be routed to. The 3609 Destination-Realm AVP MUST NOT be present in Answer messages. 3610 Diameter Clients insert the realm portion of the User-Name AVP. 3611 Diameter servers initiating a request message use the value of the 3612 Origin-Realm AVP from a previous message received from the intended 3613 target host (unless it is known a priori). When present, the 3614 Destination-Realm AVP is used to perform message routing decisions. 3616 An ABNF for a request message that includes the Destination-Realm AVP 3617 SHOULD list the Destination-Realm AVP as a required AVP (an AVP 3618 indicated as {AVP}) otherwise the message is inherently a non- 3619 routable messages. 3621 This AVP SHOULD be placed as close to the Diameter header as 3622 possible. 3624 6.7. Routing AVPs 3626 The AVPs defined in this section are Diameter AVPs used for routing 3627 purposes. These AVPs change as Diameter messages are processed by 3628 agents. 3630 6.7.1. Route-Record AVP 3632 The Route-Record AVP (AVP Code 282) is of type DiameterIdentity. The 3633 identity added in this AVP MUST be the same as the one received in 3634 the Origin-Host of the Capabilities Exchange message. 3636 6.7.2. Proxy-Info AVP 3638 The Proxy-Info AVP (AVP Code 284) is of type Grouped. This AVP 3639 contains the identity and local state information of Diameter node 3640 that creates and adds it to a message. The Grouped Data field has 3641 the following ABNF grammar: 3643 Proxy-Info ::= < AVP Header: 284 > 3644 { Proxy-Host } 3645 { Proxy-State } 3647 * [ AVP ] 3649 6.7.3. Proxy-Host AVP 3651 The Proxy-Host AVP (AVP Code 280) is of type DiameterIdentity. This 3652 AVP contains the identity of the host that added the Proxy-Info AVP. 3654 6.7.4. Proxy-State AVP 3656 The Proxy-State AVP (AVP Code 33) is of type OctetString. It 3657 contains state information that would otherwise be stored at the 3658 Diameter entity that created it. As such, this AVP MUST be treated 3659 as opaque data by entities other Diameter entities. 3661 6.8. Auth-Application-Id AVP 3663 The Auth-Application-Id AVP (AVP Code 258) is of type Unsigned32 and 3664 is used in order to advertise support of the Authentication and 3665 Authorization portion of an application (see Section 2.4). If 3666 present in a message other than CER and CEA, the value of the Auth- 3667 Application-Id AVP MUST match the Application Id present in the 3668 Diameter message header. 3670 6.9. Acct-Application-Id AVP 3672 The Acct-Application-Id AVP (AVP Code 259) is of type Unsigned32 and 3673 is used in order to advertise support of the Accounting portion of an 3674 application (see Section 2.4). If present in a message other than 3675 CER and CEA, the value of the Acct-Application-Id AVP MUST match the 3676 Application Id present in the Diameter message header. 3678 6.10. Inband-Security-Id AVP 3680 The Inband-Security-Id AVP (AVP Code 299) is of type Unsigned32 and 3681 is used in order to advertise support of the security portion of the 3682 application. 3684 Currently, the following values are supported, but there is ample 3685 room to add new security Ids. 3687 NO_INBAND_SECURITY 0 3689 This peer does not support TLS. This is the default value, if the 3690 AVP is omitted. 3692 TLS 1 3694 This node supports TLS security, as defined by [RFC4346]. 3696 6.11. Vendor-Specific-Application-Id AVP 3698 The Vendor-Specific-Application-Id AVP (AVP Code 260) is of type 3699 Grouped and is used to advertise support of a vendor-specific 3700 Diameter Application. Exactly one instance of either Auth- 3701 Application-Id or Acct-Application-Id AVP MUST be present. The 3702 Application Id carried by either Auth-Application-Id or Acct- 3703 Application-Id AVP MUST comply with vendor specific Application Id 3704 assignment described in Sec 11.3. It MUST also match the Application 3705 Id present in the Diameter header except when used in a CER or CEA 3706 messages. 3708 The Vendor-Id AVP is an informational AVP pertaining to the vendor 3709 who may have authorship of the vendor-specific Diameter application. 3710 It MUST NOT be used as a means of defining a completely separate 3711 vendor-specific Application Id space. 3713 The Vendor-Specific-Application-Id AVP SHOULD be placed as close to 3714 the Diameter header as possible. 3716 AVP Format 3718 ::= < AVP Header: 260 > 3719 { Vendor-Id } 3720 [ Auth-Application-Id ] 3721 [ Acct-Application-Id ] 3723 A Vendor-Specific-Application-Id AVP MUST contain exactly one of 3724 either Auth-Application-Id or Acct-Application-Id. If a Vendor- 3725 Specific-Application-Id is received without any of these two AVPs, 3726 then the recipient SHOULD issue an answer with a Result-Code set to 3727 DIAMETER_MISSING_AVP. The answer SHOULD also include a Failed-AVP 3728 which MUST contain an example of an Auth-Application-Id AVP and an 3729 Acct-Application-Id AVP. 3731 If a Vendor-Specific-Application-Id is received that contains both 3732 Auth-Application-Id and Acct-Application-Id, then the recipient MUST 3733 issue an answer with Result-Code set to 3734 DIAMETER_AVP_OCCURS_TOO_MANY_TIMES. The answer MUST also include a 3735 Failed-AVP which MUST contain the received Auth-Application-Id AVP 3736 and Acct-Application-Id AVP. 3738 6.12. Redirect-Host AVP 3740 One or more of instances of this AVP MUST be present if the answer 3741 message's 'E' bit is set and the Result-Code AVP is set to 3742 DIAMETER_REDIRECT_INDICATION. 3744 Upon receiving the above, the receiving Diameter node SHOULD forward 3745 the request directly to one of the hosts identified in these AVPs. 3746 The server contained in the selected Redirect-Host AVP SHOULD be used 3747 for all messages matching the criteria set by the Redirect-Host-Usage 3748 AVP. 3750 6.13. Redirect-Host-Usage AVP 3752 The Redirect-Host-Usage AVP (AVP Code 261) is of type Enumerated. 3753 This AVP MAY be present in answer messages whose 'E' bit is set and 3754 the Result-Code AVP is set to DIAMETER_REDIRECT_INDICATION. 3756 When present, this AVP provides a hints about how the routing entry 3757 resulting from the Redirect-Host is to be used. The following values 3758 are supported: 3760 DONT_CACHE 0 3762 The host specified in the Redirect-Host AVP SHOULD NOT be cached. 3763 This is the default value. 3765 ALL_SESSION 1 3767 All messages within the same session, as defined by the same value 3768 of the Session-ID AVP SHOULD be sent to the host specified in the 3769 Redirect-Host AVP. 3771 ALL_REALM 2 3773 All messages destined for the realm requested SHOULD be sent to 3774 the host specified in the Redirect-Host AVP. 3776 REALM_AND_APPLICATION 3 3778 All messages for the application requested to the realm specified 3779 SHOULD be sent to the host specified in the Redirect-Host AVP. 3781 ALL_APPLICATION 4 3783 All messages for the application requested SHOULD be sent to the 3784 host specified in the Redirect-Host AVP. 3786 ALL_HOST 5 3788 All messages that would be sent to the host that generated the 3789 Redirect-Host SHOULD be sent to the host specified in the 3790 Redirect- Host AVP. 3792 ALL_USER 6 3794 All messages for the user requested SHOULD be sent to the host 3795 specified in the Redirect-Host AVP. 3797 When multiple cached routes are created by redirect indications and 3798 they differ only in redirect usage and peers to forward requests to 3799 (see Section 6.1.8), a precedence rule MUST be applied to the 3800 redirect usage values of the cached routes during normal routing to 3801 resolve contentions that may occur. The precedence rule is the order 3802 that dictate which redirect usage should be considered before any 3803 other as they appear. The order is as follows: 3805 1. ALL_SESSION 3807 2. ALL_USER 3809 3. REALM_AND_APPLICATION 3811 4. ALL_REALM 3813 5. ALL_APPLICATION 3815 6. ALL_HOST 3817 6.14. Redirect-Max-Cache-Time AVP 3819 The Redirect-Max-Cache-Time AVP (AVP Code 262) is of type Unsigned32. 3820 This AVP MUST be present in answer messages whose 'E' bit is set, the 3821 Result-Code AVP is set to DIAMETER_REDIRECT_INDICATION and the 3822 Redirect-Host-Usage AVP set to a non-zero value. 3824 This AVP contains the maximum number of seconds the peer and route 3825 table entries, created as a result of the Redirect-Host, SHOULD be 3826 cached. Note that once a host is no longer reachable, any associated 3827 cache, peer and routing table entries MUST be deleted. 3829 7. Error Handling 3831 There are two different types of errors in Diameter; protocol and 3832 application errors. A protocol error is one that occurs at the base 3833 protocol level, and MAY require per hop attention (e.g., message 3834 routing error). Application errors, on the other hand, generally 3835 occur due to a problem with a function specified in a Diameter 3836 application (e.g., user authentication, missing AVP). 3838 Result-Code AVP values that are used to report protocol errors MUST 3839 only be present in answer messages whose 'E' bit is set. When a 3840 request message is received that causes a protocol error, an answer 3841 message is returned with the 'E' bit set, and the Result-Code AVP is 3842 set to the appropriate protocol error value. As the answer is sent 3843 back towards the originator of the request, each proxy or relay agent 3844 MAY take action on the message. 3846 1. Request +---------+ Link Broken 3847 +-------------------------->|Diameter |----///----+ 3848 | +---------------------| | v 3849 +------+--+ | 2. answer + 'E' set | Relay 2 | +--------+ 3850 |Diameter |<-+ (Unable to Forward) +---------+ |Diameter| 3851 | | | Home | 3852 | Relay 1 |--+ +---------+ | Server | 3853 +---------+ | 3. Request |Diameter | +--------+ 3854 +-------------------->| | ^ 3855 | Relay 3 |-----------+ 3856 +---------+ 3858 Figure 7: Example of Protocol Error causing answer message 3860 Figure 7 provides an example of a message forwarded upstream by a 3861 Diameter relay. When the message is received by Relay 2, and it 3862 detects that it cannot forward the request to the home server, an 3863 answer message is returned with the 'E' bit set and the Result-Code 3864 AVP set to DIAMETER_UNABLE_TO_DELIVER. Given that this error falls 3865 within the protocol error category, Relay 1 would take special 3866 action, and given the error, attempt to route the message through its 3867 alternate Relay 3. 3869 +---------+ 1. Request +---------+ 2. Request +---------+ 3870 | Access |------------>|Diameter |------------>|Diameter | 3871 | | | | | Home | 3872 | Device |<------------| Relay |<------------| Server | 3873 +---------+ 4. Answer +---------+ 3. Answer +---------+ 3874 (Missing AVP) (Missing AVP) 3876 Figure 8: Example of Application Error Answer message 3878 Figure 8 provides an example of a Diameter message that caused an 3879 application error. When application errors occur, the Diameter 3880 entity reporting the error clears the 'R' bit in the Command Flags, 3881 and adds the Result-Code AVP with the proper value. Application 3882 errors do not require any proxy or relay agent involvement, and 3883 therefore the message would be forwarded back to the originator of 3884 the request. 3886 There are certain Result-Code AVP application errors that require 3887 additional AVPs to be present in the answer. In these cases, the 3888 Diameter node that sets the Result-Code AVP to indicate the error 3889 MUST add the AVPs. Examples are: 3891 o An unrecognized AVP is received with the 'M' bit (Mandatory bit) 3892 set, causes an answer to be sent with the Result-Code AVP set to 3893 DIAMETER_AVP_UNSUPPORTED, and the Failed-AVP AVP containing the 3894 offending AVP. 3896 o An AVP that is received with an unrecognized value causes an 3897 answer to be returned with the Result-Code AVP set to 3898 DIAMETER_INVALID_AVP_VALUE, with the Failed-AVP AVP containing the 3899 AVP causing the error. 3901 o A command is received that is missing AVP(s) that are defined as 3902 required in the commands ABNF; examples are AVPs indicated as 3903 {AVP}. The receiver issues an answer with the Result-Code set to 3904 DIAMETER_MISSING_AVP, and creates an AVP with the AVP Code and 3905 other fields set as expected in the missing AVP. The created AVP 3906 is then added to the Failed- AVP AVP. 3908 The Result-Code AVP describes the error that the Diameter node 3909 encountered in its processing. In case there are multiple errors, 3910 the Diameter node MUST report only the first error it encountered 3911 (detected possibly in some implementation dependent order). The 3912 specific errors that can be described by this AVP are described in 3913 the following section. 3915 7.1. Result-Code AVP 3917 The Result-Code AVP (AVP Code 268) is of type Unsigned32 and 3918 indicates whether a particular request was completed successfully or 3919 whether an error occurred. All Diameter answer messages in IETF 3920 defined Diameter application specification MUST include one Result- 3921 Code AVP. A non-successful Result-Code AVP (one containing a non 3922 2xxx value other than DIAMETER_REDIRECT_INDICATION) MUST include the 3923 Error-Reporting-Host AVP if the host setting the Result-Code AVP is 3924 different from the identity encoded in the Origin-Host AVP. 3926 The Result-Code data field contains an IANA-managed 32-bit address 3927 space representing errors (see Section 11.4). Diameter provides the 3928 following classes of errors, all identified by the thousands digit in 3929 the decimal notation: 3931 o 1xxx (Informational) 3933 o 2xxx (Success) 3935 o 3xxx (Protocol Errors) 3937 o 4xxx (Transient Failures) 3939 o 5xxx (Permanent Failure) 3941 A non-recognized class (one whose first digit is not defined in this 3942 section) MUST be handled as a permanent failure. 3944 7.1.1. Informational 3946 Errors that fall within this category are used to inform the 3947 requester that a request could not be satisfied, and additional 3948 action is required on its part before access is granted. 3950 DIAMETER_MULTI_ROUND_AUTH 1001 3952 This informational error is returned by a Diameter server to 3953 inform the access device that the authentication mechanism being 3954 used requires multiple round trips, and a subsequent request needs 3955 to be issued in order for access to be granted. 3957 7.1.2. Success 3959 Errors that fall within the Success category are used to inform a 3960 peer that a request has been successfully completed. 3962 DIAMETER_SUCCESS 2001 3964 The request was successfully completed. 3966 DIAMETER_LIMITED_SUCCESS 2002 3968 When returned, the request was successfully completed, but 3969 additional processing is required by the application in order to 3970 provide service to the user. 3972 7.1.3. Protocol Errors 3974 Errors that fall within the Protocol Error category SHOULD be treated 3975 on a per-hop basis, and Diameter proxies MAY attempt to correct the 3976 error, if it is possible. Note that these errors MUST only be used 3977 in answer messages whose 'E' bit is set. This document omits some 3978 error codes defined in [RFC3588]. To provide backward compatibility 3979 with [RFC3588] implementations these error code values are not re- 3980 used and hence the error codes values enumerated below are non- 3981 sequential. 3983 DIAMETER_UNABLE_TO_DELIVER 3002 3985 This error is given when Diameter can not deliver the message to 3986 the destination, either because no host within the realm 3987 supporting the required application was available to process the 3988 request, or because Destination-Host AVP was given without the 3989 associated Destination-Realm AVP. 3991 DIAMETER_REALM_NOT_SERVED 3003 3993 The intended realm of the request is not recognized. 3995 DIAMETER_TOO_BUSY 3004 3997 When returned, a Diameter node SHOULD attempt to send the message 3998 to an alternate peer. This error MUST only be used when a 3999 specific server is requested, and it cannot provide the requested 4000 service. 4002 DIAMETER_LOOP_DETECTED 3005 4004 An agent detected a loop while trying to get the message to the 4005 intended recipient. The message MAY be sent to an alternate peer, 4006 if one is available, but the peer reporting the error has 4007 identified a configuration problem. 4009 DIAMETER_REDIRECT_INDICATION 3006 4011 A redirect agent has determined that the request could not be 4012 satisfied locally and the initiator of the request SHOULD direct 4013 the request directly to the server, whose contact information has 4014 been added to the response. When set, the Redirect-Host AVP MUST 4015 be present. 4017 DIAMETER_APPLICATION_UNSUPPORTED 3007 4019 A request was sent for an application that is not supported. 4021 DIAMETER_INVALID_BIT_IN_HEADER 3011 4023 This error is returned when a reserved bit in the Diameter header 4024 is set to one (1) or the bits in the Diameter header defined in 4025 Section 3 are set incorrectly. 4027 DIAMETER_INVALID_MESSAGE_LENGTH 3012 4029 This error is returned when a request is received with an invalid 4030 message length. 4032 7.1.4. Transient Failures 4034 Errors that fall within the transient failures category are used to 4035 inform a peer that the request could not be satisfied at the time it 4036 was received, but MAY be able to satisfy the request in the future. 4037 Note that these errors MUST be used in answer messages whose 'E' bit 4038 is not set. 4040 DIAMETER_AUTHENTICATION_REJECTED 4001 4042 The authentication process for the user failed, most likely due to 4043 an invalid password used by the user. Further attempts MUST only 4044 be tried after prompting the user for a new password. 4046 DIAMETER_OUT_OF_SPACE 4002 4048 A Diameter node received the accounting request but was unable to 4049 commit it to stable storage due to a temporary lack of space. 4051 ELECTION_LOST 4003 4053 The peer has determined that it has lost the election process and 4054 has therefore disconnected the transport connection. 4056 7.1.5. Permanent Failures 4058 Errors that fall within the permanent failures category are used to 4059 inform the peer that the request failed, and should not be attempted 4060 again. Note that these errors SHOULD be used in answer messages 4061 whose 'E' bit is not set. In error conditions where it is not 4062 possible or efficient to compose application specific answer grammar 4063 then answer messages with E-bit set and complying to the grammar 4064 described in 7.2 MAY also be used for permanent errors. 4066 To provide backward compatibility with existing implementations that 4067 follow [RFC3588], some of the error values that have previously been 4068 used in this category by [RFC3588] will not be re-used. Therefore 4069 the error values enumerated here maybe non-sequential. 4071 DIAMETER_AVP_UNSUPPORTED 5001 4073 The peer received a message that contained an AVP that is not 4074 recognized or supported and was marked with the Mandatory bit. A 4075 Diameter message with this error MUST contain one or more Failed- 4076 AVP AVP containing the AVPs that caused the failure. 4078 DIAMETER_UNKNOWN_SESSION_ID 5002 4080 The request contained an unknown Session-Id. 4082 DIAMETER_AUTHORIZATION_REJECTED 5003 4084 A request was received for which the user could not be authorized. 4085 This error could occur if the service requested is not permitted 4086 to the user. 4088 DIAMETER_INVALID_AVP_VALUE 5004 4090 The request contained an AVP with an invalid value in its data 4091 portion. A Diameter message indicating this error MUST include 4092 the offending AVPs within a Failed-AVP AVP. 4094 DIAMETER_MISSING_AVP 5005 4096 The request did not contain an AVP that is required by the Command 4097 Code definition. If this value is sent in the Result-Code AVP, a 4098 Failed-AVP AVP SHOULD be included in the message. The Failed-AVP 4099 AVP MUST contain an example of the missing AVP complete with the 4100 Vendor-Id if applicable. The value field of the missing AVP 4101 should be of correct minimum length and contain zeroes. 4103 DIAMETER_RESOURCES_EXCEEDED 5006 4105 A request was received that cannot be authorized because the user 4106 has already expended allowed resources. An example of this error 4107 condition is a user that is restricted to one dial-up PPP port, 4108 attempts to establish a second PPP connection. 4110 DIAMETER_CONTRADICTING_AVPS 5007 4112 The Home Diameter server has detected AVPs in the request that 4113 contradicted each other, and is not willing to provide service to 4114 the user. The Failed-AVP AVPs MUST be present which contains the 4115 AVPs that contradicted each other. 4117 DIAMETER_AVP_NOT_ALLOWED 5008 4119 A message was received with an AVP that MUST NOT be present. The 4120 Failed-AVP AVP MUST be included and contain a copy of the 4121 offending AVP. 4123 DIAMETER_AVP_OCCURS_TOO_MANY_TIMES 5009 4125 A message was received that included an AVP that appeared more 4126 often than permitted in the message definition. The Failed-AVP 4127 AVP MUST be included and contain a copy of the first instance of 4128 the offending AVP that exceeded the maximum number of occurrences 4130 DIAMETER_NO_COMMON_APPLICATION 5010 4132 This error is returned by a Diameter node that receives a CER 4133 whereby no applications are common between the CER sending peer 4134 and the CER receiving peer. 4136 DIAMETER_UNSUPPORTED_VERSION 5011 4138 This error is returned when a request was received, whose version 4139 number is unsupported. 4141 DIAMETER_UNABLE_TO_COMPLY 5012 4143 This error is returned when a request is rejected for unspecified 4144 reasons. 4146 DIAMETER_INVALID_AVP_LENGTH 5014 4148 The request contained an AVP with an invalid length. A Diameter 4149 message indicating this error MUST include the offending AVPs 4150 within a Failed-AVP AVP. In cases where the erroneous avp length 4151 value exceeds the message length or is less than the minimum AVP 4152 header length, it is sufficient to include the offending AVP 4153 header and a zero filled payload of the minimum required length 4154 for the payloads data type. If the AVP is a grouped AVP, the 4155 grouped AVP header with an empty payload would be sufficient to 4156 indicate the offending AVP. In the case where the offending AVP 4157 header cannot be fully decoded when the AVP length is less than 4158 the minimum AVP header length, it is sufficient to include an 4159 offending AVP header that is formulated by padding the incomplete 4160 AVP header with zero up to the minimum AVP header length. 4162 DIAMETER_NO_COMMON_SECURITY 5017 4164 This error is returned when a CER message is received, and there 4165 are no common security mechanisms supported between the peers. A 4166 Capabilities-Exchange-Answer (CEA) MUST be returned with the 4167 Result-Code AVP set to DIAMETER_NO_COMMON_SECURITY. 4169 DIAMETER_UNKNOWN_PEER 5018 4171 A CER was received from an unknown peer. 4173 DIAMETER_COMMAND_UNSUPPORTED 5019 4175 This error code is used when a Diameter entity receives a message 4176 with a Command Code that it does not support. 4178 DIAMETER_INVALID_HDR_BITS 5020 4180 A request was received whose bits in the Diameter header were 4181 either set to an invalid combination, or to a value that is 4182 inconsistent with the command code's definition. 4184 DIAMETER_INVALID_AVP_BITS 5021 4186 A request was received that included an AVP whose flag bits are 4187 set to an unrecognized value, or that is inconsistent with the 4188 AVP's definition. 4190 7.2. Error Bit 4192 The 'E' (Error Bit) in the Diameter header is set when the request 4193 caused a protocol-related error (see Section 7.1.3). A message with 4194 the 'E' bit MUST NOT be sent as a response to an answer message. 4195 Note that a message with the 'E' bit set is still subjected to the 4196 processing rules defined in Section 6.2. When set, the answer 4197 message will not conform to the ABNF specification for the command, 4198 and will instead conform to the following ABNF: 4200 Message Format 4202 ::= < Diameter Header: code, ERR [PXY] > 4203 0*1< Session-Id > 4204 { Origin-Host } 4205 { Origin-Realm } 4206 { Result-Code } 4207 [ Origin-State-Id ] 4208 [ Error-Message ] 4209 [ Error-Reporting-Host ] 4210 [ Failed-AVP ] 4211 * [ Proxy-Info ] 4212 * [ AVP ] 4214 Note that the code used in the header is the same than the one found 4215 in the request message, but with the 'R' bit cleared and the 'E' bit 4216 set. The 'P' bit in the header is set to the same value as the one 4217 found in the request message. 4219 7.3. Error-Message AVP 4221 The Error-Message AVP (AVP Code 281) is of type UTF8String. It MAY 4222 accompany a Result-Code AVP as a human readable error message. The 4223 Error-Message AVP is not intended to be useful in an environment 4224 where error messages are processed automatically. It SHOULD NOT be 4225 expected that the content of this AVP is parsed by network entities. 4227 7.4. Error-Reporting-Host AVP 4229 The Error-Reporting-Host AVP (AVP Code 294) is of type 4230 DiameterIdentity. This AVP contains the identity of the Diameter 4231 host that sent the Result-Code AVP to a value other than 2001 4232 (Success), only if the host setting the Result-Code is different from 4233 the one encoded in the Origin-Host AVP. This AVP is intended to be 4234 used for troubleshooting purposes, and MUST be set when the Result- 4235 Code AVP indicates a failure. 4237 7.5. Failed-AVP AVP 4239 The Failed-AVP AVP (AVP Code 279) is of type Grouped and provides 4240 debugging information in cases where a request is rejected or not 4241 fully processed due to erroneous information in a specific AVP. The 4242 value of the Result-Code AVP will provide information on the reason 4243 for the Failed-AVP AVP. A Diameter message SHOULD contain only one 4244 Failed-AVP that corresponds to the error indicated by the Result-Code 4245 AVP. For practical purposes, this Failed-AVP would typically refer 4246 to the first AVP processing error that a Diameter node encounters. 4248 The possible reasons for this AVP are the presence of an improperly 4249 constructed AVP, an unsupported or unrecognized AVP, an invalid AVP 4250 value, the omission of a required AVP, the presence of an explicitly 4251 excluded AVP (see tables in Section 10), or the presence of two or 4252 more occurrences of an AVP which is restricted to 0, 1, or 0-1 4253 occurrences. 4255 A Diameter message SHOULD contain one Failed-AVP AVP, containing the 4256 entire AVP that could not be processed successfully. If the failure 4257 reason is omission of a required AVP, an AVP with the missing AVP 4258 code, the missing vendor id, and a zero filled payload of the minimum 4259 required length for the omitted AVP will be added. If the failure 4260 reason is an invalid AVP length where the reported length is less 4261 than the minimum AVP header length or greater than the reported 4262 message length, a copy of the offending AVP header and a zero filled 4263 payload of the minimum required length SHOULD be added. 4265 In the case where the offending AVP is embedded within a grouped AVP, 4266 the Failed-AVP MAY contain the grouped AVP which in turn contains the 4267 single offending AVP. The same method MAY be employed if the grouped 4268 AVP itself is embedded in yet another grouped AVP and so on. In this 4269 case, the Failed-AVP MAY contain the grouped AVP heirarchy up to the 4270 single offending AVP. This enables the recipient to detect the 4271 location of the offending AVP when embedded in a group. 4273 AVP Format 4275 ::= < AVP Header: 279 > 4276 1* {AVP} 4278 7.6. Experimental-Result AVP 4280 The Experimental-Result AVP (AVP Code 297) is of type Grouped, and 4281 indicates whether a particular vendor-specific request was completed 4282 successfully or whether an error occurred. This AVP has the 4283 following structure: 4285 AVP Format 4287 Experimental-Result ::= < AVP Header: 297 > 4288 { Vendor-Id } 4289 { Experimental-Result-Code } 4291 The Vendor-Id AVP (see Section 5.3.3) in this grouped AVP identifies 4292 the vendor responsible for the assignment of the result code which 4293 follows. All Diameter answer messages defined in vendor-specific 4294 applications MUST include either one Result-Code AVP or one 4295 Experimental-Result AVP. 4297 7.7. Experimental-Result-Code AVP 4299 The Experimental-Result-Code AVP (AVP Code 298) is of type Unsigned32 4300 and contains a vendor-assigned value representing the result of 4301 processing the request. 4303 It is recommended that vendor-specific result codes follow the same 4304 conventions given for the Result-Code AVP regarding the different 4305 types of result codes and the handling of errors (for non 2xxx 4306 values). 4308 8. Diameter User Sessions 4310 In general, Diameter can provide two different types of services to 4311 applications. The first involves authentication and authorization, 4312 and can optionally make use of accounting. The second only makes use 4313 of accounting. 4315 When a service makes use of the authentication and/or authorization 4316 portion of an application, and a user requests access to the network, 4317 the Diameter client issues an auth request to its local server. The 4318 auth request is defined in a service specific Diameter application 4319 (e.g., NASREQ). The request contains a Session-Id AVP, which is used 4320 in subsequent messages (e.g., subsequent authorization, accounting, 4321 etc) relating to the user's session. The Session-Id AVP is a means 4322 for the client and servers to correlate a Diameter message with a 4323 user session. 4325 When a Diameter server authorizes a user to use network resources for 4326 a finite amount of time, and it is willing to extend the 4327 authorization via a future request, it MUST add the Authorization- 4328 Lifetime AVP to the answer message. The Authorization-Lifetime AVP 4329 defines the maximum number of seconds a user MAY make use of the 4330 resources before another authorization request is expected by the 4331 server. The Auth-Grace-Period AVP contains the number of seconds 4332 following the expiration of the Authorization-Lifetime, after which 4333 the server will release all state information related to the user's 4334 session. Note that if payment for services is expected by the 4335 serving realm from the user's home realm, the Authorization-Lifetime 4336 AVP, combined with the Auth-Grace-Period AVP, implies the maximum 4337 length of the session the home realm is willing to be fiscally 4338 responsible for. Services provided past the expiration of the 4339 Authorization-Lifetime and Auth-Grace-Period AVPs are the 4340 responsibility of the access device. Of course, the actual cost of 4341 services rendered is clearly outside the scope of the protocol. 4343 An access device that does not expect to send a re-authorization or a 4344 session termination request to the server MAY include the Auth- 4345 Session-State AVP with the value set to NO_STATE_MAINTAINED as a hint 4346 to the server. If the server accepts the hint, it agrees that since 4347 no session termination message will be received once service to the 4348 user is terminated, it cannot maintain state for the session. If the 4349 answer message from the server contains a different value in the 4350 Auth-Session-State AVP (or the default value if the AVP is absent), 4351 the access device MUST follow the server's directives. Note that the 4352 value NO_STATE_MAINTAINED MUST NOT be set in subsequent re- 4353 authorization requests and answers. 4355 The base protocol does not include any authorization request 4356 messages, since these are largely application-specific and are 4357 defined in a Diameter application document. However, the base 4358 protocol does define a set of messages that are used to terminate 4359 user sessions. These are used to allow servers that maintain state 4360 information to free resources. 4362 When a service only makes use of the Accounting portion of the 4363 Diameter protocol, even in combination with an application, the 4364 Session-Id is still used to identify user sessions. However, the 4365 session termination messages are not used, since a session is 4366 signaled as being terminated by issuing an accounting stop message. 4368 Diameter may also be used for services that cannot be easily 4369 categorized as authentication, authorization or accounting (e.g., 4370 certain 3GPP IMS interfaces). In such cases, the finite state 4371 machine defined in subsequent sections may not be applicable. 4372 Therefore, the applications itself MAY need to define its own finite 4373 state machine. However, such application specific state machines 4374 SHOULD follow the general state machine framework outlined in this 4375 document such as the use of Session-Id AVPs and the use of STR/STA, 4376 ASR/ASA messages for stateful sessions. 4378 8.1. Authorization Session State Machine 4380 This section contains a set of finite state machines, representing 4381 the life cycle of Diameter sessions, and which MUST be observed by 4382 all Diameter implementations that make use of the authentication 4383 and/or authorization portion of a Diameter application. The term 4384 Service-Specific below refers to a message defined in a Diameter 4385 application (e.g., Mobile IPv4, NASREQ). 4387 There are four different authorization session state machines 4388 supported in the Diameter base protocol. The first two describe a 4389 session in which the server is maintaining session state, indicated 4390 by the value of the Auth-Session-State AVP (or its absence). One 4391 describes the session from a client perspective, the other from a 4392 server perspective. The second two state machines are used when the 4393 server does not maintain session state. Here again, one describes 4394 the session from a client perspective, the other from a server 4395 perspective. 4397 When a session is moved to the Idle state, any resources that were 4398 allocated for the particular session must be released. Any event not 4399 listed in the state machines MUST be considered as an error 4400 condition, and an answer, if applicable, MUST be returned to the 4401 originator of the message. 4403 In the case that an application does not support re-auth, the state 4404 transitions related to server-initiated re-auth when both client and 4405 server sessions maintains state (e.g., Send RAR, Pending, Receive 4406 RAA) MAY be ignored. 4408 In the state table, the event 'Failure to send X' means that the 4409 Diameter agent is unable to send command X to the desired 4410 destination. This could be due to the peer being down, or due to the 4411 peer sending back a transient failure or temporary protocol error 4412 notification DIAMETER_TOO_BUSY or DIAMETER_LOOP_DETECTED in the 4413 Result-Code AVP of the corresponding Answer command. The event 'X 4414 successfully sent' is the complement of 'Failure to send X'. 4416 The following state machine is observed by a client when state is 4417 maintained on the server: 4419 CLIENT, STATEFUL 4420 State Event Action New State 4421 ------------------------------------------------------------- 4422 Idle Client or Device Requests Send Pending 4423 access service 4424 specific 4425 auth req 4427 Idle ASR Received Send ASA Idle 4428 for unknown session with 4429 Result-Code 4430 = UNKNOWN_ 4431 SESSION_ID 4433 Idle RAR Received Send RAA Idle 4434 for unknown session with 4435 Result-Code 4436 = UNKNOWN_ 4437 SESSION_ID 4439 Pending Successful Service-specific Grant Open 4440 authorization answer Access 4441 received with default 4442 Auth-Session-State value 4444 Pending Successful Service-specific Sent STR Discon 4445 authorization answer received 4446 but service not provided 4448 Pending Error processing successful Sent STR Discon 4449 Service-specific authorization 4450 answer 4452 Pending Failed Service-specific Cleanup Idle 4453 authorization answer received 4455 Open User or client device Send Open 4456 requests access to service service 4457 specific 4458 auth req 4460 Open Successful Service-specific Provide Open 4461 authorization answer received Service 4463 Open Failed Service-specific Discon. Idle 4464 authorization answer user/device 4465 received. 4467 Open RAR received and client will Send RAA Open 4468 perform subsequent re-auth with 4469 Result-Code 4470 = SUCCESS 4472 Open RAR received and client will Send RAA Idle 4473 not perform subsequent with 4474 re-auth Result-Code 4475 != SUCCESS, 4476 Discon. 4477 user/device 4479 Open Session-Timeout Expires on Send STR Discon 4480 Access Device 4482 Open ASR Received, Send ASA Discon 4483 client will comply with with 4484 request to end the session Result-Code 4485 = SUCCESS, 4486 Send STR. 4488 Open ASR Received, Send ASA Open 4489 client will not comply with with 4490 request to end the session Result-Code 4491 != SUCCESS 4493 Open Authorization-Lifetime + Send STR Discon 4494 Auth-Grace-Period expires on 4495 access device 4497 Discon ASR Received Send ASA Discon 4499 Discon STA Received Discon. Idle 4500 user/device 4502 The following state machine is observed by a server when it is 4503 maintaining state for the session: 4505 SERVER, STATEFUL 4506 State Event Action New State 4507 ------------------------------------------------------------- 4508 Idle Service-specific authorization Send Open 4509 request received, and successful 4510 user is authorized serv. 4511 specific 4512 answer 4514 Idle Service-specific authorization Send Idle 4515 request received, and failed serv. 4516 user is not authorized specific 4517 answer 4519 Open Service-specific authorization Send Open 4520 request received, and user successful 4521 is authorized serv. specific 4522 answer 4524 Open Service-specific authorization Send Idle 4525 request received, and user failed serv. 4526 is not authorized specific 4527 answer, 4528 Cleanup 4530 Open Home server wants to confirm Send RAR Pending 4531 authentication and/or 4532 authorization of the user 4534 Pending Received RAA with a failed Cleanup Idle 4535 Result-Code 4537 Pending Received RAA with Result-Code Update Open 4538 = SUCCESS session 4540 Open Home server wants to Send ASR Discon 4541 terminate the service 4543 Open Authorization-Lifetime (and Cleanup Idle 4544 Auth-Grace-Period) expires 4545 on home server. 4547 Open Session-Timeout expires on Cleanup Idle 4548 home server 4550 Discon Failure to send ASR Wait, Discon 4551 resend ASR 4553 Discon ASR successfully sent and Cleanup Idle 4554 ASA Received with Result-Code 4556 Not ASA Received None No Change. 4557 Discon 4559 Any STR Received Send STA, Idle 4560 Cleanup. 4562 The following state machine is observed by a client when state is not 4563 maintained on the server: 4565 CLIENT, STATELESS 4566 State Event Action New State 4567 ------------------------------------------------------------- 4568 Idle Client or Device Requests Send Pending 4569 access service 4570 specific 4571 auth req 4573 Pending Successful Service-specific Grant Open 4574 authorization answer Access 4575 received with Auth-Session- 4576 State set to 4577 NO_STATE_MAINTAINED 4579 Pending Failed Service-specific Cleanup Idle 4580 authorization answer 4581 received 4583 Open Session-Timeout Expires on Discon. Idle 4584 Access Device user/device 4586 Open Service to user is terminated Discon. Idle 4587 user/device 4589 The following state machine is observed by a server when it is not 4590 maintaining state for the session: 4592 SERVER, STATELESS 4593 State Event Action New State 4594 ------------------------------------------------------------- 4595 Idle Service-specific authorization Send serv. Idle 4596 request received, and specific 4597 successfully processed answer 4599 8.2. Accounting Session State Machine 4601 The following state machines MUST be supported for applications that 4602 have an accounting portion or that require only accounting services. 4603 The first state machine is to be observed by clients. 4605 See Section 9.7 for Accounting Command Codes and Section 9.8 for 4606 Accounting AVPs. 4608 The server side in the accounting state machine depends in some cases 4609 on the particular application. The Diameter base protocol defines a 4610 default state machine that MUST be followed by all applications that 4611 have not specified other state machines. This is the second state 4612 machine in this section described below. 4614 The default server side state machine requires the reception of 4615 accounting records in any order and at any time, and does not place 4616 any standards requirement on the processing of these records. 4617 Implementations of Diameter may perform checking, ordering, 4618 correlation, fraud detection, and other tasks based on these records. 4619 AVPs may need to be inspected as a part of these tasks. The tasks 4620 can happen either immediately after record reception or in a post- 4621 processing phase. However, as these tasks are typically application 4622 or even policy dependent, they are not standardized by the Diameter 4623 specifications. Applications MAY define requirements on when to 4624 accept accounting records based on the used value of Accounting- 4625 Realtime-Required AVP, credit limits checks, and so on. 4627 However, the Diameter base protocol defines one optional server side 4628 state machine that MAY be followed by applications that require 4629 keeping track of the session state at the accounting server. Note 4630 that such tracking is incompatible with the ability to sustain long 4631 duration connectivity problems. Therefore, the use of this state 4632 machine is recommended only in applications where the value of the 4633 Accounting-Realtime-Required AVP is DELIVER_AND_GRANT, and hence 4634 accounting connectivity problems are required to cause the serviced 4635 user to be disconnected. Otherwise, records produced by the client 4636 may be lost by the server which no longer accepts them after the 4637 connectivity is re-established. This state machine is the third 4638 state machine in this section. The state machine is supervised by a 4639 supervision session timer Ts, which the value should be reasonably 4640 higher than the Acct_Interim_Interval value. Ts MAY be set to two 4641 times the value of the Acct_Interim_Interval so as to avoid the 4642 accounting session in the Diameter server to change to Idle state in 4643 case of short transient network failure. 4645 Any event not listed in the state machines MUST be considered as an 4646 error condition, and a corresponding answer, if applicable, MUST be 4647 returned to the originator of the message. 4649 In the state table, the event 'Failure to send' means that the 4650 Diameter client is unable to communicate with the desired 4651 destination. This could be due to the peer being down, or due to the 4652 peer sending back a transient failure or temporary protocol error 4653 notification DIAMETER_OUT_OF_SPACE, DIAMETER_TOO_BUSY, or 4654 DIAMETER_LOOP_DETECTED in the Result-Code AVP of the Accounting 4655 Answer command. 4657 The event 'Failed answer' means that the Diameter client received a 4658 non-transient failure notification in the Accounting Answer command. 4660 Note that the action 'Disconnect user/dev' MUST have an effect also 4661 to the authorization session state table, e.g., cause the STR message 4662 to be sent, if the given application has both authentication/ 4663 authorization and accounting portions. 4665 The states PendingS, PendingI, PendingL, PendingE and PendingB stand 4666 for pending states to wait for an answer to an accounting request 4667 related to a Start, Interim, Stop, Event or buffered record, 4668 respectively. 4670 CLIENT, ACCOUNTING 4671 State Event Action New State 4672 ------------------------------------------------------------- 4673 Idle Client or device requests Send PendingS 4674 access accounting 4675 start req. 4677 Idle Client or device requests Send PendingE 4678 a one-time service accounting 4679 event req 4681 Idle Records in storage Send PendingB 4682 record 4684 PendingS Successful accounting Open 4685 start answer received 4687 PendingS Failure to send and buffer Store Open 4688 space available and realtime Start 4689 not equal to DELIVER_AND_GRANT Record 4691 PendingS Failure to send and no buffer Open 4692 space available and realtime 4693 equal to GRANT_AND_LOSE 4695 PendingS Failure to send and no buffer Disconnect Idle 4696 space available and realtime user/dev 4697 not equal to 4698 GRANT_AND_LOSE 4700 PendingS Failed accounting start answer Open 4701 received and realtime equal 4702 to GRANT_AND_LOSE 4704 PendingS Failed accounting start answer Disconnect Idle 4705 received and realtime not user/dev 4706 equal to GRANT_AND_LOSE 4708 PendingS User service terminated Store PendingS 4709 stop 4710 record 4712 Open Interim interval elapses Send PendingI 4713 accounting 4714 interim 4715 record 4716 Open User service terminated Send PendingL 4717 accounting 4718 stop req. 4720 PendingI Successful accounting interim Open 4721 answer received 4723 PendingI Failure to send and (buffer Store Open 4724 space available or old record interim 4725 can be overwritten) and record 4726 realtime not equal to 4727 DELIVER_AND_GRANT 4729 PendingI Failure to send and no buffer Open 4730 space available and realtime 4731 equal to GRANT_AND_LOSE 4733 PendingI Failure to send and no buffer Disconnect Idle 4734 space available and realtime user/dev 4735 not equal to GRANT_AND_LOSE 4737 PendingI Failed accounting interim Open 4738 answer received and realtime 4739 equal to GRANT_AND_LOSE 4741 PendingI Failed accounting interim Disconnect Idle 4742 answer received and realtime user/dev 4743 not equal to GRANT_AND_LOSE 4745 PendingI User service terminated Store PendingI 4746 stop 4747 record 4748 PendingE Successful accounting Idle 4749 event answer received 4751 PendingE Failure to send and buffer Store Idle 4752 space available event 4753 record 4755 PendingE Failure to send and no buffer Idle 4756 space available 4758 PendingE Failed accounting event answer Idle 4759 received 4761 PendingB Successful accounting answer Delete Idle 4762 received record 4764 PendingB Failure to send Idle 4766 PendingB Failed accounting answer Delete Idle 4767 received record 4769 PendingL Successful accounting Idle 4770 stop answer received 4772 PendingL Failure to send and buffer Store Idle 4773 space available stop 4774 record 4776 PendingL Failure to send and no buffer Idle 4777 space available 4779 PendingL Failed accounting stop answer Idle 4780 received 4781 SERVER, STATELESS ACCOUNTING 4782 State Event Action New State 4783 ------------------------------------------------------------- 4785 Idle Accounting start request Send Idle 4786 received, and successfully accounting 4787 processed. start 4788 answer 4790 Idle Accounting event request Send Idle 4791 received, and successfully accounting 4792 processed. event 4793 answer 4795 Idle Interim record received, Send Idle 4796 and successfully processed. accounting 4797 interim 4798 answer 4800 Idle Accounting stop request Send Idle 4801 received, and successfully accounting 4802 processed stop answer 4804 Idle Accounting request received, Send Idle 4805 no space left to store accounting 4806 records answer, 4807 Result-Code 4808 = OUT_OF_ 4809 SPACE 4811 SERVER, STATEFUL ACCOUNTING 4812 State Event Action New State 4813 ------------------------------------------------------------- 4815 Idle Accounting start request Send Open 4816 received, and successfully accounting 4817 processed. start 4818 answer, 4819 Start Ts 4821 Idle Accounting event request Send Idle 4822 received, and successfully accounting 4823 processed. event 4824 answer 4826 Idle Accounting request received, Send Idle 4827 no space left to store accounting 4828 records answer, 4829 Result-Code 4830 = OUT_OF_ 4831 SPACE 4833 Open Interim record received, Send Open 4834 and successfully processed. accounting 4835 interim 4836 answer, 4837 Restart Ts 4839 Open Accounting stop request Send Idle 4840 received, and successfully accounting 4841 processed stop answer, 4842 Stop Ts 4844 Open Accounting request received, Send Idle 4845 no space left to store accounting 4846 records answer, 4847 Result-Code 4848 = OUT_OF_ 4849 SPACE, 4850 Stop Ts 4852 Open Session supervision timer Ts Stop Ts Idle 4853 expired 4855 8.3. Server-Initiated Re-Auth 4857 A Diameter server may initiate a re-authentication and/or re- 4858 authorization service for a particular session by issuing a Re-Auth- 4859 Request (RAR). 4861 For example, for pre-paid services, the Diameter server that 4862 originally authorized a session may need some confirmation that the 4863 user is still using the services. 4865 An access device that receives a RAR message with Session-Id equal to 4866 a currently active session MUST initiate a re-auth towards the user, 4867 if the service supports this particular feature. Each Diameter 4868 application MUST state whether service-initiated re-auth is 4869 supported, since some applications do not allow access devices to 4870 prompt the user for re-auth. 4872 8.3.1. Re-Auth-Request 4874 The Re-Auth-Request (RAR), indicated by the Command-Code set to 258 4875 and the message flags' 'R' bit set, may be sent by any server to the 4876 access device that is providing session service, to request that the 4877 user be re-authenticated and/or re-authorized. 4879 Message Format 4881 ::= < Diameter Header: 258, REQ, PXY > 4882 < Session-Id > 4883 { Origin-Host } 4884 { Origin-Realm } 4885 { Destination-Realm } 4886 { Destination-Host } 4887 { Auth-Application-Id } 4888 { Re-Auth-Request-Type } 4889 [ User-Name ] 4890 [ Origin-State-Id ] 4891 * [ Proxy-Info ] 4892 * [ Route-Record ] 4893 * [ AVP ] 4895 8.3.2. Re-Auth-Answer 4897 The Re-Auth-Answer (RAA), indicated by the Command-Code set to 258 4898 and the message flags' 'R' bit clear, is sent in response to the RAR. 4899 The Result-Code AVP MUST be present, and indicates the disposition of 4900 the request. 4902 A successful RAA message MUST be followed by an application-specific 4903 authentication and/or authorization message. 4905 Message Format 4907 ::= < Diameter Header: 258, PXY > 4908 < Session-Id > 4909 { Result-Code } 4910 { Origin-Host } 4911 { Origin-Realm } 4912 [ User-Name ] 4913 [ Origin-State-Id ] 4914 [ Error-Message ] 4915 [ Error-Reporting-Host ] 4916 [ Failed-AVP ] 4917 * [ Redirect-Host ] 4918 [ Redirect-Host-Usage ] 4919 [ Redirect-Max-Cache-Time ] 4920 * [ Proxy-Info ] 4921 * [ AVP ] 4923 8.4. Session Termination 4925 It is necessary for a Diameter server that authorized a session, for 4926 which it is maintaining state, to be notified when that session is no 4927 longer active, both for tracking purposes as well as to allow 4928 stateful agents to release any resources that they may have provided 4929 for the user's session. For sessions whose state is not being 4930 maintained, this section is not used. 4932 When a user session that required Diameter authorization terminates, 4933 the access device that provided the service MUST issue a Session- 4934 Termination-Request (STR) message to the Diameter server that 4935 authorized the service, to notify it that the session is no longer 4936 active. An STR MUST be issued when a user session terminates for any 4937 reason, including user logoff, expiration of Session-Timeout, 4938 administrative action, termination upon receipt of an Abort-Session- 4939 Request (see below), orderly shutdown of the access device, etc. 4941 The access device also MUST issue an STR for a session that was 4942 authorized but never actually started. This could occur, for 4943 example, due to a sudden resource shortage in the access device, or 4944 because the access device is unwilling to provide the type of service 4945 requested in the authorization, or because the access device does not 4946 support a mandatory AVP returned in the authorization, etc. 4948 It is also possible that a session that was authorized is never 4949 actually started due to action of a proxy. For example, a proxy may 4950 modify an authorization answer, converting the result from success to 4951 failure, prior to forwarding the message to the access device. If 4952 the answer did not contain an Auth-Session-State AVP with the value 4953 NO_STATE_MAINTAINED, a proxy that causes an authorized session not to 4954 be started MUST issue an STR to the Diameter server that authorized 4955 the session, since the access device has no way of knowing that the 4956 session had been authorized. 4958 A Diameter server that receives an STR message MUST clean up 4959 resources (e.g., session state) associated with the Session-Id 4960 specified in the STR, and return a Session-Termination-Answer. 4962 A Diameter server also MUST clean up resources when the Session- 4963 Timeout expires, or when the Authorization-Lifetime and the Auth- 4964 Grace-Period AVPs expires without receipt of a re-authorization 4965 request, regardless of whether an STR for that session is received. 4966 The access device is not expected to provide service beyond the 4967 expiration of these timers; thus, expiration of either of these 4968 timers implies that the access device may have unexpectedly shut 4969 down. 4971 8.4.1. Session-Termination-Request 4973 The Session-Termination-Request (STR), indicated by the Command-Code 4974 set to 275 and the Command Flags' 'R' bit set, is sent by a Diameter 4975 client or by a Diameter proxy to inform the Diameter Server that an 4976 authenticated and/or authorized session is being terminated. 4978 Message Format 4980 ::= < Diameter Header: 275, REQ, PXY > 4981 < Session-Id > 4982 { Origin-Host } 4983 { Origin-Realm } 4984 { Destination-Realm } 4985 { Auth-Application-Id } 4986 { Termination-Cause } 4987 [ User-Name ] 4988 [ Destination-Host ] 4989 * [ Class ] 4990 [ Origin-State-Id ] 4991 * [ Proxy-Info ] 4992 * [ Route-Record ] 4993 * [ AVP ] 4995 8.4.2. Session-Termination-Answer 4997 The Session-Termination-Answer (STA), indicated by the Command-Code 4998 set to 275 and the message flags' 'R' bit clear, is sent by the 4999 Diameter Server to acknowledge the notification that the session has 5000 been terminated. The Result-Code AVP MUST be present, and MAY 5001 contain an indication that an error occurred while servicing the STR. 5003 Upon sending or receipt of the STA, the Diameter Server MUST release 5004 all resources for the session indicated by the Session-Id AVP. Any 5005 intermediate server in the Proxy-Chain MAY also release any 5006 resources, if necessary. 5008 Message Format 5010 ::= < Diameter Header: 275, PXY > 5011 < Session-Id > 5012 { Result-Code } 5013 { Origin-Host } 5014 { Origin-Realm } 5015 [ User-Name ] 5016 * [ Class ] 5017 [ Error-Message ] 5018 [ Error-Reporting-Host ] 5019 [ Failed-AVP ] 5020 [ Origin-State-Id ] 5021 * [ Redirect-Host ] 5022 [ Redirect-Host-Usage ] 5023 [ Redirect-Max-Cache-Time ] 5024 * [ Proxy-Info ] 5025 * [ AVP ] 5027 8.5. Aborting a Session 5029 A Diameter server may request that the access device stop providing 5030 service for a particular session by issuing an Abort-Session-Request 5031 (ASR). 5033 For example, the Diameter server that originally authorized the 5034 session may be required to cause that session to be stopped for lack 5035 of credit or other reasons that were not anticipated when the session 5036 was first authorized. 5038 An access device that receives an ASR with Session-ID equal to a 5039 currently active session MAY stop the session. Whether the access 5040 device stops the session or not is implementation- and/or 5041 configuration-dependent. For example, an access device may honor 5042 ASRs from certain agents only. In any case, the access device MUST 5043 respond with an Abort-Session-Answer, including a Result-Code AVP to 5044 indicate what action it took. 5046 8.5.1. Abort-Session-Request 5048 The Abort-Session-Request (ASR), indicated by the Command-Code set to 5049 274 and the message flags' 'R' bit set, may be sent by any Diameter 5050 server or any Diameter proxy to the access device that is providing 5051 session service, to request that the session identified by the 5052 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 The Origin-State-Id is used to allow detection of terminated sessions 5104 for which no STR would have been issued, due to unanticipated 5105 shutdown of an access device. 5107 A Diameter client or access device increments the value of the 5108 Origin-State-Id every time it is started or powered-up. The new 5109 Origin-State-Id is then sent in the CER/CEA message immediately upon 5110 connection to the server. The Diameter server receiving the new 5111 Origin-State-Id can determine whether the sending Diameter client had 5112 abrubtly shutdown by comparing the old value of the Origin-State-Id 5113 it has kept for that specific client is less than the new value and 5114 whether it has un-terminated sessions originating from that client. 5116 An access device can also include the Origin-State-Id in request 5117 messages other than CER if there are relays or proxies in between the 5118 access device and the server. In this case, however, the server 5119 cannot discover that the access device has been restarted unless and 5120 until it receives a new request from it. Therefore this mechanism is 5121 more opportunistic across proxies and relays. 5123 The Diameter server may assume that all sessions that were active 5124 prior to detection of a client restart have been terminated. The 5125 Diameter server MAY clean up all session state associated with such 5126 lost sessions, and MAY also issues STRs for all such lost sessions 5127 that were authorized on upstream servers, to allow session state to 5128 be cleaned up globally. 5130 8.7. Auth-Request-Type AVP 5132 The Auth-Request-Type AVP (AVP Code 274) is of type Enumerated and is 5133 included in application-specific auth requests to inform the peers 5134 whether a user is to be authenticated only, authorized only or both. 5135 Note any value other than both MAY cause RADIUS interoperability 5136 issues. The following values are defined: 5138 AUTHENTICATE_ONLY 1 5140 The request being sent is for authentication only, and MUST 5141 contain the relevant application specific authentication AVPs that 5142 are needed by the Diameter server to authenticate the user. 5144 AUTHORIZE_ONLY 2 5146 The request being sent is for authorization only, and MUST contain 5147 the application specific authorization AVPs that are necessary to 5148 identify the service being requested/offered. 5150 AUTHORIZE_AUTHENTICATE 3 5152 The request contains a request for both authentication and 5153 authorization. The request MUST include both the relevant 5154 application specific authentication information, and authorization 5155 information necessary to identify the service being requested/ 5156 offered. 5158 8.8. Session-Id AVP 5160 The Session-Id AVP (AVP Code 263) is of type UTF8String and is used 5161 to identify a specific session (see Section 8). All messages 5162 pertaining to a specific session MUST include only one Session-Id AVP 5163 and the same value MUST be used throughout the life of a session. 5164 When present, the Session-Id SHOULD appear immediately following the 5165 Diameter Header (see Section 3). 5167 The Session-Id MUST be globally and eternally unique, as it is meant 5168 to uniquely identify a user session without reference to any other 5169 information, and may be needed to correlate historical authentication 5170 information with accounting information. The Session-Id includes a 5171 mandatory portion and an implementation-defined portion; a 5172 recommended format for the implementation-defined portion is outlined 5173 below. 5175 The Session-Id MUST begin with the sender's identity encoded in the 5176 DiameterIdentity type (see Section 4.4). The remainder of the 5177 Session-Id is delimited by a ";" character, and MAY be any sequence 5178 that the client can guarantee to be eternally unique; however, the 5179 following format is recommended, (square brackets [] indicate an 5180 optional element): 5182 ;;[;] 5184 and are decimal representations of the 5185 high and low 32 bits of a monotonically increasing 64-bit value. The 5186 64-bit value is rendered in two part to simplify formatting by 32-bit 5187 processors. At startup, the high 32 bits of the 64-bit value MAY be 5188 initialized to the time in NTP format [RFC4330], and the low 32 bits 5189 MAY be initialized to zero. This will for practical purposes 5190 eliminate the possibility of overlapping Session-Ids after a reboot, 5191 assuming the reboot process takes longer than a second. 5192 Alternatively, an implementation MAY keep track of the increasing 5193 value in non-volatile memory. 5195 is implementation specific but may include a modem's 5196 device Id, a layer 2 address, timestamp, etc. 5198 Example, in which there is no optional value: 5200 accesspoint7.example.com;1876543210;523 5202 Example, in which there is an optional value: 5204 accesspoint7.example.com;1876543210;523;mobile@200.1.1.88 5206 The Session-Id is created by the Diameter application initiating the 5207 session, which in most cases is done by the client. Note that a 5208 Session-Id MAY be used for both the authentication, authorization and 5209 accounting commands of a given application. 5211 8.9. Authorization-Lifetime AVP 5213 The Authorization-Lifetime AVP (AVP Code 291) is of type Unsigned32 5214 and contains the maximum number of seconds of service to be provided 5215 to the user before the user is to be re-authenticated and/or re- 5216 authorized. Care should be taken when the Authorization- Lifetime 5217 value is determined, since a low, non-zero, value could create 5218 significant Diameter traffic, which could congest both the network 5219 and the agents. 5221 A value of zero (0) means that immediate re-auth is necessary by the 5222 access device. The absence of this AVP, or a value of all ones 5223 (meaning all bits in the 32 bit field are set to one) means no re- 5224 auth is expected. 5226 If both this AVP and the Session-Timeout AVP are present in a 5227 message, the value of the latter MUST NOT be smaller than the 5228 Authorization-Lifetime AVP. 5230 An Authorization-Lifetime AVP MAY be present in re-authorization 5231 messages, and contains the number of seconds the user is authorized 5232 to receive service from the time the re-auth answer message is 5233 received by the access device. 5235 This AVP MAY be provided by the client as a hint of the maximum 5236 lifetime that it is willing to accept. The server MUST return a 5237 value that is equal to, or smaller, than the one provided by the 5238 client. 5240 8.10. Auth-Grace-Period AVP 5242 The Auth-Grace-Period AVP (AVP Code 276) is of type Unsigned32 and 5243 contains the number of seconds the Diameter server will wait 5244 following the expiration of the Authorization-Lifetime AVP before 5245 cleaning up resources for the session. 5247 8.11. Auth-Session-State AVP 5249 The Auth-Session-State AVP (AVP Code 277) is of type Enumerated and 5250 specifies whether state is maintained for a particular session. The 5251 client MAY include this AVP in requests as a hint to the server, but 5252 the value in the server's answer message is binding. The following 5253 values are supported: 5255 STATE_MAINTAINED 0 5257 This value is used to specify that session state is being 5258 maintained, and the access device MUST issue a session termination 5259 message when service to the user is terminated. 5261 NO_STATE_MAINTAINED 1 5263 This value is used to specify that no session termination messages 5264 will be sent by the access device upon expiration of the 5265 Authorization-Lifetime. This is the default value. 5267 8.12. Re-Auth-Request-Type AVP 5269 The Re-Auth-Request-Type AVP (AVP Code 285) is of type Enumerated and 5270 is included in application-specific auth answers to inform the client 5271 of the action expected upon expiration of the Authorization-Lifetime. 5272 If the answer message contains an Authorization-Lifetime AVP with a 5273 positive value, the Re-Auth-Request-Type AVP MUST be present in an 5274 answer message. The following values are defined: 5276 AUTHORIZE_ONLY 0 5278 An authorization only re-auth is expected upon expiration of the 5279 Authorization-Lifetime. This is the default value if the AVP is 5280 not present in answer messages that include the Authorization- 5281 Lifetime. 5283 AUTHORIZE_AUTHENTICATE 1 5285 An authentication and authorization re-auth is expected upon 5286 expiration of the Authorization-Lifetime. 5288 8.13. Session-Timeout AVP 5290 The Session-Timeout AVP (AVP Code 27) [RFC2865] is of type Unsigned32 5291 and contains the maximum number of seconds of service to be provided 5292 to the user before termination of the session. When both the 5293 Session-Timeout and the Authorization-Lifetime AVPs are present in an 5294 answer message, the former MUST be equal to or greater than the value 5295 of the latter. 5297 A session that terminates on an access device due to the expiration 5298 of the Session-Timeout MUST cause an STR to be issued, unless both 5299 the access device and the home server had previously agreed that no 5300 session termination messages would be sent (see Section 8.11). 5302 A Session-Timeout AVP MAY be present in a re-authorization answer 5303 message, and contains the remaining number of seconds from the 5304 beginning of the re-auth. 5306 A value of zero, or the absence of this AVP, means that this session 5307 has an unlimited number of seconds before termination. 5309 This AVP MAY be provided by the client as a hint of the maximum 5310 timeout that it is willing to accept. However, the server MAY return 5311 a value that is equal to, or smaller, than the one provided by the 5312 client. 5314 8.14. User-Name AVP 5316 The User-Name AVP (AVP Code 1) [RFC2865] is of type UTF8String, which 5317 contains the User-Name, in a format consistent with the NAI 5318 specification [RFC4282]. 5320 8.15. Termination-Cause AVP 5322 The Termination-Cause AVP (AVP Code 295) is of type Enumerated, and 5323 is used to indicate the reason why a session was terminated on the 5324 access device. The following values are defined: 5326 DIAMETER_LOGOUT 1 5328 The user initiated a disconnect 5330 DIAMETER_SERVICE_NOT_PROVIDED 2 5332 This value is used when the user disconnected prior to the receipt 5333 of the authorization answer message. 5335 DIAMETER_BAD_ANSWER 3 5337 This value indicates that the authorization answer received by the 5338 access device was not processed successfully. 5340 DIAMETER_ADMINISTRATIVE 4 5342 The user was not granted access, or was disconnected, due to 5343 administrative reasons, such as the receipt of a Abort-Session- 5344 Request message. 5346 DIAMETER_LINK_BROKEN 5 5348 The communication to the user was abruptly disconnected. 5350 DIAMETER_AUTH_EXPIRED 6 5352 The user's access was terminated since its authorized session time 5353 has expired. 5355 DIAMETER_USER_MOVED 7 5357 The user is receiving services from another access device. 5359 DIAMETER_SESSION_TIMEOUT 8 5361 The user's session has timed out, and service has been terminated. 5363 8.16. Origin-State-Id AVP 5365 The Origin-State-Id AVP (AVP Code 278), of type Unsigned32, is a 5366 monotonically increasing value that is advanced whenever a Diameter 5367 entity restarts with loss of previous state, for example upon reboot. 5368 Origin-State-Id MAY be included in any Diameter message, including 5369 CER. 5371 A Diameter entity issuing this AVP MUST create a higher value for 5372 this AVP each time its state is reset. A Diameter entity MAY set 5373 Origin-State-Id to the time of startup, or it MAY use an incrementing 5374 counter retained in non-volatile memory across restarts. 5376 The Origin-State-Id, if present, MUST reflect the state of the entity 5377 indicated by Origin-Host. If a proxy modifies Origin-Host, it MUST 5378 either remove Origin-State-Id or modify it appropriately as well. 5379 Typically, Origin-State-Id is used by an access device that always 5380 starts up with no active sessions; that is, any session active prior 5381 to restart will have been lost. By including Origin-State-Id in a 5382 message, it allows other Diameter entities to infer that sessions 5383 associated with a lower Origin-State-Id are no longer active. If an 5384 access device does not intend for such inferences to be made, it MUST 5385 either not include Origin-State-Id in any message, or set its value 5386 to 0. 5388 8.17. Session-Binding AVP 5390 The Session-Binding AVP (AVP Code 270) is of type Unsigned32, and MAY 5391 be present in application-specific authorization answer messages. If 5392 present, this AVP MAY inform the Diameter client that all future 5393 application-specific re-auth and Session-Termination-Request messages 5394 for this session MUST be sent to the same authorization server. 5396 This field is a bit mask, and the following bits have been defined: 5398 RE_AUTH 1 5400 When set, future re-auth messages for this session MUST NOT 5401 include the Destination-Host AVP. When cleared, the default 5402 value, the Destination-Host AVP MUST be present in all re-auth 5403 messages for this session. 5405 STR 2 5407 When set, the STR message for this session MUST NOT include the 5408 Destination-Host AVP. When cleared, the default value, the 5409 Destination-Host AVP MUST be present in the STR message for this 5410 session. 5412 ACCOUNTING 4 5414 When set, all accounting messages for this session MUST NOT 5415 include the Destination-Host AVP. When cleared, the default 5416 value, the Destination-Host AVP, if known, MUST be present in all 5417 accounting messages for this session. 5419 8.18. Session-Server-Failover AVP 5421 The Session-Server-Failover AVP (AVP Code 271) is of type Enumerated, 5422 and MAY be present in application-specific authorization answer 5423 messages that either do not include the Session-Binding AVP or 5424 include the Session-Binding AVP with any of the bits set to a zero 5425 value. If present, this AVP MAY inform the Diameter client that if a 5426 re-auth or STR message fails due to a delivery problem, the Diameter 5427 client SHOULD issue a subsequent message without the Destination-Host 5428 AVP. When absent, the default value is REFUSE_SERVICE. 5430 The following values are supported: 5432 REFUSE_SERVICE 0 5434 If either the re-auth or the STR message delivery fails, terminate 5435 service with the user, and do not attempt any subsequent attempts. 5437 TRY_AGAIN 1 5439 If either the re-auth or the STR message delivery fails, resend 5440 the failed message without the Destination-Host AVP present. 5442 ALLOW_SERVICE 2 5444 If re-auth message delivery fails, assume that re-authorization 5445 succeeded. If STR message delivery fails, terminate the session. 5447 TRY_AGAIN_ALLOW_SERVICE 3 5449 If either the re-auth or the STR message delivery fails, resend 5450 the failed message without the Destination-Host AVP present. If 5451 the second delivery fails for re-auth, assume re-authorization 5452 succeeded. If the second delivery fails for STR, terminate the 5453 session. 5455 8.19. Multi-Round-Time-Out AVP 5457 The Multi-Round-Time-Out AVP (AVP Code 272) is of type Unsigned32, 5458 and SHOULD be present in application-specific authorization answer 5459 messages whose Result-Code AVP is set to DIAMETER_MULTI_ROUND_AUTH. 5460 This AVP contains the maximum number of seconds that the access 5461 device MUST provide the user in responding to an authentication 5462 request. 5464 8.20. Class AVP 5466 The Class AVP (AVP Code 25) is of type OctetString and is used by 5467 Diameter servers to return state information to the access device. 5468 When one or more Class AVPs are present in application-specific 5469 authorization answer messages, they MUST be present in subsequent re- 5470 authorization, session termination and accounting messages. Class 5471 AVPs found in a re-authorization answer message override the ones 5472 found in any previous authorization answer message. Diameter server 5473 implementations SHOULD NOT return Class AVPs that require more than 5474 4096 bytes of storage on the Diameter client. A Diameter client that 5475 receives Class AVPs whose size exceeds local available storage MUST 5476 terminate the session. 5478 8.21. Event-Timestamp AVP 5480 The Event-Timestamp (AVP Code 55) is of type Time, and MAY be 5481 included in an Accounting-Request and Accounting-Answer messages to 5482 record the time that the reported event occurred, in seconds since 5483 January 1, 1900 00:00 UTC. 5485 9. Accounting 5487 This accounting protocol is based on a server directed model with 5488 capabilities for real-time delivery of accounting information. 5489 Several fault resilience methods [RFC2975] have been built in to the 5490 protocol in order minimize loss of accounting data in various fault 5491 situations and under different assumptions about the capabilities of 5492 the used devices. 5494 9.1. Server Directed Model 5496 The server directed model means that the device generating the 5497 accounting data gets information from either the authorization server 5498 (if contacted) or the accounting server regarding the way accounting 5499 data shall be forwarded. This information includes accounting record 5500 timeliness requirements. 5502 As discussed in [RFC2975], real-time transfer of accounting records 5503 is a requirement, such as the need to perform credit limit checks and 5504 fraud detection. Note that batch accounting is not a requirement, 5505 and is therefore not supported by Diameter. Should batched 5506 accounting be required in the future, a new Diameter application will 5507 need to be created, or it could be handled using another protocol. 5508 Note, however, that even if at the Diameter layer accounting requests 5509 are processed one by one, transport protocols used under Diameter 5510 typically batch several requests in the same packet under heavy 5511 traffic conditions. This may be sufficient for many applications. 5513 The authorization server (chain) directs the selection of proper 5514 transfer strategy, based on its knowledge of the user and 5515 relationships of roaming partnerships. The server (or agents) uses 5516 the Acct-Interim-Interval and Accounting-Realtime-Required AVPs to 5517 control the operation of the Diameter peer operating as a client. 5518 The Acct-Interim-Interval AVP, when present, instructs the Diameter 5519 node acting as a client to produce accounting records continuously 5520 even during a session. Accounting-Realtime-Required AVP is used to 5521 control the behavior of the client when the transfer of accounting 5522 records from the Diameter client is delayed or unsuccessful. 5524 The Diameter accounting server MAY override the interim interval or 5525 the realtime requirements by including the Acct-Interim-Interval or 5526 Accounting-Realtime-Required AVP in the Accounting-Answer message. 5527 When one of these AVPs is present, the latest value received SHOULD 5528 be used in further accounting activities for the same session. 5530 9.2. Protocol Messages 5532 A Diameter node that receives a successful authentication and/or 5533 authorization messages from the Diameter server SHOULD collect 5534 accounting information for the session. The Accounting-Request 5535 message is used to transmit the accounting information to the 5536 Diameter server, which MUST reply with the Accounting-Answer message 5537 to confirm reception. The Accounting-Answer message includes the 5538 Result-Code AVP, which MAY indicate that an error was present in the 5539 accounting message. The value of the Accounting-Realtime-Required 5540 AVP received earlier for the session in question may indicate that 5541 the user's session has to be terminated when a rejected Accounting- 5542 Request message was received. 5544 9.3. Accounting Application Extension and Requirements 5546 Each Diameter application (e.g., NASREQ, MobileIP), SHOULD define 5547 their Service-Specific AVPs that MUST be present in the Accounting- 5548 Request message in a section entitled "Accounting AVPs". The 5549 application MUST assume that the AVPs described in this document will 5550 be present in all Accounting messages, so only their respective 5551 service-specific AVPs need to be defined in that section. 5553 Applications have the option of using one or both of the following 5554 accounting application extension models: 5556 Split Accounting Service 5558 The accounting message will carry the Application Id of the 5559 Diameter base accounting application (see Section 2.4). 5560 Accounting messages maybe routed to Diameter nodes other than the 5561 corresponding Diameter application. These nodes might be 5562 centralized accounting servers that provide accounting service for 5563 multiple different Diameter applications. These nodes MUST 5564 advertise the Diameter base accounting Application Id during 5565 capabilities exchange. 5567 Coupled Accounting Service 5569 The accounting messages will carry the Application Id of the 5570 application that is using it. The application itself will process 5571 the received accounting records or forward them to an accounting 5572 server. There is no accounting application advertisement required 5573 during capabilities exchange and the accounting messages will be 5574 routed the same as any of the other application messages. 5576 In cases where an application does not define its own accounting 5577 service, it is preferred that the split accounting model be used. 5579 9.4. Fault Resilience 5581 Diameter Base protocol mechanisms are used to overcome small message 5582 loss and network faults of temporary nature. 5584 Diameter peers acting as clients MUST implement the use of failover 5585 to guard against server failures and certain network failures. 5586 Diameter peers acting as agents or related off-line processing 5587 systems MUST detect duplicate accounting records caused by the 5588 sending of same record to several servers and duplication of messages 5589 in transit. This detection MUST be based on the inspection of the 5590 Session-Id and Accounting-Record-Number AVP pairs. Appendix C 5591 discusses duplicate detection needs and implementation issues. 5593 Diameter clients MAY have non-volatile memory for the safe storage of 5594 accounting records over reboots or extended network failures, network 5595 partitions, and server failures. If such memory is available, the 5596 client SHOULD store new accounting records there as soon as the 5597 records are created and until a positive acknowledgement of their 5598 reception from the Diameter Server has been received. Upon a reboot, 5599 the client MUST starting sending the records in the non-volatile 5600 memory to the accounting server with appropriate modifications in 5601 termination cause, session length, and other relevant information in 5602 the records. 5604 A further application of this protocol may include AVPs to control 5605 how many accounting records may at most be stored in the Diameter 5606 client without committing them to the non-volatile memory or 5607 transferring them to the Diameter server. 5609 The client SHOULD NOT remove the accounting data from any of its 5610 memory areas before the correct Accounting-Answer has been received. 5611 The client MAY remove oldest, undelivered or yet unacknowledged 5612 accounting data if it runs out of resources such as memory. It is an 5613 implementation dependent matter for the client to accept new sessions 5614 under this condition. 5616 9.5. Accounting Records 5618 In all accounting records, the Session-Id AVP MUST be present; the 5619 User-Name AVP MUST be present if it is available to the Diameter 5620 client. 5622 Different types of accounting records are sent depending on the 5623 actual type of accounted service and the authorization server's 5624 directions for interim accounting. If the accounted service is a 5625 one-time event, meaning that the start and stop of the event are 5626 simultaneous, then the Accounting-Record-Type AVP MUST be present and 5627 set to the value EVENT_RECORD. 5629 If the accounted service is of a measurable length, then the AVP MUST 5630 use the values START_RECORD, STOP_RECORD, and possibly, 5631 INTERIM_RECORD. If the authorization server has not directed interim 5632 accounting to be enabled for the session, two accounting records MUST 5633 be generated for each service of type session. When the initial 5634 Accounting-Request for a given session is sent, the Accounting- 5635 Record-Type AVP MUST be set to the value START_RECORD. When the last 5636 Accounting-Request is sent, the value MUST be STOP_RECORD. 5638 If the authorization server has directed interim accounting to be 5639 enabled, the Diameter client MUST produce additional records between 5640 the START_RECORD and STOP_RECORD, marked INTERIM_RECORD. The 5641 production of these records is directed by Acct-Interim-Interval as 5642 well as any re-authentication or re-authorization of the session. 5643 The Diameter client MUST overwrite any previous interim accounting 5644 records that are locally stored for delivery, if a new record is 5645 being generated for the same session. This ensures that only one 5646 pending interim record can exist on an access device for any given 5647 session. 5649 A particular value of Accounting-Sub-Session-Id MUST appear only in 5650 one sequence of accounting records from a DIAMETER client, except for 5651 the purposes of retransmission. The one sequence that is sent MUST 5652 be either one record with Accounting-Record-Type AVP set to the value 5653 EVENT_RECORD, or several records starting with one having the value 5654 START_RECORD, followed by zero or more INTERIM_RECORD and a single 5655 STOP_RECORD. A particular Diameter application specification MUST 5656 define the type of sequences that MUST be used. 5658 9.6. Correlation of Accounting Records 5660 If an application uses accounting messages, it can correlate 5661 accounting records with a specific application session by using the 5662 Session-Id of the particular application session in the accounting 5663 messages. Accounting messages MAY also use a different Session-Id 5664 from that of the application sessions in which case other session 5665 related information is needed to perform correlation. 5667 In cases where an application requires multiple accounting sub- 5668 session, an Accounting-Sub-Session-Id AVP is used to differentiate 5669 each sub-session. The Session-Id would remain constant for all sub- 5670 sessions and is be used to correlate all the sub-sessions to a 5671 particular application session. Note that receiving a STOP_RECORD 5672 with no Accounting-Sub-Session-Id AVP when sub-sessions were 5673 originally used in the START_RECORD messages implies that all sub- 5674 sessions are terminated. 5676 There are also cases where an application needs to correlate multiple 5677 application sessions into a single accounting record; the accounting 5678 record may span multiple different Diameter applications and sessions 5679 used by the same user at a given time. In such cases, the Acct- 5680 Multi-Session- Id AVP is used. The Acct-Multi-Session-Id AVP SHOULD 5681 be signalled by the server to the access device (typically during 5682 authorization) when it determines that a request belongs to an 5683 existing session. The access device MUST then include the Acct- 5684 Multi-Session-Id AVP in all subsequent accounting messages. 5686 The Acct-Multi-Session-Id AVP MAY include the value of the original 5687 Session-Id. It's contents are implementation specific, but MUST be 5688 globally unique across other Acct-Multi-Session-Id, and MUST NOT 5689 change during the life of a session. 5691 A Diameter application document MUST define the exact concept of a 5692 session that is being accounted, and MAY define the concept of a 5693 multi-session. For instance, the NASREQ DIAMETER application treats 5694 a single PPP connection to a Network Access Server as one session, 5695 and a set of Multilink PPP sessions as one multi-session. 5697 9.7. Accounting Command-Codes 5699 This section defines Command-Code values that MUST be supported by 5700 all Diameter implementations that provide Accounting services. 5702 9.7.1. Accounting-Request 5704 The Accounting-Request (ACR) command, indicated by the Command-Code 5705 field set to 271 and the Command Flags' 'R' bit set, is sent by a 5706 Diameter node, acting as a client, in order to exchange accounting 5707 information with a peer. 5709 The AVP listed below SHOULD include service specific accounting AVPs, 5710 as described in Section 9.3. 5712 Message Format 5714 ::= < Diameter Header: 271, REQ, PXY > 5715 < Session-Id > 5716 { Origin-Host } 5717 { Origin-Realm } 5718 { Destination-Realm } 5719 { Accounting-Record-Type } 5720 { Accounting-Record-Number } 5721 [ Acct-Application-Id ] 5722 [ Vendor-Specific-Application-Id ] 5723 [ User-Name ] 5724 [ Destination-Host ] 5725 [ Accounting-Sub-Session-Id ] 5726 [ Acct-Session-Id ] 5727 [ Acct-Multi-Session-Id ] 5728 [ Acct-Interim-Interval ] 5729 [ Accounting-Realtime-Required ] 5730 [ Origin-State-Id ] 5731 [ Event-Timestamp ] 5732 * [ Proxy-Info ] 5733 * [ Route-Record ] 5734 * [ AVP ] 5736 9.7.2. Accounting-Answer 5738 The Accounting-Answer (ACA) command, indicated by the Command-Code 5739 field set to 271 and the Command Flags' 'R' bit cleared, is used to 5740 acknowledge an Accounting-Request command. The Accounting-Answer 5741 command contains the same Session-Id as the corresponding request. 5743 Only the target Diameter Server, known as the home Diameter Server, 5744 SHOULD respond with the Accounting-Answer command. 5746 The AVP listed below SHOULD include service specific accounting AVPs, 5747 as described in Section 9.3. 5749 Message Format 5751 ::= < Diameter Header: 271, PXY > 5752 < Session-Id > 5753 { Result-Code } 5754 { Origin-Host } 5755 { Origin-Realm } 5756 { Accounting-Record-Type } 5757 { Accounting-Record-Number } 5758 [ Acct-Application-Id ] 5759 [ Vendor-Specific-Application-Id ] 5760 [ User-Name ] 5761 [ Accounting-Sub-Session-Id ] 5762 [ Acct-Session-Id ] 5763 [ Acct-Multi-Session-Id ] 5764 [ Error-Message ] 5765 [ Error-Reporting-Host ] 5766 [ Failed-AVP ] 5767 [ Acct-Interim-Interval ] 5768 [ Accounting-Realtime-Required ] 5769 [ Origin-State-Id ] 5770 [ Event-Timestamp ] 5771 * [ Proxy-Info ] 5772 * [ AVP ] 5774 9.8. Accounting AVPs 5776 This section contains AVPs that describe accounting usage information 5777 related to a specific session. 5779 9.8.1. Accounting-Record-Type AVP 5781 The Accounting-Record-Type AVP (AVP Code 480) is of type Enumerated 5782 and contains the type of accounting record being sent. The following 5783 values are currently defined for the Accounting-Record-Type AVP: 5785 EVENT_RECORD 1 5787 An Accounting Event Record is used to indicate that a one-time 5788 event has occurred (meaning that the start and end of the event 5789 are simultaneous). This record contains all information relevant 5790 to the service, and is the only record of the service. 5792 START_RECORD 2 5794 An Accounting Start, Interim, and Stop Records are used to 5795 indicate that a service of a measurable length has been given. An 5796 Accounting Start Record is used to initiate an accounting session, 5797 and contains accounting information that is relevant to the 5798 initiation of the session. 5800 INTERIM_RECORD 3 5802 An Interim Accounting Record contains cumulative accounting 5803 information for an existing accounting session. Interim 5804 Accounting Records SHOULD be sent every time a re-authentication 5805 or re-authorization occurs. Further, additional interim record 5806 triggers MAY be defined by application-specific Diameter 5807 applications. The selection of whether to use INTERIM_RECORD 5808 records is done by the Acct-Interim-Interval AVP. 5810 STOP_RECORD 4 5812 An Accounting Stop Record is sent to terminate an accounting 5813 session and contains cumulative accounting information relevant to 5814 the existing session. 5816 9.8.2. Acct-Interim-Interval AVP 5818 The Acct-Interim-Interval AVP (AVP Code 85) is of type Unsigned32 and 5819 is sent from the Diameter home authorization server to the Diameter 5820 client. The client uses information in this AVP to decide how and 5821 when to produce accounting records. With different values in this 5822 AVP, service sessions can result in one, two, or two+N accounting 5823 records, based on the needs of the home-organization. The following 5824 accounting record production behavior is directed by the inclusion of 5825 this AVP: 5827 1. The omission of the Acct-Interim-Interval AVP or its inclusion 5828 with Value field set to 0 means that EVENT_RECORD, START_RECORD, 5829 and STOP_RECORD are produced, as appropriate for the service. 5831 2. The inclusion of the AVP with Value field set to a non-zero value 5832 means that INTERIM_RECORD records MUST be produced between the 5833 START_RECORD and STOP_RECORD records. The Value field of this 5834 AVP is the nominal interval between these records in seconds. 5836 The Diameter node that originates the accounting information, 5837 known as the client, MUST produce the first INTERIM_RECORD record 5838 roughly at the time when this nominal interval has elapsed from 5839 the START_RECORD, the next one again as the interval has elapsed 5840 once more, and so on until the session ends and a STOP_RECORD 5841 record is produced. 5843 The client MUST ensure that the interim record production times 5844 are randomized so that large accounting message storms are not 5845 created either among records or around a common service start 5846 time. 5848 9.8.3. Accounting-Record-Number AVP 5850 The Accounting-Record-Number AVP (AVP Code 485) is of type Unsigned32 5851 and identifies this record within one session. As Session-Id AVPs 5852 are globally unique, the combination of Session-Id and Accounting- 5853 Record-Number AVPs is also globally unique, and can be used in 5854 matching accounting records with confirmations. An easy way to 5855 produce unique numbers is to set the value to 0 for records of type 5856 EVENT_RECORD and START_RECORD, and set the value to 1 for the first 5857 INTERIM_RECORD, 2 for the second, and so on until the value for 5858 STOP_RECORD is one more than for the last INTERIM_RECORD. 5860 9.8.4. Acct-Session-Id AVP 5862 The Acct-Session-Id AVP (AVP Code 44) is of type OctetString is only 5863 used when RADIUS/Diameter translation occurs. This AVP contains the 5864 contents of the RADIUS Acct-Session-Id attribute. 5866 9.8.5. Acct-Multi-Session-Id AVP 5868 The Acct-Multi-Session-Id AVP (AVP Code 50) is of type UTF8String, 5869 following the format specified in Section 8.8. The Acct-Multi- 5870 Session-Id AVP is used to link together multiple related accounting 5871 sessions, where each session would have a unique Session-Id, but the 5872 same Acct-Multi-Session-Id AVP. This AVP MAY be returned by the 5873 Diameter server in an authorization answer, and MUST be used in all 5874 accounting messages for the given session. 5876 9.8.6. Accounting-Sub-Session-Id AVP 5878 The Accounting-Sub-Session-Id AVP (AVP Code 287) is of type 5879 Unsigned64 and contains the accounting sub-session identifier. The 5880 combination of the Session-Id and this AVP MUST be unique per sub- 5881 session, and the value of this AVP MUST be monotonically increased by 5882 one for all new sub-sessions. The absence of this AVP implies no 5883 sub-sessions are in use, with the exception of an Accounting-Request 5884 whose Accounting-Record-Type is set to STOP_RECORD. A STOP_RECORD 5885 message with no Accounting-Sub-Session-Id AVP present will signal the 5886 termination of all sub-sessions for a given Session-Id. 5888 9.8.7. Accounting-Realtime-Required AVP 5890 The Accounting-Realtime-Required AVP (AVP Code 483) is of type 5891 Enumerated and is sent from the Diameter home authorization server to 5892 the Diameter client or in the Accounting-Answer from the accounting 5893 server. The client uses information in this AVP to decide what to do 5894 if the sending of accounting records to the accounting server has 5895 been temporarily prevented due to, for instance, a network problem. 5897 DELIVER_AND_GRANT 1 5899 The AVP with Value field set to DELIVER_AND_GRANT means that the 5900 service MUST only be granted as long as there is a connection to 5901 an accounting server. Note that the set of alternative accounting 5902 servers are treated as one server in this sense. Having to move 5903 the accounting record stream to a backup server is not a reason to 5904 discontinue the service to the user. 5906 GRANT_AND_STORE 2 5908 The AVP with Value field set to GRANT_AND_STORE means that service 5909 SHOULD be granted if there is a connection, or as long as records 5910 can still be stored as described in Section 9.4. 5912 This is the default behavior if the AVP isn't included in the 5913 reply from the authorization server. 5915 GRANT_AND_LOSE 3 5917 The AVP with Value field set to GRANT_AND_LOSE means that service 5918 SHOULD be granted even if the records can not be delivered or 5919 stored. 5921 10. AVP Occurrence Table 5923 The following tables presents the AVPs defined in this document, and 5924 specifies in which Diameter messages they MAY be present or not. 5925 AVPs that occur only inside a Grouped AVP are not shown in this 5926 table. 5928 The table uses the following symbols: 5930 0 The AVP MUST NOT be present in the message. 5932 0+ Zero or more instances of the AVP MAY be present in the 5933 message. 5935 0-1 Zero or one instance of the AVP MAY be present in the message. 5936 It is considered an error if there are more than one instance of 5937 the AVP. 5939 1 One instance of the AVP MUST be present in the message. 5941 1+ At least one instance of the AVP MUST be present in the 5942 message. 5944 10.1. Base Protocol Command AVP Table 5946 The table in this section is limited to the non-accounting Command 5947 Codes defined in this specification. 5949 +-----------------------------------------------+ 5950 | Command-Code | 5951 +---+---+---+---+---+---+---+---+---+---+---+---+ 5952 Attribute Name |CER|CEA|DPR|DPA|DWR|DWA|RAR|RAA|ASR|ASA|STR|STA| 5953 --------------------+---+---+---+---+---+---+---+---+---+---+---+---+ 5954 Acct-Interim- |0 |0 |0 |0 |0 |0 |0-1|0 |0 |0 |0 |0 | 5955 Interval | | | | | | | | | | | | | 5956 Accounting-Realtime-|0 |0 |0 |0 |0 |0 |0-1|0 |0 |0 |0 |0 | 5957 Required | | | | | | | | | | | | | 5958 Acct-Application-Id |0+ |0+ |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 | 5959 Auth-Application-Id |0+ |0+ |0 |0 |0 |0 |1 |0 |1 |0 |1 |0 | 5960 Auth-Grace-Period |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 | 5961 Auth-Request-Type |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 | 5962 Auth-Session-State |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 | 5963 Authorization- |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 | 5964 Lifetime | | | | | | | | | | | | | 5965 Class |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0+ |0+ | 5966 Destination-Host |0 |0 |0 |0 |0 |0 |1 |0 |1 |0 |0-1|0 | 5967 Destination-Realm |0 |0 |0 |0 |0 |0 |1 |0 |1 |0 |1 |0 | 5968 Disconnect-Cause |0 |0 |1 |0 |0 |0 |0 |0 |0 |0 |0 |0 | 5969 Error-Message |0 |0-1|0 |0-1|0 |0-1|0 |0-1|0 |0-1|0 |0-1| 5970 Error-Reporting-Host|0 |0 |0 |0 |0 |0 |0 |0-1|0 |0-1|0 |0-1| 5971 Failed-AVP |0 |0+ |0 |0+ |0 |0+ |0 |0+ |0 |0+ |0 |0+ | 5972 Firmware-Revision |0-1|0-1|0 |0 |0 |0 |0 |0 |0 |0 |0 |0 | 5973 Host-IP-Address |1+ |1+ |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 | 5974 Inband-Security-Id |0+ |0+ |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 | 5975 Multi-Round-Time-Out|0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 | 5976 Origin-Host |1 |1 |1 |1 |1 |1 |1 |1 |1 |1 |1 |1 | 5977 Origin-Realm |1 |1 |1 |1 |1 |1 |1 |1 |1 |1 |1 |1 | 5978 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| 5979 Product-Name |1 |1 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 | 5980 Proxy-Info |0 |0 |0 |0 |0 |0 |0+ |0+ |0+ |0+ |0+ |0+ | 5981 Redirect-Host |0 |0 |0 |0 |0 |0 |0 |0+ |0 |0+ |0 |0+ | 5982 Redirect-Host-Usage |0 |0 |0 |0 |0 |0 |0 |0-1|0 |0-1|0 |0-1| 5983 Redirect-Max-Cache- |0 |0 |0 |0 |0 |0 |0 |0-1|0 |0-1|0 |0-1| 5984 Time | | | | | | | | | | | | | 5985 Result-Code |0 |1 |0 |1 |0 |1 |0 |1 |0 |1 |0 |1 | 5986 Re-Auth-Request-Type|0 |0 |0 |0 |0 |0 |1 |0 |0 |0 |0 |0 | 5987 Route-Record |0 |0 |0 |0 |0 |0 |0+ |0 |0+ |0 |0+ |0 | 5988 Session-Binding |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 | 5989 Session-Id |0 |0 |0 |0 |0 |0 |1 |1 |1 |1 |1 |1 | 5990 Session-Server- |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 | 5991 Failover | | | | | | | | | | | | | 5992 Session-Timeout |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 | 5993 Supported-Vendor-Id |0+ |0+ |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 | 5994 Termination-Cause |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |1 |0 | 5995 User-Name |0 |0 |0 |0 |0 |0 |0-1|0-1|0-1|0-1|0-1|0-1| 5996 Vendor-Id |1 |1 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 | 5997 Vendor-Specific- |0+ |0+ |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 | 5998 Application-Id | | | | | | | | | | | | | 5999 --------------------+---+---+---+---+---+---+---+---+---+---+---+---+ 6001 10.2. Accounting AVP Table 6003 The table in this section is used to represent which AVPs defined in 6004 this document are to be present in the Accounting messages. These 6005 AVP occurrence requirements are guidelines, which may be expanded, 6006 and/or overridden by application-specific requirements in the 6007 Diameter applications documents. 6009 +-----------+ 6010 | Command | 6011 | Code | 6012 +-----+-----+ 6013 Attribute Name | ACR | ACA | 6014 ------------------------------+-----+-----+ 6015 Acct-Interim-Interval | 0-1 | 0-1 | 6016 Acct-Multi-Session-Id | 0-1 | 0-1 | 6017 Accounting-Record-Number | 1 | 1 | 6018 Accounting-Record-Type | 1 | 1 | 6019 Acct-Session-Id | 0-1 | 0-1 | 6020 Accounting-Sub-Session-Id | 0-1 | 0-1 | 6021 Accounting-Realtime-Required | 0-1 | 0-1 | 6022 Acct-Application-Id | 0-1 | 0-1 | 6023 Auth-Application-Id | 0 | 0 | 6024 Class | 0+ | 0+ | 6025 Destination-Host | 0-1 | 0 | 6026 Destination-Realm | 1 | 0 | 6027 Error-Reporting-Host | 0 | 0+ | 6028 Event-Timestamp | 0-1 | 0-1 | 6029 Origin-Host | 1 | 1 | 6030 Origin-Realm | 1 | 1 | 6031 Proxy-Info | 0+ | 0+ | 6032 Route-Record | 0+ | 0 | 6033 Result-Code | 0 | 1 | 6034 Session-Id | 1 | 1 | 6035 Termination-Cause | 0 | 0 | 6036 User-Name | 0-1 | 0-1 | 6037 Vendor-Specific-Application-Id| 0-1 | 0-1 | 6038 ------------------------------+-----+-----+ 6040 11. IANA Considerations 6042 This section provides guidance to the Internet Assigned Numbers 6043 Authority (IANA) regarding registration of values related to the 6044 Diameter protocol, in accordance with BCP 26 [RFC2434]. The 6045 following policies are used here with the meanings defined in BCP 26: 6046 "Private Use", "First Come First Served", "Expert Review", 6047 "Specification Required", "IETF Review", "Standards Action". 6049 This section explains the criteria to be used by the IANA for 6050 assignment of numbers within namespaces defined within this document. 6052 For registration requests where a Designated Expert should be 6053 consulted, the responsible IESG area director should appoint the 6054 Designated Expert. For Designated Expert with Specification 6055 Required, the request is posted to the DIME WG mailing list (or, if 6056 it has been disbanded, a successor designated by the Area Director) 6057 for comment and review, and MUST include a pointer to a public 6058 specification. Before a period of 30 days has passed, the Designated 6059 Expert will either approve or deny the registration request and 6060 publish a notice of the decision to the DIME WG mailing list or its 6061 successor. A denial notice MUST be justified by an explanation and, 6062 in the cases where it is possible, concrete suggestions on how the 6063 request can be modified so as to become acceptable. 6065 11.1. AVP Header 6067 As defined in Section 4, the AVP header contains three fields that 6068 requires IANA namespace management; the AVP Code, Vendor-ID and Flags 6069 field. 6071 11.1.1. AVP Codes 6073 The AVP Code namespace is used to identify attributes. There are 6074 multiple namespaces. Vendors can have their own AVP Codes namespace 6075 which will be identified by their Vendor-ID (also known as 6076 Enterprise-Number) and they control the assignments of their vendor- 6077 specific AVP codes within their own namespace. The absence of a 6078 Vendor-ID or a Vendor-ID value of zero (0) identifies the IETF IANA 6079 controlled AVP Codes namespace. The AVP Codes and sometimes also 6080 possible values in an AVP are controlled and maintained by IANA. 6082 AVP Code 0 is not used. AVP Codes 1-255 are managed separately as 6083 RADIUS Attribute Types [RADTYPE]. This document defines the AVP 6084 Codes 257-274, 276-285, 287, 291-300, 480, 483 and 485-486. See 6085 Section 4.5 for the assignment of the namespace in this 6086 specification. 6088 AVPs may be allocated following Designated Expert with Specification 6089 Required [RFC2434]. Release of blocks of AVPs (more than 3 at a time 6090 for a given purpose) should require IETF Review. 6092 Note that Diameter defines a mechanism for Vendor-Specific AVPs, 6093 where the Vendor-Id field in the AVP header is set to a non-zero 6094 value. Vendor-Specific AVPs codes are for Private Use and should be 6095 encouraged instead of allocation of global attribute types, for 6096 functions specific only to one vendor's implementation of Diameter, 6097 where no interoperability is deemed useful. Where a Vendor-Specific 6098 AVP is implemented by more than one vendor, allocation of global AVPs 6099 should be encouraged instead. 6101 11.1.2. AVP Flags 6103 There are 8 bits in the AVP Flags field of the AVP header, defined in 6104 Section 4. This document assigns bit 0 ('V'endor Specific), bit 1 6105 ('M'andatory) and bit 2 ('P'rotected). The remaining bits should 6106 only be assigned via a Standards Action [RFC2434]. 6108 11.2. Diameter Header 6110 As defined in Section 3, the Diameter header contains two fields that 6111 require IANA namespace management; Command Code and Command Flags. 6113 11.2.1. Command Codes 6115 The Command Code namespace is used to identify Diameter commands. 6116 The values 0-255 (0x00-0xff) are reserved for RADIUS backward 6117 compatibility, and are defined as "RADIUS Packet Type Codes" in 6118 [RADTYPE]. Values 256 - 8,388,607 (0x100 to 0x7fffff) are for 6119 permanent, standard commands, allocated by IETF Review [RFC2434]. 6120 This document defines the Command Codes 257, 258, 271, 274-275, 280 6121 and 282. See Section 3.1 for the assignment of the namespace in this 6122 specification. 6124 The values 8,388,608 - 16,777,213 (0x800000 - 0xfffffd) are reserved 6125 for vendor-specific command codes, to be allocated on a First Come, 6126 First Served basis by IANA [RFC2434]. The request to IANA for a 6127 Vendor-Specific Command Code SHOULD include a reference to a publicly 6128 available specification which documents the command in sufficient 6129 detail to aid in interoperability between independent 6130 implementations. If the specification cannot be made publicly 6131 available, the request for a vendor-specific command code MUST 6132 include the contact information of persons and/or entities 6133 responsible for authoring and maintaining the command. 6135 The values 16,777,214 and 16,777,215 (hexadecimal values 0xfffffe - 6136 0xffffff) are reserved for experimental commands. As these codes are 6137 only for experimental and testing purposes, no guarantee is made for 6138 interoperability between Diameter peers using experimental commands, 6139 as outlined in [IANA-EXP]. 6141 11.2.2. Command Flags 6143 There are eight bits in the Command Flags field of the Diameter 6144 header. This document assigns bit 0 ('R'equest), bit 1 ('P'roxy), 6145 bit 2 ('E'rror) and bit 3 ('T'). Bits 4 through 7 MUST only be 6146 assigned via a Standards Action [RFC2434]. 6148 11.3. Application Identifiers 6150 As defined in Section 2.4, the Application Id is used to identify a 6151 specific Diameter Application. There are standards-track Application 6152 Ids and vendor specific Application Ids. 6154 IANA [RFC2434] has assigned the range 0x00000001 to 0x00ffffff for 6155 standards-track applications; and 0x01000000 - 0xfffffffe for vendor 6156 specific applications, on a first-come, first-served basis. The 6157 following values are allocated. 6159 Diameter Common Messages 0 6160 Diameter Base Accounting 3 6161 Relay 0xffffffff 6163 Assignment of standards-track Application Ids are by Designated 6164 Expert with Specification Required [RFC2434]. 6166 Both Auth-Application-Id and Acct-Application-Id AVPs use the same 6167 Application Id space. A Diameter node advertising itself as a relay 6168 agent MUST set either Application-Id or Acct-Application-Id to 6169 0xffffffff. 6171 Vendor-Specific Application Ids, are for Private Use. Vendor-Specific 6172 Application Ids are assigned on a First Come, First Served basis by 6173 IANA. 6175 11.4. AVP Values 6177 Certain AVPs in Diameter define a list of values with various 6178 meanings. For attributes other than those specified in this section, 6179 adding additional values to the list can be done on a First Come, 6180 First Served basis by IANA. 6182 11.4.1. Result-Code AVP Values 6184 As defined in Section 7.1, the Result-Code AVP (AVP Code 268) defines 6185 the values 1001, 2001-2002, 3001-3012, 4001-4003 and 5001-5021. 6187 All remaining values are available for assignment via IETF Review 6188 [RFC2434]. 6190 11.4.2. Accounting-Record-Type AVP Values 6192 As defined in Section 9.8.1, the Accounting-Record-Type AVP (AVP Code 6193 480) defines the values 1-4. All remaining values are available for 6194 assignment via IETF Review [RFC2434]. 6196 11.4.3. Termination-Cause AVP Values 6198 As defined in Section 8.15, the Termination-Cause AVP (AVP Code 295) 6199 defines the values 1-8. All remaining values are available for 6200 assignment via IETF Review [RFC2434]. 6202 11.4.4. Redirect-Host-Usage AVP Values 6204 As defined in Section 6.13, the Redirect-Host-Usage AVP (AVP Code 6205 261) defines the values 0-5. All remaining values are available for 6206 assignment via IETF Review [RFC2434]. 6208 11.4.5. Session-Server-Failover AVP Values 6210 As defined in Section 8.18, the Session-Server-Failover AVP (AVP Code 6211 271) defines the values 0-3. All remaining values are available for 6212 assignment via IETF Review [RFC2434]. 6214 11.4.6. Session-Binding AVP Values 6216 As defined in Section 8.17, the Session-Binding AVP (AVP Code 270) 6217 defines the bits 1-4. All remaining bits are available for 6218 assignment via IETF Review [RFC2434]. 6220 11.4.7. Disconnect-Cause AVP Values 6222 As defined in Section 5.4.3, the Disconnect-Cause AVP (AVP Code 273) 6223 defines the values 0-2. All remaining values are available for 6224 assignment via IETF Review [RFC2434]. 6226 11.4.8. Auth-Request-Type AVP Values 6228 As defined in Section 8.7, the Auth-Request-Type AVP (AVP Code 274) 6229 defines the values 1-3. All remaining values are available for 6230 assignment via IETF Review [RFC2434]. 6232 11.4.9. Auth-Session-State AVP Values 6234 As defined in Section 8.11, the Auth-Session-State AVP (AVP Code 277) 6235 defines the values 0-1. All remaining values are available for 6236 assignment via IETF Review [RFC2434]. 6238 11.4.10. Re-Auth-Request-Type AVP Values 6240 As defined in Section 8.12, the Re-Auth-Request-Type AVP (AVP Code 6241 285) defines the values 0-1. All remaining values are available for 6242 assignment via IETF Review [RFC2434]. 6244 11.4.11. Accounting-Realtime-Required AVP Values 6246 As defined in Section 9.8.7, the Accounting-Realtime-Required AVP 6247 (AVP Code 483) defines the values 1-3. All remaining values are 6248 available for assignment via IETF Review [RFC2434]. 6250 11.4.12. Inband-Security-Id AVP (code 299) 6252 As defined in Section 6.10, the Inband-Security-Id AVP (AVP Code 299) 6253 defines the values 0-1. All remaining values are available for 6254 assignment via IETF Review [RFC2434]. 6256 11.5. Diameter TCP/SCTP Port Numbers 6258 The IANA has assigned TCP and SCTP port number 3868 to Diameter. 6260 11.6. NAPTR Service Fields 6262 The registration in the RFC MUST include the following information: 6264 Service Field: The service field being registered. An example for a 6265 new fictitious transport protocol called NCTP might be "AAA+D2N". 6267 Protocol: The specific transport protocol associated with that 6268 service field. This MUST include the name and acronym for the 6269 protocol, along with reference to a document that describes the 6270 transport protocol. For example - "New Connectionless Transport 6271 Protocol (NCTP), RFC XYZ". 6273 Name and Contact Information: The name, address, email address and 6274 telephone number for the person performing the registration. 6276 The following values have been placed into the registry: 6278 Services Field Protocol 6280 AAA+D2T TCP 6281 AAA+D2S SCTP 6283 12. Diameter protocol related configurable parameters 6285 This section contains the configurable parameters that are found 6286 throughout this document: 6288 Diameter Peer 6290 A Diameter entity MAY communicate with peers that are statically 6291 configured. A statically configured Diameter peer would require 6292 that either the IP address or the fully qualified domain name 6293 (FQDN) be supplied, which would then be used to resolve through 6294 DNS. 6296 Routing Table 6298 A Diameter proxy server routes messages based on the realm portion 6299 of a Network Access Identifier (NAI). The server MUST have a 6300 table of Realm Names, and the address of the peer to which the 6301 message must be forwarded to. The routing table MAY also include 6302 a "default route", which is typically used for all messages that 6303 cannot be locally processed. 6305 Tc timer 6307 The Tc timer controls the frequency that transport connection 6308 attempts are done to a peer with whom no active transport 6309 connection exists. The recommended value is 30 seconds. 6311 13. Security Considerations 6313 The Diameter base protocol messages SHOULD be secured by using TLS 6314 [RFC4346]. Additional security measures that are transparent to and 6315 independent of Diameter, such as IPsec [RFC4301], can also be 6316 deployed to secure connections between peers. 6318 During deployment, connections between Diameter nodes SHOULD be 6319 protected by TLS. All Diameter base protocol implementations MUST 6320 support the use of TLS. The Diameter protocol MUST NOT be used 6321 without any security mechanism. 6323 If a Diameter connection is to be protected via TLS, then the CER/CEA 6324 exchange MUST include an Inband-Security-ID AVP with a value of TLS. 6325 For TLS usage, a TLS handshake will begin when both ends are in the 6326 open state, after completion of the CER/CEA exchange. If the TLS 6327 handshake is successful, all further messages will be sent via TLS. 6328 If the handshake fails, both ends move to the closed state. See 6329 Sections 13.1 for more details. 6331 13.1. TLS Usage 6333 A Diameter node that initiates a connection to another Diameter node 6334 acts as a TLS client according to [RFC4346], and a Diameter node that 6335 accepts a connection acts as a TLS server. Diameter nodes 6336 implementing TLS for security MUST mutually authenticate as part of 6337 TLS session establishment. In order to ensure mutual authentication, 6338 the Diameter node acting as TLS server MUST request a certificate 6339 from the Diameter node acting as TLS client, and the Diameter node 6340 acting as TLS client MUST be prepared to supply a certificate on 6341 request. 6343 Diameter nodes MUST be able to negotiate the following TLS cipher 6344 suites: 6346 TLS_RSA_WITH_RC4_128_MD5 6347 TLS_RSA_WITH_RC4_128_SHA 6348 TLS_RSA_WITH_3DES_EDE_CBC_SHA 6350 Diameter nodes SHOULD be able to negotiate the following TLS cipher 6351 suite: 6353 TLS_RSA_WITH_AES_128_CBC_SHA 6355 Diameter nodes MAY negotiate other TLS cipher suites. 6357 Upon receiving the peers certificate, Diameter nodes SHOULD further 6358 validate the identity of the peer by matching the received Origin- 6359 Host and/or Origin-Realm in the CER and CEA exchange against the 6360 content of the peers certificate. Diameter peer hostname and/or 6361 realm validation can be performed in the following order: 6363 o If one or more 'Subject Alternate Name (subjectAltName)' extension 6364 of type dNSName is present in the certificate (See [RFC3280]), 6365 then the Origin-Host value can be used to find a matching 6366 extension. 6368 o If there are no matches found, then the Origin-Realm value can be 6369 used to find a matching subjectAltName extension. 6371 o Otherwise, the Origin-Host value should be found within the 6372 'Common Name (CN)' field in the Subject field of the certificate 6373 (See [RFC3280]). 6375 Identity validation MAY be omitted by a Diameter node if the 6376 information contained in the certificate cannot be correlated or 6377 mapped to the Origin-Host and Origin-Realm presented by a peer. 6378 However, the Diameter node SHOULD have external information or other 6379 means to validate the identity of a peer. 6381 13.2. Peer-to-Peer Considerations 6383 As with any peer-to-peer protocol, proper configuration of the trust 6384 model within a Diameter peer is essential to security. When 6385 certificates are used, it is necessary to configure the root 6386 certificate authorities trusted by the Diameter peer. These root CAs 6387 are likely to be unique to Diameter usage and distinct from the root 6388 CAs that might be trusted for other purposes such as Web browsing. 6389 In general, it is expected that those root CAs will be configured so 6390 as to reflect the business relationships between the organization 6391 hosting the Diameter peer and other organizations. As a result, a 6392 Diameter peer will typically not be configured to allow connectivity 6393 with any arbitrary peer. With certificate authentication, Diameter 6394 peers may not be known beforehand and therefore peer discovery may be 6395 required. 6397 14. References 6399 14.1. Normative References 6401 [FLOATPOINT] 6402 Institute of Electrical and Electronics Engineers, "IEEE 6403 Standard for Binary Floating-Point Arithmetic, ANSI/IEEE 6404 Standard 754-1985", August 1985. 6406 [IANAADFAM] 6407 IANA,, "Address Family Numbers", 6408 http://www.iana.org/assignments/address-family-numbers. 6410 [RADTYPE] IANA,, "RADIUS Types", 6411 http://www.iana.org/assignments/radius-types. 6413 [RFC791] Postel, J., "Internet Protocol", RFC 791, September 1981. 6415 [RFC793] Postel, J., "Transmission Control Protocol", RFC 793, 6416 January 1981. 6418 [RFC3539] Aboba, B. and J. Wood, "Authentication, Authorization and 6419 Accounting (AAA) Transport Profile", RFC 3539, June 2003. 6421 [RFC4004] Calhoun, P., Johansson, T., Perkins, C., Hiller, T., and 6422 P. McCann, "Diameter Mobile IPv4 Application", RFC 4004, 6423 August 2005. 6425 [RFC4005] Calhoun, P., Zorn, G., Spence, D., and D. Mitton, 6426 "Diameter Network Access Server Application", RFC 4005, 6427 August 2005. 6429 [RFC4006] Hakala, H., Mattila, L., Koskinen, J-P., Stura, M., and J. 6430 Loughney, "Diameter Credit-Control Application", RFC 4006, 6431 August 2005. 6433 [RFC4072] Eronen, P., Hiller, T., and G. Zorn, "Diameter Extensible 6434 Authentication Protocol (EAP) Application", RFC 4072, 6435 August 2005. 6437 [RFC4740] Garcia-Martin, M., Belinchon, M., Pallares-Lopez, M., 6438 Canales-Valenzuela, C., and K. Tammi, "Diameter Session 6439 Initiation Protocol (SIP) Application", RFC 4740, 6440 November 2006. 6442 [RFC4234] Crocker, D., Ed. and P. Overell, "Augmented BNF for Syntax 6443 Specifications: ABNF", RFC 4234, October 2005. 6445 [RFC3588] Calhoun, P., Loughney, J., Guttman, E., Zorn, G., and J. 6446 Arkko, "Diameter Base Protocol", RFC 3588, September 2003. 6448 [RFC2434] Narten, T. and H. Alvestrand, "Guidelines for Writing an 6449 IANA Considerations Section in RFCs", BCP 26, RFC 2434, 6450 October 1998. 6452 [RFC4306] Kaufman, C., "Internet Key Exchange (IKEv2) Protocol", 6453 RFC 4306, December 2005. 6455 [RFC4291] Hinden, R. and S. Deering, "IP Version 6 Addressing 6456 Architecture", RFC 4291, February 2006. 6458 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 6459 Requirement Levels", BCP 14, RFC 2119, March 1997. 6461 [RFC4282] Aboba, B., Beadles, M., Arkko, J., and P. Eronen, "The 6462 Network Access Identifier", RFC 4282, December 2005. 6464 [RFC3403] Mealling, M., "Dynamic Delegation Discovery System (DDDS) 6465 Part Three: The Domain Name System (DNS) Database", 6466 RFC 3403, October 2002. 6468 [RFC4086] Eastlake, D., Schiller, J., and S. Crocker, "Randomness 6469 Requirements for Security", BCP 106, RFC 4086, June 2005. 6471 [RFC2960] Stewart, R., Xie, Q., Morneault, K., Sharp, C., 6472 Schwarzbauer, H., Taylor, T., Rytina, I., Kalla, M., 6473 Zhang, L., and V. Paxson, "Stream Control Transmission 6474 Protocol", RFC 2960, October 2000. 6476 [RFC4346] Dierks, T. and E. Rescorla, "The Transport Layer Security 6477 (TLS) Protocol Version 1.1", RFC 4346, April 2006. 6479 [RFC3986] Berners-Lee, T., Fielding, R., and L. Masinter, "Uniform 6480 Resource Identifier (URI): Generic Syntax", STD 66, 6481 RFC 3986, January 2005. 6483 [RFC3629] Yergeau, F., "UTF-8, a transformation format of ISO 6484 10646", STD 63, RFC 3629, November 2003. 6486 [RFC3280] Housley, R., Polk, W., Ford, W., and D. Solo, "Internet 6487 X.509 Public Key Infrastructure Certificate and 6488 Certificate Revocation List (CRL) Profile", RFC 3280, 6489 April 2002. 6491 [RFC3490] Faltstrom, P., Hoffman, P., and A. Costello, 6492 "Internationalizing Domain Names in Applications (IDNA)", 6493 RFC 3490, March 2003. 6495 [RFC3491] Hoffman, P. and M. Blanchet, "Nameprep: A Stringprep 6496 Profile for Internationalized Domain Names (IDN)", 6497 RFC 3491, March 2003. 6499 [RFC3492] Costello, A., "Punycode: A Bootstring encoding of Unicode 6500 for Internationalized Domain Names in Applications 6501 (IDNA)", RFC 3492, March 2003. 6503 14.2. Informational References 6505 [RFC2989] Aboba, B., Calhoun, P., Glass, S., Hiller, T., McCann, P., 6506 Shiino, H., Zorn, G., Dommety, G., C.Perkins, B.Patil, 6507 D.Mitton, S.Manning, M.Beadles, P.Walsh, X.Chen, 6508 S.Sivalingham, A.Hameed, M.Munson, S.Jacobs, B.Lim, 6509 B.Hirschman, R.Hsu, Y.Xu, E.Campell, S.Baba, and E.Jaques, 6510 "Criteria for Evaluating AAA Protocols for Network 6511 Access", RFC 2989, November 2000. 6513 [RFC2975] Aboba, B., Arkko, J., and D. Harrington, "Introduction to 6514 Accounting Management", RFC 2975, October 2000. 6516 [RFC3232] Reynolds, J., "Assigned Numbers: RFC 1700 is Replaced by 6517 an On-line Database", RFC 3232, January 2002. 6519 [RFC3576] Chiba, M., Dommety, G., Eklund, M., Mitton, D., and B. 6520 Aboba, "Dynamic Authorization Extensions to Remote 6521 Authentication Dial In User Service (RADIUS)", RFC 3576, 6522 July 2003. 6524 [RFC1661] Simpson, W., "The Point-to-Point Protocol (PPP)", STD 51, 6525 RFC 1661, July 1994. 6527 [RFC2866] Rigney, C., "RADIUS Accounting", RFC 2866, June 2000. 6529 [RFC2869] Rigney, C., Willats, W., and P. Calhoun, "RADIUS 6530 Extensions", RFC 2869, June 2000. 6532 [RFC2865] Rigney, C., Willens, S., Rubens, A., and W. Simpson, 6533 "Remote Authentication Dial In User Service (RADIUS)", 6534 RFC 2865, June 2000. 6536 [RFC3162] Aboba, B., Zorn, G., and D. Mitton, "RADIUS and IPv6", 6537 RFC 3162, August 2001. 6539 [RFC4301] Kent, S. and K. Seo, "Security Architecture for the 6540 Internet Protocol", RFC 4301, December 2005. 6542 [RFC3261] Rosenberg, J., Schulzrinne, H., Camarillo, G., Johnston, 6543 A., Peterson, J., Sparks, R., Handley, M., and E. 6544 Schooler, "SIP: Session Initiation Protocol", RFC 3261, 6545 June 2002. 6547 [RFC4330] Mills, D., "Simple Network Time Protocol (SNTP) Version 4 6548 for IPv4, IPv6 and OSI", RFC 4330, January 2006. 6550 [RFC1492] Finseth, C., "An Access Control Protocol, Sometimes Called 6551 TACACS", RFC 1492, July 1993. 6553 [RFC4690] Klensin, J., Faltstrom, P., Karp, C., and IAB, "Review and 6554 Recommendations for Internationalized Domain Names 6555 (IDNs)", RFC 4690, September 2006. 6557 [IANA-EXP] 6558 Narten, T., "Assigning Experimental and Testing Numbers 6559 Considered Useful, Work in Progress.". 6561 Appendix A. Acknowledgements 6563 A.1. RFC3588bis 6565 The authors would like to thank the following people that have 6566 provided proposals and contributions to this document: 6568 To Vishnu Ram and Satendra Gera for their contributions on 6569 Capabilities Updates, Predictive Loop Avoidance as well as many other 6570 technical proposals. To Tolga Asveren for his insights and 6571 contributions on almost all of the proposed solutions incorporated 6572 into this document. To Timothy Smith for helping on the Capabilities 6573 Updates and other topics. To Tony Zhang for providing fixes to loop 6574 holes on composing Failed-AVPs as well as many other issues and 6575 topics. To Jan Nordqvist for clearly stating the usage of 6576 Application Ids. To Anders Kristensen for providing needed technical 6577 opinions. To David Frascone for providing invaluable review of the 6578 document. To Mark Jones for providing clarifying text on vendor 6579 command codes and other vendor specific indicators. 6581 Special thanks to the Diameter extensibility design team which helped 6582 resolve the tricky question of mandatory AVPs and ABNF semantics. 6583 The members of this team are as follows: 6585 Avi Lior, Jari Arkko, Glen Zorn, Lionel Morand, Mark Jones, Tolga 6586 Asveren Jouni Korhonen, Glenn McGregor. 6588 Special thanks also to people who have provided invaluable comments 6589 and inputs especially in resolving controversial issues: 6591 Glen Zorn, Yoshihiro Ohba, Marco Stura, and Pasi Eronen. 6593 Finally, we would like to thank the original authors of this 6594 document: 6596 Pat Calhoun, John Loughney, Jari Arkko, Erik Guttman and Glen Zorn. 6598 Their invaluable knowledge and experience has given us a robust and 6599 flexible AAA protocol that many people have seen great value in 6600 adopting. We greatly appreciate their support and stewardship for 6601 the continued improvements of Diameter as a protocol. We would also 6602 like to extend our gratitude to folks aside from the authors who have 6603 assisted and contributed to the original version of this document. 6604 Their efforts significantly contributed to the success of Diameter. 6606 A.2. RFC3588 6608 The authors would like to thank Nenad Trifunovic, Tony Johansson and 6609 Pankaj Patel for their participation in the pre-IETF Document Reading 6610 Party. Allison Mankin, Jonathan Wood and Bernard Aboba provided 6611 invaluable assistance in working out transport issues, and similarly 6612 with Steven Bellovin in the security area. 6614 Paul Funk and David Mitton were instrumental in getting the Peer 6615 State Machine correct, and our deep thanks go to them for their time. 6617 Text in this document was also provided by Paul Funk, Mark Eklund, 6618 Mark Jones and Dave Spence. Jacques Caron provided many great 6619 comments as a result of a thorough review of the spec. 6621 The authors would also like to acknowledge the following people for 6622 their contribution in the development of the Diameter protocol: 6624 Allan C. Rubens, Haseeb Akhtar, William Bulley, Stephen Farrell, 6625 David Frascone, Daniel C. Fox, Lol Grant, Ignacio Goyret, Nancy 6626 Greene, Peter Heitman, Fredrik Johansson, Mark Jones, Martin Julien, 6627 Bob Kopacz, Paul Krumviede, Fergal Ladley, Ryan Moats, Victor Muslin, 6628 Kenneth Peirce, John Schnizlein, Sumit Vakil, John R. Vollbrecht and 6629 Jeff Weisberg. 6631 Finally, Pat Calhoun would like to thank Sun Microsystems since most 6632 of the effort put into this document was done while he was in their 6633 employ. 6635 Appendix B. NAPTR Example 6637 As an example, consider a client that wishes to resolve aaa:ex.com. 6638 The client performs a NAPTR query for that domain, and the following 6639 NAPTR records are returned: 6641 ;; order pref flags service regexp replacement 6642 IN NAPTR 50 50 "s" "AAA+D2S" "" _diameter._sctp.example.com 6643 IN NAPTR 100 50 "s" "AAA+D2T" "" _aaa._tcp.example.com 6645 This indicates that the server supports SCTP, and TCP, in that order. 6646 If the client supports over SCTP, SCTP will be used, targeted to a 6647 host determined by an SRV lookup of _diameter._sctp.ex.com. That 6648 lookup would return: 6650 ;; Priority Weight Port Target 6651 IN SRV 0 1 5060 server1.example.com 6652 IN SRV 0 2 5060 server2.example.com 6654 Appendix C. Duplicate Detection 6656 As described in Section 9.4, accounting record duplicate detection is 6657 based on session identifiers. Duplicates can appear for various 6658 reasons: 6660 o Failover to an alternate server. Where close to real-time 6661 performance is required, failover thresholds need to be kept low 6662 and this may lead to an increased likelihood of duplicates. 6663 Failover can occur at the client or within Diameter agents. 6665 o Failure of a client or agent after sending of a record from non- 6666 volatile memory, but prior to receipt of an application layer ACK 6667 and deletion of the record. record to be sent. This will result 6668 in retransmission of the record soon after the client or agent has 6669 rebooted. 6671 o Duplicates received from RADIUS gateways. Since the 6672 retransmission behavior of RADIUS is not defined within [RFC2865], 6673 the likelihood of duplication will vary according to the 6674 implementation. 6676 o Implementation problems and misconfiguration. 6678 The T flag is used as an indication of an application layer 6679 retransmission event, e.g., due to failover to an alternate server. 6680 It is defined only for request messages sent by Diameter clients or 6681 agents. For instance, after a reboot, a client may not know whether 6682 it has already tried to send the accounting records in its non- 6683 volatile memory before the reboot occurred. Diameter servers MAY use 6684 the T flag as an aid when processing requests and detecting duplicate 6685 messages. However, servers that do this MUST ensure that duplicates 6686 are found even when the first transmitted request arrives at the 6687 server after the retransmitted request. It can be used only in cases 6688 where no answer has been received from the Server for a request and 6689 the request is sent again, (e.g., due to a failover to an alternate 6690 peer, due to a recovered primary peer or due to a client re-sending a 6691 stored record from non-volatile memory such as after reboot of a 6692 client or agent). 6694 In some cases the Diameter accounting server can delay the duplicate 6695 detection and accounting record processing until a post-processing 6696 phase takes place. At that time records are likely to be sorted 6697 according to the included User-Name and duplicate elimination is easy 6698 in this case. In other situations it may be necessary to perform 6699 real-time duplicate detection, such as when credit limits are imposed 6700 or real-time fraud detection is desired. 6702 In general, only generation of duplicates due to failover or re- 6703 sending of records in non-volatile storage can be reliably detected 6704 by Diameter clients or agents. In such cases the Diameter client or 6705 agents can mark the message as possible duplicate by setting the T 6706 flag. Since the Diameter server is responsible for duplicate 6707 detection, it can choose to make use of the T flag or not, in order 6708 to optimize duplicate detection. Since the T flag does not affect 6709 interoperability, and may not be needed by some servers, generation 6710 of the T flag is REQUIRED for Diameter clients and agents, but MAY be 6711 implemented by Diameter servers. 6713 As an example, it can be usually be assumed that duplicates appear 6714 within a time window of longest recorded network partition or device 6715 fault, perhaps a day. So only records within this time window need 6716 to be looked at in the backward direction. Secondly, hashing 6717 techniques or other schemes, such as the use of the T flag in the 6718 received messages, may be used to eliminate the need to do a full 6719 search even in this set except for rare cases. 6721 The following is an example of how the T flag may be used by the 6722 server to detect duplicate requests. 6724 A Diameter server MAY check the T flag of the received message to 6725 determine if the record is a possible duplicate. If the T flag is 6726 set in the request message, the server searches for a duplicate 6727 within a configurable duplication time window backward and 6728 forward. This limits database searching to those records where 6729 the T flag is set. In a well run network, network partitions and 6730 device faults will presumably be rare events, so this approach 6731 represents a substantial optimization of the duplicate detection 6732 process. During failover, it is possible for the original record 6733 to be received after the T flag marked record, due to differences 6734 in network delays experienced along the path by the original and 6735 duplicate transmissions. The likelihood of this occurring 6736 increases as the failover interval is decreased. In order to be 6737 able to detect out of order duplicates, the Diameter server should 6738 use backward and forward time windows when performing duplicate 6739 checking for the T flag marked request. For example, in order to 6740 allow time for the original record to exit the network and be 6741 recorded by the accounting server, the Diameter server can delay 6742 processing records with the T flag set until a time period 6743 TIME_WAIT + RECORD_PROCESSING_TIME has elapsed after the closing 6744 of the original transport connection. After this time period has 6745 expired, then it may check the T flag marked records against the 6746 database with relative assurance that the original records, if 6747 sent, have been received and recorded. 6749 Appendix D. Internationalized Domain Names 6751 To be compatible with the existing DNS infrastructure and simplify 6752 host and domain name comparison, Diameter identities (FQDNs) are 6753 represented in ASCII form. This allows the Diameter protocol to fall 6754 in-line with the DNS strategy of being transparent from the effects 6755 of Internationalized Domain Names (IDNs) by following the 6756 recommnedations in [RFC4690] and [RFC3490]. Applications that 6757 provide support for IDNs outside of the Diameter protocol but 6758 interacting with it SHOULD use the representation and conversion 6759 framework described in [RFC3490], [RFC3491] and [RFC3492]. 6761 Authors' Addresses 6763 Victor Fajardo (editor) 6764 Toshiba America Research 6765 One Telcordia Drive, 1S-222 6766 Piscataway, NJ 08854 6767 USA 6769 Phone: 1 908-421-1845 6770 Email: vfajardo@tari.toshiba.com 6772 Jari Arkko 6773 Ericsson Research 6774 02420 Jorvas 6775 Finland 6777 Phone: +358 40 5079256 6778 Email: jari.arkko@ericsson.com 6780 John Loughney 6781 Nokia Research Center 6782 955 Page Mill Road 6783 Palo Alto, CA 94304 6784 US 6786 Phone: 1-650-283-8068 6787 Email: john.loughney@nokia.com 6789 Glenn Zorn 6790 NetCube 6791 1310 East Thomas Street, #306 6792 Seattle, WA 98102 6793 US 6795 Phone: 6796 Email: glenzorn@comcast.net 6798 Full Copyright Statement 6800 Copyright (C) The IETF Trust (2008). 6802 This document is subject to the rights, licenses and restrictions 6803 contained in BCP 78, and except as set forth therein, the authors 6804 retain all their rights. 6806 This document and the information contained herein are provided on an 6807 "AS IS" basis and THE CONTRIBUTOR, THE ORGANIZATION HE/SHE REPRESENTS 6808 OR IS SPONSORED BY (IF ANY), THE INTERNET SOCIETY, THE IETF TRUST AND 6809 THE INTERNET ENGINEERING TASK FORCE DISCLAIM ALL WARRANTIES, EXPRESS 6810 OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF 6811 THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED 6812 WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. 6814 Intellectual Property 6816 The IETF takes no position regarding the validity or scope of any 6817 Intellectual Property Rights or other rights that might be claimed to 6818 pertain to the implementation or use of the technology described in 6819 this document or the extent to which any license under such rights 6820 might or might not be available; nor does it represent that it has 6821 made any independent effort to identify any such rights. Information 6822 on the procedures with respect to rights in RFC documents can be 6823 found in BCP 78 and BCP 79. 6825 Copies of IPR disclosures made to the IETF Secretariat and any 6826 assurances of licenses to be made available, or the result of an 6827 attempt made to obtain a general license or permission for the use of 6828 such proprietary rights by implementers or users of this 6829 specification can be obtained from the IETF on-line IPR repository at 6830 http://www.ietf.org/ipr. 6832 The IETF invites any interested party to bring to its attention any 6833 copyrights, patents or patent applications, or other proprietary 6834 rights that may cover technology that may be required to implement 6835 this standard. Please address the information to the IETF at 6836 ietf-ipr@ietf.org.