idnits 2.17.1 draft-ietf-dime-rfc3588bis-07.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 18. -- Found old boilerplate from RFC 3978, Section 5.5, updated by RFC 4748 on line 6806. -- Found old boilerplate from RFC 3979, Section 5, paragraph 1 on line 6817. -- Found old boilerplate from RFC 3979, Section 5, paragraph 2 on line 6824. -- Found old boilerplate from RFC 3979, Section 5, paragraph 3 on line 6830. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- == There are 2 instances of lines with non-RFC2606-compliant FQDNs in the document. == There are 2 instances of lines with non-RFC6890-compliant IPv4 addresses in the document. If these are example addresses, they should be changed. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust Copyright Line does not match the current year == Line 4536 has weird spacing: '...ly with wit...' == Line 4744 has weird spacing: '...ealtime user...' == Line 4772 has weird spacing: '... record inter...' == Line 4782 has weird spacing: '...ealtime user...' == Line 4790 has weird spacing: '...ealtime user...' == (1 more instance...) == Using lowercase 'not' together with uppercase 'MUST', 'SHALL', 'SHOULD', or 'RECOMMENDED' is not an accepted usage according to RFC 2119. Please use uppercase 'NOT' together with RFC 2119 keywords (if that is what you mean). Found 'MUST not' in this paragraph: The receiver of the Capabilities-Exchange-Request (CER) MUST determine common applications by computing the intersection of its own set of supported application identifiers against all of the application indentifier AVPs (Auth-Application-Id, Acct-Application-Id and Vendor-Specific-Application-Id) present in the CER. The value of the Vendor-Id AVP in the Vendor-Specific-Application-Id MUST not be used during computation. The sender of the Capabilities-Exchange-Answer (CEA) SHOULD include all of its supported applications as a hint to the receiver regarding all of its application capabilities. == Using lowercase 'not' together with uppercase 'MUST', 'SHALL', 'SHOULD', or 'RECOMMENDED' is not an accepted usage according to RFC 2119. Please use uppercase 'NOT' together with RFC 2119 keywords (if that is what you mean). Found 'MUST not' in this paragraph: The Destination-Realm AVP MUST be present if the message is proxiable. Request messages that may be forwarded by Diameter agents (proxies, redirects or relays) MUST also contain an Acct-Application-Id AVP, an Auth-Application-Id AVP or a Vendor-Specific-Application-Id AVP. A message that MUST NOT be forwarded by Diameter agents (proxies, redirects or relays) MUST not include the Destination-Realm in its ABNF. The value of the Destination-Realm AVP MAY be extracted from the User-Name AVP, or other application-specific methods. -- The document seems to lack a disclaimer for pre-RFC5378 work, but may have content which was first submitted before 10 November 2008. If you have contacted all the original authors and they are all willing to grant the BCP78 rights to the IETF Trust, then this is fine, and you can ignore this comment. If not, you may need to add the pre-RFC5378 disclaimer. (See the Legal Provisions document at https://trustee.ietf.org/license-info for more information.) -- The document date (September 7, 2007) is 6076 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 4251, 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 (ref. 'TCP') (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 informational reference (is this intentional?): RFC 3576 (Obsoleted by RFC 5176) -- Obsolete informational reference (is this intentional?): RFC 4330 (Obsoleted by RFC 5905) Summary: 11 errors (**), 0 flaws (~~), 12 warnings (==), 12 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 Intended status: Standards Track J. Arkko 5 Expires: March 10, 2008 Ericsson Research 6 J. Loughney 7 Nokia Research Center 8 September 7, 2007 10 Diameter Base Protocol 11 draft-ietf-dime-rfc3588bis-07.txt 13 Status of this Memo 15 By submitting this Internet-Draft, each author represents that any 16 applicable patent or other IPR claims of which he or she is aware 17 have been or will be disclosed, and any of which he or she becomes 18 aware will be disclosed, in accordance with Section 6 of BCP 79. 20 Internet-Drafts are working documents of the Internet Engineering 21 Task Force (IETF), its areas, and its working groups. Note that 22 other groups may also distribute working documents as Internet- 23 Drafts. 25 Internet-Drafts are draft documents valid for a maximum of six months 26 and may be updated, replaced, or obsoleted by other documents at any 27 time. It is inappropriate to use Internet-Drafts as reference 28 material or to cite them other than as "work in progress." 30 The list of current Internet-Drafts can be accessed at 31 http://www.ietf.org/ietf/1id-abstracts.txt. 33 The list of Internet-Draft Shadow Directories can be accessed at 34 http://www.ietf.org/shadow.html. 36 This Internet-Draft will expire on March 10, 2008. 38 Copyright Notice 40 Copyright (C) The IETF Trust (2007). 42 Abstract 44 The Diameter base protocol is intended to provide an Authentication, 45 Authorization and Accounting (AAA) framework for applications such as 46 network access or IP mobility. Diameter is also intended to work in 47 both local Authentication, Authorization & Accounting and roaming 48 situations. This document specifies the message format, transport, 49 error reporting, accounting and security services to be used by all 50 Diameter applications. The Diameter base application needs to be 51 supported by all Diameter implementations. 53 Table of Contents 55 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 7 56 1.1. Diameter Protocol . . . . . . . . . . . . . . . . . . . . 10 57 1.1.1. Description of the Document Set . . . . . . . . . . 11 58 1.1.2. Conventions Used in This Document . . . . . . . . . 12 59 1.2. Approach to Extensibility . . . . . . . . . . . . . . . . 12 60 1.2.1. Defining New AVP Values . . . . . . . . . . . . . . 13 61 1.2.2. Creating New AVPs . . . . . . . . . . . . . . . . . 13 62 1.2.3. Creating New Commands . . . . . . . . . . . . . . . 13 63 1.2.4. Creating New Authentication Applications . . . . . . 13 64 1.2.5. Creating New Accounting Applications . . . . . . . . 14 65 1.2.6. Application Authentication Procedures . . . . . . . 15 66 1.3. Terminology . . . . . . . . . . . . . . . . . . . . . . . 16 67 2. Protocol Overview . . . . . . . . . . . . . . . . . . . . . . 22 68 2.1. Transport . . . . . . . . . . . . . . . . . . . . . . . . 23 69 2.1.1. SCTP Guidelines . . . . . . . . . . . . . . . . . . 24 70 2.2. Securing Diameter Messages . . . . . . . . . . . . . . . 24 71 2.3. Diameter Application Compliance . . . . . . . . . . . . . 24 72 2.4. Application Identifiers . . . . . . . . . . . . . . . . . 24 73 2.5. Connections vs. Sessions . . . . . . . . . . . . . . . . 25 74 2.6. Peer Table . . . . . . . . . . . . . . . . . . . . . . . 26 75 2.7. Routing Table . . . . . . . . . . . . . . . . . . . . . . 27 76 2.8. Role of Diameter Agents . . . . . . . . . . . . . . . . . 28 77 2.8.1. Relay Agents . . . . . . . . . . . . . . . . . . . . 30 78 2.8.2. Proxy Agents . . . . . . . . . . . . . . . . . . . . 31 79 2.8.3. Redirect Agents . . . . . . . . . . . . . . . . . . 31 80 2.8.4. Translation Agents . . . . . . . . . . . . . . . . . 32 81 2.9. Diameter Path Authorization . . . . . . . . . . . . . . . 33 82 3. Diameter Header . . . . . . . . . . . . . . . . . . . . . . . 35 83 3.1. Command Codes . . . . . . . . . . . . . . . . . . . . . . 38 84 3.2. Command Code ABNF specification . . . . . . . . . . . . . 38 85 3.3. Diameter Command Naming Conventions . . . . . . . . . . . 40 86 4. Diameter AVPs . . . . . . . . . . . . . . . . . . . . . . . . 42 87 4.1. AVP Header . . . . . . . . . . . . . . . . . . . . . . . 42 88 4.1.1. Optional Header Elements . . . . . . . . . . . . . . 44 90 4.2. Basic AVP Data Formats . . . . . . . . . . . . . . . . . 44 91 4.3. Derived AVP Data Formats . . . . . . . . . . . . . . . . 46 92 4.4. Grouped AVP Values . . . . . . . . . . . . . . . . . . . 52 93 4.4.1. Example AVP with a Grouped Data type . . . . . . . . 53 94 4.5. Diameter Base Protocol AVPs . . . . . . . . . . . . . . . 56 95 5. Diameter Peers . . . . . . . . . . . . . . . . . . . . . . . 59 96 5.1. Peer Connections . . . . . . . . . . . . . . . . . . . . 59 97 5.2. Diameter Peer Discovery . . . . . . . . . . . . . . . . . 59 98 5.3. Capabilities Exchange . . . . . . . . . . . . . . . . . . 62 99 5.3.1. Capabilities-Exchange-Request . . . . . . . . . . . 63 100 5.3.2. Capabilities-Exchange-Answer . . . . . . . . . . . . 64 101 5.3.3. Vendor-Id AVP . . . . . . . . . . . . . . . . . . . 64 102 5.3.4. Firmware-Revision AVP . . . . . . . . . . . . . . . 64 103 5.3.5. Host-IP-Address AVP . . . . . . . . . . . . . . . . 65 104 5.3.6. Supported-Vendor-Id AVP . . . . . . . . . . . . . . 65 105 5.3.7. Product-Name AVP . . . . . . . . . . . . . . . . . . 65 106 5.4. Disconnecting Peer connections . . . . . . . . . . . . . 65 107 5.4.1. Disconnect-Peer-Request . . . . . . . . . . . . . . 66 108 5.4.2. Disconnect-Peer-Answer . . . . . . . . . . . . . . . 66 109 5.4.3. Disconnect-Cause AVP . . . . . . . . . . . . . . . . 66 110 5.5. Transport Failure Detection . . . . . . . . . . . . . . . 67 111 5.5.1. Device-Watchdog-Request . . . . . . . . . . . . . . 67 112 5.5.2. Device-Watchdog-Answer . . . . . . . . . . . . . . . 68 113 5.5.3. Transport Failure Algorithm . . . . . . . . . . . . 68 114 5.5.4. Failover and Failback Procedures . . . . . . . . . . 68 115 5.6. Peer State Machine . . . . . . . . . . . . . . . . . . . 69 116 5.6.1. Incoming connections . . . . . . . . . . . . . . . . 71 117 5.6.2. Events . . . . . . . . . . . . . . . . . . . . . . . 72 118 5.6.3. Actions . . . . . . . . . . . . . . . . . . . . . . 73 119 5.6.4. The Election Process . . . . . . . . . . . . . . . . 75 120 5.6.5. Capabilities Update . . . . . . . . . . . . . . . . 75 121 6. Diameter message processing . . . . . . . . . . . . . . . . . 76 122 6.1. Diameter Request Routing Overview . . . . . . . . . . . . 76 123 6.1.1. Originating a Request . . . . . . . . . . . . . . . 77 124 6.1.2. Sending a Request . . . . . . . . . . . . . . . . . 78 125 6.1.3. Receiving Requests . . . . . . . . . . . . . . . . . 78 126 6.1.4. Processing Local Requests . . . . . . . . . . . . . 78 127 6.1.5. Request Forwarding . . . . . . . . . . . . . . . . . 78 128 6.1.6. Request Routing . . . . . . . . . . . . . . . . . . 79 129 6.1.7. Predictive Loop Avoidance . . . . . . . . . . . . . 79 130 6.1.8. Redirecting requests . . . . . . . . . . . . . . . . 79 131 6.1.9. Relaying and Proxying Requests . . . . . . . . . . . 81 132 6.2. Diameter Answer Processing . . . . . . . . . . . . . . . 81 133 6.2.1. Processing received Answers . . . . . . . . . . . . 82 134 6.2.2. Relaying and Proxying Answers . . . . . . . . . . . 82 135 6.3. Origin-Host AVP . . . . . . . . . . . . . . . . . . . . . 83 136 6.4. Origin-Realm AVP . . . . . . . . . . . . . . . . . . . . 83 137 6.5. Destination-Host AVP . . . . . . . . . . . . . . . . . . 83 138 6.6. Destination-Realm AVP . . . . . . . . . . . . . . . . . . 84 139 6.7. Routing AVPs . . . . . . . . . . . . . . . . . . . . . . 84 140 6.7.1. Route-Record AVP . . . . . . . . . . . . . . . . . . 84 141 6.7.2. Proxy-Info AVP . . . . . . . . . . . . . . . . . . . 84 142 6.7.3. Proxy-Host AVP . . . . . . . . . . . . . . . . . . . 84 143 6.7.4. Proxy-State AVP . . . . . . . . . . . . . . . . . . 84 144 6.8. Auth-Application-Id AVP . . . . . . . . . . . . . . . . . 85 145 6.9. Acct-Application-Id AVP . . . . . . . . . . . . . . . . . 85 146 6.10. Inband-Security-Id AVP . . . . . . . . . . . . . . . . . 85 147 6.11. Vendor-Specific-Application-Id AVP . . . . . . . . . . . 85 148 6.12. Redirect-Host AVP . . . . . . . . . . . . . . . . . . . . 86 149 6.13. Redirect-Host-Usage AVP . . . . . . . . . . . . . . . . . 86 150 6.14. Redirect-Max-Cache-Time AVP . . . . . . . . . . . . . . . 88 151 6.15. E2E-Sequence AVP . . . . . . . . . . . . . . . . . . . . 88 152 7. Error Handling . . . . . . . . . . . . . . . . . . . . . . . 89 153 7.1. Result-Code AVP . . . . . . . . . . . . . . . . . . . . . 90 154 7.1.1. Informational . . . . . . . . . . . . . . . . . . . 91 155 7.1.2. Success . . . . . . . . . . . . . . . . . . . . . . 91 156 7.1.3. Protocol Errors . . . . . . . . . . . . . . . . . . 92 157 7.1.4. Transient Failures . . . . . . . . . . . . . . . . . 93 158 7.1.5. Permanent Failures . . . . . . . . . . . . . . . . . 94 159 7.2. Error Bit . . . . . . . . . . . . . . . . . . . . . . . . 97 160 7.3. Error-Message AVP . . . . . . . . . . . . . . . . . . . . 97 161 7.4. Error-Reporting-Host AVP . . . . . . . . . . . . . . . . 97 162 7.5. Failed-AVP AVP . . . . . . . . . . . . . . . . . . . . . 98 163 7.6. Experimental-Result AVP . . . . . . . . . . . . . . . . . 99 164 7.7. Experimental-Result-Code AVP . . . . . . . . . . . . . . 99 165 8. Diameter User Sessions . . . . . . . . . . . . . . . . . . . 100 166 8.1. Authorization Session State Machine . . . . . . . . . . . 101 167 8.2. Accounting Session State Machine . . . . . . . . . . . . 106 168 8.3. Server-Initiated Re-Auth . . . . . . . . . . . . . . . . 111 169 8.3.1. Re-Auth-Request . . . . . . . . . . . . . . . . . . 111 170 8.3.2. Re-Auth-Answer . . . . . . . . . . . . . . . . . . . 112 171 8.4. Session Termination . . . . . . . . . . . . . . . . . . . 113 172 8.4.1. Session-Termination-Request . . . . . . . . . . . . 114 173 8.4.2. Session-Termination-Answer . . . . . . . . . . . . . 114 174 8.5. Aborting a Session . . . . . . . . . . . . . . . . . . . 115 175 8.5.1. Abort-Session-Request . . . . . . . . . . . . . . . 116 176 8.5.2. Abort-Session-Answer . . . . . . . . . . . . . . . . 116 177 8.6. Inferring Session Termination from Origin-State-Id . . . 117 178 8.7. Auth-Request-Type AVP . . . . . . . . . . . . . . . . . . 118 179 8.8. Session-Id AVP . . . . . . . . . . . . . . . . . . . . . 118 180 8.9. Authorization-Lifetime AVP . . . . . . . . . . . . . . . 119 181 8.10. Auth-Grace-Period AVP . . . . . . . . . . . . . . . . . . 120 182 8.11. Auth-Session-State AVP . . . . . . . . . . . . . . . . . 120 183 8.12. Re-Auth-Request-Type AVP . . . . . . . . . . . . . . . . 121 184 8.13. Session-Timeout AVP . . . . . . . . . . . . . . . . . . . 121 185 8.14. User-Name AVP . . . . . . . . . . . . . . . . . . . . . . 122 186 8.15. Termination-Cause AVP . . . . . . . . . . . . . . . . . . 122 187 8.16. Origin-State-Id AVP . . . . . . . . . . . . . . . . . . . 123 188 8.17. Session-Binding AVP . . . . . . . . . . . . . . . . . . . 123 189 8.18. Session-Server-Failover AVP . . . . . . . . . . . . . . . 124 190 8.19. Multi-Round-Time-Out AVP . . . . . . . . . . . . . . . . 125 191 8.20. Class AVP . . . . . . . . . . . . . . . . . . . . . . . . 125 192 8.21. Event-Timestamp AVP . . . . . . . . . . . . . . . . . . . 125 193 9. Accounting . . . . . . . . . . . . . . . . . . . . . . . . . 127 194 9.1. Server Directed Model . . . . . . . . . . . . . . . . . . 127 195 9.2. Protocol Messages . . . . . . . . . . . . . . . . . . . . 128 196 9.3. Accounting Application Extension and Requirements . . . . 128 197 9.4. Fault Resilience . . . . . . . . . . . . . . . . . . . . 129 198 9.5. Accounting Records . . . . . . . . . . . . . . . . . . . 130 199 9.6. Correlation of Accounting Records . . . . . . . . . . . . 130 200 9.7. Accounting Command-Codes . . . . . . . . . . . . . . . . 131 201 9.7.1. Accounting-Request . . . . . . . . . . . . . . . . . 131 202 9.7.2. Accounting-Answer . . . . . . . . . . . . . . . . . 132 203 9.8. Accounting AVPs . . . . . . . . . . . . . . . . . . . . . 133 204 9.8.1. Accounting-Record-Type AVP . . . . . . . . . . . . . 133 205 9.8.2. Acct-Interim-Interval . . . . . . . . . . . . . . . 134 206 9.8.3. Accounting-Record-Number AVP . . . . . . . . . . . . 135 207 9.8.4. Acct-Session-Id AVP . . . . . . . . . . . . . . . . 135 208 9.8.5. Acct-Multi-Session-Id AVP . . . . . . . . . . . . . 135 209 9.8.6. Accounting-Sub-Session-Id AVP . . . . . . . . . . . 135 210 9.8.7. Accounting-Realtime-Required AVP . . . . . . . . . . 136 211 10. AVP Occurrence Table . . . . . . . . . . . . . . . . . . . . 137 212 10.1. Base Protocol Command AVP Table . . . . . . . . . . . . . 137 213 10.2. Accounting AVP Table . . . . . . . . . . . . . . . . . . 138 214 11. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 140 215 11.1. AVP Header . . . . . . . . . . . . . . . . . . . . . . . 140 216 11.1.1. AVP Codes . . . . . . . . . . . . . . . . . . . . . 140 217 11.1.2. AVP Flags . . . . . . . . . . . . . . . . . . . . . 141 218 11.2. Diameter Header . . . . . . . . . . . . . . . . . . . . . 141 219 11.2.1. Command Codes . . . . . . . . . . . . . . . . . . . 141 220 11.2.2. Command Flags . . . . . . . . . . . . . . . . . . . 142 221 11.3. Application Identifiers . . . . . . . . . . . . . . . . . 142 222 11.4. AVP Values . . . . . . . . . . . . . . . . . . . . . . . 143 223 11.4.1. Result-Code AVP Values . . . . . . . . . . . . . . . 143 224 11.4.2. Accounting-Record-Type AVP Values . . . . . . . . . 143 225 11.4.3. Termination-Cause AVP Values . . . . . . . . . . . . 143 226 11.4.4. Redirect-Host-Usage AVP Values . . . . . . . . . . . 143 227 11.4.5. Session-Server-Failover AVP Values . . . . . . . . . 143 228 11.4.6. Session-Binding AVP Values . . . . . . . . . . . . . 143 229 11.4.7. Disconnect-Cause AVP Values . . . . . . . . . . . . 144 230 11.4.8. Auth-Request-Type AVP Values . . . . . . . . . . . . 144 231 11.4.9. Auth-Session-State AVP Values . . . . . . . . . . . 144 232 11.4.10. Re-Auth-Request-Type AVP Values . . . . . . . . . . 144 233 11.4.11. Accounting-Realtime-Required AVP Values . . . . . . 144 234 11.4.12. Inband-Security-Id AVP (code 299) . . . . . . . . . 144 235 11.5. Diameter TCP/SCTP Port Numbers . . . . . . . . . . . . . 144 236 11.6. NAPTR Service Fields . . . . . . . . . . . . . . . . . . 144 237 12. Diameter protocol related configurable parameters . . . . . . 146 238 13. Security Considerations . . . . . . . . . . . . . . . . . . . 147 239 13.1. TLS Usage . . . . . . . . . . . . . . . . . . . . . . . . 147 240 13.2. Peer-to-Peer Considerations . . . . . . . . . . . . . . . 148 241 14. References . . . . . . . . . . . . . . . . . . . . . . . . . 149 242 14.1. Normative References . . . . . . . . . . . . . . . . . . 149 243 14.2. Informational References . . . . . . . . . . . . . . . . 151 244 Appendix A. Acknowledgements . . . . . . . . . . . . . . . . . . 153 245 Appendix B. NAPTR Example . . . . . . . . . . . . . . . . . . . 154 246 Appendix C. Duplicate Detection . . . . . . . . . . . . . . . . 155 247 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 157 248 Intellectual Property and Copyright Statements . . . . . . . . . 158 250 1. Introduction 252 Authentication, Authorization and Accounting (AAA) protocols such as 253 TACACS [RFC1492] and RADIUS [RFC2865] were initially deployed to 254 provide dial-up PPP [RFC1661] and terminal server access. Over time, 255 with the growth of the Internet and the introduction of new access 256 technologies, including wireless, DSL, Mobile IP and Ethernet, 257 routers and network access servers (NAS) have increased in complexity 258 and density, putting new demands on AAA protocols. 260 Network access requirements for AAA protocols are summarized in 261 [RFC2989]. These include: 263 Failover 265 [RFC2865] does not define failover mechanisms, and as a result, 266 failover behavior differs between implementations. In order to 267 provide well defined failover behavior, Diameter supports 268 application-layer acknowledgements, and defines failover 269 algorithms and the associated state machine. This is described in 270 Section 5.5 and [RFC3539]. 272 Transmission-level security 274 [RFC2865] defines an application-layer authentication and 275 integrity scheme that is required only for use with Response 276 packets. While [RFC2869] defines an additional authentication and 277 integrity mechanism, use is only required during Extensible 278 Authentication Protocol (EAP) sessions. While attribute-hiding is 279 supported, [RFC2865] does not provide support for per-packet 280 confidentiality. In accounting, [RFC2866] assumes that replay 281 protection is provided by the backend billing server, rather than 282 within the protocol itself. 284 While [RFC3162] defines the use of IPsec with RADIUS, support for 285 IPsec is not required. Since within [RFC4306] authentication 286 occurs only within Phase 1 prior to the establishment of IPsec SAs 287 in Phase 2, it is typically not possible to define separate trust 288 or authorization schemes for each application. This limits the 289 usefulness of IPsec in inter-domain AAA applications (such as 290 roaming) where it may be desirable to define a distinct 291 certificate hierarchy for use in a AAA deployment. In order to 292 provide universal support for transmission-level security, and 293 enable both intra- and inter-domain AAA deployments, Diameter also 294 provides support for TLS. Security is discussed in Section 13. 296 Reliable transport 298 RADIUS runs over UDP, and does not define retransmission behavior; 299 as a result, reliability varies between implementations. As 300 described in [RFC2975], this is a major issue in accounting, where 301 packet loss may translate directly into revenue loss. In order to 302 provide well defined transport behavior, Diameter runs over 303 reliable transport mechanisms (TCP, SCTP) as defined in [RFC3539]. 305 Agent support 307 [RFC2865] does not provide for explicit support for agents, 308 including Proxies, Redirects and Relays. Since the expected 309 behavior is not defined, it varies between implementations. 310 Diameter defines agent behavior explicitly; this is described in 311 Section 2.8. 313 Server-initiated messages 315 While RADIUS server-initiated messages are defined in [RFC3576], 316 support is optional. This makes it difficult to implement 317 features such as unsolicited disconnect or reauthentication/ 318 reauthorization on demand across a heterogeneous deployment. 319 Support for server-initiated messages is mandatory in Diameter, 320 and is described in Section 8. 322 Auditability 324 RADIUS does not define data-object security mechanisms, and as a 325 result, untrusted proxies may modify attributes or even packet 326 headers without being detected. Combined with lack of support for 327 capabilities negotiation, this makes it very difficult to 328 determine what occurred in the event of a dispute. 330 Transition support 332 While Diameter does not share a common protocol data unit (PDU) 333 with RADIUS, considerable effort has been expended in enabling 334 backward compatibility with RADIUS, so that the two protocols may 335 be deployed in the same network. Initially, it is expected that 336 Diameter will be deployed within new network devices, as well as 337 within gateways enabling communication between legacy RADIUS 338 devices and Diameter agents. This capability, described in 340 [RFC4005], enables Diameter support to be added to legacy 341 networks, by addition of a gateway or server speaking both RADIUS 342 and Diameter. 344 In addition to addressing the above requirements, Diameter also 345 provides support for the following: 347 Capability negotiation 349 RADIUS does not support error messages, capability negotiation, or 350 a mandatory/non-mandatory flag for attributes. Since RADIUS 351 clients and servers are not aware of each other's capabilities, 352 they may not be able to successfully negotiate a mutually 353 acceptable service, or in some cases, even be aware of what 354 service has been implemented. Diameter includes support for error 355 handling (Section 7), capability negotiation (Section 5.3), and 356 mandatory/non-mandatory attribute-value pairs (AVPs) (Section 357 4.1). 359 Peer discovery and configuration 361 RADIUS implementations typically require that the name or address 362 of servers or clients be manually configured, along with the 363 corresponding shared secrets. This results in a large 364 administrative burden, and creates the temptation to reuse the 365 RADIUS shared secret, which can result in major security 366 vulnerabilities if the Request Authenticator is not globally and 367 temporally unique as required in [RFC2865]. Through DNS, Diameter 368 enables dynamic discovery of peers. Derivation of dynamic session 369 keys is enabled via transmission-level security. 371 Roaming support 373 The ROAMOPS WG provided a survey of roaming implementations 374 [RFC2194], detailed roaming requirements [RFC2477], defined the 375 Network Access Identifier (NAI)[RFC4282], and documented existing 376 implementations (and imitations) of RADIUS-based roaming 377 [RFC2607]. In order to improve scalability, [RFC2607] introduced 378 the concept of proxy chaining via an intermediate server, 379 facilitating roaming between providers. However, since RADIUS 380 does not provide explicit support for proxies, and lacks 381 auditability and transmission-level security features, RADIUS- 382 based roaming is vulnerable to attack from external parties as 383 well as susceptible to fraud perpetrated by the roaming partners 384 themselves. As a result, it is not suitable for wide-scale 385 deployment on the Internet [RFC2607]. By providing explicit 386 support for inter-domain roaming and message routing (Sections 2.7 387 and 6), and transmission-layer security (Section 13) features, 388 Diameter addresses these limitations and provides for secure and 389 scalable roaming. 391 In the decade since AAA protocols were first introduced, the 392 capabilities of Network Access Server (NAS) devices have increased 393 substantially. As a result, while Diameter is a considerably more 394 sophisticated protocol than RADIUS, it remains feasible to implement 395 within embedded devices, given improvements in processor speeds and 396 the widespread availability of embedded TLS implementations. 398 1.1. Diameter Protocol 400 The Diameter base protocol provides the following facilities: 402 o Delivery of AVPs (attribute value pairs) 404 o Capabilities negotiation 406 o Error notification 408 o Extensibility, through addition of new commands and AVPs (required 409 in [RFC2989]). 411 o Basic services necessary for applications, such as handling of 412 user sessions or accounting 414 All data delivered by the protocol is in the form of an AVP. Some of 415 these AVP values are used by the Diameter protocol itself, while 416 others deliver data associated with particular applications that 417 employ Diameter. AVPs may be added arbitrarily to Diameter messages, 418 so long as the requirements of a message's ABNF are met and the ABNF 419 allows for it. AVPs are used by the base Diameter protocol to 420 support the following required features: 422 o Transporting of user authentication information, for the purposes 423 of enabling the Diameter server to authenticate the user. 425 o Transporting of service specific authorization information, 426 between client and servers, allowing the peers to decide whether a 427 user's access request should be granted. 429 o Exchanging resource usage information, which MAY be used for 430 accounting purposes, capacity planning, etc. 432 o Relaying, proxying and redirecting of Diameter messages through a 433 server hierarchy. 435 The Diameter base protocol provides the minimum requirements needed 436 for a AAA protocol, as required by [RFC2989]. The base protocol may 437 be used by itself for accounting purposes only, or it may be used 438 with a Diameter application, such as Mobile IPv4 [RFC4004], or 439 network access [RFC4005]. It is also possible for the base protocol 440 to be extended for use in new applications, via the addition of new 441 commands or AVPs. At this time the focus of Diameter is network 442 access and accounting applications. A truly generic AAA protocol 443 used by many applications might provide functionality not provided by 444 Diameter. Therefore, it is imperative that the designers of new 445 applications understand their requirements before using Diameter. 446 See Section 2.4 for more information on Diameter applications. 448 Any node can initiate a request. In that sense, Diameter is a peer- 449 to-peer protocol. In this document, a Diameter Client is a device at 450 the edge of the network that performs access control, such as a 451 Network Access Server (NAS) or a Foreign Agent (FA). A Diameter 452 client generates Diameter messages to request authentication, 453 authorization, and accounting services for the user. A Diameter 454 agent is a node that does not authenticate and/or authorize messages 455 locally; agents include proxies, redirects and relay agents. A 456 Diameter server performs authentication and/or authorization of the 457 user. A Diameter node MAY act as an agent for certain requests while 458 acting as a server for others. 460 The Diameter protocol also supports server-initiated messages, such 461 as a request to abort service to a particular user. 463 1.1.1. Description of the Document Set 465 Currently, the Diameter specification consists of a base 466 specification (this document), Transport Profile [RFC3539] and 467 applications: Mobile IPv4 [RFC4004], NASREQ [RFC4005], Credit Control 468 [RFC4006], EAP [RFC4072] and SIP [RFC4740]. 470 The Transport Profile document [RFC3539] discusses transport layer 471 issues that arise with AAA protocols and recommendations on how to 472 overcome these issues. This document also defines the Diameter 473 failover algorithm and state machine. 475 The Mobile IPv4 [RFC4004] application defines a Diameter application 476 that allows a Diameter server to perform AAA functions for Mobile 477 IPv4 services to a mobile node. 479 The NASREQ [RFC4005] application defines a Diameter Application that 480 allows a Diameter server to be used in a PPP/SLIP Dial-Up and 481 Terminal Server Access environment. Consideration was given for 482 servers that need to perform protocol conversion between Diameter and 483 RADIUS. 485 The Credit Control [RFC4006] application defines a Diameter 486 Application that can be used to implement real-time credit-control 487 for a variety of end user services such as network access, SIP 488 services, messaging services, and download services. It provides a 489 general solution to real-time cost and credit-control. 491 The EAP [RFC4072] application defines a Diameter Application that can 492 be used to carry EAP packets between the Network Access Server (NAS) 493 working as an EAP authenticator and a back-end authentication server. 494 The Diameter EAP application is based on NASREQ and intended for a 495 similar environment. 497 The SIP [RFC4740] application defines a Diameter Application that 498 allows a Diameter client to request authentication and authorization 499 information to a Diameter server for SIP-based IP multimedia services 500 (see SIP [RFC3261]). 502 In summary, this document defines the base protocol specification for 503 AAA, which includes support for accounting. The applications 504 documents describe applications that use this base specification for 505 Authentication, Authorization and Accounting. 507 1.1.2. Conventions Used in This Document 509 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 510 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 511 document are to be interpreted as described in [RFC2119]. 513 1.2. Approach to Extensibility 515 The Diameter protocol is designed to be extensible, using several 516 mechanisms, including: 518 o Defining new AVP values 520 o Creating new AVPs 522 o Creating new commands 524 o Creating new authentication/authorization applications 526 o Creating new accounting applications 527 o Application authentication procedures 529 Reuse of existing AVP values, AVPs, commands and Diameter 530 applications are strongly recommended. Reuse simplifies 531 standardization and implementation and avoids potential 532 interoperability issues. 534 1.2.1. Defining New AVP Values 536 New applications should attempt to reuse AVPs defined in existing 537 applications when possible, as opposed to creating new AVPs. For 538 AVPs of type Enumerated, an application may require a new value to 539 communicate some service-specific information. 541 In order to allocate a new AVP value for a standards track AVP, a 542 request MUST be sent to IANA [RFC2434], along with an explanation of 543 the new AVP value. IANA considerations for AVP values are discussed 544 in Section 11.4. 546 1.2.2. Creating New AVPs 548 When no existing AVP can be reused, a new AVP should be created. The 549 new AVP being defined MUST use one of the data types listed in 550 Section 4.2 or 4.3. If an appropriate derived data type is already 551 defined, it MAY be used instead of the base data type. 553 In the event that a logical grouping of AVPs is necessary, and 554 multiple "groups" are possible in a given command, it is recommended 555 that a Grouped AVP be used (see Section 4.4). 557 In order to create a new standards track AVP, a request MUST be sent 558 to IANA with a reference to the specification that defines the AVP. 559 IANA considerations for AVPs are discussed in Section 11.1.1. 561 1.2.3. Creating New Commands 563 A new command should only be created when no suitable command can be 564 reused from an existing application. A new command MUST result in 565 the defintion of a new application. In order to create a new 566 command, a request MUST be sent to IANA. The IANA considerations for 567 commands are discussed in Section 11.2.1. 569 1.2.4. Creating New Authentication Applications 571 Every Diameter application specification MUST have an IANA assigned 572 Application Identifier (see Section 2.4 and Section 11.3). 574 Should a new Diameter usage scenario find itself unable to fit within 575 an existing application without requiring major changes to the 576 specification, it may be desirable to create a new Diameter 577 application. Major changes to an application include: 579 o Adding new AVPs to the command, which have the "M" bit set. 581 o Requiring a command that has a different number of round trips to 582 satisfy a request (e.g., application foo has a command that 583 requires one round trip, but new application bar has a command 584 that requires two round trips to complete). 586 o Adding support for an authentication method requiring definition 587 of new AVPs for use with the application. Since a new EAP 588 authentication method can be supported within Diameter without 589 requiring new AVPs, addition of EAP methods does not require the 590 creation of a new authentication application. 592 Creation of a new application should be viewed as a last resort. An 593 implementation MAY add arbitrary non-mandatory AVPs to any command 594 defined in an application, including vendor-specific AVPs without 595 needing to define a new application. Please refer to Section 11.1.1 596 for details. 598 In order to justify allocation of a new application identifier, 599 Diameter applications MUST define one Command Code, add new mandatory 600 AVPs to the ABNF or significantly change the state machine or 601 processing rules of an existing application. 603 The expected AVPs MUST be defined in an ABNF [RFC4234] grammar (see 604 Section 3.2). If the Diameter application has accounting 605 requirements, it MUST also specify the AVPs that are to be present in 606 the Diameter Accounting messages (see Section 9.3). However, just 607 because a new authentication application id is required, does not 608 imply that a new accounting application id is required. 610 When possible, a new Diameter application SHOULD reuse existing 611 Diameter AVPs, in order to avoid defining multiple AVPs that carry 612 similar information. 614 1.2.5. Creating New Accounting Applications 616 There are services that only require Diameter accounting. Such 617 services need to define the AVPs carried in the Accounting-Request 618 (ACR)/ Accounting-Answer (ACA) messages, but do not need to define 619 new command codes. An implementation MAY add arbitrary non-mandatory 620 AVPs (AVPs with the "M" bit not set) to any command defined in an 621 application, including vendor-specific AVPs, without needing to 622 define a new accounting application. Please refer to Section 11.1.1 623 for details. 625 Application Identifiers are still required for Diameter capability 626 exchange. Every Diameter accounting application specification MUST 627 have an IANA assigned Application Identifier (see Section 2.4) or a 628 vendor specific Application Identifier. 630 Every Diameter implementation MUST support accounting. Basic 631 accounting support is sufficient to handle any application that uses 632 the ACR/ACA commands defined in this document, as long as no new 633 mandatory AVPs are added. A mandatory AVP is defined as one which 634 has the "M" bit set when sent within an accounting command, 635 regardless of whether it is required or optional within the ABNF for 636 the accounting application. 638 The creation of a new accounting application should be viewed as a 639 last resort and MUST NOT be used unless a new command or additional 640 mechanisms (e.g., application defined state machine) is defined 641 within the application, or new mandatory AVPs are added to the ABNF. 643 Within an accounting command, setting the "M" bit implies that a 644 backend server (e.g., billing server) or the accounting server itself 645 MUST understand the AVP in order to compute a correct bill. If the 646 AVP is not relevant to the billing process, when the AVP is included 647 within an accounting command, it MUST NOT have the "M" bit set, even 648 if the "M" bit is set when the same AVP is used within other Diameter 649 commands (i.e., authentication/authorization commands). 651 A DIAMETER base accounting implementation MUST be configurable to 652 advertise supported accounting applications in order to prevent the 653 accounting server from accepting accounting requests for unbillable 654 services. The combination of the home domain and the accounting 655 application Id can be used in order to route the request to the 656 appropriate accounting server. 658 When possible, a new Diameter accounting application SHOULD attempt 659 to reuse existing AVPs, in order to avoid defining multiple AVPs that 660 carry similar information. 662 If the base accounting is used without any mandatory AVPs, new 663 commands or additional mechanisms (e.g., application defined state 664 machine), then the base protocol defined standard accounting 665 application Id (Section 2.4) MUST be used in ACR/ACA commands. 667 1.2.6. Application Authentication Procedures 669 When possible, applications SHOULD be designed such that new 670 authentication methods MAY be added without requiring changes to the 671 application. This MAY require that new AVP values be assigned to 672 represent the new authentication transform, or any other scheme that 673 produces similar results. When possible, authentication frameworks, 674 such as Extensible Authentication Protocol [RFC3748], SHOULD be used. 676 1.3. Terminology 678 AAA 680 Authentication, Authorization and Accounting. 682 Accounting 684 The act of collecting information on resource usage for the 685 purpose of capacity planning, auditing, billing or cost 686 allocation. 688 Accounting Record 690 An accounting record represents a summary of the resource 691 consumption of a user over the entire session. Accounting servers 692 creating the accounting record may do so by processing interim 693 accounting events or accounting events from several devices 694 serving the same user. 696 Authentication 698 The act of verifying the identity of an entity (subject). 700 Authorization 702 The act of determining whether a requesting entity (subject) will 703 be allowed access to a resource (object). 705 AVP 707 The Diameter protocol consists of a header followed by one or more 708 Attribute-Value-Pairs (AVPs). An AVP includes a header and is 709 used to encapsulate protocol-specific data (e.g., routing 710 information) as well as authentication, authorization or 711 accounting information. 713 Broker 715 A broker is a business term commonly used in AAA infrastructures. 716 A broker is either a relay, proxy or redirect agent, and MAY be 717 operated by roaming consortiums. Depending on the business model, 718 a broker may either choose to deploy relay agents or proxy agents. 720 Diameter Agent 722 A Diameter Agent is a Diameter node that provides either relay, 723 proxy, redirect or translation services. 725 Diameter Client 727 A Diameter Client is a device at the edge of the network that 728 performs access control. An example of a Diameter client is a 729 Network Access Server (NAS) or a Foreign Agent (FA). 731 Diameter Node 733 A Diameter node is a host process that implements the Diameter 734 protocol, and acts either as a Client, Agent or Server. 736 Diameter Peer 738 A Diameter Peer is a Diameter Node to which a given Diameter Node 739 has a direct transport connection. 741 Diameter Server 743 A Diameter Server is one that handles authentication, 744 authorization and accounting requests for a particular realm. By 745 its very nature, a Diameter Server MUST support Diameter 746 applications in addition to the base protocol. 748 Downstream 750 Downstream is used to identify the direction of a particular 751 Diameter message from the home server towards the access device. 753 Home Realm 755 A Home Realm is the administrative domain with which the user 756 maintains an account relationship. 758 Home Server 760 A Diameter Server which serves the Home Realm. 762 Interim accounting 764 An interim accounting message provides a snapshot of usage during 765 a user's session. It is typically implemented in order to provide 766 for partial accounting of a user's session in the case of a device 767 reboot or other network problem prevents the reception of a 768 session summary message or session record. 770 Local Realm 772 A local realm is the administrative domain providing services to a 773 user. An administrative domain MAY act as a local realm for 774 certain users, while being a home realm for others. 776 Multi-session 778 A multi-session represents a logical linking of several sessions. 779 Multi-sessions are tracked by using the Acct-Multi-Session-Id. An 780 example of a multi-session would be a Multi-link PPP bundle. Each 781 leg of the bundle would be a session while the entire bundle would 782 be a multi-session. 784 Network Access Identifier 786 The Network Access Identifier, or NAI [RFC4282], is used in the 787 Diameter protocol to extract a user's identity and realm. The 788 identity is used to identify the user during authentication and/or 789 authorization, while the realm is used for message routing 790 purposes. 792 Proxy Agent or Proxy 794 In addition to forwarding requests and responses, proxies make 795 policy decisions relating to resource usage and provisioning. 796 This is typically accomplished by tracking the state of NAS 797 devices. While proxies typically do not respond to client 798 Requests prior to receiving a Response from the server, they may 799 originate Reject messages in cases where policies are violated. 800 As a result, proxies need to understand the semantics of the 801 messages passing through them, and may not support all Diameter 802 applications. 804 Realm 806 The string in the NAI that immediately follows the '@' character. 807 NAI realm names are required to be unique, and are piggybacked on 808 the administration of the DNS namespace. Diameter makes use of 809 the realm, also loosely referred to as domain, to determine 810 whether messages can be satisfied locally, or whether they must be 811 routed or redirected. In RADIUS, realm names are not necessarily 812 piggybacked on the DNS namespace but may be independent of it. 814 Real-time Accounting 816 Real-time accounting involves the processing of information on 817 resource usage within a defined time window. Time constraints are 818 typically imposed in order to limit financial risk. 820 Relay Agent or Relay 822 Relays forward requests and responses based on routing-related 823 AVPs and routing table entries. Since relays do not make policy 824 decisions, they do not examine or alter non-routing AVPs. As a 825 result, relays never originate messages, do not need to understand 826 the semantics of messages or non-routing AVPs, and are capable of 827 handling any Diameter application or message type. Since relays 828 make decisions based on information in routing AVPs and realm 829 forwarding tables they do not keep state on NAS resource usage or 830 sessions in progress. 832 Redirect Agent 834 Rather than forwarding requests and responses between clients and 835 servers, redirect agents refer clients to servers and allow them 836 to communicate directly. Since redirect agents do not sit in the 837 forwarding path, they do not alter any AVPs transiting between 838 client and server. Redirect agents do not originate messages and 839 are capable of handling any message type, although they may be 840 configured only to redirect messages of certain types, while 841 acting as relay or proxy agents for other types. As with proxy 842 agents, redirect agents do not keep state with respect to sessions 843 or NAS resources. 845 Roaming Relationships 847 Roaming relationships include relationships between companies and 848 ISPs, relationships among peer ISPs within a roaming consortium, 849 and relationships between an ISP and a roaming consortium. 851 Session 853 A session is a related progression of events devoted to a 854 particular activity. Each application SHOULD provide guidelines 855 as to when a session begins and ends. All Diameter packets with 856 the same Session-Identifier are considered to be part of the same 857 session. 859 Session state 861 A stateful agent is one that maintains session state information, 862 by keeping track of all authorized active sessions. Each 863 authorized session is bound to a particular service, and its state 864 is considered active either until it is notified otherwise, or by 865 expiration. 867 Sub-session 869 A sub-session represents a distinct service (e.g., QoS or data 870 characteristics) provided to a given session. These services may 871 happen concurrently (e.g., simultaneous voice and data transfer 872 during the same session) or serially. These changes in sessions 873 are tracked with the Accounting-Sub-Session-Id. 875 Transaction state 877 The Diameter protocol requires that agents maintain transaction 878 state, which is used for failover purposes. Transaction state 879 implies that upon forwarding a request, the Hop-by-Hop identifier 880 is saved; the field is replaced with a locally unique identifier, 881 which is restored to its original value when the corresponding 882 answer is received. The request's state is released upon receipt 883 of the answer. A stateless agent is one that only maintains 884 transaction state. 886 Translation Agent 888 A translation agent is a stateful Diameter node that performs 889 protocol translation between Diameter and another AAA protocol, 890 such as RADIUS. 892 Transport Connection 894 A transport connection is a TCP or SCTP connection existing 895 directly between two Diameter peers, otherwise known as a Peer- 896 to-Peer Connection. 898 Upstream 900 Upstream is used to identify the direction of a particular 901 Diameter message from the access device towards the home server. 903 User 905 The entity requesting or using some resource, in support of which 906 a Diameter client has generated a request. 908 2. Protocol Overview 910 The base Diameter protocol may be used by itself for accounting 911 applications, but for use in authentication and authorization it is 912 always extended for a particular application. Two Diameter 913 applications are defined by companion documents: NASREQ [RFC4005], 914 Mobile IPv4 [RFC4004]. These applications are introduced in this 915 document but specified elsewhere. Additional Diameter applications 916 MAY be defined in the future (see Section 11.3). 918 Diameter Clients MUST support the base protocol, which includes 919 accounting. In addition, they MUST fully support each Diameter 920 application that is needed to implement the client's service, e.g., 921 NASREQ and/or Mobile IPv4. A Diameter Client that does not support 922 both NASREQ and Mobile IPv4, MUST be referred to as "Diameter X 923 Client" where X is the application which it supports, and not a 924 "Diameter Client". 926 Diameter Servers MUST support the base protocol, which includes 927 accounting. In addition, they MUST fully support each Diameter 928 application that is needed to implement the intended service, e.g., 929 NASREQ and/or Mobile IPv4. A Diameter Server that does not support 930 both NASREQ and Mobile IPv4, MUST be referred to as "Diameter X 931 Server" where X is the application which it supports, and not a 932 "Diameter Server". 934 Diameter Relays and redirect agents are, by definition, protocol 935 transparent, and MUST transparently support the Diameter base 936 protocol, which includes accounting, and all Diameter applications. 938 Diameter proxies MUST support the base protocol, which includes 939 accounting. In addition, they MUST fully support each Diameter 940 application that is needed to implement proxied services, e.g., 941 NASREQ and/or Mobile IPv4. A Diameter proxy which does not support 942 also both NASREQ and Mobile IPv4, MUST be referred to as "Diameter X 943 Proxy" where X is the application which it supports, and not a 944 "Diameter Proxy". 946 The base Diameter protocol concerns itself with capabilities 947 negotiation, how messages are sent and how peers may eventually be 948 abandoned. The base protocol also defines certain rules that apply 949 to all exchanges of messages between Diameter nodes. 951 Communication between Diameter peers begins with one peer sending a 952 message to another Diameter peer. The set of AVPs included in the 953 message is determined by a particular Diameter application. One AVP 954 that is included to reference a user's session is the Session-Id. 956 The initial request for authentication and/or authorization of a user 957 would include the Session-Id. The Session-Id is then used in all 958 subsequent messages to identify the user's session (see Section 8 for 959 more information). The communicating party may accept the request, 960 or reject it by returning an answer message with the Result-Code AVP 961 set to indicate an error occurred. The specific behavior of the 962 Diameter server or client receiving a request depends on the Diameter 963 application employed. 965 Session state (associated with a Session-Id) MUST be freed upon 966 receipt of the Session-Termination-Request, Session-Termination- 967 Answer, expiration of authorized service time in the Session-Timeout 968 AVP, and according to rules established in a particular Diameter 969 application. 971 2.1. Transport 973 Transport profile is defined in [RFC3539]. 975 The base Diameter protocol is run on port 3868 of both TCP [TCP] and 976 SCTP [RFC2960] transport protocols. 978 Diameter clients MUST support either TCP or SCTP, while agents and 979 servers MUST support both. Future versions of this specification MAY 980 mandate that clients support SCTP. 982 A Diameter node MAY initiate connections from a source port other 983 than the one that it declares it accepts incoming connections on, and 984 MUST be prepared to receive connections on port 3868. A given 985 Diameter instance of the peer state machine MUST NOT use more than 986 one transport connection to communicate with a given peer, unless 987 multiple instances exist on the peer in which case a separate 988 connection per process is allowed. 990 When no transport connection exists with a peer, an attempt to 991 connect SHOULD be periodically made. This behavior is handled via 992 the Tc timer, whose recommended value is 30 seconds. There are 993 certain exceptions to this rule, such as when a peer has terminated 994 the transport connection stating that it does not wish to 995 communicate. 997 When connecting to a peer and either zero or more transports are 998 specified, SCTP SHOULD be tried first, followed by TCP. See Section 999 5.2 for more information on peer discovery. 1001 Diameter implementations SHOULD be able to interpret ICMP protocol 1002 port unreachable messages as explicit indications that the server is 1003 not reachable, subject to security policy on trusting such messages. 1005 Diameter implementations SHOULD also be able to interpret a reset 1006 from the transport and timed-out connection attempts. If Diameter 1007 receives data up from TCP that cannot be parsed or identified as a 1008 Diameter error made by the peer, the stream is compromised and cannot 1009 be recovered. The transport connection MUST be closed using a RESET 1010 call (send a TCP RST bit) or an SCTP ABORT message (graceful closure 1011 is compromised). 1013 2.1.1. SCTP Guidelines 1015 The following are guidelines for Diameter implementations that 1016 support SCTP: 1018 1. For interoperability: All Diameter nodes MUST be prepared to 1019 receive Diameter messages on any SCTP stream in the association. 1021 2. To prevent blocking: All Diameter nodes SHOULD utilize all SCTP 1022 streams available to the association to prevent head-of-the-line 1023 blocking. 1025 2.2. Securing Diameter Messages 1027 Diameter clients, such as Network Access Servers (NASes) and Mobility 1028 Agents MAY support TLS [RFC4346]. Diameter servers MUST support TLS. 1029 IPSec [RFC4301] can be deployed between Diameter peers as an 1030 additional security measure independent of the Diameter protocol. 1031 The Diameter protocol SHOULD NOT be used without any security 1032 mechanism. 1034 2.3. Diameter Application Compliance 1036 Application Identifiers are advertised during the capabilities 1037 exchange phase (see Section 5.3). For a given application, 1038 advertising support of an application implies that the sender 1039 supports all command codes, and the AVPs specified in the associated 1040 ABNFs, described in the specification. 1042 An implementation MAY add arbitrary non-mandatory AVPs to any command 1043 defined in an application, including vendor-specific AVPs. Please 1044 refer to Section 11.1.1 for details. 1046 2.4. Application Identifiers 1048 Each Diameter application MUST have an IANA assigned Application 1049 Identifier (see Section 11.3). The base protocol does not require an 1050 Application Identifier since its support is mandatory. During the 1051 capabilities exchange, Diameter nodes inform their peers of locally 1052 supported applications. Furthermore, all Diameter messages contain 1053 an Application Identifier, which is used in the message forwarding 1054 process. 1056 The following Application Identifier values are defined: 1058 Diameter Common Messages 0 1059 NASREQ 1 [RFC4005] 1060 Mobile-IP 2 [RFC4004] 1061 Diameter Base Accounting 3 1062 Relay 0xffffffff 1064 Relay and redirect agents MUST advertise the Relay Application 1065 Identifier, while all other Diameter nodes MUST advertise locally 1066 supported applications. The receiver of a Capabilities Exchange 1067 message advertising Relay service MUST assume that the sender 1068 supports all current and future applications. 1070 Diameter relay and proxy agents are responsible for finding an 1071 upstream server that supports the application of a particular 1072 message. If none can be found, an error message is returned with the 1073 Result-Code AVP set to DIAMETER_UNABLE_TO_DELIVER. 1075 2.5. Connections vs. Sessions 1077 This section attempts to provide the reader with an understanding of 1078 the difference between connection and session, which are terms used 1079 extensively throughout this document. 1081 A connection is a transport level connection between two peers, used 1082 to send and receive Diameter messages. A session is a logical 1083 concept at the application layer, and is shared between an access 1084 device and a server, and is identified via the Session-Id AVP. 1086 +--------+ +-------+ +--------+ 1087 | Client | | Relay | | Server | 1088 +--------+ +-------+ +--------+ 1089 <----------> <----------> 1090 peer connection A peer connection B 1092 <-----------------------------> 1093 User session x 1095 Figure 1: Diameter connections and sessions 1097 In the example provided in Figure 1, peer connection A is established 1098 between the Client and its local Relay. Peer connection B is 1099 established between the Relay and the Server. User session X spans 1100 from the Client via the Relay to the Server. Each "user" of a 1101 service causes an auth request to be sent, with a unique session 1102 identifier. Once accepted by the server, both the client and the 1103 server are aware of the session. 1105 It is important to note that there is no relationship between a 1106 connection and a session, and that Diameter messages for multiple 1107 sessions are all multiplexed through a single connection. Also note 1108 that Diameter messages pertaining to the session, both application 1109 specific and those that are defined in this document such as ASR/ASA, 1110 RAR/RAA and STR/STA MUST carry the application identifier of the 1111 application. Diameter messages pertaining to peer connection 1112 establishment and maintenance such as CER/CEA, DWR/DWA and DPR/DPA 1113 MUST carry an application id of zero (0). 1115 2.6. Peer Table 1117 The Diameter Peer Table is used in message forwarding, and referenced 1118 by the Routing Table. A Peer Table entry contains the following 1119 fields: 1121 Host identity 1123 Following the conventions described for the DiameterIdentity 1124 derived AVP data format in Section 4.4. This field contains the 1125 contents of the Origin-Host (Section 6.3) AVP found in the CER or 1126 CEA message. 1128 StatusT 1130 This is the state of the peer entry, and MUST match one of the 1131 values listed in Section 5.6. 1133 Static or Dynamic 1135 Specifies whether a peer entry was statically configured, or 1136 dynamically discovered. 1138 Expiration time 1140 Specifies the time at which dynamically discovered peer table 1141 entries are to be either refreshed, or expired. 1143 TLS Enabled 1145 Specifies whether TLS is to be used when communicating with the 1146 peer. 1148 Additional security information, when needed (e.g., keys, 1149 certificates) 1151 2.7. Routing Table 1153 All Realm-Based routing lookups are performed against what is 1154 commonly known as the Routing Table (see Section 12). A Routing 1155 Table Entry contains the following fields: 1157 Realm Name 1159 This is the field that is typically used as a primary key in the 1160 routing table lookups. Note that some implementations perform 1161 their lookups based on longest-match-from-the-right on the realm 1162 rather than requiring an exact match. 1164 Application Identifier 1166 An application is identified by an application id. A route entry 1167 can have a different destination based on the application 1168 identification in the message header. This field MUST be used as 1169 a secondary key field in routing table lookups. 1171 Local Action 1173 The Local Action field is used to identify how a message should be 1174 treated. The following actions are supported: 1176 1. LOCAL - Diameter messages that resolve to a route entry with 1177 the Local Action set to Local can be satisfied locally, and do 1178 not need to be routed to another server. 1180 2. RELAY - All Diameter messages that fall within this category 1181 MUST be routed to a next hop server, without modifying any 1182 non-routing AVPs. See Section 6.1.9 for relaying guidelines 1184 3. PROXY - All Diameter messages that fall within this category 1185 MUST be routed to a next hop server. The local server MAY 1186 apply its local policies to the message by including new AVPs 1187 to the message prior to routing. See Section 6.1.9 for 1188 proxying guidelines. 1190 4. REDIRECT - Diameter messages that fall within this category 1191 MUST have the identity of the home Diameter server(s) 1192 appended, and returned to the sender of the message. See 1193 Section 6.1.9 for redirect guidelines. 1195 Server Identifier 1197 One or more servers the message is to be routed to. These servers 1198 MUST also be present in the Peer table. When the Local Action is 1199 set to RELAY or PROXY, this field contains the identity of the 1200 server(s) the message must be routed to. When the Local Action 1201 field is set to REDIRECT, this field contains the identity of one 1202 or more servers the message should be redirected to. 1204 Static or Dynamic 1206 Specifies whether a route entry was statically configured, or 1207 dynamically discovered. 1209 Expiration time 1211 Specifies the time which a dynamically discovered route table 1212 entry expires. 1214 It is important to note that Diameter agents MUST support at least 1215 one of the LOCAL, RELAY, PROXY or REDIRECT modes of operation. 1216 Agents do not need to support all modes of operation in order to 1217 conform with the protocol specification, but MUST follow the protocol 1218 compliance guidelines in Section 2. Relay agents MUST NOT reorder 1219 AVPs, and proxies MUST NOT reorder AVPs. 1221 The routing table MAY include a default entry that MUST be used for 1222 any requests not matching any of the other entries. The routing 1223 table MAY consist of only such an entry. 1225 When a request is routed, the target server MUST have advertised the 1226 Application Identifier (see Section 2.4) for the given message, or 1227 have advertised itself as a relay or proxy agent. Otherwise, an 1228 error is returned with the Result-Code AVP set to 1229 DIAMETER_UNABLE_TO_DELIVER. 1231 2.8. Role of Diameter Agents 1233 In addition to client and servers, the Diameter protocol introduces 1234 relay, proxy, redirect, and translation agents, each of which is 1235 defined in Section 1.3. These Diameter agents are useful for several 1236 reasons: 1238 o They can distribute administration of systems to a configurable 1239 grouping, including the maintenance of security associations. 1241 o They can be used for concentration of requests from an number of 1242 co-located or distributed NAS equipment sets to a set of like user 1243 groups. 1245 o They can do value-added processing to the requests or responses. 1247 o They can be used for load balancing. 1249 o A complex network will have multiple authentication sources, they 1250 can sort requests and forward towards the correct target. 1252 The Diameter protocol requires that agents maintain transaction 1253 state, which is used for failover purposes. Transaction state 1254 implies that upon forwarding a request, its Hop-by-Hop identifier is 1255 saved; the field is replaced with a locally unique identifier, which 1256 is restored to its original value when the corresponding answer is 1257 received. The request's state is released upon receipt of the 1258 answer. A stateless agent is one that only maintains transaction 1259 state. 1261 The Proxy-Info AVP allows stateless agents to add local state to a 1262 Diameter request, with the guarantee that the same state will be 1263 present in the answer. However, the protocol's failover procedures 1264 require that agents maintain a copy of pending requests. 1266 A stateful agent is one that maintains session state information; by 1267 keeping track of all authorized active sessions. Each authorized 1268 session is bound to a particular service, and its state is considered 1269 active either until it is notified otherwise, or by expiration. Each 1270 authorized session has an expiration, which is communicated by 1271 Diameter servers via the Session-Timeout AVP. 1273 Maintaining session state MAY be useful in certain applications, such 1274 as: 1276 o Protocol translation (e.g., RADIUS <-> Diameter) 1278 o Limiting resources authorized to a particular user 1280 o Per user or transaction auditing 1282 A Diameter agent MAY act in a stateful manner for some requests and 1283 be stateless for others. A Diameter implementation MAY act as one 1284 type of agent for some requests, and as another type of agent for 1285 others. 1287 2.8.1. Relay Agents 1289 Relay Agents are Diameter agents that accept requests and route 1290 messages to other Diameter nodes based on information found in the 1291 messages (e.g., Destination-Realm). This routing decision is 1292 performed using a list of supported realms, and known peers. This is 1293 known as the Routing Table, as is defined further in Section 2.7. 1295 Relays MAY be used to aggregate requests from multiple Network Access 1296 Servers (NASes) within a common geographical area (POP). The use of 1297 Relays is advantageous since it eliminates the need for NASes to be 1298 configured with the necessary security information they would 1299 otherwise require to communicate with Diameter servers in other 1300 realms. Likewise, this reduces the configuration load on Diameter 1301 servers that would otherwise be necessary when NASes are added, 1302 changed or deleted. 1304 Relays modify Diameter messages by inserting and removing routing 1305 information, but do not modify any other portion of a message. 1306 Relays SHOULD NOT maintain session state but MUST maintain 1307 transaction state. 1309 +------+ ---------> +------+ ---------> +------+ 1310 | | 1. Request | | 2. Request | | 1311 | NAS | | DRL | | HMS | 1312 | | 4. Answer | | 3. Answer | | 1313 +------+ <--------- +------+ <--------- +------+ 1314 example.net example.net example.com 1316 Figure 2: Relaying of Diameter messages 1318 The example provided in Figure 2 depicts a request issued from NAS, 1319 which is an access device, for the user bob@example.com. Prior to 1320 issuing the request, NAS performs a Diameter route lookup, using 1321 "example.com" as the key, and determines that the message is to be 1322 relayed to DRL, which is a Diameter Relay. DRL performs the same 1323 route lookup as NAS, and relays the message to HMS, which is 1324 example.com's Home Diameter Server. HMS identifies that the request 1325 can be locally supported (via the realm), processes the 1326 authentication and/or authorization request, and replies with an 1327 answer, which is routed back to NAS using saved transaction state. 1329 Since Relays do not perform any application level processing, they 1330 provide relaying services for all Diameter applications, and 1331 therefore MUST advertise the Relay Application Identifier. 1333 2.8.2. Proxy Agents 1335 Similarly to relays, proxy agents route Diameter messages using the 1336 Diameter Routing Table. However, they differ since they modify 1337 messages to implement policy enforcement. This requires that proxies 1338 maintain the state of their downstream peers (e.g., access devices) 1339 to enforce resource usage, provide admission control, and 1340 provisioning. 1342 Proxies MAY be used in call control centers or access ISPs that 1343 provide outsourced connections, they can monitor the number and types 1344 of ports in use, and make allocation and admission decisions 1345 according to their configuration. 1347 Proxies that wish to limit resources MUST maintain session state. 1348 All proxies MUST maintain transaction state. 1350 Since enforcing policies requires an understanding of the service 1351 being provided, Proxies MUST only advertise the Diameter applications 1352 they support. 1354 2.8.3. Redirect Agents 1356 Redirect agents are useful in scenarios where the Diameter routing 1357 configuration needs to be centralized. An example is a redirect 1358 agent that provides services to all members of a consortium, but does 1359 not wish to be burdened with relaying all messages between realms. 1360 This scenario is advantageous since it does not require that the 1361 consortium provide routing updates to its members when changes are 1362 made to a member's infrastructure. 1364 Since redirect agents do not relay messages, and only return an 1365 answer with the information necessary for Diameter agents to 1366 communicate directly, they do not modify messages. Since redirect 1367 agents do not receive answer messages, they cannot maintain session 1368 state. Further, since redirect agents never relay requests, they are 1369 not required to maintain transaction state. 1371 The example provided in Figure 3 depicts a request issued from the 1372 access device, NAS, for the user bob@example.com. The message is 1373 forwarded by the NAS to its relay, DRL, which does not have a routing 1374 entry in its Diameter Routing Table for example.com. DRL has a 1375 default route configured to DRD, which is a redirect agent that 1376 returns a redirect notification to DRL, as well as HMS' contact 1377 information. Upon receipt of the redirect notification, DRL 1378 establishes a transport connection with HMS, if one doesn't already 1379 exist, and forwards the request to it. 1381 +------+ 1382 | | 1383 | DRD | 1384 | | 1385 +------+ 1386 ^ | 1387 2. Request | | 3. Redirection 1388 | | Notification 1389 | v 1390 +------+ ---------> +------+ ---------> +------+ 1391 | | 1. Request | | 4. Request | | 1392 | NAS | | DRL | | HMS | 1393 | | 6. Answer | | 5. Answer | | 1394 +------+ <--------- +------+ <--------- +------+ 1395 example.net example.net example.com 1397 Figure 3: Redirecting a Diameter Message 1399 Since redirect agents do not perform any application level 1400 processing, they provide relaying services for all Diameter 1401 applications, and therefore MUST advertise the Relay Application 1402 Identifier. 1404 2.8.4. Translation Agents 1406 A translation agent is a device that provides translation between two 1407 protocols (e.g., RADIUS<->Diameter, TACACS+<->Diameter). Translation 1408 agents are likely to be used as aggregation servers to communicate 1409 with a Diameter infrastructure, while allowing for the embedded 1410 systems to be migrated at a slower pace. 1412 Given that the Diameter protocol introduces the concept of long-lived 1413 authorized sessions, translation agents MUST be session stateful and 1414 MUST maintain transaction state. 1416 Translation of messages can only occur if the agent recognizes the 1417 application of a particular request, and therefore translation agents 1418 MUST only advertise their locally supported applications. 1420 +------+ ---------> +------+ ---------> +------+ 1421 | | RADIUS Request | | Diameter Request | | 1422 | NAS | | TLA | | HMS | 1423 | | RADIUS Answer | | Diameter Answer | | 1424 +------+ <--------- +------+ <--------- +------+ 1425 example.net example.net example.com 1426 Figure 4: Translation of RADIUS to Diameter 1428 2.9. Diameter Path Authorization 1430 As noted in Section 2.2, Diameter provides transmission level 1431 security for each connection using TLS. Therefore, each connection 1432 can be authenticated, replay and integrity protected. 1434 In addition to authenticating each connection, each connection as 1435 well as the entire session MUST also be authorized. Before 1436 initiating a connection, a Diameter Peer MUST check that its peers 1437 are authorized to act in their roles. For example, a Diameter peer 1438 may be authentic, but that does not mean that it is authorized to act 1439 as a Diameter Server advertising a set of Diameter applications. 1441 Prior to bringing up a connection, authorization checks are performed 1442 at each connection along the path. Diameter capabilities negotiation 1443 (CER/CEA) also MUST be carried out, in order to determine what 1444 Diameter applications are supported by each peer. Diameter sessions 1445 MUST be routed only through authorized nodes that have advertised 1446 support for the Diameter application required by the session. 1448 As noted in Section 6.1.9, a relay or proxy agent MUST append a 1449 Route-Record AVP to all requests forwarded. The AVP contains the 1450 identity of the peer the request was received from. 1452 The home Diameter server, prior to authorizing a session, MUST check 1453 the Route-Record AVPs to make sure that the route traversed by the 1454 request is acceptable. For example, administrators within the home 1455 realm may not wish to honor requests that have been routed through an 1456 untrusted realm. By authorizing a request, the home Diameter server 1457 is implicitly indicating its willingness to engage in the business 1458 transaction as specified by the contractual relationship between the 1459 server and the previous hop. A DIAMETER_AUTHORIZATION_REJECTED error 1460 message (see Section 7.1.5) is sent if the route traversed by the 1461 request is unacceptable. 1463 A home realm may also wish to check that each accounting request 1464 message corresponds to a Diameter response authorizing the session. 1465 Accounting requests without corresponding authorization responses 1466 SHOULD be subjected to further scrutiny, as should accounting 1467 requests indicating a difference between the requested and provided 1468 service. 1470 Forwarding of an authorization response is considered evidence of a 1471 willingness to take on financial risk relative to the session. A 1472 local realm may wish to limit this exposure, for example, by 1473 establishing credit limits for intermediate realms and refusing to 1474 accept responses which would violate those limits. By issuing an 1475 accounting request corresponding to the authorization response, the 1476 local realm implicitly indicates its agreement to provide the service 1477 indicated in the authorization response. If the service cannot be 1478 provided by the local realm, then a DIAMETER_UNABLE_TO_COMPLY error 1479 message MUST be sent within the accounting request; a Diameter client 1480 receiving an authorization response for a service that it cannot 1481 perform MUST NOT substitute an alternate service, and then send 1482 accounting requests for the alternate service instead. 1484 3. Diameter Header 1486 A summary of the Diameter header format is shown below. The fields 1487 are transmitted in network byte order. 1489 0 1 2 3 1490 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 1491 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1492 | Version | Message Length | 1493 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1494 | command flags | Command-Code | 1495 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1496 | Application-ID | 1497 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1498 | Hop-by-Hop Identifier | 1499 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1500 | End-to-End Identifier | 1501 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1502 | AVPs ... 1503 +-+-+-+-+-+-+-+-+-+-+-+-+- 1505 Version 1507 This Version field MUST be set to 1 to indicate Diameter Version 1508 1. 1510 Message Length 1512 The Message Length field is three octets and indicates the length 1513 of the Diameter message including the header fields. 1515 Command Flags 1517 The Command Flags field is eight bits. The following bits are 1518 assigned: 1520 0 1 2 3 4 5 6 7 1521 +-+-+-+-+-+-+-+-+ 1522 |R P E T r r r r| 1523 +-+-+-+-+-+-+-+-+ 1525 R(equest) 1527 If set, the message is a request. If cleared, the message is 1528 an answer. 1530 P(roxiable) 1532 If set, the message MAY be proxied, relayed or redirected. If 1533 cleared, the message MUST be locally processed. 1535 E(rror) 1537 If set, the message contains a protocol error, and the message 1538 will not conform to the ABNF described for this command. 1539 Messages with the 'E' bit set are commonly referred to as error 1540 messages. This bit MUST NOT be set in request messages. See 1541 Section 7.2. 1543 T(Potentially re-transmitted message) 1545 This flag is set after a link failover procedure, to aid the 1546 removal of duplicate requests. It is set when resending 1547 requests not yet acknowledged, as an indication of a possible 1548 duplicate due to a link failure. This bit MUST be cleared when 1549 sending a request for the first time, otherwise the sender MUST 1550 set this flag. Diameter agents only need to be concerned about 1551 the number of requests they send based on a single received 1552 request; retransmissions by other entities need not be tracked. 1553 Diameter agents that receive a request with the T flag set, 1554 MUST keep the T flag set in the forwarded request. This flag 1555 MUST NOT be set if an error answer message (e.g., a protocol 1556 error) has been received for the earlier message. It can be 1557 set only in cases where no answer has been received from the 1558 server for a request and the request is sent again. This flag 1559 MUST NOT be set in answer messages. 1561 r(eserved) 1563 These flag bits are reserved for future use, and MUST be set to 1564 zero, and ignored by the receiver. 1566 Command-Code 1568 The Command-Code field is three octets, and is used in order to 1569 communicate the command associated with the message. The 24-bit 1570 address space is managed by IANA (see Section 11.2.1). 1572 Command-Code values 16,777,214 and 16,777,215 (hexadecimal values 1573 FFFFFE -FFFFFF) are reserved for experimental use (See Section 1574 11.3). 1576 Application-ID 1578 Application-ID is four octets and is used to identify to which 1579 application the message is applicable for. The application can be 1580 an authentication application, an accounting application or a 1581 vendor specific application. See Section 11.3 for the possible 1582 values that the application-id may use. 1584 The application-id in the header MUST be the same as what is 1585 contained in any relevant application-id AVPs contained in the 1586 message. 1588 Hop-by-Hop Identifier 1590 The Hop-by-Hop Identifier is an unsigned 32-bit integer field (in 1591 network byte order) and aids in matching requests and replies. 1592 The sender MUST ensure that the Hop-by-Hop identifier in a request 1593 is unique on a given connection at any given time, and MAY attempt 1594 to ensure that the number is unique across reboots. The sender of 1595 an Answer message MUST ensure that the Hop-by-Hop Identifier field 1596 contains the same value that was found in the corresponding 1597 request. The Hop-by-Hop identifier is normally a monotonically 1598 increasing number, whose start value was randomly generated. An 1599 answer message that is received with an unknown Hop-by-Hop 1600 Identifier MUST be discarded. 1602 End-to-End Identifier 1604 The End-to-End Identifier is an unsigned 32-bit integer field (in 1605 network byte order) and is used to detect duplicate messages. 1606 Upon reboot implementations MAY set the high order 12 bits to 1607 contain the low order 12 bits of current time, and the low order 1608 20 bits to a random value. Senders of request messages MUST 1609 insert a unique identifier on each message. The identifier MUST 1610 remain locally unique for a period of at least 4 minutes, even 1611 across reboots. The originator of an Answer message MUST ensure 1612 that the End-to-End Identifier field contains the same value that 1613 was found in the corresponding request. The End-to-End Identifier 1614 MUST NOT be modified by Diameter agents of any kind. The 1615 combination of the Origin-Host (see Section 6.3) and this field is 1616 used to detect duplicates. Duplicate requests SHOULD cause the 1617 same answer to be transmitted (modulo the hop-by-hop Identifier 1618 field and any routing AVPs that may be present), and MUST NOT 1619 affect any state that was set when the original request was 1620 processed. Duplicate answer messages that are to be locally 1621 consumed (see Section 6.2) SHOULD be silently discarded. 1623 AVPs 1625 AVPs are a method of encapsulating information relevant to the 1626 Diameter message. See Section 4 for more information on AVPs. 1628 3.1. Command Codes 1630 Each command Request/Answer pair is assigned a command code, and the 1631 sub-type (i.e., request or answer) is identified via the 'R' bit in 1632 the Command Flags field of the Diameter header. 1634 Every Diameter message MUST contain a command code in its header's 1635 Command-Code field, which is used to determine the action that is to 1636 be taken for a particular message. The following Command Codes are 1637 defined in the Diameter base protocol: 1639 Command-Name Abbrev. Code Reference 1640 -------------------------------------------------------- 1641 Abort-Session-Request ASR 274 8.5.1 1642 Abort-Session-Answer ASA 274 8.5.2 1643 Accounting-Request ACR 271 9.7.1 1644 Accounting-Answer ACA 271 9.7.2 1645 Capabilities-Exchange- CER 257 5.3.1 1646 Request 1647 Capabilities-Exchange- CEA 257 5.3.2 1648 Answer 1649 Device-Watchdog-Request DWR 280 5.5.1 1650 Device-Watchdog-Answer DWA 280 5.5.2 1651 Disconnect-Peer-Request DPR 282 5.4.1 1652 Disconnect-Peer-Answer DPA 282 5.4.2 1653 Re-Auth-Request RAR 258 8.3.1 1654 Re-Auth-Answer RAA 258 8.3.2 1655 Session-Termination- STR 275 8.4.1 1656 Request 1657 Session-Termination- STA 275 8.4.2 1658 Answer 1660 3.2. Command Code ABNF specification 1662 Every Command Code defined MUST include a corresponding ABNF 1663 specification, which is used to define the AVPs that MUST or MAY be 1664 present. The following format is used in the definition: 1666 command-def = command-name "::=" diameter-message 1668 command-name = diameter-name 1669 diameter-name = ALPHA *(ALPHA / DIGIT / "-") 1671 diameter-message = header [ *fixed] [ *required] [ *optional] 1673 header = "<" "Diameter Header:" command-id 1674 [r-bit] [p-bit] [e-bit] [application-id] ">" 1676 application-id = 1*DIGIT 1678 command-id = 1*DIGIT 1679 ; The Command Code assigned to the command 1681 r-bit = ", REQ" 1682 ; If present, the 'R' bit in the Command 1683 ; Flags is set, indicating that the message 1684 ; is a request, as opposed to an answer. 1686 p-bit = ", PXY" 1687 ; If present, the 'P' bit in the Command 1688 ; Flags is set, indicating that the message 1689 ; is proxiable. 1691 e-bit = ", ERR" 1692 ; If present, the 'E' bit in the Command 1693 ; Flags is set, indicating that the answer 1694 ; message contains a Result-Code AVP in 1695 ; the "protocol error" class. 1697 fixed = [qual] "<" avp-spec ">" 1698 ; Defines the fixed position of an AVP 1700 required = [qual] "{" avp-spec "}" 1701 ; The AVP MUST be present and can appear 1702 ; anywhere in the message. 1704 optional = [qual] "[" avp-name "]" 1705 ; The avp-name in the 'optional' rule cannot 1706 ; evaluate to any AVP Name which is included 1707 ; in a fixed or required rule. The AVP can 1708 ; appear anywhere in the message. 1710 qual = [min] "*" [max] 1711 ; See ABNF conventions, RFC 4234 Section 6.6. 1712 ; The absence of any qualifiers depends on 1713 ; whether it precedes a fixed, required, or 1714 ; optional rule. If a fixed or required rule has 1715 ; no qualifier, then exactly one such AVP MUST 1716 ; be present. If an optional rule has no 1717 ; qualifier, then 0 or 1 such AVP may be 1718 ; present. 1719 ; 1720 ; NOTE: "[" and "]" have a different meaning 1721 ; than in ABNF (see the optional rule, above). 1722 ; These braces cannot be used to express 1723 ; optional fixed rules (such as an optional 1724 ; ICV at the end). To do this, the convention 1725 ; is '0*1fixed'. 1727 min = 1*DIGIT 1728 ; The minimum number of times the element may 1729 ; be present. The default value is zero. 1731 max = 1*DIGIT 1732 ; The maximum number of times the element may 1733 ; be present. The default value is infinity. A 1734 ; value of zero implies the AVP MUST NOT be 1735 ; present. 1737 avp-spec = diameter-name 1738 ; The avp-spec has to be an AVP Name, defined 1739 ; in the base or extended Diameter 1740 ; specifications. 1742 avp-name = avp-spec / "AVP" 1743 ; The string "AVP" stands for *any* arbitrary AVP 1744 ; Name, not otherwise listed in that command code 1745 ; definition. 1747 The following is a definition of a fictitious command code: 1749 Example-Request ::= < Diameter Header: 9999999, REQ, PXY > 1750 { User-Name } 1751 * { Origin-Host } 1752 * [ AVP 1754 3.3. Diameter Command Naming Conventions 1756 Diameter command names typically includes one or more English words 1757 followed by the verb Request or Answer. Each English word is 1758 delimited by a hyphen. A three-letter acronym for both the request 1759 and answer is also normally provided. 1761 An example is a message set used to terminate a session. The command 1762 name is Session-Terminate-Request and Session-Terminate-Answer, while 1763 the acronyms are STR and STA, respectively. 1765 Both the request and the answer for a given command share the same 1766 command code. The request is identified by the R(equest) bit in the 1767 Diameter header set to one (1), to ask that a particular action be 1768 performed, such as authorizing a user or terminating a session. Once 1769 the receiver has completed the request it issues the corresponding 1770 answer, which includes a result code that communicates one of the 1771 following: 1773 o The request was successful 1775 o The request failed 1777 o An additional request must be sent to provide information the peer 1778 requires prior to returning a successful or failed answer. 1780 o The receiver could not process the request, but provides 1781 information about a Diameter peer that is able to satisfy the 1782 request, known as redirect. 1784 Additional information, encoded within AVPs, MAY also be included in 1785 answer messages. 1787 4. Diameter AVPs 1789 Diameter AVPs carry specific authentication, accounting, 1790 authorization and routing information as well as configuration 1791 details for the request and reply. 1793 Some AVPs MAY be listed more than once. The effect of such an AVP is 1794 specific, and is specified in each case by the AVP description. 1796 Each AVP of type OctetString MUST be padded to align on a 32-bit 1797 boundary, while other AVP types align naturally. A number of zero- 1798 valued bytes are added to the end of the AVP Data field till a word 1799 boundary is reached. The length of the padding is not reflected in 1800 the AVP Length field. 1802 4.1. AVP Header 1804 The fields in the AVP header MUST be sent in network byte order. The 1805 format of the header is: 1807 0 1 2 3 1808 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 1809 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1810 | AVP Code | 1811 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1812 |V M r r r r r r| AVP Length | 1813 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1814 | Vendor-ID (opt) | 1815 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1816 | Data ... 1817 +-+-+-+-+-+-+-+-+ 1819 AVP Code 1821 The AVP Code, combined with the Vendor-Id field, identifies the 1822 attribute uniquely. AVP numbers 1 through 255 are reserved for 1823 backward compatibility with RADIUS, without setting the Vendor-Id 1824 field. AVP numbers 256 and above are used for Diameter, which are 1825 allocated by IANA (see Section 11.1). 1827 AVP Flags 1829 The AVP Flags field informs the receiver how each attribute must 1830 be handled. The 'r' (reserved) bits are unused and SHOULD be set 1831 to 0. Note that subsequent Diameter applications MAY define 1832 additional bits within the AVP Header, and an unrecognized bit 1833 SHOULD be considered an error. 1835 The 'M' Bit, known as the Mandatory bit, indicates whether support 1836 of the AVP is required. If an AVP with the 'M' bit set is 1837 received by a Diameter client, server, proxy, or translation agent 1838 and either the AVP or its value is unrecognized, the message MUST 1839 be rejected. Diameter Relay and redirect agents MUST NOT reject 1840 messages with unrecognized AVPs. 1842 The 'M' bit MUST be set according to the rules defined for the AVP 1843 containing it. In order to preserve interoperability, a Diameter 1844 implementation MUST be able to exclude from a Diameter message any 1845 Mandatory AVP which is neither defined in the base Diameter 1846 protocol nor in any of the Diameter Application specifications 1847 governing the message in which it appears. It MAY do this in one 1848 of the following ways: 1850 1. If a message is rejected because it contains a Mandatory AVP 1851 which is neither defined in the base Diameter standard nor in 1852 any of the Diameter Application specifications governing the 1853 message in which it appears, the implementation may resend the 1854 message without the AVP, possibly inserting additional 1855 standard AVPs instead. 1857 2. A configuration option may be provided on a system wide, per 1858 peer, or per realm basis that would allow/prevent particular 1859 Mandatory AVPs to be sent. Thus an administrator could change 1860 the configuration to avoid interoperability problems. 1862 Diameter implementations are required to support all Mandatory 1863 AVPs which are allowed by the message's formal syntax and defined 1864 either in the base Diameter standard or in one of the Diameter 1865 Application specifications governing the message. 1867 AVPs with the 'M' bit cleared are informational only and a 1868 receiver that receives a message with such an AVP that is not 1869 supported, or whose value is not supported, MAY simply ignore the 1870 AVP. 1872 The 'V' bit, known as the Vendor-Specific bit, indicates whether 1873 the optional Vendor-ID field is present in the AVP header. When 1874 set the AVP Code belongs to the specific vendor code address 1875 space. 1877 Unless otherwise noted, AVPs will have the following default AVP 1878 Flags field settings: 1880 The 'M' bit MUST be set. The 'V' bit MUST NOT be set. 1882 AVP Length 1884 The AVP Length field is three octets, and indicates the number of 1885 octets in this AVP including the AVP Code, AVP Length, AVP Flags, 1886 Vendor-ID field (if present) and the AVP data. If a message is 1887 received with an invalid attribute length, the message SHOULD be 1888 rejected. 1890 4.1.1. Optional Header Elements 1892 The AVP Header contains one optional field. This field is only 1893 present if the respective bit-flag is enabled. 1895 Vendor-ID 1897 The Vendor-ID field is present if the 'V' bit is set in the AVP 1898 Flags field. The optional four-octet Vendor-ID field contains the 1899 IANA assigned "SMI Network Management Private Enterprise Codes" 1900 [RFC3232] value, encoded in network byte order. Any vendor 1901 wishing to implement a vendor-specific Diameter AVP MUST use their 1902 own Vendor-ID along with their privately managed AVP address 1903 space, guaranteeing that they will not collide with any other 1904 vendor's vendor-specific AVP(s), nor with future IETF 1905 applications. 1907 A vendor ID value of zero (0) corresponds to the IETF adopted AVP 1908 values, as managed by the IANA. Since the absence of the vendor 1909 ID field implies that the AVP in question is not vendor specific, 1910 implementations MUST NOT use the zero (0) vendor ID. 1912 4.2. Basic AVP Data Formats 1914 The Data field is zero or more octets and contains information 1915 specific to the Attribute. The format and length of the Data field 1916 is determined by the AVP Code and AVP Length fields. The format of 1917 the Data field MUST be one of the following base data types or a data 1918 type derived from the base data types. In the event that a new Basic 1919 AVP Data Format is needed, a new version of this RFC must be created. 1921 OctetString 1923 The data contains arbitrary data of variable length. Unless 1924 otherwise noted, the AVP Length field MUST be set to at least 8 1925 (12 if the 'V' bit is enabled). AVP Values of this type that are 1926 not a multiple of four-octets in length is followed by the 1927 necessary padding so that the next AVP (if any) will start on a 1928 32-bit boundary. 1930 Integer32 1932 32 bit signed value, in network byte order. The AVP Length field 1933 MUST be set to 12 (16 if the 'V' bit is enabled). 1935 Integer64 1937 64 bit signed value, in network byte order. The AVP Length field 1938 MUST be set to 16 (20 if the 'V' bit is enabled). 1940 Unsigned32 1942 32 bit unsigned value, in network byte order. The AVP Length 1943 field MUST be set to 12 (16 if the 'V' bit is enabled). 1945 Unsigned64 1947 64 bit unsigned value, in network byte order. The AVP Length 1948 field MUST be set to 16 (20 if the 'V' bit is enabled). 1950 Float32 1952 This represents floating point values of single precision as 1953 described by [FLOATPOINT]. The 32-bit value is transmitted in 1954 network byte order. The AVP Length field MUST be set to 12 (16 if 1955 the 'V' bit is enabled). 1957 Float64 1959 This represents floating point values of double precision as 1960 described by [FLOATPOINT]. The 64-bit value is transmitted in 1961 network byte order. The AVP Length field MUST be set to 16 (20 if 1962 the 'V' bit is enabled). 1964 Grouped 1966 The Data field is specified as a sequence of AVPs. Each of these 1967 AVPs follows - in the order in which they are specified - 1968 including their headers and padding. The AVP Length field is set 1969 to 8 (12 if the 'V' bit is enabled) plus the total length of all 1970 included AVPs, including their headers and padding. Thus the AVP 1971 length field of an AVP of type Grouped is always a multiple of 4. 1973 4.3. Derived AVP Data Formats 1975 In addition to using the Basic AVP Data Formats, applications may 1976 define data formats derived from the Basic AVP Data Formats. An 1977 application that defines new AVP Derived Data Formats MUST include 1978 them in a section entitled "AVP Derived Data Formats", using the same 1979 format as the definitions below. Each new definition must be either 1980 defined or listed with a reference to the RFC that defines the 1981 format. 1983 The below AVP Derived Data Formats are commonly used by applications. 1985 Address 1987 The Address format is derived from the OctetString AVP Base 1988 Format. It is a discriminated union, representing, for example a 1989 32-bit (IPv4) [IPV4] or 128-bit (IPv6) [RFC4291] address, most 1990 significant octet first. The first two octets of the Address AVP 1991 represents the AddressType, which contains an Address Family 1992 defined in [IANAADFAM]. The AddressType is used to discriminate 1993 the content and format of the remaining octets. 1995 Time 1997 The Time format is derived from the OctetString AVP Base Format. 1998 The string MUST contain four octets, in the same format as the 1999 first four bytes are in the NTP timestamp format. The NTP 2000 Timestamp format is defined in chapter 3 of [RFC4330]. 2002 This represents the number of seconds since 0h on 1 January 1900 2003 with respect to the Coordinated Universal Time (UTC). 2005 On 6h 28m 16s UTC, 7 February 2036 the time value will overflow. 2006 SNTP [RFC4330] describes a procedure to extend the time to 2104. 2007 This procedure MUST be supported by all DIAMETER nodes. 2009 UTF8String 2011 The UTF8String format is derived from the OctetString AVP Base 2012 Format. This is a human readable string represented using the 2013 ISO/IEC IS 10646-1 character set, encoded as an OctetString using 2014 the UTF-8 [RFC3629] transformation format described in RFC 3629. 2016 Since additional code points are added by amendments to the 10646 2017 standard from time to time, implementations MUST be prepared to 2018 encounter any code point from 0x00000001 to 0x7fffffff. Byte 2019 sequences that do not correspond to the valid encoding of a code 2020 point into UTF-8 charset or are outside this range are prohibited. 2022 The use of control codes SHOULD be avoided. When it is necessary 2023 to represent a new line, the control code sequence CR LF SHOULD be 2024 used. 2026 The use of leading or trailing white space SHOULD be avoided. 2028 For code points not directly supported by user interface hardware 2029 or software, an alternative means of entry and display, such as 2030 hexadecimal, MAY be provided. 2032 For information encoded in 7-bit US-ASCII, the UTF-8 charset is 2033 identical to the US-ASCII charset. 2035 UTF-8 may require multiple bytes to represent a single character / 2036 code point; thus the length of an UTF8String in octets may be 2037 different from the number of characters encoded. 2039 Note that the AVP Length field of an UTF8String is measured in 2040 octets, not characters. 2042 DiameterIdentity 2044 The DiameterIdentity format is derived from the OctetString AVP 2045 Base Format. 2047 DiameterIdentity = FQDN 2049 DiameterIdentity value is used to uniquely identify a Diameter 2050 node for purposes of duplicate connection and routing loop 2051 detection. 2053 The contents of the string MUST be the FQDN of the Diameter node. 2054 If multiple Diameter nodes run on the same host, each Diameter 2055 node MUST be assigned a unique DiameterIdentity. If a Diameter 2056 node can be identified by several FQDNs, a single FQDN should be 2057 picked at startup, and used as the only DiameterIdentity for that 2058 node, whatever the connection it is sent on. 2060 DiameterURI 2062 The DiameterURI MUST follow the Uniform Resource Identifiers (URI) 2063 syntax [RFC3986] rules specified below: 2065 "aaa://" FQDN [ port ] [ transport ] [ protocol ] 2067 ; No transport security 2069 "aaas://" FQDN [ port ] [ transport ] [ protocol ] 2071 ; Transport security used 2073 FQDN = Fully Qualified Host Name 2075 port = ":" 1*DIGIT 2077 ; One of the ports used to listen for 2078 ; incoming connections. 2079 ; If absent, 2080 ; the default Diameter port (3868) is 2081 ; assumed. 2083 transport = ";transport=" transport-protocol 2085 ; One of the transports used to listen 2086 ; for incoming connections. If absent, 2087 ; the default SCTP [RFC2960] protocol is 2088 ; assumed. UDP MUST NOT be used when 2089 ; the aaa-protocol field is set to 2090 ; diameter. 2092 transport-protocol = ( "tcp" / "sctp" / "udp" ) 2094 protocol = ";protocol=" aaa-protocol 2096 ; If absent, the default AAA protocol 2097 ; is diameter. 2099 aaa-protocol = ( "diameter" / "radius" / "tacacs+" ) 2101 The following are examples of valid Diameter host identities: 2103 aaa://host.example.com;transport=tcp 2104 aaa://host.example.com:6666;transport=tcp 2105 aaa://host.example.com;protocol=diameter 2106 aaa://host.example.com:6666;protocol=diameter 2107 aaa://host.example.com:6666;transport=tcp;protocol=diameter 2108 aaa://host.example.com:1813;transport=udp;protocol=radius 2110 Enumerated 2112 Enumerated is derived from the Integer32 AVP Base Format. The 2113 definition contains a list of valid values and their 2114 interpretation and is described in the Diameter application 2115 introducing the AVP. 2117 IPFilterRule 2119 The IPFilterRule format is derived from the OctetString AVP Base 2120 Format. It uses the ASCII charset. Packets may be filtered based 2121 on the following information that is associated with it: 2123 Direction (in or out) 2124 Source and destination IP address (possibly masked) 2125 Protocol 2126 Source and destination port (lists or ranges) 2127 TCP flags 2128 IP fragment flag 2129 IP options 2130 ICMP types 2132 Rules for the appropriate direction are evaluated in order, with 2133 the first matched rule terminating the evaluation. Each packet is 2134 evaluated once. If no rule matches, the packet is dropped if the 2135 last rule evaluated was a permit, and passed if the last rule was 2136 a deny. 2138 IPFilterRule filters MUST follow the format: 2140 action dir proto from src to dst [options] 2142 action permit - Allow packets that match the rule. 2143 deny - Drop packets that match the rule. 2145 dir "in" is from the terminal, "out" is to the 2146 terminal. 2148 proto An IP protocol specified by number. The "ip" 2149 keyword means any protocol will match. 2151 src and dst
[ports] 2153 The
may be specified as: 2154 ipno An IPv4 or IPv6 number in dotted- 2155 quad or canonical IPv6 form. Only 2156 this exact IP number will match the 2157 rule. 2158 ipno/bits An IP number as above with a mask 2159 width of the form 1.2.3.4/24. In 2160 this case, all IP numbers from 2161 1.2.3.0 to 1.2.3.255 will match. 2162 The bit width MUST be valid for the 2163 IP version and the IP number MUST 2164 NOT have bits set beyond the mask. 2165 For a match to occur, the same IP 2166 version must be present in the 2167 packet that was used in describing 2168 the IP address. To test for a 2169 particular IP version, the bits part 2170 can be set to zero. The keyword 2171 "any" is 0.0.0.0/0 or the IPv6 2172 equivalent. The keyword "assigned" 2173 is the address or set of addresses 2174 assigned to the terminal. For IPv4, 2175 a typical first rule is often "deny 2176 in ip! assigned" 2178 The sense of the match can be inverted by 2179 preceding an address with the not modifier (!), 2180 causing all other addresses to be matched 2181 instead. This does not affect the selection of 2182 port numbers. 2184 With the TCP, UDP and SCTP protocols, optional 2185 ports may be specified as: 2187 {port/port-port}[,ports[,...]] 2189 The '-' notation specifies a range of ports 2190 (including boundaries). 2192 Fragmented packets that have a non-zero offset 2193 (i.e., not the first fragment) will never match 2194 a rule that has one or more port 2195 specifications. See the frag option for 2196 details on matching fragmented packets. 2198 options: 2199 frag Match if the packet is a fragment and this is not 2200 the first fragment of the datagram. frag may not 2201 be used in conjunction with either tcpflags or 2202 TCP/UDP port specifications. 2204 ipoptions spec 2205 Match if the IP header contains the comma 2206 separated list of options specified in spec. The 2207 supported IP options are: 2209 ssrr (strict source route), lsrr (loose source 2210 route), rr (record packet route) and ts 2211 (timestamp). The absence of a particular option 2212 may be denoted with a '!'. 2214 tcpoptions spec 2215 Match if the TCP header contains the comma 2216 separated list of options specified in spec. The 2217 supported TCP options are: 2219 mss (maximum segment size), window (tcp window 2220 advertisement), sack (selective ack), ts (rfc1323 2221 timestamp) and cc (rfc1644 t/tcp connection 2222 count). The absence of a particular option may 2223 be denoted with a '!'. 2225 established 2226 TCP packets only. Match packets that have the RST 2227 or ACK bits set. 2229 setup TCP packets only. Match packets that have the SYN 2230 bit set but no ACK bit. 2232 tcpflags spec 2233 TCP packets only. Match if the TCP header 2234 contains the comma separated list of flags 2235 specified in spec. The supported TCP flags are: 2237 fin, syn, rst, psh, ack and urg. The absence of a 2238 particular flag may be denoted with a '!'. A rule 2239 that contains a tcpflags specification can never 2240 match a fragmented packet that has a non-zero 2241 offset. See the frag option for details on 2242 matching fragmented packets. 2244 icmptypes types 2245 ICMP packets only. Match if the ICMP type is in 2246 the list types. The list may be specified as any 2247 combination of ranges or individual types 2248 separated by commas. Both the numeric values and 2249 the symbolic values listed below can be used. The 2250 supported ICMP types are: 2252 echo reply (0), destination unreachable (3), 2253 source quench (4), redirect (5), echo request 2254 (8), router advertisement (9), router 2255 solicitation (10), time-to-live exceeded (11), IP 2256 header bad (12), timestamp request (13), 2257 timestamp reply (14), information request (15), 2258 information reply (16), address mask request (17) 2259 and address mask reply (18). 2261 There is one kind of packet that the access device MUST always 2262 discard, that is an IP fragment with a fragment offset of one. 2263 This is a valid packet, but it only has one use, to try to 2264 circumvent firewalls. 2266 An access device that is unable to interpret or apply a deny rule 2267 MUST terminate the session. An access device that is unable to 2268 interpret or apply a permit rule MAY apply a more restrictive 2269 rule. An access device MAY apply deny rules of its own before the 2270 supplied rules, for example to protect the access device owner's 2271 infrastructure. 2273 The rule syntax is a modified subset of ipfw(8) from FreeBSD, and 2274 the ipfw.c code may provide a useful base for implementations. 2276 4.4. Grouped AVP Values 2278 The Diameter protocol allows AVP values of type 'Grouped.' This 2279 implies that the Data field is actually a sequence of AVPs. It is 2280 possible to include an AVP with a Grouped type within a Grouped type, 2281 that is, to nest them. AVPs within an AVP of type Grouped have the 2282 same padding requirements as non-Grouped AVPs, as defined in Section 2283 4. 2285 The AVP Code numbering space of all AVPs included in a Grouped AVP is 2286 the same as for non-grouped AVPs. Further, if any of the AVPs 2287 encapsulated within a Grouped AVP has the 'M' (mandatory) bit set, 2288 the Grouped AVP itself MUST also include the 'M' bit set. 2290 Every Grouped AVP defined MUST include a corresponding grammar, using 2291 ABNF [RFC4234] (with modifications), as defined below. 2293 grouped-avp-def = name "::=" avp 2295 name-fmt = ALPHA *(ALPHA / DIGIT / "-") 2297 name = name-fmt 2298 ; The name has to be the name of an AVP, 2299 ; defined in the base or extended Diameter 2300 ; specifications. 2302 avp = header [ *fixed] [ *required] [ *optional] 2303 [ *fixed] 2305 header = "<" "AVP-Header:" avpcode [vendor] ">" 2307 avpcode = 1*DIGIT 2308 ; The AVP Code assigned to the Grouped AVP 2310 vendor = 1*DIGIT 2311 ; The Vendor-ID assigned to the Grouped AVP. 2312 ; If absent, the default value of zero is 2313 ; used. 2315 4.4.1. Example AVP with a Grouped Data type 2317 The Example-AVP (AVP Code 999999) is of type Grouped and is used to 2318 clarify how Grouped AVP values work. The Grouped Data field has the 2319 following ABNF grammar: 2321 Example-AVP ::= < AVP Header: 999999 > 2322 { Origin-Host } 2323 1*{ Session-Id } 2324 *[ AVP ] 2326 An Example-AVP with Grouped Data follows. 2328 The Origin-Host AVP is required (Section 6.3). In this case: 2330 Origin-Host = "example.com". 2332 One or more Session-Ids must follow. Here there are two: 2334 Session-Id = 2335 "grump.example.com:33041;23432;893;0AF3B81" 2337 Session-Id = 2338 "grump.example.com:33054;23561;2358;0AF3B82" 2340 optional AVPs included are 2342 Recovery-Policy = 2343 2163bc1d0ad82371f6bc09484133c3f09ad74a0dd5346d54195a7cf0b35 2344 2cabc881839a4fdcfbc1769e2677a4c1fb499284c5f70b48f58503a45c5 2345 c2d6943f82d5930f2b7c1da640f476f0e9c9572a50db8ea6e51e1c2c7bd 2346 f8bb43dc995144b8dbe297ac739493946803e1cee3e15d9b765008a1b2a 2347 cf4ac777c80041d72c01e691cf751dbf86e85f509f3988e5875dc905119 2348 26841f00f0e29a6d1ddc1a842289d440268681e052b30fb638045f7779c 2349 1d873c784f054f688f5001559ecff64865ef975f3e60d2fd7966b8c7f92 2351 Futuristic-Acct-Record = 2352 fe19da5802acd98b07a5b86cb4d5d03f0314ab9ef1ad0b67111ff3b90a0 2353 57fe29620bf3585fd2dd9fcc38ce62f6cc208c6163c008f4258d1bc88b8 2354 17694a74ccad3ec69269461b14b2e7a4c111fb239e33714da207983f58c 2355 41d018d56fe938f3cbf089aac12a912a2f0d1923a9390e5f789cb2e5067 2356 d3427475e49968f841 2358 The data for the optional AVPs is represented in hex since the format 2359 of these AVPs is neither known at the time of definition of the 2360 Example-AVP group, nor (likely) at the time when the example instance 2361 of this AVP is interpreted - except by Diameter implementations which 2362 support the same set of AVPs. The encoding example illustrates how 2363 padding is used and how length fields are calculated. Also note that 2364 AVPs may be present in the Grouped AVP value which the receiver 2365 cannot interpret (here, the Recover-Policy and Futuristic-Acct-Record 2366 AVPs). The length of the Example-AVP is the sum of all the length of 2367 the member AVPs including their padding plus the Example-AVP header 2368 size. 2370 This AVP would be encoded as follows: 2372 0 1 2 3 4 5 6 7 2373 +-------+-------+-------+-------+-------+-------+-------+-------+ 2374 0 | Example AVP Header (AVP Code = 999999), Length = 496 | 2375 +-------+-------+-------+-------+-------+-------+-------+-------+ 2376 8 | Origin-Host AVP Header (AVP Code = 264), Length = 19 | 2377 +-------+-------+-------+-------+-------+-------+-------+-------+ 2378 16 | 'e' | 'x' | 'a' | 'm' | 'p' | 'l' | 'e' | '.' | 2379 +-------+-------+-------+-------+-------+-------+-------+-------+ 2380 24 | 'c' | 'o' | 'm' |Padding| Session-Id AVP Header | 2381 +-------+-------+-------+-------+-------+-------+-------+-------+ 2382 32 | (AVP Code = 263), Length = 49 | 'g' | 'r' | 'u' | 'm' | 2383 +-------+-------+-------+-------+-------+-------+-------+-------+ 2384 . . . 2385 +-------+-------+-------+-------+-------+-------+-------+-------+ 2386 72 | 'F' | '3' | 'B' | '8' | '1' |Padding|Padding|Padding| 2387 +-------+-------+-------+-------+-------+-------+-------+-------+ 2388 80 | Session-Id AVP Header (AVP Code = 263), Length = 50 | 2389 +-------+-------+-------+-------+-------+-------+-------+-------+ 2390 88 | 'g' | 'r' | 'u' | 'm' | 'p' | '.' | 'e' | 'x' | 2391 +-------+-------+-------+-------+-------+-------+-------+-------+ 2392 . . . 2393 +-------+-------+-------+-------+-------+-------+-------+-------+ 2394 120| '5' | '8' | ';' | '0' | 'A' | 'F' | '3' | 'B' | 2395 +-------+-------+-------+-------+-------+-------+-------+-------+ 2396 128| '8' | '2' |Padding|Padding| Recovery-Policy Header (AVP | 2397 +-------+-------+-------+-------+-------+-------+-------+-------+ 2398 136| Code = 8341), Length = 223 | 0x21 | 0x63 | 0xbc | 0x1d | 2399 +-------+-------+-------+-------+-------+-------+-------+-------+ 2400 144| 0x0a | 0xd8 | 0x23 | 0x71 | 0xf6 | 0xbc | 0x09 | 0x48 | 2401 +-------+-------+-------+-------+-------+-------+-------+-------+ 2402 . . . 2403 +-------+-------+-------+-------+-------+-------+-------+-------+ 2404 352| 0x8c | 0x7f | 0x92 |Padding| Futuristic-Acct-Record Header | 2405 +-------+-------+-------+-------+-------+-------+-------+-------+ 2406 328|(AVP Code = 15930),Length = 137| 0xfe | 0x19 | 0xda | 0x58 | 2407 +-------+-------+-------+-------+-------+-------+-------+-------+ 2408 336| 0x02 | 0xac | 0xd9 | 0x8b | 0x07 | 0xa5 | 0xb8 | 0xc6 | 2409 +-------+-------+-------+-------+-------+-------+-------+-------+ 2410 . . . 2411 +-------+-------+-------+-------+-------+-------+-------+-------+ 2412 488| 0xe4 | 0x99 | 0x68 | 0xf8 | 0x41 |Padding|Padding|Padding| 2413 +-------+-------+-------+-------+-------+-------+-------+-------+ 2415 4.5. Diameter Base Protocol AVPs 2417 The following table describes the Diameter AVPs defined in the base 2418 protocol, their AVP Code values, types, possible flag values. 2420 Due to space constraints, the short form DiamIdent is used to 2421 represent DiameterIdentity. 2423 +---------------------+ 2424 | AVP Flag rules | 2425 |----+-----+----+-----| 2426 AVP Section | | |SHLD| MUST| 2427 Attribute Name Code Defined Data Type |MUST| MAY | NOT| NOT| 2428 -----------------------------------------|----+-----+----+-----| 2429 Acct- 85 9.8.2 Unsigned32 | M | | | V | 2430 Interim-Interval | | | | | 2431 Accounting- 483 9.8.7 Enumerated | M | | | V | 2432 Realtime-Required | | | | | 2433 Acct- 50 9.8.5 UTF8String | M | | | V | 2434 Multi-Session-Id | | | | | 2435 Accounting- 485 9.8.3 Unsigned32 | M | | | V | 2436 Record-Number | | | | | 2437 Accounting- 480 9.8.1 Enumerated | M | | | V | 2438 Record-Type | | | | | 2439 Accounting- 44 9.8.4 OctetString| M | | | V | 2440 Session-Id | | | | | 2441 Accounting- 287 9.8.6 Unsigned64 | M | | | V | 2442 Sub-Session-Id | | | | | 2443 Acct- 259 6.9 Unsigned32 | M | | | V | 2444 Application-Id | | | | | 2445 Auth- 258 6.8 Unsigned32 | M | | | V | 2446 Application-Id | | | | | 2447 Auth-Request- 274 8.7 Enumerated | M | | | V | 2448 Type | | | | | 2449 Authorization- 291 8.9 Unsigned32 | M | | | V | 2450 Lifetime | | | | | 2451 Auth-Grace- 276 8.10 Unsigned32 | M | | | V | 2452 Period | | | | | 2453 Auth-Session- 277 8.11 Enumerated | M | | | V | 2454 State | | | | | 2455 Re-Auth-Request- 285 8.12 Enumerated | M | | | V | 2456 Type | | | | | 2457 Class 25 8.20 OctetString| M | | | V | 2458 Destination-Host 293 6.5 DiamIdent | M | | | V | 2459 Destination- 283 6.6 DiamIdent | M | | | V | 2460 Realm | | | | | 2461 Disconnect-Cause 273 5.4.3 Enumerated | M | | | V | 2462 E2E-Sequence AVP 300 6.15 Grouped | M | | | V | 2463 Error-Message 281 7.3 UTF8String | | | | V,M | 2464 Error-Reporting- 294 7.4 DiamIdent | | | | V,M | 2465 Host | | | | | 2466 Event-Timestamp 55 8.21 Time | M | | | V | 2467 Experimental- 297 7.6 Grouped | M | | | V | 2468 Result | | | | | 2469 -----------------------------------------|----+-----+----+-----| 2470 +---------------------+ 2471 | AVP Flag rules | 2472 |----+-----+----+-----| 2473 AVP Section | | |SHLD| MUST| 2474 Attribute Name Code Defined Data Type |MUST| MAY | NOT| NOT| 2475 -----------------------------------------|----+-----+----+-----| 2476 Experimental- 298 7.7 Unsigned32 | M | | | V | 2477 Result-Code | | | | | 2478 Failed-AVP 279 7.5 Grouped | M | | | V | 2479 Firmware- 267 5.3.4 Unsigned32 | | | | V,M | 2480 Revision | | | | | 2481 Host-IP-Address 257 5.3.5 Address | M | | | V | 2482 Inband-Security | M | | | V | 2483 -Id 299 6.10 Unsigned32 | | | | | 2484 Multi-Round- 272 8.19 Unsigned32 | M | | | V | 2485 Time-Out | | | | | 2486 Origin-Host 264 6.3 DiamIdent | M | | | V | 2487 Origin-Realm 296 6.4 DiamIdent | M | | | V | 2488 Origin-State-Id 278 8.16 Unsigned32 | M | | | V | 2489 Product-Name 269 5.3.7 UTF8String | | | | V,M | 2490 Proxy-Host 280 6.7.3 DiamIdent | M | | | V | 2491 Proxy-Info 284 6.7.2 Grouped | M | | | V | 2492 Proxy-State 33 6.7.4 OctetString| M | | | V | 2493 Redirect-Host 292 6.12 DiamURI | M | | | V | 2494 Redirect-Host- 261 6.13 Enumerated | M | | | V | 2495 Usage | | | | | 2496 Redirect-Max- 262 6.14 Unsigned32 | M | | | V | 2497 Cache-Time | | | | | 2498 Result-Code 268 7.1 Unsigned32 | M | | | V | 2499 Route-Record 282 6.7.1 DiamIdent | M | | | V | 2500 Session-Id 263 8.8 UTF8String | M | | | V | 2501 Session-Timeout 27 8.13 Unsigned32 | M | | | V | 2502 Session-Binding 270 8.17 Unsigned32 | M | | | V | 2503 Session-Server- 271 8.18 Enumerated | M | | | V | 2504 Failover | | | | | 2505 Supported- 265 5.3.6 Unsigned32 | M | | | V | 2506 Vendor-Id | | | | | 2507 Termination- 295 8.15 Enumerated | M | | | V | 2508 Cause | | | | | 2509 User-Name 1 8.14 UTF8String | M | | | V | 2510 Vendor-Id 266 5.3.3 Unsigned32 | M | | | V | 2511 Vendor-Specific- 260 6.11 Grouped | M | | | V | 2512 Application-Id | | | | | 2513 -----------------------------------------|----+-----+----+-----| 2515 5. Diameter Peers 2517 This section describes how Diameter nodes establish connections and 2518 communicate with peers. 2520 5.1. Peer Connections 2522 Although a Diameter node may have many possible peers that it is able 2523 to communicate with, it may not be economical to have an established 2524 connection to all of them. At a minimum, a Diameter node SHOULD have 2525 an established connection with two peers per realm, known as the 2526 primary and secondary peers. Of course, a node MAY have additional 2527 connections, if it is deemed necessary. Typically, all messages for 2528 a realm are sent to the primary peer, but in the event that failover 2529 procedures are invoked, any pending requests are sent to the 2530 secondary peer. However, implementations are free to load balance 2531 requests between a set of peers. 2533 Note that a given peer MAY act as a primary for a given realm, while 2534 acting as a secondary for another realm. 2536 When a peer is deemed suspect, which could occur for various reasons, 2537 including not receiving a DWA within an allotted timeframe, no new 2538 requests should be forwarded to the peer, but failover procedures are 2539 invoked. When an active peer is moved to this mode, additional 2540 connections SHOULD be established to ensure that the necessary number 2541 of active connections exists. 2543 There are two ways that a peer is removed from the suspect peer list: 2545 1. The peer is no longer reachable, causing the transport connection 2546 to be shutdown. The peer is moved to the closed state. 2548 2. Three watchdog messages are exchanged with accepted round trip 2549 times, and the connection to the peer is considered stabilized. 2551 In the event the peer being removed is either the primary or 2552 secondary, an alternate peer SHOULD replace the deleted peer, and 2553 assume the role of either primary or secondary. 2555 5.2. Diameter Peer Discovery 2557 Allowing for dynamic Diameter agent discovery will make it possible 2558 for simpler and more robust deployment of Diameter services. In 2559 order to promote interoperable implementations of Diameter peer 2560 discovery, the following mechanisms are described. These are based 2561 on existing IETF standards. The first option (manual configuration) 2562 MUST be supported by all DIAMETER nodes, while the latter option 2563 (DNS) MAY be supported. 2565 There are two cases where Diameter peer discovery may be performed. 2566 The first is when a Diameter client needs to discover a first-hop 2567 Diameter agent. The second case is when a Diameter agent needs to 2568 discover another agent - for further handling of a Diameter 2569 operation. In both cases, the following 'search order' is 2570 recommended: 2572 1. The Diameter implementation consults its list of static 2573 (manually) configured Diameter agent locations. These will be 2574 used if they exist and respond. 2576 2. The Diameter implementation performs a NAPTR query for a server 2577 in a particular realm. The Diameter implementation has to know 2578 in advance which realm to look for a Diameter agent in. This 2579 could be deduced, for example, from the 'realm' in a NAI that a 2580 Diameter implementation needed to perform a Diameter operation 2581 on. 2583 * The services relevant for the task of transport protocol 2584 selection are those with NAPTR service fields with values 2585 "AAA+D2x", where x is a letter that corresponds to a transport 2586 protocol supported by the domain. This specification defines 2587 D2T for TCP and D2S for SCTP. We also establish an IANA 2588 registry for NAPTR service name to transport protocol 2589 mappings. 2591 These NAPTR records provide a mapping from a domain, to the 2592 SRV record for contacting a server with the specific transport 2593 protocol in the NAPTR services field. The resource record 2594 will contain an empty regular expression and a replacement 2595 value, which is the SRV record for that particular transport 2596 protocol. If the server supports multiple transport 2597 protocols, there will be multiple NAPTR records, each with a 2598 different service value. As per [RFC3403], the client 2599 discards any records whose services fields are not applicable. 2600 For the purposes of this specification, several rules are 2601 defined. 2603 * A client MUST discard any service fields that identify a 2604 resolution service whose value is not "D2X", for values of X 2605 that indicate transport protocols supported by the client. 2606 The NAPTR processing as described in [RFC3403] will result in 2607 discovery of the most preferred transport protocol of the 2608 server that is supported by the client, as well as an SRV 2609 record for the server. 2611 The domain suffixes in the NAPTR replacement field SHOULD 2612 match the domain of the original query. 2614 3. If no NAPTR records are found, the requester queries for those 2615 address records for the destination address, 2616 '_diameter._sctp'.realm or '_diameter._tcp'.realm. Address 2617 records include A RR's, AAAA RR's or other similar records, 2618 chosen according to the requestor's network protocol 2619 capabilities. If the DNS server returns no address records, the 2620 requestor gives up. 2622 If the server is using a site certificate, the domain name in the 2623 query and the domain name in the replacement field MUST both be 2624 valid based on the site certificate handed out by the server in 2625 the TLS or IKE exchange. Similarly, the domain name in the SRV 2626 query and the domain name in the target in the SRV record MUST 2627 both be valid based on the same site certificate. Otherwise, an 2628 attacker could modify the DNS records to contain replacement 2629 values in a different domain, and the client could not validate 2630 that this was the desired behavior, or the result of an attack 2632 Also, the Diameter Peer MUST check to make sure that the 2633 discovered peers are authorized to act in its role. 2634 Authentication via IKE or TLS, or validation of DNS RRs via 2635 DNSSEC is not sufficient to conclude this. For example, a web 2636 server may have obtained a valid TLS certificate, and secured RRs 2637 may be included in the DNS, but this does not imply that it is 2638 authorized to act as a Diameter Server. 2640 Authorization can be achieved for example, by configuration of a 2641 Diameter Server CA. Alternatively this can be achieved by 2642 definition of OIDs within TLS or IKE certificates so as to 2643 signify Diameter Server authorization. 2645 A dynamically discovered peer causes an entry in the Peer Table (see 2646 Section 2.6) to be created. Note that entries created via DNS MUST 2647 expire (or be refreshed) within the DNS TTL. If a peer is discovered 2648 outside of the local realm, a routing table entry (see Section 2.7) 2649 for the peer's realm is created. The routing table entry's 2650 expiration MUST match the peer's expiration value. 2652 5.3. Capabilities Exchange 2654 When two Diameter peers establish a transport connection, they MUST 2655 exchange the Capabilities Exchange messages, as specified in the peer 2656 state machine (see Section 5.6). This message allows the discovery 2657 of a peer's identity and its capabilities (protocol version number, 2658 supported Diameter applications, security mechanisms, etc.) 2660 The receiver only issues commands to its peers that have advertised 2661 support for the Diameter application that defines the command. A 2662 Diameter node MUST cache the supported applications in order to 2663 ensure that unrecognized commands and/or AVPs are not unnecessarily 2664 sent to a peer. 2666 A receiver of a Capabilities-Exchange-Req (CER) message that does not 2667 have any applications in common with the sender MUST return a 2668 Capabilities-Exchange-Answer (CEA) with the Result-Code AVP set to 2669 DIAMETER_NO_COMMON_APPLICATION, and SHOULD disconnect the transport 2670 layer connection. Note that receiving a CER or CEA from a peer 2671 advertising itself as a Relay (see Section 2.4) MUST be interpreted 2672 as having common applications with the peer. 2674 The receiver of the Capabilities-Exchange-Request (CER) MUST 2675 determine common applications by computing the intersection of its 2676 own set of supported application identifiers against all of the 2677 application indentifier AVPs (Auth-Application-Id, 2678 Acct-Application-Id and Vendor-Specific-Application-Id) present in 2679 the CER. The value of the Vendor-Id AVP in the Vendor-Specific- 2680 Application-Id MUST not be used during computation. The sender of 2681 the Capabilities-Exchange-Answer (CEA) SHOULD include all of its 2682 supported applications as a hint to the receiver regarding all of its 2683 application capabilities. 2685 Similarly, a receiver of a Capabilities-Exchange-Req (CER) message 2686 that does not have any security mechanisms in common with the sender 2687 MUST return a Capabilities-Exchange-Answer (CEA) with the Result-Code 2688 AVP set to DIAMETER_NO_COMMON_SECURITY, and SHOULD disconnect the 2689 transport layer connection. 2691 CERs received from unknown peers MAY be silently discarded, or a CEA 2692 MAY be issued with the Result-Code AVP set to DIAMETER_UNKNOWN_PEER. 2693 In both cases, the transport connection is closed. If the local 2694 policy permits receiving CERs from unknown hosts, a successful CEA 2695 MAY be returned. If a CER from an unknown peer is answered with a 2696 successful CEA, the lifetime of the peer entry is equal to the 2697 lifetime of the transport connection. In case of a transport 2698 failure, all the pending transactions destined to the unknown peer 2699 can be discarded. 2701 The CER and CEA messages MUST NOT be proxied, redirected or relayed. 2703 Since the CER/CEA messages cannot be proxied, it is still possible 2704 that an upstream agent receives a message for which it has no 2705 available peers to handle the application that corresponds to the 2706 Command-Code. In such instances, the 'E' bit is set in the answer 2707 message (see Section 7.) with the Result-Code AVP set to 2708 DIAMETER_UNABLE_TO_DELIVER to inform the downstream to take action 2709 (e.g., re-routing request to an alternate peer). 2711 With the exception of the Capabilities-Exchange-Request message, a 2712 message of type Request that includes the Auth-Application-Id or 2713 Acct-Application-Id AVPs, or a message with an application-specific 2714 command code, MAY only be forwarded to a host that has explicitly 2715 advertised support for the application (or has advertised the Relay 2716 Application Identifier). 2718 5.3.1. Capabilities-Exchange-Request 2720 The Capabilities-Exchange-Request (CER), indicated by the Command- 2721 Code set to 257 and the Command Flags' 'R' bit set, is sent to 2722 exchange local capabilities. Upon detection of a transport failure, 2723 this message MUST NOT be sent to an alternate peer. 2725 When Diameter is run over SCTP [RFC2960], which allows for 2726 connections to span multiple interfaces and multiple IP addresses, 2727 the Capabilities-Exchange-Request message MUST contain one Host-IP- 2728 Address AVP for each potential IP address that MAY be locally used 2729 when transmitting Diameter messages. 2731 Message Format 2733 ::= < Diameter Header: 257, REQ > 2734 { Origin-Host } 2735 { Origin-Realm } 2736 1* { Host-IP-Address } 2737 { Vendor-Id } 2738 { Product-Name } 2739 [ Origin-State-Id ] 2740 * [ Supported-Vendor-Id ] 2741 * [ Auth-Application-Id ] 2742 * [ Inband-Security-Id ] 2743 * [ Acct-Application-Id ] 2744 * [ Vendor-Specific-Application-Id ] 2745 [ Firmware-Revision ] 2746 * [ AVP ] 2748 5.3.2. Capabilities-Exchange-Answer 2750 The Capabilities-Exchange-Answer (CEA), indicated by the Command-Code 2751 set to 257 and the Command Flags' 'R' bit cleared, is sent in 2752 response to a CER message. 2754 When Diameter is run over SCTP [RFC2960], which allows connections to 2755 span multiple interfaces, hence, multiple IP addresses, the 2756 Capabilities-Exchange-Answer message MUST contain one Host-IP-Address 2757 AVP for each potential IP address that MAY be locally used when 2758 transmitting Diameter messages. 2760 Message Format 2762 ::= < Diameter Header: 257 > 2763 { Result-Code } 2764 { Origin-Host } 2765 { Origin-Realm } 2766 1* { Host-IP-Address } 2767 { Vendor-Id } 2768 { Product-Name } 2769 [ Origin-State-Id ] 2770 [ Error-Message ] 2771 [ Failed-AVP ] 2772 * [ Supported-Vendor-Id ] 2773 * [ Auth-Application-Id ] 2774 * [ Inband-Security-Id ] 2775 * [ Acct-Application-Id ] 2776 * [ Vendor-Specific-Application-Id ] 2777 [ Firmware-Revision ] 2778 * [ AVP ] 2780 5.3.3. Vendor-Id AVP 2782 The Vendor-Id AVP (AVP Code 266) is of type Unsigned32 and contains 2783 the IANA "SMI Network Management Private Enterprise Codes" [RFC3232] 2784 value assigned to the vendor of the Diameter device. It is 2785 envisioned that the combination of the Vendor-Id, Product-Name 2786 (Section 5.3.7) and the Firmware-Revision (Section 5.3.4) AVPs may 2787 provide useful debugging information. 2789 A Vendor-Id value of zero in the CER or CEA messages is reserved and 2790 indicates that this field is ignored. 2792 5.3.4. Firmware-Revision AVP 2794 The Firmware-Revision AVP (AVP Code 267) is of type Unsigned32 and is 2795 used to inform a Diameter peer of the firmware revision of the 2796 issuing device. 2798 For devices that do not have a firmware revision (general purpose 2799 computers running Diameter software modules, for instance), the 2800 revision of the Diameter software module may be reported instead. 2802 5.3.5. Host-IP-Address AVP 2804 The Host-IP-Address AVP (AVP Code 257) is of type Address and is used 2805 to inform a Diameter peer of the sender's IP address. All source 2806 addresses that a Diameter node expects to use with SCTP [RFC2960] 2807 MUST be advertised in the CER and CEA messages by including a 2808 Host-IP- Address AVP for each address. This AVP MUST ONLY be used in 2809 the CER and CEA messages. 2811 5.3.6. Supported-Vendor-Id AVP 2813 The Supported-Vendor-Id AVP (AVP Code 265) is of type Unsigned32 and 2814 contains the IANA "SMI Network Management Private Enterprise Codes" 2815 [RFC3232] value assigned to a vendor other than the device vendor but 2816 including the application vendor. This is used in the CER and CEA 2817 messages in order to inform the peer that the sender supports (a 2818 subset of) the vendor-specific AVPs defined by the vendor identified 2819 in this AVP. The value of this AVP SHOULD NOT be set to zero. 2820 Multiple instances of this AVP containing the same value SHOULD NOT 2821 be sent. 2823 5.3.7. Product-Name AVP 2825 The Product-Name AVP (AVP Code 269) is of type UTF8String, and 2826 contains the vendor assigned name for the product. The Product-Name 2827 AVP SHOULD remain constant across firmware revisions for the same 2828 product. 2830 5.4. Disconnecting Peer connections 2832 When a Diameter node disconnects one of its transport connections, 2833 its peer cannot know the reason for the disconnect, and will most 2834 likely assume that a connectivity problem occurred, or that the peer 2835 has rebooted. In these cases, the peer may periodically attempt to 2836 reconnect, as stated in Section 2.1. In the event that the 2837 disconnect was a result of either a shortage of internal resources, 2838 or simply that the node in question has no intentions of forwarding 2839 any Diameter messages to the peer in the foreseeable future, a 2840 periodic connection request would not be welcomed. The 2841 Disconnection-Reason AVP contains the reason the Diameter node issued 2842 the Disconnect-Peer-Request message. 2844 The Disconnect-Peer-Request message is used by a Diameter node to 2845 inform its peer of its intent to disconnect the transport layer, and 2846 that the peer shouldn't reconnect unless it has a valid reason to do 2847 so (e.g., message to be forwarded). Upon receipt of the message, the 2848 Disconnect-Peer-Answer is returned, which SHOULD contain an error if 2849 messages have recently been forwarded, and are likely in flight, 2850 which would otherwise cause a race condition. 2852 The receiver of the Disconnect-Peer-Answer initiates the transport 2853 disconnect. The sender of the Disconnect-Peer-Answer should be able 2854 to detect the transport closure and cleanup the connection. 2856 5.4.1. Disconnect-Peer-Request 2858 The Disconnect-Peer-Request (DPR), indicated by the Command-Code set 2859 to 282 and the Command Flags' 'R' bit set, is sent to a peer to 2860 inform its intentions to shutdown the transport connection. Upon 2861 detection of a transport failure, this message MUST NOT be sent to an 2862 alternate peer. 2864 Message Format 2866 ::= < Diameter Header: 282, REQ > 2867 { Origin-Host } 2868 { Origin-Realm } 2869 { Disconnect-Cause } 2871 5.4.2. Disconnect-Peer-Answer 2873 The Disconnect-Peer-Answer (DPA), indicated by the Command-Code set 2874 to 282 and the Command Flags' 'R' bit cleared, is sent as a response 2875 to the Disconnect-Peer-Request message. Upon receipt of this 2876 message, the transport connection is shutdown. 2878 Message Format 2880 ::= < Diameter Header: 282 > 2881 { Result-Code } 2882 { Origin-Host } 2883 { Origin-Realm } 2884 [ Error-Message ] 2885 [ Failed-AVP ] 2887 5.4.3. Disconnect-Cause AVP 2889 The Disconnect-Cause AVP (AVP Code 273) is of type Enumerated. A 2890 Diameter node MUST include this AVP in the Disconnect-Peer-Request 2891 message to inform the peer of the reason for its intention to 2892 shutdown the transport connection. The following values are 2893 supported: 2895 REBOOTING 0 2896 A scheduled reboot is imminent. Receiver of DPR with above result 2897 code MAY attempt reconnection. 2899 BUSY 1 2900 The peer's internal resources are constrained, and it has 2901 determined that the transport connection needs to be closed. 2902 Receiver of DPR with above result code SHOULD NOT attempt 2903 reconnection. 2905 DO_NOT_WANT_TO_TALK_TO_YOU 2 2906 The peer has determined that it does not see a need for the 2907 transport connection to exist, since it does not expect any 2908 messages to be exchanged in the near future. Receiver of DPR 2909 with above result code SHOULD NOT attempt reconnection. 2911 5.5. Transport Failure Detection 2913 Given the nature of the Diameter protocol, it is recommended that 2914 transport failures be detected as soon as possible. Detecting such 2915 failures will minimize the occurrence of messages sent to unavailable 2916 agents, resulting in unnecessary delays, and will provide better 2917 failover performance. The Device-Watchdog-Request and Device- 2918 Watchdog-Answer messages, defined in this section, are used to pro- 2919 actively detect transport failures. 2921 5.5.1. Device-Watchdog-Request 2923 The Device-Watchdog-Request (DWR), indicated by the Command-Code set 2924 to 280 and the Command Flags' 'R' bit set, is sent to a peer when no 2925 traffic has been exchanged between two peers (see Section 5.5.3). 2926 Upon detection of a transport failure, this message MUST NOT be sent 2927 to an alternate peer. 2929 Message Format 2931 ::= < Diameter Header: 280, REQ > 2932 { Origin-Host } 2933 { Origin-Realm } 2934 [ Origin-State-Id ] 2936 5.5.2. Device-Watchdog-Answer 2938 The Device-Watchdog-Answer (DWA), indicated by the Command-Code set 2939 to 280 and the Command Flags' 'R' bit cleared, is sent as a response 2940 to the Device-Watchdog-Request message. 2942 Message Format 2944 ::= < Diameter Header: 280 > 2945 { Result-Code } 2946 { Origin-Host } 2947 { Origin-Realm } 2948 [ Error-Message ] 2949 [ Failed-AVP ] 2950 [ Origin-State-Id ] 2952 5.5.3. Transport Failure Algorithm 2954 The transport failure algorithm is defined in [RFC3539]. All 2955 Diameter implementations MUST support the algorithm defined in the 2956 specification in order to be compliant to the Diameter base protocol. 2958 5.5.4. Failover and Failback Procedures 2960 In the event that a transport failure is detected with a peer, it is 2961 necessary for all pending request messages to be forwarded to an 2962 alternate agent, if possible. This is commonly referred to as 2963 failover. 2965 In order for a Diameter node to perform failover procedures, it is 2966 necessary for the node to maintain a pending message queue for a 2967 given peer. When an answer message is received, the corresponding 2968 request is removed from the queue. The Hop-by-Hop Identifier field 2969 is used to match the answer with the queued request. 2971 When a transport failure is detected, if possible all messages in the 2972 queue are sent to an alternate agent with the T flag set. On booting 2973 a Diameter client or agent, the T flag is also set on any records 2974 still remaining to be transmitted in non-volatile storage. An 2975 example of a case where it is not possible to forward the message to 2976 an alternate server is when the message has a fixed destination, and 2977 the unavailable peer is the message's final destination (see 2978 Destination-Host AVP). Such an error requires that the agent return 2979 an answer message with the 'E' bit set and the Result-Code AVP set to 2980 DIAMETER_UNABLE_TO_DELIVER. 2982 It is important to note that multiple identical requests or answers 2983 MAY be received as a result of a failover. The End-to-End Identifier 2984 field in the Diameter header along with the Origin-Host AVP MUST be 2985 used to identify duplicate messages. 2987 As described in Section 2.1, a connection request should be 2988 periodically attempted with the failed peer in order to re-establish 2989 the transport connection. Once a connection has been successfully 2990 established, messages can once again be forwarded to the peer. This 2991 is commonly referred to as failback. 2993 5.6. Peer State Machine 2995 This section contains a finite state machine that MUST be observed by 2996 all Diameter implementations. Each Diameter node MUST follow the 2997 state machine described below when communicating with each peer. 2998 Multiple actions are separated by commas, and may continue on 2999 succeeding lines, as space requires. Similarly, state and next state 3000 may also span multiple lines, as space requires. 3002 This state machine is closely coupled with the state machine 3003 described in [RFC3539], which is used to open, close, failover, 3004 probe, and reopen transport connections. Note in particular that 3005 [RFC3539] requires the use of watchdog messages to probe connections. 3006 For Diameter, DWR and DWA messages are to be used. 3008 I- is used to represent the initiator (connecting) connection, while 3009 the R- is used to represent the responder (listening) connection. 3010 The lack of a prefix indicates that the event or action is the same 3011 regardless of the connection on which the event occurred. 3013 The stable states that a state machine may be in are Closed, I-Open 3014 and R-Open; all other states are intermediate. Note that I-Open and 3015 R-Open are equivalent except for whether the initiator or responder 3016 transport connection is used for communication. 3018 A CER message is always sent on the initiating connection immediately 3019 after the connection request is successfully completed. In the case 3020 of an election, one of the two connections will shut down. The 3021 responder connection will survive if the Origin-Host of the local 3022 Diameter entity is higher than that of the peer; the initiator 3023 connection will survive if the peer's Origin-Host is higher. All 3024 subsequent messages are sent on the surviving connection. Note that 3025 the results of an election on one peer are guaranteed to be the 3026 inverse of the results on the other. 3028 For TLS usage, a TLS handshake will begin when both ends are in the 3029 open state. If the TLS handshake is successful, all further messages 3030 will be sent via TLS. If the handshake fails, both ends move to the 3031 closed state. 3033 The state machine constrains only the behavior of a Diameter 3034 implementation as seen by Diameter peers through events on the wire. 3036 Any implementation that produces equivalent results is considered 3037 compliant. 3039 state event action next state 3040 ----------------------------------------------------------------- 3041 Closed Start I-Snd-Conn-Req Wait-Conn-Ack 3042 R-Conn-CER R-Accept, R-Open 3043 Process-CER, 3044 R-Snd-CEA 3046 Wait-Conn-Ack I-Rcv-Conn-Ack I-Snd-CER Wait-I-CEA 3047 I-Rcv-Conn-Nack Cleanup Closed 3048 R-Conn-CER R-Accept, Wait-Conn-Ack/ 3049 Process-CER Elect 3050 Timeout Error Closed 3052 Wait-I-CEA I-Rcv-CEA Process-CEA I-Open 3053 R-Conn-CER R-Accept, Wait-Returns 3054 Process-CER, 3055 Elect 3056 I-Peer-Disc I-Disc Closed 3057 I-Rcv-Non-CEA Error Closed 3058 Timeout Error Closed 3060 Wait-Conn-Ack/ I-Rcv-Conn-Ack I-Snd-CER,Elect Wait-Returns 3061 Elect I-Rcv-Conn-Nack R-Snd-CEA R-Open 3062 R-Peer-Disc R-Disc Wait-Conn-Ack 3063 R-Conn-CER R-Reject Wait-Conn-Ack/ 3064 Elect 3065 Timeout Error Closed 3067 Wait-Returns Win-Election I-Disc,R-Snd-CEA R-Open 3068 I-Peer-Disc I-Disc, R-Open 3069 R-Snd-CEA 3070 I-Rcv-CEA R-Disc I-Open 3071 R-Peer-Disc R-Disc Wait-I-CEA 3072 R-Conn-CER R-Reject Wait-Returns 3073 Timeout Error Closed 3075 R-Open Send-Message R-Snd-Message R-Open 3076 R-Rcv-Message Process R-Open 3077 R-Rcv-DWR Process-DWR, R-Open 3078 R-Snd-DWA 3079 R-Rcv-DWA Process-DWA R-Open 3080 R-Conn-CER R-Reject R-Open 3081 Stop R-Snd-DPR Closing 3082 R-Rcv-DPR R-Snd-DPA, Closed 3083 R-Disc 3085 R-Peer-Disc R-Disc Closed 3086 R-Rcv-CER R-Snd-CEA R-Open 3087 R-Rcv-CEA Process-CEA R-Open 3089 I-Open Send-Message I-Snd-Message I-Open 3090 I-Rcv-Message Process I-Open 3091 I-Rcv-DWR Process-DWR, I-Open 3092 I-Snd-DWA 3093 I-Rcv-DWA Process-DWA I-Open 3094 R-Conn-CER R-Reject I-Open 3095 Stop I-Snd-DPR Closing 3096 I-Rcv-DPR I-Snd-DPA, Closed 3097 I-Disc 3098 I-Peer-Disc I-Disc Closed 3099 I-Rcv-CER I-Snd-CEA I-Open 3100 I-Rcv-CEA Process-CEA I-Open 3102 Closing I-Rcv-DPA I-Disc Closed 3103 R-Rcv-DPA R-Disc Closed 3104 Timeout Error Closed 3105 I-Peer-Disc I-Disc Closed 3106 R-Peer-Disc R-Disc Closed 3108 5.6.1. Incoming connections 3110 When a connection request is received from a Diameter peer, it is 3111 not, in the general case, possible to know the identity of that peer 3112 until a CER is received from it. This is because host and port 3113 determine the identity of a Diameter peer; and the source port of an 3114 incoming connection is arbitrary. Upon receipt of CER, the identity 3115 of the connecting peer can be uniquely determined from Origin-Host. 3117 For this reason, a Diameter peer must employ logic separate from the 3118 state machine to receive connection requests, accept them, and await 3119 CER. Once CER arrives on a new connection, the Origin-Host that 3120 identifies the peer is used to locate the state machine associated 3121 with that peer, and the new connection and CER are passed to the 3122 state machine as an R-Conn-CER event. 3124 The logic that handles incoming connections SHOULD close and discard 3125 the connection if any message other than CER arrives, or if an 3126 implementation-defined timeout occurs prior to receipt of CER. 3128 Because handling of incoming connections up to and including receipt 3129 of CER requires logic, separate from that of any individual state 3130 machine associated with a particular peer, it is described separately 3131 in this section rather than in the state machine above. 3133 5.6.2. Events 3135 Transitions and actions in the automaton are caused by events. In 3136 this section, we will ignore the -I and -R prefix, since the actual 3137 event would be identical, but would occur on one of two possible 3138 connections. 3140 Start The Diameter application has signaled that a 3141 connection should be initiated with the peer. 3143 R-Conn-CER An acknowledgement is received stating that the 3144 transport connection has been established, and the 3145 associated CER has arrived. 3147 Rcv-Conn-Ack A positive acknowledgement is received confirming that 3148 the transport connection is established. 3150 Rcv-Conn-Nack A negative acknowledgement was received stating that 3151 the transport connection was not established. 3153 Timeout An application-defined timer has expired while waiting 3154 for some event. 3156 Rcv-CER A CER message from the peer was received. 3158 Rcv-CEA A CEA message from the peer was received. 3160 Rcv-Non-CEA A message other than CEA from the peer was received. 3162 Peer-Disc A disconnection indication from the peer was received. 3164 Rcv-DPR A DPR message from the peer was received. 3166 Rcv-DPA A DPA message from the peer was received. 3168 Win-Election An election was held, and the local node was the 3169 winner. 3171 Send-Message A message is to be sent. 3173 Rcv-Message A message other than CER, CEA, DPR, DPA, DWR or DWA 3174 was received. 3176 Stop The Diameter application has signaled that a 3177 connection should be terminated (e.g., on system 3178 shutdown). 3180 5.6.3. Actions 3182 Actions in the automaton are caused by events and typically indicate 3183 the transmission of packets and/or an action to be taken on the 3184 connection. In this section we will ignore the I- and R-prefix, 3185 since the actual action would be identical, but would occur on one of 3186 two possible connections. 3188 Snd-Conn-Req A transport connection is initiated with the peer. 3190 Accept The incoming connection associated with the R-Conn-CER 3191 is accepted as the responder connection. 3193 Reject The incoming connection associated with the R-Conn-CER 3194 is disconnected. 3196 Process-CER The CER associated with the R-Conn-CER is processed. 3197 Snd-CER A CER message is sent to the peer. 3199 Snd-CEA A CEA message is sent to the peer. 3201 Cleanup If necessary, the connection is shutdown, and any 3202 local resources are freed. 3204 Error The transport layer connection is disconnected, either 3205 politely or abortively, in response to an error 3206 condition. Local resources are freed. 3208 Process-CEA A received CEA is processed. 3210 Snd-DPR A DPR message is sent to the peer. 3212 Snd-DPA A DPA message is sent to the peer. 3214 Disc The transport layer connection is disconnected, and 3215 local resources are freed. 3217 Elect An election occurs (see Section 5.6.4 for more 3218 information). 3220 Snd-Message A message is sent. 3222 Snd-DWR A DWR message is sent. 3224 Snd-DWA A DWA message is sent. 3226 Process-DWR The DWR message is serviced. 3228 Process-DWA The DWA message is serviced. 3230 Process A message is serviced. 3232 5.6.4. The Election Process 3234 The election is performed on the responder. The responder compares 3235 the Origin-Host received in the CER with its own Origin-Host as two 3236 streams of octets. If the local Origin-Host lexicographically 3237 succeeds the received Origin-Host a Win-Election event is issued 3238 locally. 3240 To be consistent with DNS case insensitivity, octets that fall in the 3241 ASCII range 'a' through 'z' MUST compare equally to their upper-case 3242 counterparts between 'A' and 'Z', i.e. value 0x41 compares equal to 3243 0x61, 0x42 to 0x62 and so forth up to and including 0x5a and 0x7a. 3245 The winner of the election MUST close the connection it initiated. 3246 Historically, maintaining the responder side of a connection was more 3247 efficient than maintaining the initiator side. However, current 3248 practices makes this distinction irrelevant. 3250 5.6.5. Capabilities Update 3252 A Diameter node MUST initiate peer capabilities update by sending a 3253 Capabilities-Exchange-Req (CER) to all its peers which supports peer 3254 capabilities update and is in OPEN state. The receiver of CER in 3255 open state MUST process and reply to the CER as a described in 3256 Section 5.3. The CEA which the receiver sends MUST contain its 3257 latest capabilities. Note that peers which successfully process the 3258 peer capabilities update SHOULD also update their routing tables to 3259 reflect the change. The receiver of the CEA, with a Result-Code AVP 3260 other than DIAMETER_SUCCESS, initiates the transport disconnect. The 3261 peer may periodically attempt to reconnect, as stated in Section 2.1. 3263 Peer capabilities update in the open state SHOULD be limited to the 3264 advertisement of the new list of supported applications and MUST 3265 preclude re-negotiation of security mechanism or other capabilities. 3266 If any capabilities change happens in the node (e.g. change in 3267 security mechanisms), other than a change in the supported 3268 applications, the node SHOULD gracefully terminate (setting the 3269 Disconnect-Cause AVP value to REBOOTING) and re-establish the 3270 diameter connections to all the peers. 3272 6. Diameter message processing 3274 This section describes how Diameter requests and answers are created 3275 and processed. 3277 6.1. Diameter Request Routing Overview 3279 A request is sent towards its final destination using a combination 3280 of the Destination-Realm and Destination-Host AVPs, in one of these 3281 three combinations: 3283 o a request that is not able to be proxied (such as CER) MUST NOT 3284 contain either Destination-Realm or Destination-Host AVPs. 3286 o a request that needs to be sent to a home server serving a 3287 specific realm, but not to a specific server (such as the first 3288 request of a series of round-trips), MUST contain a Destination- 3289 Realm AVP, but MUST NOT contain a Destination-Host AVP. 3291 o otherwise, a request that needs to be sent to a specific home 3292 server among those serving a given realm, MUST contain both the 3293 Destination-Realm and Destination-Host AVPs. 3295 The Destination-Host AVP is used as described above when the 3296 destination of the request is fixed, which includes: 3298 o Authentication requests that span multiple round trips 3300 o A Diameter message that uses a security mechanism that makes use 3301 of a pre-established session key shared between the source and the 3302 final destination of the message. 3304 o Server initiated messages that MUST be received by a specific 3305 Diameter client (e.g., access device), such as the Abort-Session- 3306 Request message, which is used to request that a particular user's 3307 session be terminated. 3309 Note that an agent can forward a request to a host described in the 3310 Destination-Host AVP only if the host in question is included in its 3311 peer table (see Section 2.7). Otherwise, the request is routed based 3312 on the Destination-Realm only (see Sections 6.1.6). 3314 The Destination-Realm AVP MUST be present if the message is 3315 proxiable. Request messages that may be forwarded by Diameter agents 3316 (proxies, redirects or relays) MUST also contain an Acct- 3317 Application-Id AVP, an Auth-Application-Id AVP or a Vendor-Specific- 3318 Application-Id AVP. A message that MUST NOT be forwarded by Diameter 3319 agents (proxies, redirects or relays) MUST not include the 3320 Destination-Realm in its ABNF. The value of the Destination-Realm 3321 AVP MAY be extracted from the User-Name AVP, or other application- 3322 specific methods. 3324 When a message is received, the message is processed in the following 3325 order: 3327 o If the message is destined for the local host, the procedures 3328 listed in Section 6.1.4 are followed. 3330 o If the message is intended for a Diameter peer with whom the local 3331 host is able to directly communicate, the procedures listed in 3332 Section 6.1.5 are followed. This is known as Request Forwarding. 3334 o The procedures listed in Section 6.1.6 are followed, which is 3335 known as Request Routing. 3337 o If none of the above is successful, an answer is returned with the 3338 Result-Code set to DIAMETER_UNABLE_TO_DELIVER, with the E-bit set. 3340 For routing of Diameter messages to work within an administrative 3341 domain, all Diameter nodes within the realm MUST be peers. 3343 Note the processing rules contained in this section are intended to 3344 be used as general guidelines to Diameter developers. Certain 3345 implementations MAY use different methods than the ones described 3346 here, and still comply with the protocol specification. See Section 3347 7 for more detail on error handling. 3349 6.1.1. Originating a Request 3351 When creating a request, in addition to any other procedures 3352 described in the application definition for that specific request, 3353 the following procedures MUST be followed: 3355 o the Command-Code is set to the appropriate value 3357 o the 'R' bit is set 3359 o the End-to-End Identifier is set to a locally unique value 3361 o the Origin-Host and Origin-Realm AVPs MUST be set to the 3362 appropriate values, used to identify the source of the message 3364 o the Destination-Host and Destination-Realm AVPs MUST be set to the 3365 appropriate values as described in Section 6.1. 3367 o an Acct-Application-Id AVP, an Auth-Application-Id or a Vendor- 3368 Specific-Application-Id AVP must be included if the request is 3369 proxiable. The application id present in one of these relevant 3370 AVPs must match the application id present in the diameter message 3371 header. 3373 6.1.2. Sending a Request 3375 When sending a request, originated either locally, or as the result 3376 of a forwarding or routing operation, the following procedures MUST 3377 be followed: 3379 o the Hop-by-Hop Identifier should be set to a locally unique value. 3381 o The message should be saved in the list of pending requests. 3383 Other actions to perform on the message based on the particular role 3384 the agent is playing are described in the following sections. 3386 6.1.3. Receiving Requests 3388 A relay or proxy agent MUST check for forwarding loops when receiving 3389 requests. A loop is detected if the server finds its own identity in 3390 a Route-Record AVP. When such an event occurs, the agent MUST answer 3391 with the Result-Code AVP set to DIAMETER_LOOP_DETECTED. 3393 6.1.4. Processing Local Requests 3395 A request is known to be for local consumption when one of the 3396 following conditions occur: 3398 o The Destination-Host AVP contains the local host's identity, 3400 o The Destination-Host AVP is not present, the Destination-Realm AVP 3401 contains a realm the server is configured to process locally, and 3402 the Diameter application is locally supported, or 3404 o Both the Destination-Host and the Destination-Realm are not 3405 present. 3407 When a request is locally processed, the rules in Section 6.2 should 3408 be used to generate the corresponding answer. 3410 6.1.5. Request Forwarding 3412 Request forwarding is done using the Diameter Peer Table. The 3413 Diameter peer table contains all of the peers that the local node is 3414 able to directly communicate with. 3416 When a request is received, and the host encoded in the Destination- 3417 Host AVP is one that is present in the peer table, the message SHOULD 3418 be forwarded to the peer. 3420 6.1.6. Request Routing 3422 Diameter request message routing is done via realms and applications. 3423 A Diameter message that may be forwarded by Diameter agents (proxies, 3424 redirects or relays) MUST include the target realm in the 3425 Destination-Realm AVP. Request routing SHOULD rely on the 3426 Destination-Realm AVP and the application id present in the request 3427 message header to aid in the routing decision. It MAY also rely on 3428 the application identification AVPs Auth-Application-Id, Acct- 3429 Application-Id or Vendor-Specific-Application-Id instead of the 3430 application id in the message header as a secondary measure. The 3431 realm MAY be retrieved from the User-Name AVP, which is in the form 3432 of a Network Access Identifier (NAI). The realm portion of the NAI 3433 is inserted in the Destination-Realm AVP. 3435 Diameter agents MAY have a list of locally supported realms and 3436 applications, and MAY have a list of externally supported realms and 3437 applications. When a request is received that includes a realm 3438 and/or application that is not locally supported, the message is 3439 routed to the peer configured in the Routing Table (see Section 2.7). 3441 Realm names and application identifiers are the minimum supported 3442 routing criteria, additional routing information maybe needed to 3443 support redirect semantics. 3445 6.1.7. Predictive Loop Avoidance 3447 Before forwarding or routing a request, Diameter agents, in addition 3448 to processing done in Section 6.1.3, SHOULD check for the presence of 3449 candidate route's peer identity in any of the Route-Record AVPs. In 3450 an event of the agent detecting the presence of a candidate route's 3451 peer identity in a Route-Record AVP, the agent MUST ignore such route 3452 for the Diameter request message and attempt alternate routes if any. 3453 In case all the candidate routes are eliminated by the above 3454 criteria, the agent SHOULD return DIAMETER_UNABLE_TO_DELIVER message. 3456 6.1.8. Redirecting requests 3458 When a redirect agent receives a request whose routing entry is set 3459 to REDIRECT, it MUST reply with an answer message with the 'E' bit 3460 set, while maintaining the Hop-by-Hop Identifier in the header, and 3461 include the Result-Code AVP to DIAMETER_REDIRECT_INDICATION. Each of 3462 the servers associated with the routing entry are added in separate 3463 Redirect-Host AVP. 3465 +------------------+ 3466 | Diameter | 3467 | Redirect Agent | 3468 +------------------+ 3469 ^ | 2. command + 'E' bit 3470 1. Request | | Result-Code = 3471 joe@example.com | | DIAMETER_REDIRECT_INDICATION + 3472 | | Redirect-Host AVP(s) 3473 | v 3474 +-------------+ 3. Request +-------------+ 3475 | example.com |------------->| example.net | 3476 | Relay | | Diameter | 3477 | Agent |<-------------| Server | 3478 +-------------+ 4. Answer +-------------+ 3480 Figure 5: Diameter Redirect Agent 3482 The receiver of the answer message with the 'E' bit set, and the 3483 Result-Code AVP set to DIAMETER_REDIRECT_INDICATION uses the hop-by- 3484 hop field in the Diameter header to identify the request in the 3485 pending message queue (see Section 5.3) that is to be redirected. If 3486 no transport connection exists with the new agent, one is created, 3487 and the request is sent directly to it. 3489 Multiple Redirect-Host AVPs are allowed. The receiver of the answer 3490 message with the 'E' bit set selects exactly one of these hosts as 3491 the destination of the redirected message. 3493 When the Redirect-Host-Usage AVP included in the answer message has a 3494 non-zero value, a route entry for the redirect indications is created 3495 and cached by the receiver. The redirect usage for such route entry 3496 is set by the value of Redirect-Host-Usage AVP and the lifetime of 3497 the cached route entry is set by Redirect-Max-Cache-Time AVP value. 3499 It is possible that multiple redirect indications can create multiple 3500 cached route entries differing only in their redirect usage and the 3501 peer to forward messages to. As an example, two(2) route entries 3502 that are created by two(2) redirect indications results in two(2) 3503 cached routes for the same realm and application Id. However, one 3504 has a redirect usage of ALL_SESSION where matching request will be 3505 forwarded to one peer and the other has a redirect usage of ALL_REALM 3506 where request are forwarded to another peer. Therefore, an incoming 3507 request that matches the realm and application Id of both routes will 3508 need additional resolution. In such a case, a routing precedence 3509 rule MUST be used againts the redirect usage value to resolve the 3510 contention. The precedence rule can be found in Section 6.13. 3512 6.1.9. Relaying and Proxying Requests 3514 A relay or proxy agent MUST append a Route-Record AVP to all requests 3515 forwarded. The AVP contains the identity of the peer the request was 3516 received from. 3518 The Hop-by-Hop identifier in the request is saved, and replaced with 3519 a locally unique value. The source of the request is also saved, 3520 which includes the IP address, port and protocol. 3522 A relay or proxy agent MAY include the Proxy-Info AVP in requests if 3523 it requires access to any local state information when the 3524 corresponding response is received. Proxy-Info AVP has certain 3525 security implications and SHOULD contain an embedded HMAC with a 3526 node-local key. Alternatively, it MAY simply use local storage to 3527 store state information. 3529 The message is then forwarded to the next hop, as identified in the 3530 Routing Table. 3532 Figure 6 provides an example of message routing using the procedures 3533 listed in these sections. 3535 (Origin-Host=nas.mno.net) (Origin-Host=nas.mno.net) 3536 (Origin-Realm=mno.net) (Origin-Realm=mno.net) 3537 (Destination-Realm=example.com) (Destination- 3538 Realm=example.com) 3539 (Route-Record=nas.example.net) 3540 +------+ ------> +------+ ------> +------+ 3541 | | (Request) | | (Request) | | 3542 | NAS +-------------------+ DRL +-------------------+ HMS | 3543 | | | | | | 3544 +------+ <------ +------+ <------ +------+ 3545 example.net (Answer) example.net (Answer) example.com 3546 (Origin-Host=hms.example.com) (Origin-Host=hms.example.com) 3547 (Origin-Realm=example.com) (Origin-Realm=example.com) 3549 Figure 6: Routing of Diameter messages 3551 Relay agents do not require full validation of incoming messages. At 3552 a minimum, validation of the message header and relevant routing AVPs 3553 has to be done when relaying messages. 3555 6.2. Diameter Answer Processing 3557 When a request is locally processed, the following procedures MUST be 3558 applied to create the associated answer, in addition to any 3559 additional procedures that MAY be discussed in the Diameter 3560 application defining the command: 3562 o The same Hop-by-Hop identifier in the request is used in the 3563 answer. 3565 o The local host's identity is encoded in the Origin-Host AVP. 3567 o The Destination-Host and Destination-Realm AVPs MUST NOT be 3568 present in the answer message. 3570 o The Result-Code AVP is added with its value indicating success or 3571 failure. 3573 o If the Session-Id is present in the request, it MUST be included 3574 in the answer. 3576 o Any Proxy-Info AVPs in the request MUST be added to the answer 3577 message, in the same order they were present in the request. 3579 o The 'P' bit is set to the same value as the one in the request. 3581 o The same End-to-End identifier in the request is used in the 3582 answer. 3584 Note that the error messages (see Section 7.3) are also subjected to 3585 the above processing rules. 3587 6.2.1. Processing received Answers 3589 A Diameter client or proxy MUST match the Hop-by-Hop Identifier in an 3590 answer received against the list of pending requests. The 3591 corresponding message should be removed from the list of pending 3592 requests. It SHOULD ignore answers received that do not match a 3593 known Hop-by-Hop Identifier. 3595 6.2.2. Relaying and Proxying Answers 3597 If the answer is for a request which was proxied or relayed, the 3598 agent MUST restore the original value of the Diameter header's Hop- 3599 by-Hop Identifier field. 3601 If the last Proxy-Info AVP in the message is targeted to the local 3602 Diameter server, the AVP MUST be removed before the answer is 3603 forwarded. 3605 If a relay or proxy agent receives an answer with a Result-Code AVP 3606 indicating a failure, it MUST NOT modify the contents of the AVP. 3607 Any additional local errors detected SHOULD be logged, but not 3608 reflected in the Result-Code AVP. If the agent receives an answer 3609 message with a Result-Code AVP indicating success, and it wishes to 3610 modify the AVP to indicate an error, it MUST modify the Result-Code 3611 AVP to contain the appropriate error in the message destined towards 3612 the access device as well as include the Error-Reporting-Host AVP and 3613 it MUST issue an STR on behalf of the access device. 3615 The agent MUST then send the answer to the host that it received the 3616 original request from. 3618 6.3. Origin-Host AVP 3620 The Origin-Host AVP (AVP Code 264) is of type DiameterIdentity, and 3621 MUST be present in all Diameter messages. This AVP identifies the 3622 endpoint that originated the Diameter message. Relay agents MUST NOT 3623 modify this AVP. 3625 The value of the Origin-Host AVP is guaranteed to be unique within a 3626 single host. 3628 Note that the Origin-Host AVP may resolve to more than one address as 3629 the Diameter peer may support more than one address. 3631 This AVP SHOULD be placed as close to the Diameter header as 3632 possible. 6.10 3634 6.4. Origin-Realm AVP 3636 The Origin-Realm AVP (AVP Code 296) is of type DiameterIdentity. 3637 This AVP contains the Realm of the originator of any Diameter message 3638 and MUST be present in all messages. 3640 This AVP SHOULD be placed as close to the Diameter header as 3641 possible. 3643 6.5. Destination-Host AVP 3645 The Destination-Host AVP (AVP Code 293) is of type DiameterIdentity. 3646 This AVP MUST be present in all unsolicited agent initiated messages, 3647 MAY be present in request messages, and MUST NOT be present in Answer 3648 messages. 3650 The absence of the Destination-Host AVP will cause a message to be 3651 sent to any Diameter server supporting the application within the 3652 realm specified in Destination-Realm AVP. 3654 This AVP SHOULD be placed as close to the Diameter header as 3655 possible. 3657 6.6. Destination-Realm AVP 3659 The Destination-Realm AVP (AVP Code 283) is of type DiameterIdentity, 3660 and contains the realm the message is to be routed to. The 3661 Destination-Realm AVP MUST NOT be present in Answer messages. 3662 Diameter Clients insert the realm portion of the User-Name AVP. 3663 Diameter servers initiating a request message use the value of the 3664 Origin-Realm AVP from a previous message received from the intended 3665 target host (unless it is known a priori). When present, the 3666 Destination-Realm AVP is used to perform message routing decisions. 3668 Request messages whose ABNF does not list the Destination-Realm AVP 3669 as a mandatory AVP are inherently non-routable messages. 3671 This AVP SHOULD be placed as close to the Diameter header as 3672 possible. 3674 6.7. Routing AVPs 3676 The AVPs defined in this section are Diameter AVPs used for routing 3677 purposes. These AVPs change as Diameter messages are processed by 3678 agents. 3680 6.7.1. Route-Record AVP 3682 The Route-Record AVP (AVP Code 282) is of type DiameterIdentity. The 3683 identity added in this AVP MUST be the same as the one received in 3684 the Origin-Host of the Capabilities Exchange message. 3686 6.7.2. Proxy-Info AVP 3688 The Proxy-Info AVP (AVP Code 284) is of type Grouped. The Grouped 3689 Data field has the following ABNF grammar: 3691 Proxy-Info ::= < AVP Header: 284 > 3692 { Proxy-Host } 3693 { Proxy-State } 3694 * [ AVP ] 3696 6.7.3. Proxy-Host AVP 3698 The Proxy-Host AVP (AVP Code 280) is of type DiameterIdentity. This 3699 AVP contains the identity of the host that added the Proxy-Info AVP. 3701 6.7.4. Proxy-State AVP 3703 The Proxy-State AVP (AVP Code 33) is of type OctetString, and 3704 contains state local information, and MUST be treated as opaque data. 3706 6.8. Auth-Application-Id AVP 3708 The Auth-Application-Id AVP (AVP Code 258) is of type Unsigned32 and 3709 is used in order to advertise support of the Authentication and 3710 Authorization portion of an application (see Section 2.4). The Auth- 3711 Application-Id MUST also be present in all Authentication and/or 3712 Authorization messages that are defined in a separate Diameter 3713 specification and have an Application ID assigned. If present in a 3714 message, the value of the Auth-Application-Id AVP MUST match the 3715 application id present in the diameter message header except when 3716 used in a CER or CEA messages. 3718 6.9. Acct-Application-Id AVP 3720 The Acct-Application-Id AVP (AVP Code 259) is of type Unsigned32 and 3721 is used in order to advertise support of the Accounting portion of an 3722 application (see Section 2.4). The Acct-Application-Id MUST also be 3723 present in all Accounting messages. Exactly one of the Auth- 3724 Application-Id and Acct-Application-Id AVPs MAY be present. If 3725 present in a message, the value of the Acct-Application-Id AVP MUST 3726 match the application id present in the diameter message header 3727 except when used in a CER or CEA messages. 3729 6.10. Inband-Security-Id AVP 3731 The Inband-Security-Id AVP (AVP Code 299) is of type Unsigned32 and 3732 is used in order to advertise support of the Security portion of the 3733 application. 3735 Currently, the following values are supported, but there is ample 3736 room to add new security Ids. 3738 NO_INBAND_SECURITY 0 3740 This peer does not support TLS. This is the default value, if the 3741 AVP is omitted. 3743 TLS 1 3745 This node supports TLS security, as defined by [RFC4346]. 3747 6.11. Vendor-Specific-Application-Id AVP 3749 The Vendor-Specific-Application-Id AVP (AVP Code 260) is of type 3750 Grouped and is used to advertise support of a vendor-specific 3751 Diameter Application. Exactly one instance of either Auth- 3752 Application-Id or Acct-Application-Id AVP MAY be present. The 3753 application identifier carried by either Auth-Application-Id or Acct- 3754 Application-Id AVP MUST comply with vendor specific application 3755 identifier assignment described in Sec 11.3. It MUST also match the 3756 application id present in the diameter header except when used in a 3757 CER or CEA messages. 3759 The Vendor-Id AVP is an informational AVP pertaining to the vendor 3760 who may have authorship of the vendor-specific Diameter application. 3761 It MUST NOT be used as a means of defining a completely separate 3762 vendor-specific application identifier space. 3764 This AVP MUST also be present as the first AVP in all experimental 3765 commands defined in the vendor-specific application. 3767 This AVP SHOULD be placed as close to the Diameter header as 3768 possible. 3770 AVP Format 3772 ::= < AVP Header: 260 > 3773 { Vendor-Id } 3774 ({ Auth-Application-Id } / 3775 { Acct-Application-Id }) 3777 6.12. Redirect-Host AVP 3779 One or more of instances of this AVP MUST be present if the answer 3780 message's 'E' bit is set and the Result-Code AVP is set to 3781 DIAMETER_REDIRECT_INDICATION. 3783 Upon receiving the above, the receiving Diameter node SHOULD forward 3784 the request directly to one of the hosts identified in these AVPs. 3785 The server contained in the selected Redirect-Host AVP SHOULD be used 3786 for all messages pertaining to this session. 3788 6.13. Redirect-Host-Usage AVP 3790 The Redirect-Host-Usage AVP (AVP Code 261) is of type Enumerated. 3791 This AVP MAY be present in answer messages whose 'E' bit is set and 3792 the Result-Code AVP is set to DIAMETER_REDIRECT_INDICATION. 3794 When present, this AVP dictates how the routing entry resulting from 3795 the Redirect-Host is to be used. The following values are supported: 3797 DONT_CACHE 0 3799 The host specified in the Redirect-Host AVP should not be cached. 3800 This is the default value. 3802 ALL_SESSION 1 3804 All messages within the same session, as defined by the same value 3805 of the Session-ID AVP MAY be sent to the host specified in the 3806 Redirect-Host AVP. 3808 ALL_REALM 2 3810 All messages destined for the realm requested MAY be sent to the 3811 host specified in the Redirect-Host AVP. 3813 REALM_AND_APPLICATION 3 3815 All messages for the application requested to the realm specified 3816 MAY be sent to the host specified in the Redirect-Host AVP. 3818 ALL_APPLICATION 4 3820 All messages for the application requested MAY be sent to the host 3821 specified in the Redirect-Host AVP. 3823 ALL_HOST 5 3825 All messages that would be sent to the host that generated the 3826 Redirect-Host MAY be sent to the host specified in the Redirect- 3827 Host AVP. 3829 ALL_USER 6 3831 All messages for the user requested MAY be sent to the host 3832 specified in the Redirect-Host AVP. 3834 When multiple cached routes are created by redirect indications and 3835 they differs only in redirect usage and peers to forward requests to 3836 (see Section 6.1.8), a precedence rule MUST be applied to the 3837 redirect usage values of the cached routes during normal routing to 3838 resolve contentions that may occur. The precedence rule is the order 3839 that dictate which redirect usage should be considered before any 3840 other as they appear. The order is as follows: 3842 1. ALL_SESSION 3844 2. ALL_USER 3846 3. REALM_AND_APPLICATION 3848 4. ALL_REALM 3850 5. ALL_APPLICATION 3852 6. ALL_HOST 3854 6.14. Redirect-Max-Cache-Time AVP 3856 The Redirect-Max-Cache-Time AVP (AVP Code 262) is of type Unsigned32. 3857 This AVP MUST be present in answer messages whose 'E' bit is set, the 3858 Result-Code AVP is set to DIAMETER_REDIRECT_INDICATION and the 3859 Redirect-Host-Usage AVP set to a non-zero value. 3861 This AVP contains the maximum number of seconds the peer and route 3862 table entries, created as a result of the Redirect-Host, will be 3863 cached. Note that once a host created due to a redirect indication 3864 is no longer reachable, any associated peer and routing table entries 3865 MUST be deleted. 3867 6.15. E2E-Sequence AVP 3869 The E2E-Sequence AVP (AVP Code 300) provides anti-replay protection 3870 for end to end messages and is of type grouped. It contains a random 3871 value (an OctetString with a nonce) and counter (an Integer). For 3872 each end-to-end peer with which a node communicates (or remembers 3873 communicating) a different nonce value MUST be used and the counter 3874 is initiated at zero and increases by one each time this AVP is 3875 emitted to that peer. 3877 7. Error Handling 3879 There are two different types of errors in Diameter; protocol and 3880 application errors. A protocol error is one that occurs at the base 3881 protocol level, and MAY require per hop attention (e.g., message 3882 routing error). Application errors, on the other hand, generally 3883 occur due to a problem with a function specified in a Diameter 3884 application (e.g., user authentication, Missing AVP). 3886 Result-Code AVP values that are used to report protocol errors MUST 3887 only be present in answer messages whose 'E' bit is set. When a 3888 request message is received that causes a protocol error, an answer 3889 message is returned with the 'E' bit set, and the Result-Code AVP is 3890 set to the appropriate protocol error value. As the answer is sent 3891 back towards the originator of the request, each proxy or relay agent 3892 MAY take action on the message. 3894 1. Request +---------+ Link Broken 3895 +-------------------------->|Diameter |----///----+ 3896 | +---------------------| | v 3897 +------+--+ | 2. answer + 'E' set | Relay 2 | +--------+ 3898 |Diameter |<-+ (Unable to Forward) +---------+ |Diameter| 3899 | | | Home | 3900 | Relay 1 |--+ +---------+ | Server | 3901 +---------+ | 3. Request |Diameter | +--------+ 3902 +-------------------->| | ^ 3903 | Relay 3 |-----------+ 3904 +---------+ 3906 Figure 7: Example of Protocol Error causing answer message 3908 Figure 7 provides an example of a message forwarded upstream by a 3909 Diameter relay. When the message is received by Relay 2, and it 3910 detects that it cannot forward the request to the home server, an 3911 answer message is returned with the 'E' bit set and the Result-Code 3912 AVP set to DIAMETER_UNABLE_TO_DELIVER. Given that this error falls 3913 within the protocol error category, Relay 1 would take special 3914 action, and given the error, attempt to route the message through its 3915 alternate Relay 3. 3917 +---------+ 1. Request +---------+ 2. Request +---------+ 3918 | Access |------------>|Diameter |------------>|Diameter | 3919 | | | | | Home | 3920 | Device |<------------| Relay |<------------| Server | 3921 +---------+ 4. Answer +---------+ 3. Answer +---------+ 3922 (Missing AVP) (Missing AVP) 3924 Figure 8: Example of Application Error Answer message 3926 Figure 8 provides an example of a Diameter message that caused an 3927 application error. When application errors occur, the Diameter 3928 entity reporting the error clears the 'R' bit in the Command Flags, 3929 and adds the Result-Code AVP with the proper value. Application 3930 errors do not require any proxy or relay agent involvement, and 3931 therefore the message would be forwarded back to the originator of 3932 the request. 3934 There are certain Result-Code AVP application errors that require 3935 additional AVPs to be present in the answer. In these cases, the 3936 Diameter node that sets the Result-Code AVP to indicate the error 3937 MUST add the AVPs. Examples are: 3939 o An unrecognized AVP is received with the 'M' bit (Mandatory bit) 3940 set, causes an answer to be sent with the Result-Code AVP set to 3941 DIAMETER_AVP_UNSUPPORTED, and the Failed-AVP AVP containing the 3942 offending AVP. 3944 o An AVP that is received with an unrecognized value causes an 3945 answer to be returned with the Result-Code AVP set to 3946 DIAMETER_INVALID_AVP_VALUE, with the Failed-AVP AVP containing the 3947 AVP causing the error. 3949 o A command is received with an AVP that is omitted, yet is 3950 mandatory according to the command's ABNF. The receiver issues an 3951 answer with the Result-Code set to DIAMETER_MISSING_AVP, and 3952 creates an AVP with the AVP Code and other fields set as expected 3953 in the missing AVP. The created AVP is then added to the Failed- 3954 AVP AVP. 3956 The Result-Code AVP describes the error that the Diameter node 3957 encountered in its processing. In case there are multiple errors, 3958 the Diameter node MUST report only the first error it encountered 3959 (detected possibly in some implementation dependent order). The 3960 specific errors that can be described by this AVP are described in 3961 the following section. 3963 7.1. Result-Code AVP 3965 The Result-Code AVP (AVP Code 268) is of type Unsigned32 and 3966 indicates whether a particular request was completed successfully or 3967 whether an error occurred. All Diameter answer messages defined in 3968 IETF applications MUST include one Result-Code AVP. A non-successful 3969 Result-Code AVP (one containing a non 2xxx value other than 3970 DIAMETER_REDIRECT_INDICATION) MUST include the Error-Reporting-Host 3971 AVP if the host setting the Result-Code AVP is different from the 3972 identity encoded in the Origin-Host AVP. 3974 The Result-Code data field contains an IANA-managed 32-bit address 3975 space representing errors (see Section 11.4). Diameter provides the 3976 following classes of errors, all identified by the thousands digit in 3977 the decimal notation: 3979 o 1xxx (Informational) 3981 o 2xxx (Success) 3983 o 3xxx (Protocol Errors) 3985 o 4xxx (Transient Failures) 3987 o 5xxx (Permanent Failure) 3989 A non-recognized class (one whose first digit is not defined in this 3990 section) MUST be handled as a permanent failure. 3992 7.1.1. Informational 3994 Errors that fall within this category are used to inform the 3995 requester that a request could not be satisfied, and additional 3996 action is required on its part before access is granted. 3998 DIAMETER_MULTI_ROUND_AUTH 1001 4000 This informational error is returned by a Diameter server to 4001 inform the access device that the authentication mechanism being 4002 used requires multiple round trips, and a subsequent request needs 4003 to be issued in order for access to be granted. 4005 7.1.2. Success 4007 Errors that fall within the Success category are used to inform a 4008 peer that a request has been successfully completed. 4010 DIAMETER_SUCCESS 2001 4012 The Request was successfully completed. 4014 DIAMETER_LIMITED_SUCCESS 2002 4016 When returned, the request was successfully completed, but 4017 additional processing is required by the application in order to 4018 provide service to the user. 4020 7.1.3. Protocol Errors 4022 Errors that fall within the Protocol Error category SHOULD be treated 4023 on a per-hop basis, and Diameter proxies MAY attempt to correct the 4024 error, if it is possible. Note that these and only these errors MUST 4025 only be used in answer messages whose 'E' bit is set. To provide 4026 backward compatibility with existing implementations that follow 4027 [RFC3588], some of the error values that have previously been used in 4028 this category by [RFC3588] will not be re-used. Therefore the error 4029 values enumerated here maybe non-sequential. 4031 DIAMETER_UNABLE_TO_DELIVER 3002 4033 This error is given when Diameter can not deliver the message to 4034 the destination, either because no host within the realm 4035 supporting the required application was available to process the 4036 request, or because Destination-Host AVP was given without the 4037 associated Destination-Realm AVP. 4039 DIAMETER_REALM_NOT_SERVED 3003 4041 The intended realm of the request is not recognized. 4043 DIAMETER_TOO_BUSY 3004 4045 When returned, a Diameter node SHOULD attempt to send the message 4046 to an alternate peer. This error MUST only be used when a 4047 specific server is requested, and it cannot provide the requested 4048 service. 4050 DIAMETER_LOOP_DETECTED 3005 4052 An agent detected a loop while trying to get the message to the 4053 intended recipient. The message MAY be sent to an alternate peer, 4054 if one is available, but the peer reporting the error has 4055 identified a configuration problem. 4057 DIAMETER_REDIRECT_INDICATION 3006 4059 A redirect agent has determined that the request could not be 4060 satisfied locally and the initiator of the request should direct 4061 the request directly to the server, whose contact information has 4062 been added to the response. When set, the Redirect-Host AVP MUST 4063 be present. 4065 DIAMETER_APPLICATION_UNSUPPORTED 3007 4067 A request was sent for an application that is not supported. 4069 DIAMETER_INVALID_BIT_IN_HEADER 3011 4071 This error is returned when a reserved bit in the Diameter header 4072 is set to one (1) or the bits in the Diameter header defined in 4073 Sec 3 are set incorrectly. 4075 DIAMETER_INVALID_MESSAGE_LENGTH 3012 4077 This error is returned when a request is received with an invalid 4078 message length. 4080 7.1.4. Transient Failures 4082 Errors that fall within the transient failures category are used to 4083 inform a peer that the request could not be satisfied at the time it 4084 was received, but MAY be able to satisfy the request in the future. 4085 Note that these errors MUST be used in answer messages whose 'E' bit 4086 is not set. 4088 DIAMETER_AUTHENTICATION_REJECTED 4001 4090 The authentication process for the user failed, most likely due to 4091 an invalid password used by the user. Further attempts MUST only 4092 be tried after prompting the user for a new password. 4094 DIAMETER_OUT_OF_SPACE 4002 4096 A Diameter node received the accounting request but was unable to 4097 commit it to stable storage due to a temporary lack of space. 4099 ELECTION_LOST 4003 4101 The peer has determined that it has lost the election process and 4102 has therefore disconnected the transport connection. 4104 7.1.5. Permanent Failures 4106 Errors that fall within the permanent failures category are used to 4107 inform the peer that the request failed, and should not be attempted 4108 again. Note that these errors SHOULD be used in answer messages 4109 whose 'E' bit is not set. In error conditions where it is not 4110 possible or efficient to compose application specific answer grammar 4111 then answer messages with E-bit set and complying to the grammar 4112 described in 7.2 MAY also be used for permanent errors. 4114 To provide backward compatibility with existing implementations that 4115 follow [RFC3588], some of the error values that have previously been 4116 used in this category by [RFC3588] will not be re-used. Therefore 4117 the error values enumerated here maybe non-sequential. 4119 DIAMETER_AVP_UNSUPPORTED 5001 4121 The peer received a message that contained an AVP that is not 4122 recognized or supported and was marked with the Mandatory bit. A 4123 Diameter message with this error MUST contain one or more Failed- 4124 AVP AVP containing the AVPs that caused the failure. 4126 DIAMETER_UNKNOWN_SESSION_ID 5002 4128 The request contained an unknown Session-Id. 4130 DIAMETER_AUTHORIZATION_REJECTED 5003 4132 A request was received for which the user could not be authorized. 4133 This error could occur if the service requested is not permitted 4134 to the user. 4136 DIAMETER_INVALID_AVP_VALUE 5004 4138 The request contained an AVP with an invalid value in its data 4139 portion. A Diameter message indicating this error MUST include 4140 the offending AVPs within a Failed-AVP AVP. 4142 DIAMETER_MISSING_AVP 5005 4144 The request did not contain an AVP that is required by the Command 4145 Code definition. If this value is sent in the Result-Code AVP, a 4146 Failed-AVP AVP SHOULD be included in the message. The Failed-AVP 4147 AVP MUST contain an example of the missing AVP complete with the 4148 Vendor-Id if applicable. The value field of the missing AVP 4149 should be of correct minimum length and contain zeroes. 4151 DIAMETER_RESOURCES_EXCEEDED 5006 4153 A request was received that cannot be authorized because the user 4154 has already expended allowed resources. An example of this error 4155 condition is a user that is restricted to one dial-up PPP port, 4156 attempts to establish a second PPP connection. 4158 DIAMETER_CONTRADICTING_AVPS 5007 4160 The Home Diameter server has detected AVPs in the request that 4161 contradicted each other, and is not willing to provide service to 4162 the user. The Failed-AVP AVPs MUST be present which contains the 4163 AVPs that contradicted each other. 4165 DIAMETER_AVP_NOT_ALLOWED 5008 4167 A message was received with an AVP that MUST NOT be present. The 4168 Failed-AVP AVP MUST be included and contain a copy of the 4169 offending AVP. 4171 DIAMETER_AVP_OCCURS_TOO_MANY_TIMES 5009 4173 A message was received that included an AVP that appeared more 4174 often than permitted in the message definition. The Failed-AVP 4175 AVP MUST be included and contain a copy of the first instance of 4176 the offending AVP that exceeded the maximum number of occurrences 4178 DIAMETER_NO_COMMON_APPLICATION 5010 4180 This error is returned by a Diameter node that is not acting as a 4181 relay when it receives a CER which advertises a set of 4182 applications that it does not support. 4184 DIAMETER_UNSUPPORTED_VERSION 5011 4186 This error is returned when a request was received, whose version 4187 number is unsupported. 4189 DIAMETER_UNABLE_TO_COMPLY 5012 4191 This error is returned when a request is rejected for unspecified 4192 reasons. 4194 DIAMETER_INVALID_AVP_LENGTH 5014 4196 The request contained an AVP with an invalid length. A Diameter 4197 message indicating this error MUST include the offending AVPs 4198 within a Failed-AVP AVP. In cases where the erroneous avp length 4199 value exceeds the message length or is less than the minimum AVP 4200 header length, it is sufficient to include the offending AVP 4201 header and a zero filled payload of the minimum required length 4202 for the payloads data type. If the AVP is a grouped AVP, the 4203 grouped AVP header with an empty payload would be sufficient to 4204 indicate the offending AVP. In the case where the offending AVP 4205 header cannot be fully decoded when avp length is less than the 4206 minimum AVP header length, it is sufficient to include an 4207 offending AVP header that is formulated by padding the incomplete 4208 AVP header with zero up to the minimum AVP header length. 4210 DIAMETER_NO_COMMON_SECURITY 5017 4212 This error is returned when a CER message is received, and there 4213 are no common security mechanisms supported between the peers. A 4214 Capabilities-Exchange-Answer (CEA) MUST be returned with the 4215 Result-Code AVP set to DIAMETER_NO_COMMON_SECURITY. 4217 DIAMETER_UNKNOWN_PEER 5018 4219 A CER was received from an unknown peer. 4221 DIAMETER_COMMAND_UNSUPPORTED 5019 4223 The Request contained a Command-Code that the receiver did not 4224 recognize or support. This MUST be used when a Diameter node 4225 receives an experimental command that it does not understand. 4227 DIAMETER_INVALID_HDR_BITS 5020 4229 A request was received whose bits in the Diameter header were 4230 either set to an invalid combination, or to a value that is 4231 inconsistent with the command code's definition. 4233 DIAMETER_INVALID_AVP_BITS 5021 4235 A request was received that included an AVP whose flag bits are 4236 set to an unrecognized value, or that is inconsistent with the 4237 AVP's definition. 4239 7.2. Error Bit 4241 The 'E' (Error Bit) in the Diameter header is set when the request 4242 caused a protocol-related error (see Section 7.1.3). A message with 4243 the 'E' bit MUST NOT be sent as a response to an answer message. 4244 Note that a message with the 'E' bit set is still subjected to the 4245 processing rules defined in Section 6.2. When set, the answer 4246 message will not conform to the ABNF specification for the command, 4247 and will instead conform to the following ABNF: 4249 Message Format 4251 ::= < Diameter Header: code, ERR [PXY] > 4252 0*1< Session-Id > 4253 { Origin-Host } 4254 { Origin-Realm } 4255 { Result-Code } 4256 [ Origin-State-Id ] 4257 [ Error-Message ] 4258 [ Error-Reporting-Host ] 4259 [ Failed-AVP ] 4260 * [ Proxy-Info ] 4261 * [ AVP ] 4263 Note that the code used in the header is the same than the one found 4264 in the request message, but with the 'R' bit cleared and the 'E' bit 4265 set. The 'P' bit in the header is set to the same value as the one 4266 found in the request message. 4268 7.3. Error-Message AVP 4270 The Error-Message AVP (AVP Code 281) is of type UTF8String. It MAY 4271 accompany a Result-Code AVP as a human readable error message. The 4272 Error-Message AVP is not intended to be useful in real-time, and 4273 SHOULD NOT be expected to be parsed by network entities. 4275 7.4. Error-Reporting-Host AVP 4277 The Error-Reporting-Host AVP (AVP Code 294) is of type 4278 DiameterIdentity. This AVP contains the identity of the Diameter 4279 host that sent the Result-Code AVP to a value other than 2001 4280 (Success), only if the host setting the Result-Code is different from 4281 the one encoded in the Origin-Host AVP. This AVP is intended to be 4282 used for troubleshooting purposes, and MUST be set when the Result- 4283 Code AVP indicates a failure. 4285 7.5. Failed-AVP AVP 4287 The Failed-AVP AVP (AVP Code 279) is of type Grouped and provides 4288 debugging information in cases where a request is rejected or not 4289 fully processed due to erroneous information in a specific AVP. The 4290 value of the Result-Code AVP will provide information on the reason 4291 for the Failed-AVP AVP. A Diameter message SHOULD contain only one 4292 Failed-AVP that corresponds to the error indicated by the Result-Code 4293 AVP. For practical purposes, this Failed-AVP would typically refer 4294 to the first AVP processing error that a Diameter node encounters. 4296 The possible reasons for this AVP are the presence of an improperly 4297 constructed AVP, an unsupported or unrecognized AVP, an invalid AVP 4298 value, the omission of a required AVP, the presence of an explicitly 4299 excluded AVP (see tables in Section 10), or the presence of two or 4300 more occurrences of an AVP which is restricted to 0, 1, or 0-1 4301 occurrences. 4303 A Diameter message SHOULD contain one Failed-AVP AVP, containing the 4304 entire AVP that could not be processed successfully. If the failure 4305 reason is omission of a required AVP, an AVP with the missing AVP 4306 code, the missing vendor id, and a zero filled payload of the minimum 4307 required length for the omitted AVP will be added. If the failure 4308 reason is an invalid AVP length where the reported length is less 4309 than the minimum AVP header length or greater than the reported 4310 message length, a copy of the offending AVP header and a zero filled 4311 payload of the minimum required length SHOULD be added. 4313 In the case where the offending AVP is embedded within a grouped AVP, 4314 the Failed-AVP MAY contain the grouped AVP which in turn contains the 4315 single offending AVP. The same method MAY be employed if the grouped 4316 AVP itself is embedded in yet another grouped AVP and so on. In this 4317 case, the Failed-AVP MAY contain the grouped AVP heirarchy up to the 4318 single offending AVP. This enables the recipient to detect the 4319 location of the offending AVP when embedded in a group. 4321 AVP Format 4323 ::= < AVP Header: 279 > 4324 1* {AVP} 4326 7.6. Experimental-Result AVP 4328 The Experimental-Result AVP (AVP Code 297) is of type Grouped, and 4329 indicates whether a particular vendor-specific request was completed 4330 successfully or whether an error occurred. Its Data field has the 4331 following ABNF grammar: 4333 AVP Format 4335 Experimental-Result ::= < AVP Header: 297 > 4336 { Vendor-Id } 4337 { Experimental-Result-Code } 4339 The Vendor-Id AVP (see Section 5.3.3) in this grouped AVP identifies 4340 the vendor responsible for the assignment of the result code which 4341 follows. All Diameter answer messages defined in vendor-specific 4342 applications MUST include either one Result-Code AVP or one 4343 Experimental-Result AVP. 4345 7.7. Experimental-Result-Code AVP 4347 The Experimental-Result-Code AVP (AVP Code 298) is of type Unsigned32 4348 and contains a vendor-assigned value representing the result of 4349 processing the request. 4351 It is recommended that vendor-specific result codes follow the same 4352 conventions given for the Result-Code AVP regarding the different 4353 types of result codes and the handling of errors (for non 2xxx 4354 values). 4356 8. Diameter User Sessions 4358 In general, Diameter can provide two different types of services to 4359 applications. The first involves authentication and authorization, 4360 and can optionally make use of accounting. The second only makes use 4361 of accounting. 4363 When a service makes use of the authentication and/or authorization 4364 portion of an application, and a user requests access to the network, 4365 the Diameter client issues an auth request to its local server. The 4366 auth request is defined in a service specific Diameter application 4367 (e.g., NASREQ). The request contains a Session-Id AVP, which is used 4368 in subsequent messages (e.g., subsequent authorization, accounting, 4369 etc) relating to the user's session. The Session-Id AVP is a means 4370 for the client and servers to correlate a Diameter message with a 4371 user session. 4373 When a Diameter server authorizes a user to use network resources for 4374 a finite amount of time, and it is willing to extend the 4375 authorization via a future request, it MUST add the Authorization- 4376 Lifetime AVP to the answer message. The Authorization-Lifetime AVP 4377 defines the maximum number of seconds a user MAY make use of the 4378 resources before another authorization request is expected by the 4379 server. The Auth-Grace-Period AVP contains the number of seconds 4380 following the expiration of the Authorization-Lifetime, after which 4381 the server will release all state information related to the user's 4382 session. Note that if payment for services is expected by the 4383 serving realm from the user's home realm, the Authorization-Lifetime 4384 AVP, combined with the Auth-Grace-Period AVP, implies the maximum 4385 length of the session the home realm is willing to be fiscally 4386 responsible for. Services provided past the expiration of the 4387 Authorization-Lifetime and Auth-Grace-Period AVPs are the 4388 responsibility of the access device. Of course, the actual cost of 4389 services rendered is clearly outside the scope of the protocol. 4391 An access device that does not expect to send a re-authorization or a 4392 session termination request to the server MAY include the Auth- 4393 Session-State AVP with the value set to NO_STATE_MAINTAINED as a hint 4394 to the server. If the server accepts the hint, it agrees that since 4395 no session termination message will be received once service to the 4396 user is terminated, it cannot maintain state for the session. If the 4397 answer message from the server contains a different value in the 4398 Auth-Session-State AVP (or the default value if the AVP is absent), 4399 the access device MUST follow the server's directives. Note that the 4400 value NO_STATE_MAINTAINED MUST NOT be set in subsequent re- 4401 authorization requests and answers. 4403 The base protocol does not include any authorization request 4404 messages, since these are largely application-specific and are 4405 defined in a Diameter application document. However, the base 4406 protocol does define a set of messages that is used to terminate user 4407 sessions. These are used to allow servers that maintain state 4408 information to free resources. 4410 When a service only makes use of the Accounting portion of the 4411 Diameter protocol, even in combination with an application, the 4412 Session-Id is still used to identify user sessions. However, the 4413 session termination messages are not used, since a session is 4414 signaled as being terminated by issuing an accounting stop message. 4416 Diameter may also be used for services that cannot be easily 4417 categorized as authentication, authorization or accounting (e.g., 4418 certain 3GPP IMS interfaces). In such cases, the finite state 4419 machine defined in subsequent sections may not be applicable. 4420 Therefore, the applications itself MAY need to define its own finite 4421 state machine. However, such application specific statemachines MUST 4422 comply with general Diameter user session requirements such co- 4423 relating all message exchanges via Session-Id AVP. 4425 8.1. Authorization Session State Machine 4427 This section contains a set of finite state machines, representing 4428 the life cycle of Diameter sessions, and which MUST be observed by 4429 all Diameter implementations that make use of the authentication 4430 and/or authorization portion of a Diameter application. The term 4431 Service-Specific below refers to a message defined in a Diameter 4432 application (e.g., Mobile IPv4, NASREQ). 4434 There are four different authorization session state machines 4435 supported in the Diameter base protocol. The first two describe a 4436 session in which the server is maintaining session state, indicated 4437 by the value of the Auth-Session-State AVP (or its absence). One 4438 describes the session from a client perspective, the other from a 4439 server perspective. The second two state machines are used when the 4440 server does not maintain session state. Here again, one describes 4441 the session from a client perspective, the other from a server 4442 perspective. 4444 When a session is moved to the Idle state, any resources that were 4445 allocated for the particular session must be released. Any event not 4446 listed in the state machines MUST be considered as an error 4447 condition, and an answer, if applicable, MUST be returned to the 4448 originator of the message. 4450 In the case that an application does not support re-auth, the state 4451 transitions related to server-initiated re-auth when both client and 4452 server sessions maintains state (e.g., Send RAR, Pending, Receive 4453 RAA) MAY be ignored. 4455 In the state table, the event 'Failure to send X' means that the 4456 Diameter agent is unable to send command X to the desired 4457 destination. This could be due to the peer being down, or due to the 4458 peer sending back a transient failure or temporary protocol error 4459 notification DIAMETER_TOO_BUSY or DIAMETER_LOOP_DETECTED in the 4460 Result-Code AVP of the corresponding Answer command. The event 'X 4461 successfully sent' is the complement of 'Failure to send X'. 4463 The following state machine is observed by a client when state is 4464 maintained on the server: 4466 CLIENT, STATEFUL 4467 State Event Action New State 4468 ------------------------------------------------------------- 4469 Idle Client or Device Requests Send Pending 4470 access service 4471 specific 4472 auth req 4474 Idle ASR Received Send ASA Idle 4475 for unknown session with 4476 Result-Code 4477 = UNKNOWN_ 4478 SESSION_ID 4480 Idle RAR Received Send RAA Idle 4481 for unknown session with 4482 Result-Code 4483 = UNKNOWN_ 4484 SESSION_ID 4486 Pending Successful Service-specific Grant Open 4487 authorization answer Access 4488 received with default 4489 Auth-Session-State value 4491 Pending Successful Service-specific Sent STR Discon 4492 authorization answer received 4493 but service not provided 4495 Pending Error processing successful Sent STR Discon 4496 Service-specific authorization 4497 answer 4499 Pending Failed Service-specific Cleanup Idle 4500 authorization answer received 4502 Open User or client device Send Open 4503 requests access to service service 4504 specific 4505 auth req 4507 Open Successful Service-specific Provide Open 4508 authorization answer received Service 4510 Open Failed Service-specific Discon. Idle 4511 authorization answer user/device 4512 received. 4514 Open RAR received and client will Send RAA Open 4515 perform subsequent re-auth with 4516 Result-Code 4517 = SUCCESS 4519 Open RAR received and client will Send RAA Idle 4520 not perform subsequent with 4521 re-auth Result-Code 4522 != SUCCESS, 4523 Discon. 4524 user/device 4526 Open Session-Timeout Expires on Send STR Discon 4527 Access Device 4529 Open ASR Received, Send ASA Discon 4530 client will comply with with 4531 request to end the session Result-Code 4532 = SUCCESS, 4533 Send STR. 4535 Open ASR Received, Send ASA Open 4536 client will not comply with with 4537 request to end the session Result-Code 4538 != SUCCESS 4540 Open Authorization-Lifetime + Send STR Discon 4541 Auth-Grace-Period expires on 4542 access device 4544 Discon ASR Received Send ASA Discon 4546 Discon STA Received Discon. Idle 4547 user/device 4549 The following state machine is observed by a server when it is 4550 maintaining state for the session: 4552 SERVER, STATEFUL 4553 State Event Action New State 4554 ------------------------------------------------------------- 4555 Idle Service-specific authorization Send Open 4556 request received, and successful 4557 user is authorized serv. 4558 specific 4559 answer 4561 Idle Service-specific authorization Send Idle 4562 request received, and failed serv. 4563 user is not authorized specific 4564 answer 4566 Open Service-specific authorization Send Open 4567 request received, and user successful 4568 is authorized serv. specific 4569 answer 4571 Open Service-specific authorization Send Idle 4572 request received, and user failed serv. 4573 is not authorized specific 4574 answer, 4575 Cleanup 4577 Open Home server wants to confirm Send RAR Pending 4578 authentication and/or 4579 authorization of the user 4581 Pending Received RAA with a failed Cleanup Idle 4582 Result-Code 4584 Pending Received RAA with Result-Code Update Open 4585 = SUCCESS session 4587 Open Home server wants to Send ASR Discon 4588 terminate the service 4590 Open Authorization-Lifetime (and Cleanup Idle 4591 Auth-Grace-Period) expires 4592 on home server. 4594 Open Session-Timeout expires on Cleanup Idle 4595 home server 4597 Discon Failure to send ASR Wait, Discon 4598 resend ASR 4600 Discon ASR successfully sent and Cleanup Idle 4601 ASA Received with Result-Code 4603 Not ASA Received None No Change. 4604 Discon 4606 Any STR Received Send STA, Idle 4607 Cleanup. 4609 The following state machine is observed by a client when state is not 4610 maintained on the server: 4612 CLIENT, STATELESS 4613 State Event Action New State 4614 ------------------------------------------------------------- 4615 Idle Client or Device Requests Send Pending 4616 access service 4617 specific 4618 auth req 4620 Pending Successful Service-specific Grant Open 4621 authorization answer Access 4622 received with Auth-Session- 4623 State set to 4624 NO_STATE_MAINTAINED 4626 Pending Failed Service-specific Cleanup Idle 4627 authorization answer 4628 received 4630 Open Session-Timeout Expires on Discon. Idle 4631 Access Device user/device 4633 Open Service to user is terminated Discon. Idle 4634 user/device 4636 The following state machine is observed by a server when it is not 4637 maintaining state for the session: 4639 SERVER, STATELESS 4640 State Event Action New State 4641 ------------------------------------------------------------- 4642 Idle Service-specific authorization Send serv. Idle 4643 request received, and specific 4644 successfully processed answer 4646 8.2. Accounting Session State Machine 4648 The following state machines MUST be supported for applications that 4649 have an accounting portion or that require only accounting services. 4650 The first state machine is to be observed by clients. 4652 See Section 9.7 for Accounting Command Codes and Section 9.8 for 4653 Accounting AVPs. 4655 The server side in the accounting state machine depends in some cases 4656 on the particular application. The Diameter base protocol defines a 4657 default state machine that MUST be followed by all applications that 4658 have not specified other state machines. This is the second state 4659 machine in this section described below. 4661 The default server side state machine requires the reception of 4662 accounting records in any order and at any time, and does not place 4663 any standards requirement on the processing of these records. 4664 Implementations of Diameter MAY perform checking, ordering, 4665 correlation, fraud detection, and other tasks based on these records. 4666 Both base Diameter AVPs as well as application specific AVPs MAY be 4667 inspected as a part of these tasks. The tasks can happen either 4668 immediately after record reception or in a post-processing phase. 4669 However, as these tasks are typically application or even policy 4670 dependent, they are not standardized by the Diameter specifications. 4671 Applications MAY define requirements on when to accept accounting 4672 records based on the used value of Accounting-Realtime-Required AVP, 4673 credit limits checks, and so on. 4675 However, the Diameter base protocol defines one optional server side 4676 state machine that MAY be followed by applications that require 4677 keeping track of the session state at the accounting server. Note 4678 that such tracking is incompatible with the ability to sustain long 4679 duration connectivity problems. Therefore, the use of this state 4680 machine is recommended only in applications where the value of the 4681 Accounting-Realtime-Required AVP is DELIVER_AND_GRANT, and hence 4682 accounting connectivity problems are required to cause the serviced 4683 user to be disconnected. Otherwise, records produced by the client 4684 may be lost by the server which no longer accepts them after the 4685 connectivity is re-established. This state machine is the third 4686 state machine in this section. The state machine is supervised by a 4687 supervision session timer Ts, which the value should be reasonably 4688 higher than the Acct_Interim_Interval value. Ts MAY be set to two 4689 times the value of the Acct_Interim_Interval so as to avoid the 4690 accounting session in the Diameter server to change to Idle state in 4691 case of short transient network failure. 4693 Any event not listed in the state machines MUST be considered as an 4694 error condition, and a corresponding answer, if applicable, MUST be 4695 returned to the originator of the message. 4697 In the state table, the event 'Failure to send' means that the 4698 Diameter client is unable to communicate with the desired 4699 destination. This could be due to the peer being down, or due to the 4700 peer sending back a transient failure or temporary protocol error 4701 notification DIAMETER_OUT_OF_SPACE, DIAMETER_TOO_BUSY, or 4702 DIAMETER_LOOP_DETECTED in the Result-Code AVP of the Accounting 4703 Answer command. 4705 The event 'Failed answer' means that the Diameter client received a 4706 non-transient failure notification in the Accounting Answer command. 4708 Note that the action 'Disconnect user/dev' MUST have an effect also 4709 to the authorization session state table, e.g., cause the STR message 4710 to be sent, if the given application has both authentication/ 4711 authorization and accounting portions. 4713 The states PendingS, PendingI, PendingL, PendingE and PendingB stand 4714 for pending states to wait for an answer to an accounting request 4715 related to a Start, Interim, Stop, Event or buffered record, 4716 respectively. 4718 CLIENT, ACCOUNTING 4719 State Event Action New State 4720 ------------------------------------------------------------- 4721 Idle Client or device requests Send PendingS 4722 access accounting 4723 start req. 4725 Idle Client or device requests Send PendingE 4726 a one-time service accounting 4727 event req 4729 Idle Records in storage Send PendingB 4730 record 4732 PendingS Successful accounting Open 4733 start answer received 4735 PendingS Failure to send and buffer Store Open 4736 space available and realtime Start 4737 not equal to DELIVER_AND_GRANT Record 4739 PendingS Failure to send and no buffer Open 4740 space available and realtime 4741 equal to GRANT_AND_LOSE 4743 PendingS Failure to send and no buffer Disconnect Idle 4744 space available and realtime user/dev 4745 not equal to 4746 GRANT_AND_LOSE 4748 PendingS Failed accounting start answer Open 4749 received and realtime equal 4750 to GRANT_AND_LOSE 4752 PendingS Failed accounting start answer Disconnect Idle 4753 received and realtime not user/dev 4754 equal to GRANT_AND_LOSE 4756 PendingS User service terminated Store PendingS 4757 stop 4758 record 4760 Open Interim interval elapses Send PendingI 4761 accounting 4762 interim 4763 record 4764 Open User service terminated Send PendingL 4765 accounting 4766 stop req. 4768 PendingI Successful accounting interim Open 4769 answer received 4771 PendingI Failure to send and (buffer Store Open 4772 space available or old record interim 4773 can be overwritten) and record 4774 realtime not equal to 4775 DELIVER_AND_GRANT 4777 PendingI Failure to send and no buffer Open 4778 space available and realtime 4779 equal to GRANT_AND_LOSE 4781 PendingI Failure to send and no buffer Disconnect Idle 4782 space available and realtime user/dev 4783 not equal to GRANT_AND_LOSE 4785 PendingI Failed accounting interim Open 4786 answer received and realtime 4787 equal to GRANT_AND_LOSE 4789 PendingI Failed accounting interim Disconnect Idle 4790 answer received and realtime user/dev 4791 not equal to GRANT_AND_LOSE 4793 PendingI User service terminated Store PendingI 4794 stop 4795 record 4796 PendingE Successful accounting Idle 4797 event answer received 4799 PendingE Failure to send and buffer Store Idle 4800 space available event 4801 record 4803 PendingE Failure to send and no buffer Idle 4804 space available 4806 PendingE Failed accounting event answer Idle 4807 received 4809 PendingB Successful accounting answer Delete Idle 4810 received record 4812 PendingB Failure to send Idle 4814 PendingB Failed accounting answer Delete Idle 4815 received record 4817 PendingL Successful accounting Idle 4818 stop answer received 4820 PendingL Failure to send and buffer Store Idle 4821 space available stop 4822 record 4824 PendingL Failure to send and no buffer Idle 4825 space available 4827 PendingL Failed accounting stop answer Idle 4828 received 4830 SERVER, STATELESS ACCOUNTING 4831 State Event Action New State 4832 ------------------------------------------------------------- 4834 Idle Accounting start request Send Idle 4835 received, and successfully accounting 4836 processed. start 4837 answer 4839 Idle Accounting event request Send Idle 4840 received, and successfully accounting 4841 processed. event 4842 answer 4844 Idle Interim record received, Send Idle 4845 and successfully processed. accounting 4846 interim 4847 answer 4849 Idle Accounting stop request Send Idle 4850 received, and successfully accounting 4851 processed stop answer 4853 Idle Accounting request received, Send Idle 4854 no space left to store accounting 4855 records answer, 4856 Result-Code 4857 = OUT_OF_ 4858 SPACE 4860 SERVER, STATEFUL ACCOUNTING 4861 State Event Action New State 4862 ------------------------------------------------------------- 4864 Idle Accounting start request Send Open 4865 received, and successfully accounting 4866 processed. start 4867 answer, 4868 Start Ts 4870 Idle Accounting event request Send Idle 4871 received, and successfully accounting 4872 processed. event 4873 answer 4875 Idle Accounting request received, Send Idle 4876 no space left to store accounting 4877 records answer, 4878 Result-Code 4879 = OUT_OF_ 4880 SPACE 4882 Open Interim record received, Send Open 4883 and successfully processed. accounting 4884 interim 4885 answer, 4886 Restart Ts 4888 Open Accounting stop request Send Idle 4889 received, and successfully accounting 4890 processed stop answer, 4891 Stop Ts 4893 Open Accounting request received, Send Idle 4894 no space left to store accounting 4895 records answer, 4896 Result-Code 4897 = OUT_OF_ 4898 SPACE, 4899 Stop Ts 4901 Open Session supervision timer Ts Stop Ts Idle 4902 expired 4904 8.3. Server-Initiated Re-Auth 4906 A Diameter server may initiate a re-authentication and/or re- 4907 authorization service for a particular session by issuing a Re-Auth- 4908 Request (RAR). 4910 For example, for pre-paid services, the Diameter server that 4911 originally authorized a session may need some confirmation that the 4912 user is still using the services. 4914 An access device that receives a RAR message with Session-Id equal to 4915 a currently active session MUST initiate a re-auth towards the user, 4916 if the service supports this particular feature. Each Diameter 4917 application MUST state whether service-initiated re-auth is 4918 supported, since some applications do not allow access devices to 4919 prompt the user for re-auth. 4921 8.3.1. Re-Auth-Request 4923 The Re-Auth-Request (RAR), indicated by the Command-Code set to 258 4924 and the message flags' 'R' bit set, may be sent by any server to the 4925 access device that is providing session service, to request that the 4926 user be re-authenticated and/or re-authorized. 4928 Message Format 4930 ::= < Diameter Header: 258, REQ, PXY > 4931 < Session-Id > 4932 { Origin-Host } 4933 { Origin-Realm } 4934 { Destination-Realm } 4935 { Destination-Host } 4936 { Auth-Application-Id } 4937 { Re-Auth-Request-Type } 4938 [ User-Name ] 4939 [ Origin-State-Id ] 4940 * [ Proxy-Info ] 4941 * [ Route-Record ] 4942 * [ AVP ] 4944 8.3.2. Re-Auth-Answer 4946 The Re-Auth-Answer (RAA), indicated by the Command-Code set to 258 4947 and the message flags' 'R' bit clear, is sent in response to the RAR. 4948 The Result-Code AVP MUST be present, and indicates the disposition of 4949 the request. 4951 A successful RAA message MUST be followed by an application-specific 4952 authentication and/or authorization message. 4954 Message Format 4956 ::= < Diameter Header: 258, PXY > 4957 < Session-Id > 4958 { Result-Code } 4959 { Origin-Host } 4960 { Origin-Realm } 4961 [ User-Name ] 4962 [ Origin-State-Id ] 4963 [ Error-Message ] 4964 [ Error-Reporting-Host ] 4965 [ Failed-AVP ] 4966 * [ Redirect-Host ] 4967 [ Redirect-Host-Usage ] 4968 [ Redirect-Max-Cache-Time ] 4969 * [ Proxy-Info ] 4970 * [ AVP ] 4972 8.4. Session Termination 4974 It is necessary for a Diameter server that authorized a session, for 4975 which it is maintaining state, to be notified when that session is no 4976 longer active, both for tracking purposes as well as to allow 4977 stateful agents to release any resources that they may have provided 4978 for the user's session. For sessions whose state is not being 4979 maintained, this section is not used. 4981 When a user session that required Diameter authorization terminates, 4982 the access device that provided the service MUST issue a Session- 4983 Termination-Request (STR) message to the Diameter server that 4984 authorized the service, to notify it that the session is no longer 4985 active. An STR MUST be issued when a user session terminates for any 4986 reason, including user logoff, expiration of Session-Timeout, 4987 administrative action, termination upon receipt of an Abort-Session- 4988 Request (see below), orderly shutdown of the access device, etc. 4990 The access device also MUST issue an STR for a session that was 4991 authorized but never actually started. This could occur, for 4992 example, due to a sudden resource shortage in the access device, or 4993 because the access device is unwilling to provide the type of service 4994 requested in the authorization, or because the access device does not 4995 support a mandatory AVP returned in the authorization, etc. 4997 It is also possible that a session that was authorized is never 4998 actually started due to action of a proxy. For example, a proxy may 4999 modify an authorization answer, converting the result from success to 5000 failure, prior to forwarding the message to the access device. If 5001 the answer did not contain an Auth-Session-State AVP with the value 5002 NO_STATE_MAINTAINED, a proxy that causes an authorized session not to 5003 be started MUST issue an STR to the Diameter server that authorized 5004 the session, since the access device has no way of knowing that the 5005 session had been authorized. 5007 A Diameter server that receives an STR message MUST clean up 5008 resources (e.g., session state) associated with the Session-Id 5009 specified in the STR, and return a Session-Termination-Answer. 5011 A Diameter server also MUST clean up resources when the Session- 5012 Timeout expires, or when the Authorization-Lifetime and the Auth- 5013 Grace-Period AVPs expires without receipt of a re-authorization 5014 request, regardless of whether an STR for that session is received. 5015 The access device is not expected to provide service beyond the 5016 expiration of these timers; thus, expiration of either of these 5017 timers implies that the access device may have unexpectedly shut 5018 down. 5020 8.4.1. Session-Termination-Request 5022 The Session-Termination-Request (STR), indicated by the Command-Code 5023 set to 275 and the Command Flags' 'R' bit set, is sent by the access 5024 device to inform the Diameter Server that an authenticated and/or 5025 authorized session is being terminated. 5027 Message Format 5029 ::= < Diameter Header: 275, REQ, PXY > 5030 < Session-Id > 5031 { Origin-Host } 5032 { Origin-Realm } 5033 { Destination-Realm } 5034 { Auth-Application-Id } 5035 { Termination-Cause } 5036 [ User-Name ] 5037 [ Destination-Host ] 5038 * [ Class ] 5039 [ Origin-State-Id ] 5040 * [ Proxy-Info ] 5041 * [ Route-Record ] 5042 * [ AVP ] 5044 8.4.2. Session-Termination-Answer 5046 The Session-Termination-Answer (STA), indicated by the Command-Code 5047 set to 275 and the message flags' 'R' bit clear, is sent by the 5048 Diameter Server to acknowledge the notification that the session has 5049 been terminated. The Result-Code AVP MUST be present, and MAY 5050 contain an indication that an error occurred while servicing the STR. 5052 Upon sending or receipt of the STA, the Diameter Server MUST release 5053 all resources for the session indicated by the Session-Id AVP. Any 5054 intermediate server in the Proxy-Chain MAY also release any 5055 resources, if necessary. 5057 Message Format 5059 ::= < Diameter Header: 275, PXY > 5060 < Session-Id > 5061 { Result-Code } 5062 { Origin-Host } 5063 { Origin-Realm } 5064 [ User-Name ] 5065 * [ Class ] 5066 [ Error-Message ] 5067 [ Error-Reporting-Host ] 5068 [ Failed-AVP ] 5069 [ Origin-State-Id ] 5070 * [ Redirect-Host ] 5071 [ Redirect-Host-Usage ] 5072 ^ 5073 [ Redirect-Max-Cache-Time ] 5074 * [ Proxy-Info ] 5075 * [ AVP ] 5077 8.5. Aborting a Session 5079 A Diameter server may request that the access device stop providing 5080 service for a particular session by issuing an Abort-Session-Request 5081 (ASR). 5083 For example, the Diameter server that originally authorized the 5084 session may be required to cause that session to be stopped for 5085 credit or other reasons that were not anticipated when the session 5086 was first authorized. On the other hand, an operator may maintain a 5087 management server for the purpose of issuing ASRs to administratively 5088 remove users from the network. 5090 An access device that receives an ASR with Session-ID equal to a 5091 currently active session MAY stop the session. Whether the access 5092 device stops the session or not is implementation- and/or 5093 configuration-dependent. For example, an access device may honor 5094 ASRs from certain agents only. In any case, the access device MUST 5095 respond with an Abort-Session-Answer, including a Result-Code AVP to 5096 indicate what action it took. 5098 Note that if the access device does stop the session upon receipt of 5099 an ASR, it issues an STR to the authorizing server (which may or may 5100 not be the agent issuing the ASR) just as it would if the session 5101 were terminated for any other reason. 5103 8.5.1. Abort-Session-Request 5105 The Abort-Session-Request (ASR), indicated by the Command-Code set to 5106 274 and the message flags' 'R' bit set, may be sent by any server to 5107 the access device that is providing session service, to request that 5108 the session identified by the Session-Id be stopped. 5110 Message Format 5112 ::= < Diameter Header: 274, REQ, PXY > 5113 < Session-Id > 5114 { Origin-Host } 5115 { Origin-Realm } 5116 { Destination-Realm } 5117 { Destination-Host } 5118 { Auth-Application-Id } 5119 [ User-Name ] 5120 [ Origin-State-Id ] 5121 * [ Proxy-Info ] 5122 * [ Route-Record ] 5123 * [ AVP ] 5125 8.5.2. Abort-Session-Answer 5127 The Abort-Session-Answer (ASA), indicated by the Command-Code set to 5128 274 and the message flags' 'R' bit clear, is sent in response to the 5129 ASR. The Result-Code AVP MUST be present, and indicates the 5130 disposition of the request. 5132 If the session identified by Session-Id in the ASR was successfully 5133 terminated, Result-Code is set to DIAMETER_SUCCESS. If the session 5134 is not currently active, Result-Code is set to 5135 DIAMETER_UNKNOWN_SESSION_ID. If the access device does not stop the 5136 session for any other reason, Result-Code is set to 5137 DIAMETER_UNABLE_TO_COMPLY. 5139 Message Format 5141 ::= < Diameter Header: 274, PXY > 5142 < Session-Id > 5143 { Result-Code } 5144 { Origin-Host } 5145 { Origin-Realm } 5146 [ User-Name ] 5147 [ Origin-State-Id ] 5148 [ Error-Message ] 5149 [ Error-Reporting-Host ] 5150 [ Failed-AVP ] 5151 * [ Redirect-Host ] 5152 [ Redirect-Host-Usage ] 5153 [ Redirect-Max-Cache-Time ] 5154 * [ Proxy-Info ] 5155 * [ AVP ] 5157 8.6. Inferring Session Termination from Origin-State-Id 5159 Origin-State-Id is used to allow rapid detection of terminated 5160 sessions for which no STR would have been issued, due to 5161 unanticipated shutdown of an access device. 5163 By including Origin-State-Id in CER/CEA messages, an access device 5164 allows a next-hop server to determine immediately upon connection 5165 whether the device has lost its sessions since the last connection. 5167 By including Origin-State-Id in request messages, an access device 5168 also allows a server with which it communicates via proxy to make 5169 such a determination. However, a server that is not directly 5170 connected with the access device will not discover that the access 5171 device has been restarted unless and until it receives a new request 5172 from the access device. Thus, use of this mechanism across proxies 5173 is opportunistic rather than reliable, but useful nonetheless. 5175 When a Diameter server receives an Origin-State-Id that is greater 5176 than the Origin-State-Id previously received from the same issuer, it 5177 may assume that the issuer has lost state since the previous message 5178 and that all sessions that were active under the lower Origin-State- 5179 Id have been terminated. The Diameter server MAY clean up all 5180 session state associated with such lost sessions, and MAY also issues 5181 STRs for all such lost sessions that were authorized on upstream 5182 servers, to allow session state to be cleaned up globally. 5184 8.7. Auth-Request-Type AVP 5186 The Auth-Request-Type AVP (AVP Code 274) is of type Enumerated and is 5187 included in application-specific auth requests to inform the peers 5188 whether a user is to be authenticated only, authorized only or both. 5189 Note any value other than both MAY cause RADIUS interoperability 5190 issues. The following values are defined: 5192 AUTHENTICATE_ONLY 1 5194 The request being sent is for authentication only, and MUST 5195 contain the relevant application specific authentication AVPs that 5196 are needed by the Diameter server to authenticate the user. 5198 AUTHORIZE_ONLY 2 5200 The request being sent is for authorization only, and MUST contain 5201 the application specific authorization AVPs that are necessary to 5202 identify the service being requested/offered. 5204 AUTHORIZE_AUTHENTICATE 3 5206 The request contains a request for both authentication and 5207 authorization. The request MUST include both the relevant 5208 application specific authentication information, and authorization 5209 information necessary to identify the service being requested/ 5210 offered. 5212 8.8. Session-Id AVP 5214 The Session-Id AVP (AVP Code 263) is of type UTF8String and is used 5215 to identify a specific session (see Section 8). All messages 5216 pertaining to a specific session MUST include only one Session-Id AVP 5217 and the same value MUST be used throughout the life of a session. 5218 When present, the Session-Id SHOULD appear immediately following the 5219 Diameter Header (see Section 3). 5221 The Session-Id MUST be globally and eternally unique, as it is meant 5222 to uniquely identify a user session without reference to any other 5223 information, and may be needed to correlate historical authentication 5224 information with accounting information. The Session-Id includes a 5225 mandatory portion and an implementation-defined portion; a 5226 recommended format for the implementation-defined portion is outlined 5227 below. 5229 The Session-Id MUST begin with the sender's identity encoded in the 5230 DiameterIdentity type (see Section 4.4). The remainder of the 5231 Session-Id is delimited by a ";" character, and MAY be any sequence 5232 that the client can guarantee to be eternally unique; however, the 5233 following format is recommended, (square brackets [] indicate an 5234 optional element): 5236 ;;[;] 5238 and are decimal representations of the 5239 high and low 32 bits of a monotonically increasing 64-bit value. The 5240 64-bit value is rendered in two part to simplify formatting by 32-bit 5241 processors. At startup, the high 32 bits of the 64-bit value MAY be 5242 initialized to the time, and the low 32 bits MAY be initialized to 5243 zero. This will for practical purposes eliminate the possibility of 5244 overlapping Session-Ids after a reboot, assuming the reboot process 5245 takes longer than a second. Alternatively, an implementation MAY 5246 keep track of the increasing value in non-volatile memory. 5248 is implementation specific but may include a modem's 5249 device Id, a layer 2 address, timestamp, etc. 5251 Example, in which there is no optional value: 5253 accesspoint7.acme.com;1876543210;523 5255 Example, in which there is an optional value: 5257 accesspoint7.acme.com;1876543210;523;mobile@200.1.1.88 5259 The Session-Id is created by the Diameter application initiating the 5260 session, which in most cases is done by the client. Note that a 5261 Session-Id MAY be used for both the authorization and accounting 5262 commands of a given application. 5264 8.9. Authorization-Lifetime AVP 5266 The Authorization-Lifetime AVP (AVP Code 291) is of type Unsigned32 5267 and contains the maximum number of seconds of service to be provided 5268 to the user before the user is to be re-authenticated and/or re- 5269 authorized. Great care should be taken when the Authorization- 5270 Lifetime value is determined, since a low, non-zero, value could 5271 create significant Diameter traffic, which could congest both the 5272 network and the agents. 5274 A value of zero (0) means that immediate re-auth is necessary by the 5275 access device. This is typically used in cases where multiple 5276 authentication methods are used, and a successful auth response with 5277 this AVP set to zero is used to signal that the next authentication 5278 method is to be immediately initiated. The absence of this AVP, or a 5279 value of all ones (meaning all bits in the 32 bit field are set to 5280 one) means no re-auth is expected. 5282 If both this AVP and the Session-Timeout AVP are present in a 5283 message, the value of the latter MUST NOT be smaller than the 5284 Authorization-Lifetime AVP. 5286 An Authorization-Lifetime AVP MAY be present in re-authorization 5287 messages, and contains the number of seconds the user is authorized 5288 to receive service from the time the re-auth answer message is 5289 received by the access device. 5291 This AVP MAY be provided by the client as a hint of the maximum 5292 lifetime that it is willing to accept. However, the server MAY 5293 return a value that is equal to, or smaller, than the one provided by 5294 the client. 5296 8.10. Auth-Grace-Period AVP 5298 The Auth-Grace-Period AVP (AVP Code 276) is of type Unsigned32 and 5299 contains the number of seconds the Diameter server will wait 5300 following the expiration of the Authorization-Lifetime AVP before 5301 cleaning up resources for the session. 5303 8.11. Auth-Session-State AVP 5305 The Auth-Session-State AVP (AVP Code 277) is of type Enumerated and 5306 specifies whether state is maintained for a particular session. The 5307 client MAY include this AVP in requests as a hint to the server, but 5308 the value in the server's answer message is binding. The following 5309 values are supported: 5311 STATE_MAINTAINED 0 5313 This value is used to specify that session state is being 5314 maintained, and the access device MUST issue a session termination 5315 message when service to the user is terminated. This is the 5316 default value. 5318 NO_STATE_MAINTAINED 1 5320 This value is used to specify that no session termination messages 5321 will be sent by the access device upon expiration of the 5322 Authorization-Lifetime. 5324 8.12. Re-Auth-Request-Type AVP 5326 The Re-Auth-Request-Type AVP (AVP Code 285) is of type Enumerated and 5327 is included in application-specific auth answers to inform the client 5328 of the action expected upon expiration of the Authorization-Lifetime. 5329 If the answer message contains an Authorization-Lifetime AVP with a 5330 positive value, the Re-Auth-Request-Type AVP MUST be present in an 5331 answer message. The following values are defined: 5333 AUTHORIZE_ONLY 0 5335 An authorization only re-auth is expected upon expiration of the 5336 Authorization-Lifetime. This is the default value if the AVP is 5337 not present in answer messages that include the Authorization- 5338 Lifetime. 5340 AUTHORIZE_AUTHENTICATE 1 5342 An authentication and authorization re-auth is expected upon 5343 expiration of the Authorization-Lifetime. 5345 8.13. Session-Timeout AVP 5347 The Session-Timeout AVP (AVP Code 27) [RFC2865] is of type Unsigned32 5348 and contains the maximum number of seconds of service to be provided 5349 to the user before termination of the session. When both the 5350 Session-Timeout and the Authorization-Lifetime AVPs are present in an 5351 answer message, the former MUST be equal to or greater than the value 5352 of the latter. 5354 A session that terminates on an access device due to the expiration 5355 of the Session-Timeout MUST cause an STR to be issued, unless both 5356 the access device and the home server had previously agreed that no 5357 session termination messages would be sent (see Section 8.9). 5359 A Session-Timeout AVP MAY be present in a re-authorization answer 5360 message, and contains the remaining number of seconds from the 5361 beginning of the re-auth. 5363 A value of zero, or the absence of this AVP, means that this session 5364 has an unlimited number of seconds before termination. 5366 This AVP MAY be provided by the client as a hint of the maximum 5367 timeout that it is willing to accept. However, the server MAY return 5368 a value that is equal to, or smaller, than the one provided by the 5369 client. 5371 8.14. User-Name AVP 5373 The User-Name AVP (AVP Code 1) [RFC2865] is of type UTF8String, which 5374 contains the User-Name, in a format consistent with the NAI 5375 specification [RFC4282]. 5377 8.15. Termination-Cause AVP 5379 The Termination-Cause AVP (AVP Code 295) is of type Enumerated, and 5380 is used to indicate the reason why a session was terminated on the 5381 access device. The following values are defined: 5383 DIAMETER_LOGOUT 1 5385 The user initiated a disconnect 5387 DIAMETER_SERVICE_NOT_PROVIDED 2 5389 This value is used when the user disconnected prior to the receipt 5390 of the authorization answer message. 5392 DIAMETER_BAD_ANSWER 3 5394 This value indicates that the authorization answer received by the 5395 access device was not processed successfully. 5397 DIAMETER_ADMINISTRATIVE 4 5399 The user was not granted access, or was disconnected, due to 5400 administrative reasons, such as the receipt of a Abort-Session- 5401 Request message. 5403 DIAMETER_LINK_BROKEN 5 5405 The communication to the user was abruptly disconnected. 5407 DIAMETER_AUTH_EXPIRED 6 5409 The user's access was terminated since its authorized session time 5410 has expired. 5412 DIAMETER_USER_MOVED 7 5414 The user is receiving services from another access device. 5416 DIAMETER_SESSION_TIMEOUT 8 5418 The user's session has timed out, and service has been terminated. 5420 8.16. Origin-State-Id AVP 5422 The Origin-State-Id AVP (AVP Code 278), of type Unsigned32, is a 5423 monotonically increasing value that is advanced whenever a Diameter 5424 entity restarts with loss of previous state, for example upon reboot. 5425 Origin-State-Id MAY be included in any Diameter message, including 5426 CER. 5428 A Diameter entity issuing this AVP MUST create a higher value for 5429 this AVP each time its state is reset. A Diameter entity MAY set 5430 Origin-State-Id to the time of startup, or it MAY use an incrementing 5431 counter retained in non-volatile memory across restarts. 5433 The Origin-State-Id, if present, MUST reflect the state of the entity 5434 indicated by Origin-Host. If a proxy modifies Origin-Host, it MUST 5435 either remove Origin-State-Id or modify it appropriately as well. 5436 Typically, Origin-State-Id is used by an access device that always 5437 starts up with no active sessions; that is, any session active prior 5438 to restart will have been lost. By including Origin-State-Id in a 5439 message, it allows other Diameter entities to infer that sessions 5440 associated with a lower Origin-State-Id are no longer active. If an 5441 access device does not intend for such inferences to be made, it MUST 5442 either not include Origin-State-Id in any message, or set its value 5443 to 0. 5445 8.17. Session-Binding AVP 5447 The Session-Binding AVP (AVP Code 270) is of type Unsigned32, and MAY 5448 be present in application-specific authorization answer messages. If 5449 present, this AVP MAY inform the Diameter client that all future 5450 application-specific re-auth messages for this session MUST be sent 5451 to the same authorization server. This AVP MAY also specify that a 5452 Session-Termination-Request message for this session MUST be sent to 5453 the same authorizing server. 5455 This field is a bit mask, and the following bits have been defined: 5457 RE_AUTH 1 5459 When set, future re-auth messages for this session MUST NOT 5460 include the Destination-Host AVP. When cleared, the default 5461 value, the Destination-Host AVP MUST be present in all re-auth 5462 messages for this session. 5464 STR 2 5466 When set, the STR message for this session MUST NOT include the 5467 Destination-Host AVP. When cleared, the default value, the 5468 Destination-Host AVP MUST be present in the STR message for this 5469 session. 5471 ACCOUNTING 4 5473 When set, all accounting messages for this session MUST NOT 5474 include the Destination-Host AVP. When cleared, the default 5475 value, the Destination-Host AVP, if known, MUST be present in all 5476 accounting messages for this session. 5478 8.18. Session-Server-Failover AVP 5480 The Session-Server-Failover AVP (AVP Code 271) is of type Enumerated, 5481 and MAY be present in application-specific authorization answer 5482 messages that either do not include the Session-Binding AVP or 5483 include the Session-Binding AVP with any of the bits set to a zero 5484 value. If present, this AVP MAY inform the Diameter client that if a 5485 re-auth or STR message fails due to a delivery problem, the Diameter 5486 client SHOULD issue a subsequent message without the Destination-Host 5487 AVP. When absent, the default value is REFUSE_SERVICE. 5489 The following values are supported: 5491 REFUSE_SERVICE 0 5493 If either the re-auth or the STR message delivery fails, terminate 5494 service with the user, and do not attempt any subsequent attempts. 5496 TRY_AGAIN 1 5498 If either the re-auth or the STR message delivery fails, resend 5499 the failed message without the Destination-Host AVP present. 5501 ALLOW_SERVICE 2 5503 If re-auth message delivery fails, assume that re-authorization 5504 succeeded. If STR message delivery fails, terminate the session. 5506 TRY_AGAIN_ALLOW_SERVICE 3 5508 If either the re-auth or the STR message delivery fails, resend 5509 the failed message without the Destination-Host AVP present. If 5510 the second delivery fails for re-auth, assume re-authorization 5511 succeeded. If the second delivery fails for STR, terminate the 5512 session. 5514 8.19. Multi-Round-Time-Out AVP 5516 The Multi-Round-Time-Out AVP (AVP Code 272) is of type Unsigned32, 5517 and SHOULD be present in application-specific authorization answer 5518 messages whose Result-Code AVP is set to DIAMETER_MULTI_ROUND_AUTH. 5519 This AVP contains the maximum number of seconds that the access 5520 device MUST provide the user in responding to an authentication 5521 request. 5523 8.20. Class AVP 5525 The Class AVP (AVP Code 25) is of type OctetString and is used to by 5526 Diameter servers to return state information to the access device. 5527 When one or more Class AVPs are present in application-specific 5528 authorization answer messages, they MUST be present in subsequent re- 5529 authorization, session termination and accounting messages. Class 5530 AVPs found in a re-authorization answer message override the ones 5531 found in any previous authorization answer message. Diameter server 5532 implementations SHOULD NOT return Class AVPs that require more than 5533 4096 bytes of storage on the Diameter client. A Diameter client that 5534 receives Class AVPs whose size exceeds local available storage MUST 5535 terminate the session. 5537 8.21. Event-Timestamp AVP 5539 The Event-Timestamp (AVP Code 55) is of type Time, and MAY be 5540 included in an Accounting-Request and Accounting-Answer messages to 5541 record the time that the reported event occurred, in seconds since 5542 January 1, 1900 00:00 UTC. 5544 9. Accounting 5546 This accounting protocol is based on a server directed model with 5547 capabilities for real-time delivery of accounting information. 5548 Several fault resilience methods [RFC2975] have been built in to the 5549 protocol in order minimize loss of accounting data in various fault 5550 situations and under different assumptions about the capabilities of 5551 the used devices. 5553 9.1. Server Directed Model 5555 The server directed model means that the device generating the 5556 accounting data gets information from either the authorization server 5557 (if contacted) or the accounting server regarding the way accounting 5558 data shall be forwarded. This information includes accounting record 5559 timeliness requirements. 5561 As discussed in [RFC2975], real-time transfer of accounting records 5562 is a requirement, such as the need to perform credit limit checks and 5563 fraud detection. Note that batch accounting is not a requirement, 5564 and is therefore not supported by Diameter. Should batched 5565 accounting be required in the future, a new Diameter application will 5566 need to be created, or it could be handled using another protocol. 5567 Note, however, that even if at the Diameter layer accounting requests 5568 are processed one by one, transport protocols used under Diameter 5569 typically batch several requests in the same packet under heavy 5570 traffic conditions. This may be sufficient for many applications. 5572 The authorization server (chain) directs the selection of proper 5573 transfer strategy, based on its knowledge of the user and 5574 relationships of roaming partnerships. The server (or agents) uses 5575 the Acct-Interim-Interval and Accounting-Realtime-Required AVPs to 5576 control the operation of the Diameter peer operating as a client. 5577 The Acct-Interim-Interval AVP, when present, instructs the Diameter 5578 node acting as a client to produce accounting records continuously 5579 even during a session. Accounting-Realtime-Required AVP is used to 5580 control the behavior of the client when the transfer of accounting 5581 records from the Diameter client is delayed or unsuccessful. 5583 The Diameter accounting server MAY override the interim interval or 5584 the realtime requirements by including the Acct-Interim-Interval or 5585 Accounting-Realtime-Required AVP in the Accounting-Answer message. 5586 When one of these AVPs is present, the latest value received SHOULD 5587 be used in further accounting activities for the same session. 5589 9.2. Protocol Messages 5591 A Diameter node that receives a successful authentication and/or 5592 authorization messages from the Home AAA server MUST collect 5593 accounting information for the session. The Accounting-Request 5594 message is used to transmit the accounting information to the Home 5595 AAA server, which MUST reply with the Accounting-Answer message to 5596 confirm reception. The Accounting-Answer message includes the 5597 Result-Code AVP, which MAY indicate that an error was present in the 5598 accounting message. A rejected Accounting-Request message MAY cause 5599 the user's session to be terminated, depending on the value of the 5600 Accounting-Realtime-Required AVP received earlier for the session in 5601 question. 5603 Each Diameter Accounting protocol message MAY be compressed, in order 5604 to reduce network bandwidth usage. If TLS is used to secure the 5605 Diameter session, then TLS compression [RFC4346] MAY be used. 5607 9.3. Accounting Application Extension and Requirements 5609 Each Diameter application (e.g., NASREQ, MobileIP), MUST define their 5610 Service-Specific AVPs that MUST be present in the Accounting-Request 5611 message in a section entitled "Accounting AVPs". The application 5612 MUST assume that the AVPs described in this document will be present 5613 in all Accounting messages, so only their respective service-specific 5614 AVPs need to be defined in this section. 5616 Applications have the option of using one or both of the following 5617 accounting application extension models: 5619 Split Accounting Service 5621 The accounting message will carry the application identifier of 5622 the Diameter base accounting application (see Section 2.4). 5623 Accounting messages maybe routed to Diameter nodes other than the 5624 corresponding Diameter application. These nodes might be 5625 centralized accounting servers that provide accounting service for 5626 multiple different Diameter applications. These nodes MUST 5627 advertise the Diameter base accounting application identifier 5628 during capabilities exchange. 5630 Accounting messages which uses the Diameter base accounting 5631 application identifier in its header MUST include the application 5632 identifier of the Diameter application it is providing service for 5633 in the Acct-Application-Id AVP. This allows the accounting server 5634 to determine which Diameter application the accounting records are 5635 for. 5637 Coupled Accounting Service 5639 The accounting messages will carry the application identifier of 5640 the application that is using it. The application itself will 5641 process the received accounting records or forward them to an 5642 accounting server. There is no accounting application 5643 advertisement required during capabilities exchange and the 5644 accounting messages will be routed the same as any of the other 5645 application messages. 5647 In cases where an application does not define its own accounting 5648 service, it is preferred that the split accounting model be used. 5650 9.4. Fault Resilience 5652 Diameter Base protocol mechanisms are used to overcome small message 5653 loss and network faults of temporary nature. 5655 Diameter peers acting as clients MUST implement the use of failover 5656 to guard against server failures and certain network failures. 5657 Diameter peers acting as agents or related off-line processing 5658 systems MUST detect duplicate accounting records caused by the 5659 sending of same record to several servers and duplication of messages 5660 in transit. This detection MUST be based on the inspection of the 5661 Session-Id and Accounting-Record-Number AVP pairs. Appendix C 5662 discusses duplicate detection needs and implementation issues. 5664 Diameter clients MAY have non-volatile memory for the safe storage of 5665 accounting records over reboots or extended network failures, network 5666 partitions, and server failures. If such memory is available, the 5667 client SHOULD store new accounting records there as soon as the 5668 records are created and until a positive acknowledgement of their 5669 reception from the Diameter Server has been received. Upon a reboot, 5670 the client MUST starting sending the records in the non-volatile 5671 memory to the accounting server with appropriate modifications in 5672 termination cause, session length, and other relevant information in 5673 the records. 5675 A further application of this protocol may include AVPs to control 5676 how many accounting records may at most be stored in the Diameter 5677 client without committing them to the non-volatile memory or 5678 transferring them to the Diameter server. 5680 The client SHOULD NOT remove the accounting data from any of its 5681 memory areas before the correct Accounting-Answer has been received. 5682 The client MAY remove oldest, undelivered or yet unacknowledged 5683 accounting data if it runs out of resources such as memory. It is an 5684 implementation dependent matter for the client to accept new sessions 5685 under this condition. 5687 9.5. Accounting Records 5689 In all accounting records, the Session-Id AVP MUST be present; the 5690 User-Name AVP MUST be present if it is available to the Diameter 5691 client. 5693 Different types of accounting records are sent depending on the 5694 actual type of accounted service and the authorization server's 5695 directions for interim accounting. If the accounted service is a 5696 one-time event, meaning that the start and stop of the event are 5697 simultaneous, then the Accounting-Record-Type AVP MUST be present and 5698 set to the value EVENT_RECORD. 5700 If the accounted service is of a measurable length, then the AVP MUST 5701 use the values START_RECORD, STOP_RECORD, and possibly, 5702 INTERIM_RECORD. If the authorization server has not directed interim 5703 accounting to be enabled for the session, two accounting records MUST 5704 be generated for each service of type session. When the initial 5705 Accounting-Request for a given session is sent, the Accounting- 5706 Record-Type AVP MUST be set to the value START_RECORD. When the last 5707 Accounting-Request is sent, the value MUST be STOP_RECORD. 5709 If the authorization server has directed interim accounting to be 5710 enabled, the Diameter client MUST produce additional records between 5711 the START_RECORD and STOP_RECORD, marked INTERIM_RECORD. The 5712 production of these records is directed by Acct-Interim-Interval as 5713 well as any re-authentication or re-authorization of the session. 5714 The Diameter client MUST overwrite any previous interim accounting 5715 records that are locally stored for delivery, if a new record is 5716 being generated for the same session. This ensures that only one 5717 pending interim record can exist on an access device for any given 5718 session. 5720 A particular value of Accounting-Sub-Session-Id MUST appear only in 5721 one sequence of accounting records from a DIAMETER client, except for 5722 the purposes of retransmission. The one sequence that is sent MUST 5723 be either one record with Accounting-Record-Type AVP set to the value 5724 EVENT_RECORD, or several records starting with one having the value 5725 START_RECORD, followed by zero or more INTERIM_RECORD and a single 5726 STOP_RECORD. A particular Diameter application specification MUST 5727 define the type of sequences that MUST be used. 5729 9.6. Correlation of Accounting Records 5731 The Diameter protocol's Session-Id AVP, which is globally unique (see 5732 Section 8.8), is used during the authorization phase to identify a 5733 particular session. Services that do not require any authorization 5734 still use the Session-Id AVP to identify sessions. Accounting 5735 messages MAY use a different Session-Id from that sent in 5736 authorization messages. Specific applications MAY require different 5737 a Session-ID for accounting messages. 5739 However, there are certain applications that require multiple 5740 accounting sub-sessions. Such applications would send messages with 5741 a constant Session-Id AVP, but a different Accounting-Sub-Session-Id 5742 AVP. In these cases, correlation is performed using the Session-Id. 5743 It is important to note that receiving a STOP_RECORD with no 5744 Accounting-Sub-Session-Id AVP when sub-sessions were originally used 5745 in the START_RECORD messages implies that all sub-sessions are 5746 terminated. 5748 Furthermore, there are certain applications where a user receives 5749 service from different access devices (e.g., Mobile IPv4), each with 5750 their own unique Session-Id. In such cases, the Acct-Multi-Session- 5751 Id AVP is used for correlation. During authorization, a server that 5752 determines that a request is for an existing session SHOULD include 5753 the Acct-Multi-Session-Id AVP, which the access device MUST include 5754 in all subsequent accounting messages. 5756 The Acct-Multi-Session-Id AVP MAY include the value of the original 5757 Session-Id. It's contents are implementation specific, but MUST be 5758 globally unique across other Acct-Multi-Session-Id, and MUST NOT 5759 change during the life of a session. 5761 A Diameter application document MUST define the exact concept of a 5762 session that is being accounted, and MAY define the concept of a 5763 multi-session. For instance, the NASREQ DIAMETER application treats 5764 a single PPP connection to a Network Access Server as one session, 5765 and a set of Multilink PPP sessions as one multi-session. 5767 9.7. Accounting Command-Codes 5769 This section defines Command-Code values that MUST be supported by 5770 all Diameter implementations that provide Accounting services. 5772 9.7.1. Accounting-Request 5774 The Accounting-Request (ACR) command, indicated by the Command-Code 5775 field set to 271 and the Command Flags' 'R' bit set, is sent by a 5776 Diameter node, acting as a client, in order to exchange accounting 5777 information with a peer. 5779 One of Acct-Application-Id and Vendor-Specific-Application-Id AVPs 5780 MUST be present. If the Vendor-Specific-Application-Id grouped AVP 5781 is present, it must have an Acct-Application-Id inside. 5783 The AVP listed below SHOULD include service specific accounting AVPs, 5784 as described in Section 9.3. 5786 Message Format 5788 ::= < Diameter Header: 271, REQ, PXY > 5789 < Session-Id > 5790 { Origin-Host } 5791 { Origin-Realm } 5792 { Destination-Realm } 5793 { Accounting-Record-Type } 5794 { Accounting-Record-Number } 5795 [ Acct-Application-Id ] 5796 [ Vendor-Specific-Application-Id ] 5797 [ User-Name ] 5798 [ Destination-Host ] 5799 [ Accounting-Sub-Session-Id ] 5800 [ Acct-Session-Id ] 5801 [ Acct-Multi-Session-Id ] 5802 [ Acct-Interim-Interval ] 5803 [ Accounting-Realtime-Required ] 5804 [ Origin-State-Id ] 5805 [ Event-Timestamp ] 5806 * [ Proxy-Info ] 5807 * [ Route-Record ] 5808 * [ AVP ] 5810 9.7.2. Accounting-Answer 5812 The Accounting-Answer (ACA) command, indicated by the Command-Code 5813 field set to 271 and the Command Flags' 'R' bit cleared, is used to 5814 acknowledge an Accounting-Request command. The Accounting-Answer 5815 command contains the same Session-Id as the corresponding request. 5817 Only the target Diameter Server, known as the home Diameter Server, 5818 SHOULD respond with the Accounting-Answer command. 5820 One of Acct-Application-Id and Vendor-Specific-Application-Id AVPs 5821 MUST be present. If the Vendor-Specific-Application-Id grouped AVP 5822 is present, it must have an Acct-Application-Id inside. 5824 The AVP listed below SHOULD include service specific accounting AVPs, 5825 as described in Section 9.3. 5827 Message Format 5829 ::= < Diameter Header: 271, PXY > 5830 < Session-Id > 5831 { Result-Code } 5832 { Origin-Host } 5833 { Origin-Realm } 5834 { Accounting-Record-Type } 5835 { Accounting-Record-Number } 5836 [ Acct-Application-Id ] 5837 [ Vendor-Specific-Application-Id ] 5838 [ User-Name ] 5839 [ Accounting-Sub-Session-Id ] 5840 [ Acct-Session-Id ] 5841 [ Acct-Multi-Session-Id ] 5842 [ Error-Message ] 5843 [ Error-Reporting-Host ] 5844 [ Failed-AVP ] 5845 [ Acct-Interim-Interval ] 5846 [ Accounting-Realtime-Required ] 5847 [ Origin-State-Id ] 5848 [ Event-Timestamp ] 5849 * [ Proxy-Info ] 5850 * [ AVP ] 5852 9.8. Accounting AVPs 5854 This section contains AVPs that describe accounting usage information 5855 related to a specific session. 5857 9.8.1. Accounting-Record-Type AVP 5859 The Accounting-Record-Type AVP (AVP Code 480) is of type Enumerated 5860 and contains the type of accounting record being sent. The following 5861 values are currently defined for the Accounting-Record-Type AVP: 5863 EVENT_RECORD 1 5865 An Accounting Event Record is used to indicate that a one-time 5866 event has occurred (meaning that the start and end of the event 5867 are simultaneous). This record contains all information relevant 5868 to the service, and is the only record of the service. 5870 START_RECORD 2 5872 An Accounting Start, Interim, and Stop Records are used to 5873 indicate that a service of a measurable length has been given. An 5874 Accounting Start Record is used to initiate an accounting session, 5875 and contains accounting information that is relevant to the 5876 initiation of the session. 5878 INTERIM_RECORD 3 5880 An Interim Accounting Record contains cumulative accounting 5881 information for an existing accounting session. Interim 5882 Accounting Records SHOULD be sent every time a re-authentication 5883 or re-authorization occurs. Further, additional interim record 5884 triggers MAY be defined by application-specific Diameter 5885 applications. The selection of whether to use INTERIM_RECORD 5886 records is done by the Acct-Interim-Interval AVP. 5888 STOP_RECORD 4 5890 An Accounting Stop Record is sent to terminate an accounting 5891 session and contains cumulative accounting information relevant to 5892 the existing session. 5894 9.8.2. Acct-Interim-Interval 5896 The Acct-Interim-Interval AVP (AVP Code 85) is of type Unsigned32 and 5897 is sent from the Diameter home authorization server to the Diameter 5898 client. The client uses information in this AVP to decide how and 5899 when to produce accounting records. With different values in this 5900 AVP, service sessions can result in one, two, or two+N accounting 5901 records, based on the needs of the home-organization. The following 5902 accounting record production behavior is directed by the inclusion of 5903 this AVP: 5905 1. The omission of the Acct-Interim-Interval AVP or its inclusion 5906 with Value field set to 0 means that EVENT_RECORD, START_RECORD, 5907 and STOP_RECORD are produced, as appropriate for the service. 5909 2. The inclusion of the AVP with Value field set to a non-zero value 5910 means that INTERIM_RECORD records MUST be produced between the 5911 START_RECORD and STOP_RECORD records. The Value field of this 5912 AVP is the nominal interval between these records in seconds. 5914 The Diameter node that originates the accounting information, 5915 known as the client, MUST produce the first INTERIM_RECORD record 5916 roughly at the time when this nominal interval has elapsed from 5917 the START_RECORD, the next one again as the interval has elapsed 5918 once more, and so on until the session ends and a STOP_RECORD 5919 record is produced. 5921 The client MUST ensure that the interim record production times 5922 are randomized so that large accounting message storms are not 5923 created either among records or around a common service start 5924 time. 5926 9.8.3. Accounting-Record-Number AVP 5928 The Accounting-Record-Number AVP (AVP Code 485) is of type Unsigned32 5929 and identifies this record within one session. As Session-Id AVPs 5930 are globally unique, the combination of Session-Id and Accounting- 5931 Record-Number AVPs is also globally unique, and can be used in 5932 matching accounting records with confirmations. An easy way to 5933 produce unique numbers is to set the value to 0 for records of type 5934 EVENT_RECORD and START_RECORD, and set the value to 1 for the first 5935 INTERIM_RECORD, 2 for the second, and so on until the value for 5936 STOP_RECORD is one more than for the last INTERIM_RECORD. 5938 9.8.4. Acct-Session-Id AVP 5940 The Acct-Session-Id AVP (AVP Code 44) is of type OctetString is only 5941 used when RADIUS/Diameter translation occurs. This AVP contains the 5942 contents of the RADIUS Acct-Session-Id attribute. 5944 9.8.5. Acct-Multi-Session-Id AVP 5946 The Acct-Multi-Session-Id AVP (AVP Code 50) is of type UTF8String, 5947 following the format specified in Section 8.8. The Acct-Multi- 5948 Session-Id AVP is used to link together multiple related accounting 5949 sessions, where each session would have a unique Session-Id, but the 5950 same Acct-Multi-Session-Id AVP. This AVP MAY be returned by the 5951 Diameter server in an authorization answer, and MUST be used in all 5952 accounting messages for the given session. 5954 9.8.6. Accounting-Sub-Session-Id AVP 5956 The Accounting-Sub-Session-Id AVP (AVP Code 287) is of type 5957 Unsigned64 and contains the accounting sub-session identifier. The 5958 combination of the Session-Id and this AVP MUST be unique per sub- 5959 session, and the value of this AVP MUST be monotonically increased by 5960 one for all new sub-sessions. The absence of this AVP implies no 5961 sub-sessions are in use, with the exception of an Accounting-Request 5962 whose Accounting-Record-Type is set to STOP_RECORD. A STOP_RECORD 5963 message with no Accounting-Sub-Session-Id AVP present will signal the 5964 termination of all sub-sessions for a given Session-Id. 5966 9.8.7. Accounting-Realtime-Required AVP 5968 The Accounting-Realtime-Required AVP (AVP Code 483) is of type 5969 Enumerated and is sent from the Diameter home authorization server to 5970 the Diameter client or in the Accounting-Answer from the accounting 5971 server. The client uses information in this AVP to decide what to do 5972 if the sending of accounting records to the accounting server has 5973 been temporarily prevented due to, for instance, a network problem. 5975 DELIVER_AND_GRANT 1 5977 The AVP with Value field set to DELIVER_AND_GRANT means that the 5978 service MUST only be granted as long as there is a connection to 5979 an accounting server. Note that the set of alternative accounting 5980 servers are treated as one server in this sense. Having to move 5981 the accounting record stream to a backup server is not a reason to 5982 discontinue the service to the user. 5984 GRANT_AND_STORE 2 5986 The AVP with Value field set to GRANT_AND_STORE means that service 5987 SHOULD be granted if there is a connection, or as long as records 5988 can still be stored as described in Section 9.4. 5990 This is the default behavior if the AVP isn't included in the 5991 reply from the authorization server. 5993 GRANT_AND_LOSE 3 5995 The AVP with Value field set to GRANT_AND_LOSE means that service 5996 SHOULD be granted even if the records can not be delivered or 5997 stored. 5999 10. AVP Occurrence Table 6001 The following tables presents the AVPs defined in this document, and 6002 specifies in which Diameter messages they MAY be present or not. 6003 AVPs that occur only inside a Grouped AVP are not shown in this 6004 table. 6006 The table uses the following symbols: 6008 0 The AVP MUST NOT be present in the message. 6010 0+ Zero or more instances of the AVP MAY be present in the 6011 message. 6013 0-1 Zero or one instance of the AVP MAY be present in the message. 6014 It is considered an error if there are more than one instance of 6015 the AVP. 6017 1 One instance of the AVP MUST be present in the message. 6019 1+ At least one instance of the AVP MUST be present in the 6020 message. 6022 10.1. Base Protocol Command AVP Table 6024 The table in this section is limited to the non-accounting Command 6025 Codes defined in this specification. 6027 +-----------------------------------------------+ 6028 | Command-Code | 6029 +---+---+---+---+---+---+---+---+---+---+---+---+ 6030 Attribute Name |CER|CEA|DPR|DPA|DWR|DWA|RAR|RAA|ASR|ASA|STR|STA| 6031 --------------------+---+---+---+---+---+---+---+---+---+---+---+---+ 6032 Acct-Interim- |0 |0 |0 |0 |0 |0 |0-1|0 |0 |0 |0 |0 | 6033 Interval | | | | | | | | | | | | | 6034 Accounting-Realtime-|0 |0 |0 |0 |0 |0 |0-1|0 |0 |0 |0 |0 | 6035 Required | | | | | | | | | | | | | 6036 Acct-Application-Id |0+ |0+ |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 | 6037 Auth-Application-Id |0+ |0+ |0 |0 |0 |0 |1 |0 |1 |0 |1 |0 | 6038 Auth-Grace-Period |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 | 6039 Auth-Request-Type |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 | 6040 Auth-Session-State |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 | 6041 Authorization- |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 | 6042 Lifetime | | | | | | | | | | | | | 6043 Class |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0+ |0+ | 6044 Destination-Host |0 |0 |0 |0 |0 |0 |1 |0 |1 |0 |0-1|0 | 6045 Destination-Realm |0 |0 |0 |0 |0 |0 |1 |0 |1 |0 |1 |0 | 6046 Disconnect-Cause |0 |0 |1 |0 |0 |0 |0 |0 |0 |0 |0 |0 | 6047 Error-Message |0 |0-1|0 |0-1|0 |0-1|0 |0-1|0 |0-1|0 |0-1| 6048 Error-Reporting-Host|0 |0 |0 |0 |0 |0 |0 |0-1|0 |0-1|0 |0-1| 6049 Failed-AVP |0 |0+ |0 |0+ |0 |0+ |0 |0+ |0 |0+ |0 |0+ | 6050 Firmware-Revision |0-1|0-1|0 |0 |0 |0 |0 |0 |0 |0 |0 |0 | 6051 Host-IP-Address |1+ |1+ |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 | 6052 Inband-Security-Id |0+ |0+ |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 | 6053 Multi-Round-Time-Out|0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 | 6054 Origin-Host |1 |1 |1 |1 |1 |1 |1 |1 |1 |1 |1 |1 | 6055 Origin-Realm |1 |1 |1 |1 |1 |1 |1 |1 |1 |1 |1 |1 | 6056 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| 6057 Product-Name |1 |1 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 | 6058 Proxy-Info |0 |0 |0 |0 |0 |0 |0+ |0+ |0+ |0+ |0+ |0+ | 6059 Redirect-Host |0 |0 |0 |0 |0 |0 |0 |0+ |0 |0+ |0 |0+ | 6060 Redirect-Host-Usage |0 |0 |0 |0 |0 |0 |0 |0-1|0 |0-1|0 |0-1| 6061 Redirect-Max-Cache- |0 |0 |0 |0 |0 |0 |0 |0-1|0 |0-1|0 |0-1| 6062 Time | | | | | | | | | | | | | 6063 Result-Code |0 |1 |0 |1 |0 |1 |0 |1 |0 |1 |0 |1 | 6064 Re-Auth-Request-Type|0 |0 |0 |0 |0 |0 |1 |0 |0 |0 |0 |0 | 6065 Route-Record |0 |0 |0 |0 |0 |0 |0+ |0 |0+ |0 |0+ |0 | 6066 Session-Binding |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 | 6067 Session-Id |0 |0 |0 |0 |0 |0 |1 |1 |1 |1 |1 |1 | 6068 Session-Server- |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 | 6069 Failover | | | | | | | | | | | | | 6070 Session-Timeout |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 | 6071 Supported-Vendor-Id |0+ |0+ |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 | 6072 Termination-Cause |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |1 |0 | 6073 User-Name |0 |0 |0 |0 |0 |0 |0-1|0-1|0-1|0-1|0-1|0-1| 6074 Vendor-Id |1 |1 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 | 6075 Vendor-Specific- |0+ |0+ |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 | 6076 Application-Id | | | | | | | | | | | | | 6077 --------------------+---+---+---+---+---+---+---+---+---+---+---+---+ 6079 10.2. Accounting AVP Table 6081 The table in this section is used to represent which AVPs defined in 6082 this document are to be present in the Accounting messages. These 6083 AVP occurrence requirements are guidelines, which may be expanded, 6084 and/or overridden by application-specific requirements in the 6085 Diameter applications documents. 6087 +-----------+ 6088 | Command | 6089 | Code | 6090 +-----+-----+ 6091 Attribute Name | ACR | ACA | 6092 ------------------------------+-----+-----+ 6093 Acct-Interim-Interval | 0-1 | 0-1 | 6094 Acct-Multi-Session-Id | 0-1 | 0-1 | 6095 Accounting-Record-Number | 1 | 1 | 6096 Accounting-Record-Type | 1 | 1 | 6097 Acct-Session-Id | 0-1 | 0-1 | 6098 Accounting-Sub-Session-Id | 0-1 | 0-1 | 6099 Accounting-Realtime-Required | 0-1 | 0-1 | 6100 Acct-Application-Id | 0-1 | 0-1 | 6101 Auth-Application-Id | 0 | 0 | 6102 Class | 0+ | 0+ | 6103 Destination-Host | 0-1 | 0 | 6104 Destination-Realm | 1 | 0 | 6105 Error-Reporting-Host | 0 | 0+ | 6106 Event-Timestamp | 0-1 | 0-1 | 6107 Origin-Host | 1 | 1 | 6108 Origin-Realm | 1 | 1 | 6109 Proxy-Info | 0+ | 0+ | 6110 Route-Record | 0+ | 0 | 6111 Result-Code | 0 | 1 | 6112 Session-Id | 1 | 1 | 6113 Termination-Cause | 0 | 0 | 6114 User-Name | 0-1 | 0-1 | 6115 Vendor-Specific-Application-Id| 0-1 | 0-1 | 6116 ------------------------------+-----+-----+ 6118 11. IANA Considerations 6120 This section provides guidance to the Internet Assigned Numbers 6121 Authority (IANA) regarding registration of values related to the 6122 Diameter protocol, in accordance with BCP 26 [RFC2434]. The 6123 following policies are used here with the meanings defined in BCP 26: 6124 "Private Use", "First Come First Served", "Expert Review", 6125 "Specification Required", "IETF Consensus", "Standards Action". 6127 This section explains the criteria to be used by the IANA for 6128 assignment of numbers within namespaces defined within this document. 6130 Diameter is not intended as a general purpose protocol, and 6131 allocations SHOULD NOT be made for purposes unrelated to 6132 authentication, authorization or accounting. 6134 For registration requests where a Designated Expert should be 6135 consulted, the responsible IESG area director should appoint the 6136 Designated Expert. For Designated Expert with Specification 6137 Required, the request is posted to the DIME WG mailing list (or, if 6138 it has been disbanded, a successor designated by the Area Director) 6139 for comment and review, and MUST include a pointer to a public 6140 specification. Before a period of 30 days has passed, the Designated 6141 Expert will either approve or deny the registration request and 6142 publish a notice of the decision to the DIME WG mailing list or its 6143 successor. A denial notice must be justified by an explanation and, 6144 in the cases where it is possible, concrete suggestions on how the 6145 request can be modified so as to become acceptable. 6147 11.1. AVP Header 6149 As defined in Section 4, the AVP header contains three fields that 6150 requires IANA namespace management; the AVP Code, Vendor-ID and Flags 6151 field. 6153 11.1.1. AVP Codes 6155 The AVP Code namespace is used to identify attributes. There are 6156 multiple namespaces. Vendors can have their own AVP Codes namespace 6157 which will be identified by their Vendor-ID (also known as 6158 Enterprise-Number) and they control the assignments of their vendor- 6159 specific AVP codes within their own namespace. The absence of a 6160 Vendor-ID or a Vendor-ID value of zero (0) identifies the IETF IANA 6161 controlled AVP Codes namespace. The AVP Codes and sometimes also 6162 possible values in an AVP are controlled and maintained by IANA. 6164 AVP Code 0 is not used. AVP Codes 1-255 are managed separately as 6165 RADIUS Attribute Types [RADTYPE]. This document defines the AVP 6166 Codes 257-274, 276-285, 287, 291-300, 480, 483 and 485-486. See 6167 Section 4.5 for the assignment of the namespace in this 6168 specification. 6170 AVPs may be allocated following Designated Expert with Specification 6171 Required [RFC2434]. Release of blocks of AVPs (more than 3 at a time 6172 for a given purpose) should require IETF Consensus. 6174 Note that Diameter defines a mechanism for Vendor-Specific AVPs, 6175 where the Vendor-Id field in the AVP header is set to a non-zero 6176 value. Vendor-Specific AVPs codes are for Private Use and should be 6177 encouraged instead of allocation of global attribute types, for 6178 functions specific only to one vendor's implementation of Diameter, 6179 where no interoperability is deemed useful. Where a Vendor-Specific 6180 AVP is implemented by more than one vendor, allocation of global AVPs 6181 should be encouraged instead. 6183 11.1.2. AVP Flags 6185 There are 8 bits in the AVP Flags field of the AVP header, defined in 6186 Section 4. This document assigns bit 0 ('V'endor Specific), bit 1 6187 ('M'andatory) and bit 2 ('P'rotected). The remaining bits should 6188 only be assigned via a Standards Action [RFC2434]. 6190 11.2. Diameter Header 6192 As defined in Section 3, the Diameter header contains two fields that 6193 require IANA namespace management; Command Code and Command Flags. 6195 11.2.1. Command Codes 6197 The Command Code namespace is used to identify Diameter commands. 6198 The values 0-255 (0x00-0xff) are reserved for RADIUS backward 6199 compatibility, and are defined as "RADIUS Packet Type Codes" in 6200 [RADTYPE]. Values 256 - 8,388,607 (0x100 to 0x7fffff) are for 6201 permanent, standard commands, allocated by IETF Consensus [RFC2434]. 6202 This document defines the Command Codes 257, 258, 271, 274-275, 280 6203 and 282. See Section 3.1 for the assignment of the namespace in this 6204 specification. 6206 The values 8,388,608 - 16,777,213 (0x800000 - 0xfffffd) are reserved 6207 for vendor-specific command codes, to be allocated on a First Come, 6208 First Served basis by IANA [RFC2434]. The request to IANA for a 6209 Vendor-Specific Command Code SHOULD include a reference to a publicly 6210 available specification which documents the command in sufficient 6211 detail to aid in interoperability between independent 6212 implementations. If the specification cannot be made publicly 6213 available, the request for a vendor-specific command code MUST 6214 include the contact information of persons and/or entities 6215 responsible for authoring and maintaining the command. 6217 The values 16,777,214 and 16,777,215 (hexadecimal values 0xfffffe - 6218 0xffffff) are reserved for experimental commands. As these codes are 6219 only for experimental and testing purposes, no guarantee is made for 6220 interoperability between Diameter peers using experimental commands, 6221 as outlined in [IANA-EXP]. 6223 11.2.2. Command Flags 6225 There are eight bits in the Command Flags field of the Diameter 6226 header. This document assigns bit 0 ('R'equest), bit 1 ('P'roxy), 6227 bit 2 ('E'rror) and bit 3 ('T'). Bits 4 through 7 MUST only be 6228 assigned via a Standards Action [RFC2434]. 6230 11.3. Application Identifiers 6232 As defined in Section 2.4, the Application Identifier is used to 6233 identify a specific Diameter Application. There are standards-track 6234 application ids and vendor specific application ids. 6236 IANA [RFC2434] has assigned the range 0x00000001 to 0x00ffffff for 6237 standards-track applications; and 0x01000000 - 0xfffffffe for vendor 6238 specific applications, on a first-come, first-served basis. The 6239 following values are allocated. 6241 Diameter Common Messages 0 6242 NASREQ 1 [RFC4005] 6243 Mobile-IP 2 [RFC4004] 6244 Diameter Base Accounting 3 6245 Relay 0xffffffff 6247 Assignment of standards-track application IDs are by Designated 6248 Expert with Specification Required [RFC2434]. 6250 Both Auth-Application-Id and Acct-Application-Id AVPs use the same 6251 Application Identifier space. A diameter node advertising itself as 6252 a relay agent MUST set either Application-Id or Acct-Application-Id 6253 to 0xffffffff. 6255 Vendor-Specific Application Identifiers, are for Private Use. Vendor- 6256 Specific Application Identifiers are assigned on a First Come, First 6257 Served basis by IANA. 6259 11.4. AVP Values 6261 Certain AVPs in Diameter define a list of values with various 6262 meanings. For attributes other than those specified in this section, 6263 adding additional values to the list can be done on a First Come, 6264 First Served basis by IANA. 6266 11.4.1. Result-Code AVP Values 6268 As defined in Section 7.1, the Result-Code AVP (AVP Code 268) defines 6269 the values 1001, 2001-2002, 3001-3012, 4001-4003 and 5001-5021. 6271 All remaining values are available for assignment via IETF Consensus 6272 [RFC2434]. 6274 11.4.2. Accounting-Record-Type AVP Values 6276 As defined in Section 9.8.1, the Accounting-Record-Type AVP (AVP Code 6277 480) defines the values 1-4. All remaining values are available for 6278 assignment via IETF Consensus [RFC2434]. 6280 11.4.3. Termination-Cause AVP Values 6282 As defined in Section 8.15, the Termination-Cause AVP (AVP Code 295) 6283 defines the values 1-8. All remaining values are available for 6284 assignment via IETF Consensus [RFC2434]. 6286 11.4.4. Redirect-Host-Usage AVP Values 6288 As defined in Section 6.13, the Redirect-Host-Usage AVP (AVP Code 6289 261) defines the values 0-5. All remaining values are available for 6290 assignment via IETF Consensus [RFC2434]. 6292 11.4.5. Session-Server-Failover AVP Values 6294 As defined in Section 8.18, the Session-Server-Failover AVP (AVP Code 6295 271) defines the values 0-3. All remaining values are available for 6296 assignment via IETF Consensus [RFC2434]. 6298 11.4.6. Session-Binding AVP Values 6300 As defined in Section 8.17, the Session-Binding AVP (AVP Code 270) 6301 defines the bits 1-4. All remaining bits are available for 6302 assignment via IETF Consensus [RFC2434]. 6304 11.4.7. Disconnect-Cause AVP Values 6306 As defined in Section 5.4.3, the Disconnect-Cause AVP (AVP Code 273) 6307 defines the values 0-2. All remaining values are available for 6308 assignment via IETF Consensus [RFC2434]. 6310 11.4.8. Auth-Request-Type AVP Values 6312 As defined in Section 8.7, the Auth-Request-Type AVP (AVP Code 274) 6313 defines the values 1-3. All remaining values are available for 6314 assignment via IETF Consensus [RFC2434]. 6316 11.4.9. Auth-Session-State AVP Values 6318 As defined in Section 8.11, the Auth-Session-State AVP (AVP Code 277) 6319 defines the values 0-1. All remaining values are available for 6320 assignment via IETF Consensus [RFC2434]. 6322 11.4.10. Re-Auth-Request-Type AVP Values 6324 As defined in Section 8.12, the Re-Auth-Request-Type AVP (AVP Code 6325 285) defines the values 0-1. All remaining values are available for 6326 assignment via IETF Consensus [RFC2434]. 6328 11.4.11. Accounting-Realtime-Required AVP Values 6330 As defined in Section 9.8.7, the Accounting-Realtime-Required AVP 6331 (AVP Code 483) defines the values 1-3. All remaining values are 6332 available for assignment via IETF Consensus [RFC2434]. 6334 11.4.12. Inband-Security-Id AVP (code 299) 6336 As defined in Section 6.10, the Inband-Security-Id AVP (AVP Code 299) 6337 defines the values 0-1. All remaining values are available for 6338 assignment via IETF Consensus [RFC2434]. 6340 11.5. Diameter TCP/SCTP Port Numbers 6342 The IANA has assigned TCP and SCTP port number 3868 to Diameter. 6344 11.6. NAPTR Service Fields 6346 The registration in the RFC MUST include the following information: 6348 Service Field: The service field being registered. An example for a 6349 new fictitious transport protocol called NCTP might be "AAA+D2N". 6351 Protocol: The specific transport protocol associated with that 6352 service field. This MUST include the name and acronym for the 6353 protocol, along with reference to a document that describes the 6354 transport protocol. For example - "New Connectionless Transport 6355 Protocol (NCTP), RFC 5766". 6357 Name and Contact Information: The name, address, email address and 6358 telephone number for the person performing the registration. 6360 The following values have been placed into the registry: 6362 Services Field Protocol 6364 AAA+D2T TCP 6365 AAA+D2S SCTP 6367 12. Diameter protocol related configurable parameters 6369 This section contains the configurable parameters that are found 6370 throughout this document: 6372 Diameter Peer 6374 A Diameter entity MAY communicate with peers that are statically 6375 configured. A statically configured Diameter peer would require 6376 that either the IP address or the fully qualified domain name 6377 (FQDN) be supplied, which would then be used to resolve through 6378 DNS. 6380 Routing Table 6382 A Diameter proxy server routes messages based on the realm portion 6383 of a Network Access Identifier (NAI). The server MUST have a 6384 table of Realm Names, and the address of the peer to which the 6385 message must be forwarded to. The routing table MAY also include 6386 a "default route", which is typically used for all messages that 6387 cannot be locally processed. 6389 Tc timer 6391 The Tc timer controls the frequency that transport connection 6392 attempts are done to a peer with whom no active transport 6393 connection exists. The recommended value is 30 seconds. 6395 13. Security Considerations 6397 The Diameter base protocol assumes that messages maybe secured by 6398 using TLS. As an alternative, IPSec can be also be used to secure 6399 Diameter peer connections but its usage is transparent from the 6400 Diameter node and Diameter protocol perspective. These security 6401 mechanism is acceptable in environments where there is no untrusted 6402 third party agent. 6404 Diameter clients, such as Network Access Servers (NASes) and Mobility 6405 Agents MAY support TLS [RFC4346]. Diameter servers MUST support TLS. 6406 Diameter implementations SHOULD use transmission-level security of 6407 some kind (IPsec or TLS) on each connection. 6409 If a Diameter connection is to be protected via TLS, then the CER/CEA 6410 exchange MUST include an Inband-Security-ID AVP with a value of TLS. 6411 For TLS usage, a TLS handshake will begin when both ends are in the 6412 open state, after completion of the CER/CEA exchange. If the TLS 6413 handshake is successful, all further messages will be sent via TLS. 6414 If the handshake fails, both ends move to the closed state. See 6415 Sections 13.1 for more details. 6417 13.1. TLS Usage 6419 A Diameter node that initiates a connection to another Diameter node 6420 acts as a TLS client according to [RFC4346], and a Diameter node that 6421 accepts a connection acts as a TLS server. Diameter nodes 6422 implementing TLS for security MUST mutually authenticate as part of 6423 TLS session establishment. In order to ensure mutual authentication, 6424 the Diameter node acting as TLS server must request a certificate 6425 from the Diameter node acting as TLS client, and the Diameter node 6426 acting as TLS client MUST be prepared to supply a certificate on 6427 request. 6429 Diameter nodes MUST be able to negotiate the following TLS cipher 6430 suites: 6432 TLS_RSA_WITH_RC4_128_MD5 6433 TLS_RSA_WITH_RC4_128_SHA 6434 TLS_RSA_WITH_3DES_EDE_CBC_SHA 6436 Diameter nodes SHOULD be able to negotiate the following TLS cipher 6437 suite: 6439 TLS_RSA_WITH_AES_128_CBC_SHA 6441 Diameter nodes MAY negotiate other TLS cipher suites. 6443 13.2. Peer-to-Peer Considerations 6445 As with any peer-to-peer protocol, proper configuration of the trust 6446 model within a Diameter peer is essential to security. When 6447 certificates are used, it is necessary to configure the root 6448 certificate authorities trusted by the Diameter peer. These root CAs 6449 are likely to be unique to Diameter usage and distinct from the root 6450 CAs that might be trusted for other purposes such as Web browsing. 6451 In general, it is expected that those root CAs will be configured so 6452 as to reflect the business relationships between the organization 6453 hosting the Diameter peer and other organizations. As a result, a 6454 Diameter peer will typically not be configured to allow connectivity 6455 with any arbitrary peer. With certificate authentication, Diameter 6456 peers may not be known beforehand and therefore peer discovery may be 6457 required. 6459 14. References 6461 14.1. Normative References 6463 [FLOATPOINT] 6464 Institute of Electrical and Electronics Engineers, "IEEE 6465 Standard for Binary Floating-Point Arithmetic, ANSI/IEEE 6466 Standard 754-1985", August 1985. 6468 [IANAADFAM] 6469 IANA,, "Address Family Numbers", 6470 http://www.iana.org/assignments/address-family-numbers. 6472 [RADTYPE] IANA,, "RADIUS Types", 6473 http://www.iana.org/assignments/radius-types. 6475 [IPV4] Postel, J., "Internet Protocol", RFC 791, September 1981. 6477 [TCP] Postel, J., "Transmission Control Protocol", RFC 793, 6478 January 1981. 6480 [RFC3539] Aboba, B. and J. Wood, "Authentication, Authorization and 6481 Accounting (AAA) Transport Profile", RFC 3539, June 2003. 6483 [RFC4004] Calhoun, P., Johansson, T., Perkins, C., Hiller, T., and 6484 P. McCann, "Diameter Mobile IPv4 Application", RFC 4004, 6485 August 2005. 6487 [RFC4005] Calhoun, P., Zorn, G., Spence, D., and D. Mitton, 6488 "Diameter Network Access Server Application", RFC 4005, 6489 August 2005. 6491 [RFC4006] Hakala, H., Mattila, L., Koskinen, J-P., Stura, M., and J. 6492 Loughney, "Diameter Credit-Control Application", RFC 4006, 6493 August 2005. 6495 [RFC4072] Eronen, P., Hiller, T., and G. Zorn, "Diameter Extensible 6496 Authentication Protocol (EAP) Application", RFC 4072, 6497 August 2005. 6499 [RFC4740] Garcia-Martin, M., Belinchon, M., Pallares-Lopez, M., 6500 Canales-Valenzuela, C., and K. Tammi, "Diameter Session 6501 Initiation Protocol (SIP) Application", RFC 4740, 6502 November 2006. 6504 [RFC4234] Crocker, D., Ed. and P. Overell, "Augmented BNF for Syntax 6505 Specifications: ABNF", RFC 4234, October 2005. 6507 [RFC3588] Calhoun, P., Loughney, J., Guttman, E., Zorn, G., and J. 6508 Arkko, "Diameter Base Protocol", RFC 3588, September 2003. 6510 [RFC3748] Aboba, B., Blunk, L., Vollbrecht, J., Carlson, J., and H. 6511 Levkowetz, "Extensible Authentication Protocol (EAP)", 6512 RFC 3748, June 2004. 6514 [RFC2434] Narten, T. and H. Alvestrand, "Guidelines for Writing an 6515 IANA Considerations Section in RFCs", BCP 26, RFC 2434, 6516 October 1998. 6518 [RFC4306] Kaufman, C., "Internet Key Exchange (IKEv2) Protocol", 6519 RFC 4306, December 2005. 6521 [RFC4291] Hinden, R. and S. Deering, "IP Version 6 Addressing 6522 Architecture", RFC 4291, February 2006. 6524 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 6525 Requirement Levels", BCP 14, RFC 2119, March 1997. 6527 [RFC4282] Aboba, B., Beadles, M., Arkko, J., and P. Eronen, "The 6528 Network Access Identifier", RFC 4282, December 2005. 6530 [RFC3403] Mealling, M., "Dynamic Delegation Discovery System (DDDS) 6531 Part Three: The Domain Name System (DNS) Database", 6532 RFC 3403, October 2002. 6534 [RFC3261] Rosenberg, J., Schulzrinne, H., Camarillo, G., Johnston, 6535 A., Peterson, J., Sparks, R., Handley, M., and E. 6536 Schooler, "SIP: Session Initiation Protocol", RFC 3261, 6537 June 2002. 6539 [RFC2960] Stewart, R., Xie, Q., Morneault, K., Sharp, C., 6540 Schwarzbauer, H., Taylor, T., Rytina, I., Kalla, M., 6541 Zhang, L., and V. Paxson, "Stream Control Transmission 6542 Protocol", RFC 2960, October 2000. 6544 [RFC4346] Dierks, T. and E. Rescorla, "The Transport Layer Security 6545 (TLS) Protocol Version 1.1", RFC 4346, April 2006. 6547 [RFC3986] Berners-Lee, T., Fielding, R., and L. Masinter, "Uniform 6548 Resource Identifier (URI): Generic Syntax", STD 66, 6549 RFC 3986, January 2005. 6551 [RFC3629] Yergeau, F., "UTF-8, a transformation format of ISO 6552 10646", STD 63, RFC 3629, November 2003. 6554 14.2. Informational References 6556 [RFC2989] Aboba, B., Calhoun, P., Glass, S., Hiller, T., McCann, P., 6557 Shiino, H., Zorn, G., Dommety, G., C.Perkins, B.Patil, 6558 D.Mitton, S.Manning, M.Beadles, P.Walsh, X.Chen, 6559 S.Sivalingham, A.Hameed, M.Munson, S.Jacobs, B.Lim, 6560 B.Hirschman, R.Hsu, Y.Xu, E.Campell, S.Baba, and E.Jaques, 6561 "Criteria for Evaluating AAA Protocols for Network 6562 Access", RFC 2989, November 2000. 6564 [RFC2975] Aboba, B., Arkko, J., and D. Harrington, "Introduction to 6565 Accounting Management", RFC 2975, October 2000. 6567 [RFC3232] Reynolds, J., "Assigned Numbers: RFC 1700 is Replaced by 6568 an On-line Database", RFC 3232, January 2002. 6570 [RFC3576] Chiba, M., Dommety, G., Eklund, M., Mitton, D., and B. 6571 Aboba, "Dynamic Authorization Extensions to Remote 6572 Authentication Dial In User Service (RADIUS)", RFC 3576, 6573 July 2003. 6575 [RFC1661] Simpson, W., "The Point-to-Point Protocol (PPP)", STD 51, 6576 RFC 1661, July 1994. 6578 [RFC2607] Aboba, B. and J. Vollbrecht, "Proxy Chaining and Policy 6579 Implementation in Roaming", RFC 2607, June 1999. 6581 [RFC2866] Rigney, C., "RADIUS Accounting", RFC 2866, June 2000. 6583 [RFC2869] Rigney, C., Willats, W., and P. Calhoun, "RADIUS 6584 Extensions", RFC 2869, June 2000. 6586 [RFC2865] Rigney, C., Willens, S., Rubens, A., and W. Simpson, 6587 "Remote Authentication Dial In User Service (RADIUS)", 6588 RFC 2865, June 2000. 6590 [RFC3162] Aboba, B., Zorn, G., and D. Mitton, "RADIUS and IPv6", 6591 RFC 3162, August 2001. 6593 [RFC2194] Aboba, B., Lu, J., Alsop, J., Ding, J., and W. Wang, 6594 "Review of Roaming Implementations", RFC 2194, 6595 September 1997. 6597 [RFC2477] Aboba, B. and G. Zorn, "Criteria for Evaluating Roaming 6598 Protocols", RFC 2477, January 1999. 6600 [RFC4301] Kent, S. and K. Seo, "Security Architecture for the 6601 Internet Protocol", RFC 4301, December 2005. 6603 [RFC4330] Mills, D., "Simple Network Time Protocol (SNTP) Version 4 6604 for IPv4, IPv6 and OSI", RFC 4330, January 2006. 6606 [RFC1492] Finseth, C., "An Access Control Protocol, Sometimes Called 6607 TACACS", RFC 1492, July 1993. 6609 [IANA-EXP] 6610 Narten, T., "Assigning Experimental and Testing Numbers 6611 Considered Useful, Work in Progress.". 6613 Appendix A. Acknowledgements 6615 The authors would like to thank the following people that have 6616 provided proposals and contributions to this document: 6618 To Vishnu Ram and Satendra Gera for their contributions on 6619 Capabilities Updates, Predictive Loop Avoidance as well as many other 6620 technical proposals. To Tolga Asveren for his insights and 6621 contributions on almost all of the proposed solutions incorporated 6622 into this document. To Timothy Smith for helping on the Capabilities 6623 Updates and other topics. To Tony Zhang for providing fixes to loop 6624 holes on composing Failed-AVPs as well as many other issues and 6625 topics. To Jan Nordqvist for clearly stating the usage of 6626 application ids. To Anders Kristensen for providing needed technical 6627 opinions. To David Frascone for providing invaluable review of the 6628 document. To Mark Jones for providing clarifying text on vendor 6629 command codes and other vendor specific indicators. 6631 Special thanks also to people who have provided invaluable comments 6632 and inputs especially in resolving controversial issues: 6634 Glen Zorn, Yoshihiro Ohba, Marco Stura, and Pasi Eronen. 6636 Finally, we would like to thank the original authors of this 6637 document: 6639 Pat Calhoun, John Loughney, Jari Arkko, Erik Guttman and Glen Zorn. 6641 Their invaluable knowledge and experience has given us a robust and 6642 flexible AAA protocol that many people have seen great value in 6643 adopting. We greatly appreciate their support and stewardship for 6644 the continued improvements of Diameter as a protocol. We would also 6645 like to extend our gratitude to folks aside from the authors who have 6646 assisted and contributed to the original version of this document. 6647 Their efforts significantly contributed to the success of Diameter. 6649 Appendix B. NAPTR Example 6651 As an example, consider a client that wishes to resolve aaa:ex.com. 6652 The client performs a NAPTR query for that domain, and the following 6653 NAPTR records are returned: 6655 ;; order pref flags service regexp replacement 6656 IN NAPTR 50 50 "s" "AAA+D2S" "" 6657 _diameter._sctp.example.com IN NAPTR 100 50 "s" "AAA+D2T" 6658 "" _aaa._tcp.example.com 6660 This indicates that the server supports SCTP, and TCP, in that order. 6661 If the client supports over SCTP, SCTP will be used, targeted to a 6662 host determined by an SRV lookup of _diameter._sctp.ex.com. That 6663 lookup would return: 6665 ;; Priority Weight Port Target 6666 IN SRV 0 1 5060 server1.example.com IN SRV 0 6667 2 5060 server2.example.com 6669 Appendix C. Duplicate Detection 6671 As described in Section 9.4, accounting record duplicate detection is 6672 based on session identifiers. Duplicates can appear for various 6673 reasons: 6675 o Failover to an alternate server. Where close to real-time 6676 performance is required, failover thresholds need to be kept low 6677 and this may lead to an increased likelihood of duplicates. 6678 Failover can occur at the client or within Diameter agents. 6680 o Failure of a client or agent after sending of a record from non- 6681 volatile memory, but prior to receipt of an application layer ACK 6682 and deletion of the record. record to be sent. This will result 6683 in retransmission of the record soon after the client or agent has 6684 rebooted. 6686 o Duplicates received from RADIUS gateways. Since the 6687 retransmission behavior of RADIUS is not defined within [RFC2865], 6688 the likelihood of duplication will vary according to the 6689 implementation. 6691 o Implementation problems and misconfiguration. 6693 The T flag is used as an indication of an application layer 6694 retransmission event, e.g., due to failover to an alternate server. 6695 It is defined only for request messages sent by Diameter clients or 6696 agents. For instance, after a reboot, a client may not know whether 6697 it has already tried to send the accounting records in its non- 6698 volatile memory before the reboot occurred. Diameter servers MAY use 6699 the T flag as an aid when processing requests and detecting duplicate 6700 messages. However, servers that do this MUST ensure that duplicates 6701 are found even when the first transmitted request arrives at the 6702 server after the retransmitted request. It can be used only in cases 6703 where no answer has been received from the Server for a request and 6704 the request is sent again, (e.g., due to a failover to an alternate 6705 peer, due to a recovered primary peer or due to a client re-sending a 6706 stored record from non-volatile memory such as after reboot of a 6707 client or agent). 6709 In some cases the Diameter accounting server can delay the duplicate 6710 detection and accounting record processing until a post-processing 6711 phase takes place. At that time records are likely to be sorted 6712 according to the included User-Name and duplicate elimination is easy 6713 in this case. In other situations it may be necessary to perform 6714 real-time duplicate detection, such as when credit limits are imposed 6715 or real-time fraud detection is desired. 6717 In general, only generation of duplicates due to failover or re- 6718 sending of records in non-volatile storage can be reliably detected 6719 by Diameter clients or agents. In such cases the Diameter client or 6720 agents can mark the message as possible duplicate by setting the T 6721 flag. Since the Diameter server is responsible for duplicate 6722 detection, it can choose to make use of the T flag or not, in order 6723 to optimize duplicate detection. Since the T flag does not affect 6724 interoperability, and may not be needed by some servers, generation 6725 of the T flag is REQUIRED for Diameter clients and agents, but MAY be 6726 implemented by Diameter servers. 6728 As an example, it can be usually be assumed that duplicates appear 6729 within a time window of longest recorded network partition or device 6730 fault, perhaps a day. So only records within this time window need 6731 to be looked at in the backward direction. Secondly, hashing 6732 techniques or other schemes, such as the use of the T flag in the 6733 received messages, may be used to eliminate the need to do a full 6734 search even in this set except for rare cases. 6736 The following is an example of how the T flag may be used by the 6737 server to detect duplicate requests. 6739 A Diameter server MAY check the T flag of the received message to 6740 determine if the record is a possible duplicate. If the T flag is 6741 set in the request message, the server searches for a duplicate 6742 within a configurable duplication time window backward and 6743 forward. This limits database searching to those records where 6744 the T flag is set. In a well run network, network partitions and 6745 device faults will presumably be rare events, so this approach 6746 represents a substantial optimization of the duplicate detection 6747 process. During failover, it is possible for the original record 6748 to be received after the T flag marked record, due to differences 6749 in network delays experienced along the path by the original and 6750 duplicate transmissions. The likelihood of this occurring 6751 increases as the failover interval is decreased. In order to be 6752 able to detect out of order duplicates, the Diameter server should 6753 use backward and forward time windows when performing duplicate 6754 checking for the T flag marked request. For example, in order to 6755 allow time for the original record to exit the network and be 6756 recorded by the accounting server, the Diameter server can delay 6757 processing records with the T flag set until a time period 6758 TIME_WAIT + RECORD_PROCESSING_TIME has elapsed after the closing 6759 of the original transport connection. After this time period has 6760 expired, then it may check the T flag marked records against the 6761 database with relative assurance that the original records, if 6762 sent, have been received and recorded. 6764 Authors' Addresses 6766 Victor Fajardo (editor) 6767 Toshiba America Research 6768 One Telcordia Drive, 1S-222 6769 Piscataway, NJ 08854 6770 USA 6772 Phone: 1 908-421-1845 6773 Email: vfajardo@tari.toshiba.com 6775 Jari Arkko 6776 Ericsson Research 6777 02420 Jorvas 6778 Finland 6780 Phone: +358 40 5079256 6781 Email: jari.arkko@ericsson.com 6783 John Loughney 6784 Nokia Research Center 6785 955 Page Mill Road 6786 Palo Alto, CA 94304 6787 US 6789 Phone: 1-650-283-8068 6790 Email: john.loughney@nokia.com 6792 Full Copyright Statement 6794 Copyright (C) The IETF Trust (2007). 6796 This document is subject to the rights, licenses and restrictions 6797 contained in BCP 78, and except as set forth therein, the authors 6798 retain all their rights. 6800 This document and the information contained herein are provided on an 6801 "AS IS" basis and THE CONTRIBUTOR, THE ORGANIZATION HE/SHE REPRESENTS 6802 OR IS SPONSORED BY (IF ANY), THE INTERNET SOCIETY, THE IETF TRUST AND 6803 THE INTERNET ENGINEERING TASK FORCE DISCLAIM ALL WARRANTIES, EXPRESS 6804 OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF 6805 THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED 6806 WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. 6808 Intellectual Property 6810 The IETF takes no position regarding the validity or scope of any 6811 Intellectual Property Rights or other rights that might be claimed to 6812 pertain to the implementation or use of the technology described in 6813 this document or the extent to which any license under such rights 6814 might or might not be available; nor does it represent that it has 6815 made any independent effort to identify any such rights. Information 6816 on the procedures with respect to rights in RFC documents can be 6817 found in BCP 78 and BCP 79. 6819 Copies of IPR disclosures made to the IETF Secretariat and any 6820 assurances of licenses to be made available, or the result of an 6821 attempt made to obtain a general license or permission for the use of 6822 such proprietary rights by implementers or users of this 6823 specification can be obtained from the IETF on-line IPR repository at 6824 http://www.ietf.org/ipr. 6826 The IETF invites any interested party to bring to its attention any 6827 copyrights, patents or patent applications, or other proprietary 6828 rights that may cover technology that may be required to implement 6829 this standard. Please address the information to the IETF at 6830 ietf-ipr@ietf.org. 6832 Acknowledgment 6834 Funding for the RFC Editor function is provided by the IETF 6835 Administrative Support Activity (IASA).