Internet Engineering Task Force (IETF)                   V. Fajardo, Ed.
Request for Comments: 6733                        Telcordia Technologies
Obsoletes: 3588, 5719                                           J. Arkko
Category: Standards Track                              Ericsson Research
ISSN: 2070-1721                                              J. Loughney
                                                   Nokia Research Center
                                                            G. Zorn, Ed.
                                                             Network Zen
                                                            October 2012
        
Internet Engineering Task Force (IETF)                   V. Fajardo, Ed.
Request for Comments: 6733                        Telcordia Technologies
Obsoletes: 3588, 5719                                           J. Arkko
Category: Standards Track                              Ericsson Research
ISSN: 2070-1721                                              J. Loughney
                                                   Nokia Research Center
                                                            G. Zorn, Ed.
                                                             Network Zen
                                                            October 2012
        

Diameter Base Protocol

Diameter基本协议

Abstract

摘要

The Diameter base protocol is intended to provide an Authentication, Authorization, and Accounting (AAA) framework for applications such as network access or IP mobility in both local and roaming situations. This document specifies the message format, transport, error reporting, accounting, and security services used by all Diameter applications. The Diameter base protocol as defined in this document obsoletes RFC 3588 and RFC 5719, and it must be supported by all new Diameter implementations.

Diameter基本协议旨在为本地和漫游情况下的网络访问或IP移动等应用程序提供身份验证、授权和计费(AAA)框架。本文档指定了所有Diameter应用程序使用的消息格式、传输、错误报告、记帐和安全服务。本文档中定义的Diameter基本协议淘汰了RFC 3588和RFC 5719,并且必须得到所有新Diameter实现的支持。

Status of This Memo

关于下段备忘

This is an Internet Standards Track document.

这是一份互联网标准跟踪文件。

This document is a product of the Internet Engineering Task Force (IETF). It represents the consensus of the IETF community. It has received public review and has been approved for publication by the Internet Engineering Steering Group (IESG). Further information on Internet Standards is available in Section 2 of RFC 5741.

本文件是互联网工程任务组(IETF)的产品。它代表了IETF社区的共识。它已经接受了公众审查,并已被互联网工程指导小组(IESG)批准出版。有关互联网标准的更多信息,请参见RFC 5741第2节。

Information about the current status of this document, any errata, and how to provide feedback on it may be obtained at http://www.rfc-editor.org/info/rfc6733.

有关本文件当前状态、任何勘误表以及如何提供反馈的信息,请访问http://www.rfc-editor.org/info/rfc6733.

Copyright Notice

版权公告

Copyright (c) 2012 IETF Trust and the persons identified as the document authors. All rights reserved.

版权所有(c)2012 IETF信托基金和确定为文件作者的人员。版权所有。

This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (http://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Simplified BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Simplified BSD License.

本文件受BCP 78和IETF信托有关IETF文件的法律规定的约束(http://trustee.ietf.org/license-info)自本文件出版之日起生效。请仔细阅读这些文件,因为它们描述了您对本文件的权利和限制。从本文件中提取的代码组件必须包括信托法律条款第4.e节中所述的简化BSD许可证文本,并提供简化BSD许可证中所述的无担保。

This document may contain material from IETF Documents or IETF Contributions published or made publicly available before November 10, 2008. The person(s) controlling the copyright in some of this material may not have granted the IETF Trust the right to allow modifications of such material outside the IETF Standards Process. Without obtaining an adequate license from the person(s) controlling the copyright in such materials, this document may not be modified outside the IETF Standards Process, and derivative works of it may not be created outside the IETF Standards Process, except to format it for publication as an RFC or to translate it into languages other than English.

本文件可能包含2008年11月10日之前发布或公开的IETF文件或IETF贡献中的材料。控制某些材料版权的人员可能未授予IETF信托允许在IETF标准流程之外修改此类材料的权利。在未从控制此类材料版权的人员处获得充分许可的情况下,不得在IETF标准流程之外修改本文件,也不得在IETF标准流程之外创建其衍生作品,除了将其格式化以RFC形式发布或将其翻译成英语以外的其他语言。

Table of Contents

目录

   1. Introduction ....................................................7
      1.1. Diameter Protocol ..........................................9
           1.1.1. Description of the Document Set ....................10
           1.1.2. Conventions Used in This Document ..................11
           1.1.3. Changes from RFC 3588 ..............................11
      1.2. Terminology ...............................................12
      1.3. Approach to Extensibility .................................17
           1.3.1. Defining New AVP Values ............................18
           1.3.2. Creating New AVPs ..................................18
           1.3.3. Creating New Commands ..............................18
           1.3.4. Creating New Diameter Applications .................19
   2. Protocol Overview ..............................................20
      2.1. Transport .................................................22
           2.1.1. SCTP Guidelines ....................................23
      2.2. Securing Diameter Messages ................................24
      2.3. Diameter Application Compliance ...........................24
      2.4. Application Identifiers ...................................24
      2.5. Connections vs. Sessions ..................................25
      2.6. Peer Table ................................................26
        
   1. Introduction ....................................................7
      1.1. Diameter Protocol ..........................................9
           1.1.1. Description of the Document Set ....................10
           1.1.2. Conventions Used in This Document ..................11
           1.1.3. Changes from RFC 3588 ..............................11
      1.2. Terminology ...............................................12
      1.3. Approach to Extensibility .................................17
           1.3.1. Defining New AVP Values ............................18
           1.3.2. Creating New AVPs ..................................18
           1.3.3. Creating New Commands ..............................18
           1.3.4. Creating New Diameter Applications .................19
   2. Protocol Overview ..............................................20
      2.1. Transport .................................................22
           2.1.1. SCTP Guidelines ....................................23
      2.2. Securing Diameter Messages ................................24
      2.3. Diameter Application Compliance ...........................24
      2.4. Application Identifiers ...................................24
      2.5. Connections vs. Sessions ..................................25
      2.6. Peer Table ................................................26
        
      2.7. Routing Table .............................................27
      2.8. Role of Diameter Agents ...................................28
           2.8.1. Relay Agents .......................................30
           2.8.2. Proxy Agents .......................................31
           2.8.3. Redirect Agents ....................................31
           2.8.4. Translation Agents .................................32
      2.9. Diameter Path Authorization ...............................33
   3. Diameter Header ................................................34
      3.1. Command Codes .............................................37
      3.2. Command Code Format Specification .........................38
      3.3. Diameter Command Naming Conventions .......................40
   4. Diameter AVPs ..................................................40
      4.1. AVP Header ................................................41
           4.1.1. Optional Header Elements ...........................42
      4.2. Basic AVP Data Formats ....................................43
      4.3. Derived AVP Data Formats ..................................44
           4.3.1. Common Derived AVP Data Formats ....................44
      4.4. Grouped AVP Values ........................................51
           4.4.1. Example AVP with a Grouped Data Type ...............52
      4.5. Diameter Base Protocol AVPs ...............................55
   5. Diameter Peers .................................................58
      5.1. Peer Connections ..........................................58
      5.2. Diameter Peer Discovery ...................................59
      5.3. Capabilities Exchange .....................................60
           5.3.1. Capabilities-Exchange-Request ......................62
           5.3.2. Capabilities-Exchange-Answer .......................63
           5.3.3. Vendor-Id AVP ......................................63
           5.3.4. Firmware-Revision AVP ..............................64
           5.3.5. Host-IP-Address AVP ................................64
           5.3.6. Supported-Vendor-Id AVP ............................64
           5.3.7. Product-Name AVP ...................................64
      5.4. Disconnecting Peer Connections ............................64
           5.4.1. Disconnect-Peer-Request ............................65
           5.4.2. Disconnect-Peer-Answer .............................65
           5.4.3. Disconnect-Cause AVP ...............................66
      5.5. Transport Failure Detection ...............................66
           5.5.1. Device-Watchdog-Request ............................67
           5.5.2. Device-Watchdog-Answer .............................67
           5.5.3. Transport Failure Algorithm ........................67
           5.5.4. Failover and Failback Procedures ...................67
      5.6. Peer State Machine ........................................68
           5.6.1. Incoming Connections ...............................71
           5.6.2. Events .............................................71
           5.6.3. Actions ............................................72
           5.6.4. The Election Process ...............................74
        
      2.7. Routing Table .............................................27
      2.8. Role of Diameter Agents ...................................28
           2.8.1. Relay Agents .......................................30
           2.8.2. Proxy Agents .......................................31
           2.8.3. Redirect Agents ....................................31
           2.8.4. Translation Agents .................................32
      2.9. Diameter Path Authorization ...............................33
   3. Diameter Header ................................................34
      3.1. Command Codes .............................................37
      3.2. Command Code Format Specification .........................38
      3.3. Diameter Command Naming Conventions .......................40
   4. Diameter AVPs ..................................................40
      4.1. AVP Header ................................................41
           4.1.1. Optional Header Elements ...........................42
      4.2. Basic AVP Data Formats ....................................43
      4.3. Derived AVP Data Formats ..................................44
           4.3.1. Common Derived AVP Data Formats ....................44
      4.4. Grouped AVP Values ........................................51
           4.4.1. Example AVP with a Grouped Data Type ...............52
      4.5. Diameter Base Protocol AVPs ...............................55
   5. Diameter Peers .................................................58
      5.1. Peer Connections ..........................................58
      5.2. Diameter Peer Discovery ...................................59
      5.3. Capabilities Exchange .....................................60
           5.3.1. Capabilities-Exchange-Request ......................62
           5.3.2. Capabilities-Exchange-Answer .......................63
           5.3.3. Vendor-Id AVP ......................................63
           5.3.4. Firmware-Revision AVP ..............................64
           5.3.5. Host-IP-Address AVP ................................64
           5.3.6. Supported-Vendor-Id AVP ............................64
           5.3.7. Product-Name AVP ...................................64
      5.4. Disconnecting Peer Connections ............................64
           5.4.1. Disconnect-Peer-Request ............................65
           5.4.2. Disconnect-Peer-Answer .............................65
           5.4.3. Disconnect-Cause AVP ...............................66
      5.5. Transport Failure Detection ...............................66
           5.5.1. Device-Watchdog-Request ............................67
           5.5.2. Device-Watchdog-Answer .............................67
           5.5.3. Transport Failure Algorithm ........................67
           5.5.4. Failover and Failback Procedures ...................67
      5.6. Peer State Machine ........................................68
           5.6.1. Incoming Connections ...............................71
           5.6.2. Events .............................................71
           5.6.3. Actions ............................................72
           5.6.4. The Election Process ...............................74
        
   6. Diameter Message Processing ....................................74
      6.1. Diameter Request Routing Overview .........................74
           6.1.1. Originating a Request ..............................75
           6.1.2. Sending a Request ..................................76
           6.1.3. Receiving Requests .................................76
           6.1.4. Processing Local Requests ..........................76
           6.1.5. Request Forwarding .................................77
           6.1.6. Request Routing ....................................77
           6.1.7. Predictive Loop Avoidance ..........................77
           6.1.8. Redirecting Requests ...............................78
           6.1.9. Relaying and Proxying Requests .....................79
      6.2. Diameter Answer Processing ................................80
           6.2.1. Processing Received Answers ........................81
           6.2.2. Relaying and Proxying Answers ......................81
      6.3. Origin-Host AVP ...........................................81
      6.4. Origin-Realm AVP ..........................................82
      6.5. Destination-Host AVP ......................................82
      6.6. Destination-Realm AVP .....................................82
      6.7. Routing AVPs ..............................................83
           6.7.1. Route-Record AVP ...................................83
           6.7.2. Proxy-Info AVP .....................................83
           6.7.3. Proxy-Host AVP .....................................83
           6.7.4. Proxy-State AVP ....................................83
      6.8. Auth-Application-Id AVP ...................................83
      6.9. Acct-Application-Id AVP ...................................84
      6.10. Inband-Security-Id AVP ...................................84
      6.11. Vendor-Specific-Application-Id AVP .......................84
      6.12. Redirect-Host AVP ........................................85
      6.13. Redirect-Host-Usage AVP ..................................85
      6.14. Redirect-Max-Cache-Time AVP ..............................87
   7. Error Handling .................................................87
      7.1. Result-Code AVP ...........................................89
           7.1.1. Informational ......................................90
           7.1.2. Success ............................................90
           7.1.3. Protocol Errors ....................................90
           7.1.4. Transient Failures .................................92
           7.1.5. Permanent Failures .................................92
      7.2. Error Bit .................................................95
      7.3. Error-Message AVP .........................................96
      7.4. Error-Reporting-Host AVP ..................................96
      7.5. Failed-AVP AVP ............................................96
      7.6. Experimental-Result AVP ...................................97
      7.7. Experimental-Result-Code AVP ..............................97
   8. Diameter User Sessions .........................................98
      8.1. Authorization Session State Machine .......................99
      8.2. Accounting Session State Machine .........................104
        
   6. Diameter Message Processing ....................................74
      6.1. Diameter Request Routing Overview .........................74
           6.1.1. Originating a Request ..............................75
           6.1.2. Sending a Request ..................................76
           6.1.3. Receiving Requests .................................76
           6.1.4. Processing Local Requests ..........................76
           6.1.5. Request Forwarding .................................77
           6.1.6. Request Routing ....................................77
           6.1.7. Predictive Loop Avoidance ..........................77
           6.1.8. Redirecting Requests ...............................78
           6.1.9. Relaying and Proxying Requests .....................79
      6.2. Diameter Answer Processing ................................80
           6.2.1. Processing Received Answers ........................81
           6.2.2. Relaying and Proxying Answers ......................81
      6.3. Origin-Host AVP ...........................................81
      6.4. Origin-Realm AVP ..........................................82
      6.5. Destination-Host AVP ......................................82
      6.6. Destination-Realm AVP .....................................82
      6.7. Routing AVPs ..............................................83
           6.7.1. Route-Record AVP ...................................83
           6.7.2. Proxy-Info AVP .....................................83
           6.7.3. Proxy-Host AVP .....................................83
           6.7.4. Proxy-State AVP ....................................83
      6.8. Auth-Application-Id AVP ...................................83
      6.9. Acct-Application-Id AVP ...................................84
      6.10. Inband-Security-Id AVP ...................................84
      6.11. Vendor-Specific-Application-Id AVP .......................84
      6.12. Redirect-Host AVP ........................................85
      6.13. Redirect-Host-Usage AVP ..................................85
      6.14. Redirect-Max-Cache-Time AVP ..............................87
   7. Error Handling .................................................87
      7.1. Result-Code AVP ...........................................89
           7.1.1. Informational ......................................90
           7.1.2. Success ............................................90
           7.1.3. Protocol Errors ....................................90
           7.1.4. Transient Failures .................................92
           7.1.5. Permanent Failures .................................92
      7.2. Error Bit .................................................95
      7.3. Error-Message AVP .........................................96
      7.4. Error-Reporting-Host AVP ..................................96
      7.5. Failed-AVP AVP ............................................96
      7.6. Experimental-Result AVP ...................................97
      7.7. Experimental-Result-Code AVP ..............................97
   8. Diameter User Sessions .........................................98
      8.1. Authorization Session State Machine .......................99
      8.2. Accounting Session State Machine .........................104
        
      8.3. Server-Initiated Re-Auth .................................110
           8.3.1. Re-Auth-Request ...................................110
           8.3.2. Re-Auth-Answer ....................................110
      8.4. Session Termination ......................................111
           8.4.1. Session-Termination-Request .......................112
           8.4.2. Session-Termination-Answer ........................113
      8.5. Aborting a Session .......................................113
           8.5.1. Abort-Session-Request .............................114
           8.5.2. Abort-Session-Answer ..............................114
      8.6. Inferring Session Termination from Origin-State-Id .......115
      8.7. Auth-Request-Type AVP ....................................116
      8.8. Session-Id AVP ...........................................116
      8.9. Authorization-Lifetime AVP ...............................117
      8.10. Auth-Grace-Period AVP ...................................118
      8.11. Auth-Session-State AVP ..................................118
      8.12. Re-Auth-Request-Type AVP ................................118
      8.13. Session-Timeout AVP .....................................119
      8.14. User-Name AVP ...........................................119
      8.15. Termination-Cause AVP ...................................120
      8.16. Origin-State-Id AVP .....................................120
      8.17. Session-Binding AVP .....................................120
      8.18. Session-Server-Failover AVP .............................121
      8.19. Multi-Round-Time-Out AVP ................................122
      8.20. Class AVP ...............................................122
      8.21. Event-Timestamp AVP .....................................122
   9. Accounting ....................................................123
      9.1. Server Directed Model ....................................123
      9.2. Protocol Messages ........................................124
      9.3. Accounting Application Extension and Requirements ........124
      9.4. Fault Resilience .........................................125
      9.5. Accounting Records .......................................125
      9.6. Correlation of Accounting Records ........................126
      9.7. Accounting Command Codes .................................127
           9.7.1. Accounting-Request ................................127
           9.7.2. Accounting-Answer .................................128
      9.8. Accounting AVPs ..........................................129
           9.8.1. Accounting-Record-Type AVP ........................129
           9.8.2. Acct-Interim-Interval AVP .........................130
           9.8.3. Accounting-Record-Number AVP ......................131
           9.8.4. Acct-Session-Id AVP ...............................131
           9.8.5. Acct-Multi-Session-Id AVP .........................131
           9.8.6. Accounting-Sub-Session-Id AVP .....................131
           9.8.7. Accounting-Realtime-Required AVP ..................132
   10. AVP Occurrence Tables ........................................132
      10.1. Base Protocol Command AVP Table .........................133
      10.2. Accounting AVP Table ....................................134
        
      8.3. Server-Initiated Re-Auth .................................110
           8.3.1. Re-Auth-Request ...................................110
           8.3.2. Re-Auth-Answer ....................................110
      8.4. Session Termination ......................................111
           8.4.1. Session-Termination-Request .......................112
           8.4.2. Session-Termination-Answer ........................113
      8.5. Aborting a Session .......................................113
           8.5.1. Abort-Session-Request .............................114
           8.5.2. Abort-Session-Answer ..............................114
      8.6. Inferring Session Termination from Origin-State-Id .......115
      8.7. Auth-Request-Type AVP ....................................116
      8.8. Session-Id AVP ...........................................116
      8.9. Authorization-Lifetime AVP ...............................117
      8.10. Auth-Grace-Period AVP ...................................118
      8.11. Auth-Session-State AVP ..................................118
      8.12. Re-Auth-Request-Type AVP ................................118
      8.13. Session-Timeout AVP .....................................119
      8.14. User-Name AVP ...........................................119
      8.15. Termination-Cause AVP ...................................120
      8.16. Origin-State-Id AVP .....................................120
      8.17. Session-Binding AVP .....................................120
      8.18. Session-Server-Failover AVP .............................121
      8.19. Multi-Round-Time-Out AVP ................................122
      8.20. Class AVP ...............................................122
      8.21. Event-Timestamp AVP .....................................122
   9. Accounting ....................................................123
      9.1. Server Directed Model ....................................123
      9.2. Protocol Messages ........................................124
      9.3. Accounting Application Extension and Requirements ........124
      9.4. Fault Resilience .........................................125
      9.5. Accounting Records .......................................125
      9.6. Correlation of Accounting Records ........................126
      9.7. Accounting Command Codes .................................127
           9.7.1. Accounting-Request ................................127
           9.7.2. Accounting-Answer .................................128
      9.8. Accounting AVPs ..........................................129
           9.8.1. Accounting-Record-Type AVP ........................129
           9.8.2. Acct-Interim-Interval AVP .........................130
           9.8.3. Accounting-Record-Number AVP ......................131
           9.8.4. Acct-Session-Id AVP ...............................131
           9.8.5. Acct-Multi-Session-Id AVP .........................131
           9.8.6. Accounting-Sub-Session-Id AVP .....................131
           9.8.7. Accounting-Realtime-Required AVP ..................132
   10. AVP Occurrence Tables ........................................132
      10.1. Base Protocol Command AVP Table .........................133
      10.2. Accounting AVP Table ....................................134
        
   11. IANA Considerations ..........................................135
      11.1. AVP Header ..............................................135
           11.1.1. AVP Codes ........................................136
           11.1.2. AVP Flags ........................................136
      11.2. Diameter Header .........................................136
           11.2.1. Command Codes ....................................136
           11.2.2. Command Flags ....................................137
      11.3. AVP Values ..............................................137
           11.3.1. Experimental-Result-Code AVP .....................137
           11.3.2. Result-Code AVP Values ...........................137
           11.3.3. Accounting-Record-Type AVP Values ................137
           11.3.4. Termination-Cause AVP Values .....................137
           11.3.5. Redirect-Host-Usage AVP Values ...................137
           11.3.6. Session-Server-Failover AVP Values ...............137
           11.3.7. Session-Binding AVP Values .......................137
           11.3.8. Disconnect-Cause AVP Values ......................138
           11.3.9. Auth-Request-Type AVP Values .....................138
           11.3.10. Auth-Session-State AVP Values ...................138
           11.3.11. Re-Auth-Request-Type AVP Values .................138
           11.3.12. Accounting-Realtime-Required AVP Values .........138
           11.3.13. Inband-Security-Id AVP (code 299) ...............138
      11.4. _diameters Service Name and Port Number Registration ....138
      11.5. SCTP Payload Protocol Identifiers .......................139
      11.6. S-NAPTR Parameters ......................................139
   12. Diameter Protocol-Related Configurable Parameters ............139
   13. Security Considerations ......................................140
      13.1. TLS/TCP and DTLS/SCTP Usage .............................140
      13.2. Peer-to-Peer Considerations .............................141
      13.3. AVP Considerations ......................................141
   14. References ...................................................142
      14.1. Normative References ....................................142
      14.2. Informative References ..................................144
   Appendix A. Acknowledgements .....................................147
     A.1. This Document .............................................147
     A.2. RFC 3588 ..................................................148
   Appendix B. S-NAPTR Example ......................................148
   Appendix C. Duplicate Detection ..................................149
   Appendix D. Internationalized Domain Names .......................151
        
   11. IANA Considerations ..........................................135
      11.1. AVP Header ..............................................135
           11.1.1. AVP Codes ........................................136
           11.1.2. AVP Flags ........................................136
      11.2. Diameter Header .........................................136
           11.2.1. Command Codes ....................................136
           11.2.2. Command Flags ....................................137
      11.3. AVP Values ..............................................137
           11.3.1. Experimental-Result-Code AVP .....................137
           11.3.2. Result-Code AVP Values ...........................137
           11.3.3. Accounting-Record-Type AVP Values ................137
           11.3.4. Termination-Cause AVP Values .....................137
           11.3.5. Redirect-Host-Usage AVP Values ...................137
           11.3.6. Session-Server-Failover AVP Values ...............137
           11.3.7. Session-Binding AVP Values .......................137
           11.3.8. Disconnect-Cause AVP Values ......................138
           11.3.9. Auth-Request-Type AVP Values .....................138
           11.3.10. Auth-Session-State AVP Values ...................138
           11.3.11. Re-Auth-Request-Type AVP Values .................138
           11.3.12. Accounting-Realtime-Required AVP Values .........138
           11.3.13. Inband-Security-Id AVP (code 299) ...............138
      11.4. _diameters Service Name and Port Number Registration ....138
      11.5. SCTP Payload Protocol Identifiers .......................139
      11.6. S-NAPTR Parameters ......................................139
   12. Diameter Protocol-Related Configurable Parameters ............139
   13. Security Considerations ......................................140
      13.1. TLS/TCP and DTLS/SCTP Usage .............................140
      13.2. Peer-to-Peer Considerations .............................141
      13.3. AVP Considerations ......................................141
   14. References ...................................................142
      14.1. Normative References ....................................142
      14.2. Informative References ..................................144
   Appendix A. Acknowledgements .....................................147
     A.1. This Document .............................................147
     A.2. RFC 3588 ..................................................148
   Appendix B. S-NAPTR Example ......................................148
   Appendix C. Duplicate Detection ..................................149
   Appendix D. Internationalized Domain Names .......................151
        
1. Introduction
1. 介绍

Authentication, Authorization, and Accounting (AAA) protocols such as TACACS [RFC1492] and RADIUS [RFC2865] were initially deployed to provide dial-up PPP [RFC1661] and terminal server access. Over time, AAA support was needed on many new access technologies, the scale and complexity of AAA networks grew, and AAA was also used on new applications (such as voice over IP). This led to new demands on AAA protocols.

身份验证、授权和计费(AAA)协议,如TACACS[RFC1492]和RADIUS[RFC2865]最初被部署用于提供拨号PPP[RFC1661]和终端服务器访问。随着时间的推移,许多新的接入技术需要AAA支持,AAA网络的规模和复杂性不断增长,AAA也被用于新的应用程序(如IP语音)。这就对AAA协议提出了新的要求。

Network access requirements for AAA protocols are summarized in Aboba, et al. [RFC2989]. These include:

AAA协议的网络访问要求在Aboba等[RFC2989]中进行了总结。这些措施包括:

Failover

故障转移

[RFC2865] does not define failover mechanisms and, as a result, failover behavior differs between implementations. In order to provide well-defined failover behavior, Diameter supports application-layer acknowledgements and defines failover algorithms and the associated state machine.

[RFC2865]未定义故障转移机制,因此,不同实现的故障转移行为不同。为了提供定义良好的故障转移行为,Diameter支持应用程序层确认,并定义故障转移算法和关联的状态机。

Transmission-level security

传输级安全

RADIUS [RFC2865] defines an application-layer authentication and integrity scheme that is required only for use with response packets. While [RFC2869] defines an additional authentication and integrity mechanism, use is only required during Extensible Authentication Protocol (EAP) [RFC3748] sessions. While attribute hiding is supported, [RFC2865] does not provide support for per-packet confidentiality. In accounting, [RFC2866] assumes that replay protection is provided by the backend billing server rather than within the protocol itself.

RADIUS[RFC2865]定义了一个应用层身份验证和完整性方案,该方案仅用于响应数据包。虽然[RFC2869]定义了额外的身份验证和完整性机制,但仅在可扩展身份验证协议(EAP)[RFC3748]会话期间需要使用。虽然支持属性隐藏,但[RFC2865]不支持每个数据包的机密性。在记帐中,[RFC2866]假设回放保护由后端计费服务器提供,而不是在协议本身内提供。

While [RFC3162] defines the use of IPsec with RADIUS, support for IPsec is not required. In order to provide universal support for transmission-level security, and enable both intra- and inter-domain AAA deployments, Diameter provides support for TLS/TCP and DTLS/SCTP. Security is discussed in Section 13.

虽然[RFC3162]定义了使用带RADIUS的IPsec,但不需要支持IPsec。为了提供对传输级别安全性的通用支持,并支持域内和域间AAA部署,Diameter提供了对TLS/TCP和DTLS/SCTP的支持。第13节讨论了安全性。

Reliable transport

可靠运输

RADIUS runs over UDP, and does not define retransmission behavior; as a result, reliability varies between implementations. As described in [RFC2975], this is a major issue in accounting, where packet loss may translate directly into revenue loss. In order to

RADIUS在UDP上运行,不定义重传行为;因此,实现之间的可靠性各不相同。如[RFC2975]所述,这是会计中的一个主要问题,数据包丢失可能直接转化为收入损失。为了

provide well-defined transport behavior, Diameter runs over reliable transport mechanisms (TCP, Stream Control Transmission Protocol (SCTP)) as defined in [RFC3539].

按照[RFC3539]中的定义,提供定义良好的传输行为,直径通过可靠的传输机制(TCP、流控制传输协议(SCTP))运行。

Agent support

代理支持

RADIUS does not provide for explicit support for agents, including proxies, redirects, and relays. Since the expected behavior is not defined, it varies between implementations. Diameter defines agent behavior explicitly; this is described in Section 2.8.

RADIUS不提供对代理的显式支持,包括代理、重定向和中继。由于未定义预期的行为,因此不同的实现会有所不同。Diameter明确定义了agent行为;第2.8节对此进行了说明。

Server-initiated messages

服务器启动的消息

While server-initiated messages are defined in RADIUS [RFC5176], support is optional. This makes it difficult to implement features such as unsolicited disconnect or re-authentication/ re-authorization on demand across a heterogeneous deployment. To address this issue, support for server-initiated messages is mandatory in Diameter.

虽然RADIUS[RFC5176]中定义了服务器启动的消息,但支持是可选的。这使得在异构部署中很难实现主动断开连接或按需重新身份验证/重新授权等功能。为了解决这个问题,在Diameter中必须支持服务器启动的消息。

Transition support

过渡支持

While Diameter does not share a common protocol data unit (PDU) with RADIUS, considerable effort has been expended in enabling backward compatibility with RADIUS so that the two protocols may be deployed in the same network. Initially, it is expected that Diameter will be deployed within new network devices, as well as within gateways enabling communication between legacy RADIUS devices and Diameter agents. This capability enables Diameter support to be added to legacy networks, by addition of a gateway or server speaking both RADIUS and Diameter.

虽然Diameter与RADIUS不共享公共协议数据单元(PDU),但在实现与RADIUS的向后兼容性方面已经付出了相当大的努力,以便两个协议可以部署在同一网络中。最初,预计Diameter将部署在新的网络设备中,以及支持传统RADIUS设备和Diameter代理之间通信的网关中。此功能可通过添加同时使用RADIUS和Diameter的网关或服务器,将Diameter支持添加到传统网络中。

In addition to addressing the above requirements, Diameter also provides support for the following:

除满足上述要求外,Diameter还提供以下支持:

Capability negotiation

能力谈判

RADIUS does not support error messages, capability negotiation, or a mandatory/non-mandatory flag for attributes. Since RADIUS clients and servers are not aware of each other's capabilities, they may not be able to successfully negotiate a mutually acceptable service or, in some cases, even be aware of what service has been implemented. Diameter includes support for error handling (Section 7), capability negotiation (Section 5.3), and mandatory/non-mandatory Attribute-Value Pairs (AVPs) (Section 4.1).

RADIUS不支持错误消息、功能协商或属性的强制性/非强制性标志。由于RADIUS客户端和服务器不知道彼此的能力,因此它们可能无法成功协商双方都能接受的服务,或者在某些情况下,甚至无法知道已实现的服务。直径包括对错误处理(第7节)、能力协商(第5.3节)和强制性/非强制性属性值对(AVP)(第4.1节)的支持。

Peer discovery and configuration

对等发现和配置

RADIUS implementations typically require that the name or address of servers or clients be manually configured, along with the corresponding shared secrets. This results in a large administrative burden and creates the temptation to reuse the RADIUS shared secret, which can result in major security vulnerabilities if the Request Authenticator is not globally and temporally unique as required in [RFC2865]. Through DNS, Diameter enables dynamic discovery of peers (see Section 5.2). Derivation of dynamic session keys is enabled via transmission-level security.

RADIUS实施通常要求手动配置服务器或客户端的名称或地址以及相应的共享机密。这导致了巨大的管理负担,并产生了重用RADIUS共享机密的诱惑,如果请求验证器不是[RFC2865]中所要求的全局和时间唯一的,则可能导致严重的安全漏洞。通过DNS,Diameter支持对等点的动态发现(参见第5.2节)。动态会话密钥的派生通过传输级安全性启用。

Over time, the capabilities of Network Access Server (NAS) devices have increased substantially. As a result, while Diameter is a considerably more sophisticated protocol than RADIUS, it remains feasible to implement it within embedded devices.

随着时间的推移,网络访问服务器(NAS)设备的功能大幅增加。因此,虽然Diameter是一个比RADIUS复杂得多的协议,但在嵌入式设备中实现它仍然是可行的。

1.1. Diameter Protocol
1.1. 直径协议

The Diameter base protocol provides the following facilities:

Diameter base协议提供以下功能:

o Ability to exchange messages and deliver AVPs

o 能够交换消息和交付AVP

o Capabilities negotiation

o 能力谈判

o Error notification

o 错误通知

o Extensibility, required in [RFC2989], through addition of new applications, commands, and AVPs

o [RFC2989]中要求的扩展性,通过添加新的应用程序、命令和AVP

o Basic services necessary for applications, such as the handling of user sessions or accounting

o 应用程序所需的基本服务,如处理用户会话或记帐

All data delivered by the protocol is in the form of AVPs. Some of these AVP values are used by the Diameter protocol itself, while others deliver data associated with particular applications that employ Diameter. AVPs may be arbitrarily added to Diameter messages, the only restriction being that the Command Code Format (CCF) specification (Section 3.2) be satisfied. AVPs are used by the base Diameter protocol to support the following required features:

协议提供的所有数据均采用AVPs格式。其中一些AVP值由Diameter协议本身使用,而其他值则提供与使用Diameter的特定应用程序相关的数据。AVP可以任意添加到Diameter消息中,唯一的限制是满足命令代码格式(CCF)规范(第3.2节)。基本直径协议使用AVP支持以下所需功能:

o Transporting of user authentication information, for the purposes of enabling the Diameter server to authenticate the user

o 传输用户身份验证信息,以使Diameter服务器能够对用户进行身份验证

o Transporting of service-specific authorization information, between client and servers, allowing the peers to decide whether a user's access request should be granted

o 在客户端和服务器之间传输特定于服务的授权信息,允许对等方决定是否应授予用户的访问请求

o Exchanging resource usage information, which may be used for accounting purposes, capacity planning, etc.

o 交换资源使用信息,这些信息可用于记帐、容量规划等。

o Routing, relaying, proxying, and redirecting of Diameter messages through a server hierarchy

o 通过服务器层次结构对Diameter消息进行路由、中继、代理和重定向

The Diameter base protocol satisfies the minimum requirements for a AAA protocol, as specified by [RFC2989]. The base protocol may be used by itself for accounting purposes only, or it may be used with a Diameter application, such as Mobile IPv4 [RFC4004], or network access [RFC4005]. It is also possible for the base protocol to be extended for use in new applications, via the addition of new commands or AVPs. The initial focus of Diameter was network access and accounting applications. A truly generic AAA protocol used by many applications might provide functionality not provided by Diameter. Therefore, it is imperative that the designers of new applications understand their requirements before using Diameter. See Section 1.3.4 for more information on Diameter applications.

Diameter基本协议满足[RFC2989]规定的AAA协议的最低要求。基本协议可仅用于记帐目的,也可用于Diameter应用程序,如移动IPv4[RFC4004]或网络访问[RFC4005]。还可以通过添加新命令或AVP来扩展基本协议,以便在新的应用程序中使用。Diameter最初的重点是网络访问和计费应用程序。许多应用程序使用的真正通用的AAA协议可能提供Diameter未提供的功能。因此,在使用直径之前,新应用程序的设计者必须了解其要求。有关直径应用的更多信息,请参见第1.3.4节。

Any node can initiate a request. In that sense, Diameter is a peer-to-peer protocol. In this document, a Diameter client is a device at the edge of the network that performs access control, such as a Network Access Server (NAS) or a Foreign Agent (FA). A Diameter client generates Diameter messages to request authentication, authorization, and accounting services for the user. A Diameter agent is a node that does not provide local user authentication or authorization services; agents include proxies, redirects, and relay agents. A Diameter server performs authentication and/or authorization of the user. A Diameter node may act as an agent for certain requests while acting as a server for others.

任何节点都可以发起请求。从这个意义上讲,Diameter是一种对等协议。在本文档中,Diameter客户端是网络边缘执行访问控制的设备,如网络访问服务器(NAS)或外部代理(FA)。Diameter客户端生成Diameter消息以请求用户的身份验证、授权和记帐服务。Diameter代理是不提供本地用户身份验证或授权服务的节点;代理包括代理、重定向和中继代理。Diameter服务器执行用户的身份验证和/或授权。Diameter节点可以充当某些请求的代理,同时充当其他请求的服务器。

The Diameter protocol also supports server-initiated messages, such as a request to abort service to a particular user.

Diameter协议还支持服务器启动的消息,例如向特定用户请求中止服务。

1.1.1. Description of the Document Set
1.1.1. 文档集的说明

The Diameter specification consists of an updated version of the base protocol specification (this document) and the Transport Profile [RFC3539]. This document obsoletes both RFC 3588 and RFC 5719. A summary of the base protocol updates included in this document can be found in Section 1.1.3.

Diameter规范包括基本协议规范(本文件)的更新版本和传输配置文件[RFC3539]。本文件淘汰了RFC 3588和RFC 5719。本文件中包含的基本协议更新摘要见第1.1.3节。

This document defines the base protocol specification for AAA, which includes support for accounting. There are also a myriad of applications documents describing applications that use this base specification for Authentication, Authorization, and Accounting. These application documents specify how to use the Diameter protocol within the context of their application.

本文档定义了AAA的基本协议规范,其中包括对记帐的支持。还有大量应用程序文档描述使用此基本规范进行身份验证、授权和记帐的应用程序。这些应用程序文档指定了如何在其应用程序上下文中使用Diameter协议。

The Transport Profile document [RFC3539] discusses transport layer issues that arise with AAA protocols and recommendations on how to overcome these issues. This document also defines the Diameter failover algorithm and state machine.

传输配置文件文档[RFC3539]讨论了AAA协议产生的传输层问题,并就如何克服这些问题提出了建议。本文档还定义了Diameter故障切换算法和状态机。

"Clarifications on the Routing of Diameter Request Based on the Username and the Realm" [RFC5729] defines specific behavior on how to route requests based on the content of the User-Name AVP (Attribute Value Pair).

“基于用户名和领域的Diameter请求路由说明”[RFC5729]定义了如何基于用户名AVP(属性值对)内容路由请求的具体行为。

1.1.2. Conventions Used in This Document
1.1.2. 本文件中使用的公约

The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in [RFC2119].

本文件中的关键词“必须”、“不得”、“必需”、“应”、“不应”、“应”、“不应”、“建议”、“可”和“可选”应按照[RFC2119]中所述进行解释。

1.1.3. Changes from RFC 3588
1.1.3. RFC 3588的变更

This document obsoletes RFC 3588 but is fully backward compatible with that document. The changes introduced in this document focus on fixing issues that have surfaced during the implementation of Diameter (RFC 3588). An overview of some the major changes are given below.

本文件淘汰RFC 3588,但与该文件完全向后兼容。本文档中介绍的更改侧重于修复Diameter(RFC 3588)实施过程中出现的问题。下文概述了一些主要变化。

o Deprecated the use of the Inband-Security AVP for negotiating Transport Layer Security (TLS) [RFC5246]. It has been generally considered that bootstrapping of TLS via Inband-Security AVP creates certain security risks because it does not completely protect the information carried in the CER/CEA (Capabilities-Exchange-Request/Capabilities-Exchange-Answer). This version of Diameter adopts the common approach of defining a well-known secured port that peers should use when communicating via TLS/TCP and DTLS/SCTP. This new approach augments the existing in-band security negotiation, but it does not completely replace it. The old method is kept for backward compatibility reasons.

o 不推荐使用带内安全AVP协商传输层安全(TLS)[RFC5246]。通常认为,通过带内安全AVP引导TLS会产生某些安全风险,因为它不能完全保护CER/CEA(能力交换请求/能力交换应答)中携带的信息。此版本的Diameter采用了一种常见的方法,即定义一个众所周知的安全端口,对等方在通过TLS/TCP和DTLS/SCTP进行通信时应使用该端口。这种新方法增强了现有的带内安全协商,但并不能完全取代它。出于向后兼容的原因保留旧方法。

o Deprecated the exchange of CER/CEA messages in the open state. This feature was implied in the peer state machine table of RFC 3588, but it was not clearly defined anywhere else in that document. As work on this document progressed, it became clear that the multiplicity of meaning and use of Application-Id AVPs in the CER/CEA messages (and the messages themselves) is seen as an abuse of the Diameter extensibility rules and thus required simplification. Capabilities exchange in the open state has been re-introduced in a separate specification [RFC6737], which clearly defines new commands for this feature.

o 不推荐在打开状态下交换CER/CEA消息。RFC3588的对等状态机表中暗示了此功能,但在该文档的其他地方没有明确定义。随着本文档工作的进展,很明显,CER/CEA消息(以及消息本身)中应用程序Id AVP的含义和使用的多样性被视为对Diameter扩展性规则的滥用,因此需要简化。开放状态下的功能交换已在单独的规范[RFC6737]中重新引入,该规范明确定义了此功能的新命令。

o Simplified security requirements. The use of a secured transport for exchanging Diameter messages remains mandatory. However, TLS/ TCP and DTLS/SCTP have become the primary methods of securing Diameter with IPsec as a secondary alternative. See Section 13 for details. The support for the End-to-End security framework (E2E-Sequence AVP and 'P'-bit in the AVP header) has also been deprecated.

o 简化的安全要求。使用安全传输来交换Diameter消息仍然是强制性的。然而,TLS/TCP和DTLS/SCTP已经成为保护Diameter的主要方法,而IPsec作为次要替代方案。详见第13节。对端到端安全框架(E2E序列AVP和AVP头中的“P”-位)的支持也已被弃用。

o Changed Diameter extensibility. This includes fixes to the Diameter extensibility description (Section 1.3 and others) to better aid Diameter application designers; in addition, the new specification relaxes the policy with respect to the allocation of Command Codes for vendor-specific uses.

o 改变直径扩展性。这包括对Diameter扩展性描述(第1.3节和其他部分)的修正,以更好地帮助Diameter应用程序设计者;此外,新规范放宽了有关为供应商特定用途分配命令代码的政策。

o Clarified Application Id usage. Clarify the proper use of Application Id information, which can be found in multiple places within a Diameter message. This includes correlating Application Ids found in the message headers and AVPs. These changes also clearly specify the proper Application Id value to use for specific base protocol messages (ASR/ASA, STR/STA) as well as clarify the content and use of Vendor-Specific-Application-Id.

o 阐明了应用程序Id的用法。阐明应用程序Id信息的正确使用,这些信息可以在Diameter消息的多个位置找到。这包括关联在消息头和AVP中找到的应用程序ID。这些更改还明确指定了用于特定基本协议消息(ASR/ASA、STR/STA)的正确应用程序Id值,并澄清了供应商特定的应用程序Id的内容和使用。

o Clarified routing fixes. This document more clearly specifies what information (AVPs and Application Ids) can be used for making general routing decisions. A rule for the prioritization of redirect routing criteria when multiple route entries are found via redirects has also been added (see Section 6.13).

o 澄清路由修复。本文档更明确地指定了可用于做出一般路由决策的信息(AVP和应用程序ID)。当通过重定向找到多个路由条目时,还添加了重定向路由标准的优先级规则(见第6.13节)。

o Simplified Diameter peer discovery. The Diameter discovery process now supports only widely used discovery schemes; the rest have been deprecated (see Section 5.2 for details).

o 简化的对等发现。Diameter发现过程现在只支持广泛使用的发现方案;其余部分已被弃用(详见第5.2节)。

There are many other miscellaneous fixes that have been introduced in this document that may not be considered significant, but they have value nonetheless. Examples are removal of obsolete types, fixes to the state machine, clarification of the election process, message validation, fixes to Failed-AVP and Result-Code AVP values, etc. All of the errata filed against RFC 3588 prior to the publication of this document have been addressed. A comprehensive list of changes is not shown here for practical reasons.

本文档中引入的许多其他杂项修复可能并不重要,但它们仍然有价值。示例包括删除过时类型、修复状态机、澄清选举过程、消息验证、修复失败的AVP和结果代码AVP值等。本文件发布前根据RFC 3588提交的所有勘误表均已解决。出于实际原因,此处未显示全面的变更列表。

1.2. Terminology
1.2. 术语

AAA

AAA

Authentication, Authorization, and Accounting.

身份验证、授权和记帐。

ABNF

荷兰银行

Augmented Backus-Naur Form [RFC5234]. A metalanguage with its own formal syntax and rules. It is based on the Backus-Naur Form and is used to define message exchanges in a bi-directional communications protocol.

增广巴科斯诺尔形式[RFC5234]。一种具有自身形式语法和规则的元语言。它基于Backus-Naur形式,用于定义双向通信协议中的消息交换。

Accounting

会计

The act of collecting information on resource usage for the purpose of capacity planning, auditing, billing, or cost allocation.

为容量规划、审计、计费或成本分配而收集资源使用信息的行为。

Accounting Record

会计记录

An accounting record represents a summary of the resource consumption of a user over the entire session. Accounting servers creating the accounting record may do so by processing interim accounting events or accounting events from several devices serving the same user.

记帐记录表示整个会话中用户资源消耗的摘要。创建记帐记录的记帐服务器可以通过处理临时记帐事件或来自为同一用户服务的多个设备的记帐事件来实现。

Authentication

认证

The act of verifying the identity of an entity (subject).

验证实体(主体)身份的行为。

Authorization

批准

The act of determining whether a requesting entity (subject) will be allowed access to a resource (object).

确定是否允许请求实体(主体)访问资源(对象)的行为。

Attribute-Value Pair (AVP)

属性值对(AVP)

The Diameter protocol consists of a header followed by one or more Attribute-Value-Pairs (AVPs). An AVP includes a header and is used to encapsulate protocol-specific data (e.g., routing information) as well as authentication, authorization, or accounting information.

Diameter协议由一个标头和一个或多个属性值对(AVP)组成。AVP包括报头,用于封装协议特定数据(例如,路由信息)以及认证、授权或记帐信息。

Command Code Format (CCF)

命令代码格式(CCF)

A modified form of ABNF used to define Diameter commands (see Section 3.2).

ABNF的一种修改形式,用于定义直径命令(见第3.2节)。

Diameter Agent

直径剂

A Diameter Agent is a Diameter node that provides relay, proxy, redirect, or translation services.

Diameter代理是提供中继、代理、重定向或转换服务的Diameter节点。

Diameter Client

直径客户端

A Diameter client is a Diameter node that supports Diameter client applications as well as the base protocol. Diameter clients are often implemented in devices situated at the edge of a network and provide access control services for that network. Typical examples of Diameter clients include the Network Access Server (NAS) and the Mobile IP Foreign Agent (FA).

Diameter客户端是支持Diameter客户端应用程序以及基本协议的Diameter节点。Diameter客户端通常在位于网络边缘的设备中实现,并为该网络提供访问控制服务。Diameter客户端的典型示例包括网络访问服务器(NAS)和移动IP外部代理(FA)。

Diameter Node

直径节点

A Diameter node is a host process that implements the Diameter protocol and acts as either a client, an agent, or a server.

Diameter节点是一个主机进程,它实现Diameter协议并充当客户端、代理或服务器。

Diameter Peer

直径对等体

Two Diameter nodes sharing a direct TCP or SCTP transport connection are called Diameter peers.

共享直接TCP或SCTP传输连接的两个Diameter节点称为Diameter对等节点。

Diameter Server

直径服务器

A Diameter server is a Diameter node that handles authentication, authorization, and accounting requests for a particular realm. By its very nature, a Diameter server must support Diameter server applications in addition to the base protocol.

Diameter服务器是处理特定领域的身份验证、授权和记帐请求的Diameter节点。就其本质而言,Diameter服务器必须支持基本协议之外的Diameter服务器应用程序。

Downstream

下游的

Downstream is used to identify the direction of a particular Diameter message from the home server towards the Diameter client.

下游用于标识特定Diameter消息从家庭服务器到Diameter客户端的方向。

Home Realm

家乡

A Home Realm is the administrative domain with which the user maintains an account relationship.

主域是用户与之保持帐户关系的管理域。

Home Server

家庭服务器

A Diameter server that serves the Home Realm.

服务于家庭领域的Diameter服务器。

Interim Accounting

中期会计

An interim accounting message provides a snapshot of usage during a user's session. Typically, it is implemented in order to provide for partial accounting of a user's session in case a device reboot or other network problem prevents the delivery of a session summary message or session record.

临时记帐消息提供用户会话期间使用情况的快照。通常,它的实现是为了在设备重新启动或其他网络问题阻止会话摘要消息或会话记录的传递时提供用户会话的部分记帐。

Local Realm

本地域

A local realm is the administrative domain providing services to a user. An administrative domain may act as a local realm for certain users while being a home realm for others.

本地域是向用户提供服务的管理域。管理域可以作为某些用户的本地域,而作为其他用户的主域。

Multi-session

多会话

A multi-session represents a logical linking of several sessions. Multi-sessions are tracked by using the Acct-Multi-Session-Id. An example of a multi-session would be a Multi-link PPP bundle. Each leg of the bundle would be a session while the entire bundle would be a multi-session.

多会话表示多个会话的逻辑链接。使用Acct-Multi-Session-Id跟踪多个会话。多会话的一个示例是多链路PPP捆绑包。捆绑包的每个分支将是一个会话,而整个捆绑包将是一个多会话。

Network Access Identifier

网络访问标识符

The Network Access Identifier, or NAI [RFC4282], is used in the Diameter protocol to extract a user's identity and realm. The identity is used to identify the user during authentication and/or authorization while the realm is used for message routing purposes.

网络访问标识符或NAI[RFC4282]在Diameter协议中用于提取用户的身份和领域。身份用于在身份验证和/或授权期间标识用户,而域用于消息路由目的。

Proxy Agent or Proxy

代理

In addition to forwarding requests and responses, proxies make policy decisions relating to resource usage and provisioning. Typically, this is accomplished by tracking the state of NAS devices. While proxies usually do not respond to client requests prior to receiving a response from the server, they may originate Reject messages in cases where policies are violated. As a result, proxies need to understand the semantics of the messages passing through them, and they may not support all Diameter applications.

除了转发请求和响应外,代理还做出与资源使用和资源调配相关的策略决策。通常,这是通过跟踪NAS设备的状态来实现的。虽然代理通常不会在从服务器接收响应之前响应客户端请求,但在违反策略的情况下,它们可能会发出拒绝消息。因此,代理需要理解通过它们传递的消息的语义,并且它们可能不支持所有Diameter应用程序。

Realm

领域

The string in the NAI that immediately follows the '@' character. NAI realm names are required to be unique and are piggybacked on the administration of the DNS namespace. Diameter makes use of the realm, also loosely referred to as domain, to determine whether messages can be satisfied locally or whether they must be routed or redirected. In RADIUS, realm names are not necessarily piggybacked on the DNS namespace but may be independent of it.

NAI中紧跟“@”字符的字符串。NAI领域名称必须是唯一的,并且由DNS名称空间的管理提供。Diameter利用领域(也称为域)来确定消息是否可以在本地得到满足,或者消息是否必须路由或重定向。在RADIUS中,域名不一定是DNS名称空间上的载体,但可能独立于DNS名称空间。

Real-Time Accounting

实时会计

Real-time accounting involves the processing of information on resource usage within a defined time window. Typically, time constraints are imposed in order to limit financial risk. The Diameter Credit-Control Application [RFC4006] is an example of an application that defines real-time accounting functionality.

实时记帐涉及在定义的时间窗口内处理有关资源使用情况的信息。通常,时间限制是为了限制金融风险。Diameter信用控制应用程序[RFC4006]是定义实时会计功能的应用程序示例。

Relay Agent or Relay

中继代理或中继

Relays forward requests and responses based on routing-related AVPs and routing table entries. Since relays do not make policy decisions, they do not examine or alter non-routing AVPs. As a result, relays never originate messages, do not need to understand the semantics of messages or non-routing AVPs, and are capable of handling any Diameter application or message type. Since relays make decisions based on information in routing AVPs and realm forwarding tables, they do not keep state on NAS resource usage or sessions in progress.

中继转发基于路由相关AVP和路由表条目的请求和响应。由于中继器不会做出策略决策,因此它们不会检查或更改非路由AVP。因此,中继从不发起消息,不需要理解消息或非路由AVP的语义,并且能够处理任何Diameter应用程序或消息类型。由于中继根据路由AVP和领域转发表中的信息做出决策,因此它们不会保持NAS资源使用或正在进行的会话的状态。

Redirect Agent

重定向代理

Rather than forwarding requests and responses between clients and servers, redirect agents refer clients to servers and allow them to communicate directly. Since redirect agents do not sit in the forwarding path, they do not alter any AVPs transiting between client and server. Redirect agents do not originate messages and are capable of handling any message type, although they may be configured only to redirect messages of certain types, while acting as relay or proxy agents for other types. As with relay agents, redirect agents do not keep state with respect to sessions or NAS resources.

重定向代理不在客户端和服务器之间转发请求和响应,而是将客户端指向服务器,并允许它们直接通信。由于重定向代理不位于转发路径中,因此它们不会更改在客户端和服务器之间传输的任何AVP。重定向代理不发起消息,并且能够处理任何消息类型,尽管它们可能仅配置为重定向某些类型的消息,同时充当其他类型的中继或代理。与中继代理一样,重定向代理不保持会话或NAS资源的状态。

Session

一场

A session is a related progression of events devoted to a particular activity. Diameter application documents provide guidelines as to when a session begins and ends. All Diameter packets with the same Session-Id are considered to be part of the same session.

会话是专门用于特定活动的事件的相关进展。Diameter应用程序文档提供了会话开始和结束的时间指南。具有相同会话Id的所有Diameter数据包都被视为同一会话的一部分。

Stateful Agent

有状态代理

A stateful agent is one that maintains session state information, by keeping track of all authorized active sessions. Each authorized session is bound to a particular service, and its state is considered active either until it is notified otherwise or until expiration.

有状态代理通过跟踪所有授权的活动会话来维护会话状态信息。每个授权会话都绑定到一个特定的服务,其状态被认为是活动的,直到收到其他通知或到期。

Sub-session

分组会议

A sub-session represents a distinct service (e.g., QoS or data characteristics) provided to a given session. These services may happen concurrently (e.g., simultaneous voice and data transfer during the same session) or serially. These changes in sessions are tracked with the Accounting-Sub-Session-Id.

子会话表示提供给给定会话的不同服务(例如,QoS或数据特征)。这些服务可以同时发生(例如,在同一会话期间同时进行语音和数据传输)或连续发生。会话中的这些更改通过Accounting-Sub-Session-Id进行跟踪。

Transaction State

事务状态

The Diameter protocol requires that agents maintain transaction state, which is used for failover purposes. Transaction state implies that upon forwarding a request, the Hop-by-Hop Identifier is saved; the field is replaced with a locally unique identifier, which is restored to its original value when the corresponding answer is received. The request's state is released upon receipt of the answer. A stateless agent is one that only maintains transaction state.

Diameter协议要求代理维护事务状态,事务状态用于故障切换。事务状态意味着在转发请求时,逐跳标识符被保存;该字段将替换为本地唯一标识符,当收到相应的答案时,该标识符将恢复为其原始值。请求的状态在收到答复后即被释放。无状态代理是只维护事务状态的代理。

Translation Agent

翻译代理

A translation agent (TLA in Figure 4) is a stateful Diameter node that performs protocol translation between Diameter and another AAA protocol, such as RADIUS.

翻译代理(图4中的TLA)是一个有状态的Diameter节点,它在Diameter和另一个AAA协议(如RADIUS)之间执行协议转换。

Upstream

上游

Upstream is used to identify the direction of a particular Diameter message from the Diameter client towards the home server.

上游用于标识特定Diameter消息从Diameter客户端到家庭服务器的方向。

User

使用者

The entity or device requesting or using some resource, in support of which a Diameter client has generated a request.

请求或使用某些资源的实体或设备,Diameter客户端已生成请求以支持该实体或设备。

1.3. Approach to Extensibility
1.3. 扩展性方法

The Diameter protocol is designed to be extensible, using several mechanisms, including:

Diameter协议设计为可扩展,使用了多种机制,包括:

o Defining new AVP values

o 定义新的AVP值

o Creating new AVPs

o 创建新的AVP

o Creating new commands

o 创建新命令

o Creating new applications

o 创建新的应用程序

From the point of view of extensibility, Diameter authentication, authorization, and accounting applications are treated in the same way.

从可扩展性的角度来看,Diameter身份验证、授权和记帐应用程序的处理方式是相同的。

Note: Protocol designers should try to reuse existing functionality, namely AVP values, AVPs, commands, and Diameter applications. Reuse simplifies standardization and implementation. To avoid potential interoperability issues, it is important to ensure that the semantics of the reused features are well understood. Given that Diameter can also carry RADIUS attributes as Diameter AVPs, such reuse considerations also apply to existing RADIUS attributes that may be useful in a Diameter application.

注意:协议设计者应尝试重用现有功能,即AVP值、AVP、命令和Diameter应用程序。重用简化了标准化和实现。为了避免潜在的互操作性问题,确保重用特性的语义得到充分理解是很重要的。鉴于直径还可以携带半径属性作为直径AVP,此类重用考虑也适用于现有半径属性,这些属性在直径应用程序中可能有用。

1.3.1. Defining New AVP Values
1.3.1. 定义新的AVP值

In order to allocate a new AVP value for AVPs defined in the Diameter base protocol, the IETF needs to approve a new RFC that describes the AVP value. IANA considerations for these AVP values are discussed in Section 11.3.

为了为Diameter base协议中定义的AVP分配新的AVP值,IETF需要批准描述AVP值的新RFC。第11.3节讨论了这些AVP值的IANA注意事项。

The allocation of AVP values for other AVPs is guided by the IANA considerations of the document that defines those AVPs. Typically, allocation of new values for an AVP defined in an RFC would require IETF Review [RFC5226], whereas values for vendor-specific AVPs can be allocated by the vendor.

其他AVP的AVP值分配由定义这些AVP的文件中的IANA注意事项指导。通常,RFC中定义的AVP的新值分配需要IETF审查[RFC5226],而供应商特定AVP的值可由供应商分配。

1.3.2. Creating New AVPs
1.3.2. 创建新的AVP

A new AVP being defined MUST use one of the data types listed in Sections 4.2 or 4.3. If an appropriate derived data type is already defined, it SHOULD be used instead of a base data type to encourage reusability and good design practice.

定义的新AVP必须使用第4.2节或第4.3节中列出的数据类型之一。如果已经定义了适当的派生数据类型,则应该使用它而不是基本数据类型,以鼓励重用性和良好的设计实践。

In the event that a logical grouping of AVPs is necessary, and multiple "groups" are possible in a given command, it is recommended that a Grouped AVP be used (see Section 4.4).

如果需要对AVP进行逻辑分组,并且给定命令中可能存在多个“组”,建议使用分组AVP(见第4.4节)。

The creation of new AVPs can happen in various ways. The recommended approach is to define a new general-purpose AVP in a Standards Track RFC approved by the IETF. However, as described in Section 11.1.1, there are other mechanisms.

新AVP的创建可以以各种方式进行。建议的方法是在IETF批准的标准跟踪RFC中定义新的通用AVP。但是,如第11.1.1节所述,还有其他机制。

1.3.3. Creating New Commands
1.3.3. 创建新命令

A new Command Code MUST be allocated when required AVPs (those indicated as {AVP} in the CCF definition) are added to, deleted from, or redefined in (for example, by changing a required AVP into an optional one) an existing command.

在现有命令中添加、删除或重新定义所需AVP(CCF定义中指示为{AVP})时(例如,通过将所需AVP更改为可选AVP),必须分配新的命令代码。

Furthermore, if the transport characteristics of a command are changed (for example, with respect to the number of round trips required), a new Command Code MUST be registered.

此外,如果命令的传输特性发生变化(例如,与所需往返次数有关),则必须注册新的命令代码。

A change to the CCF of a command, such as described above, MUST result in the definition of a new Command Code. This subsequently leads to the need to define a new Diameter application for any application that will use that new command.

如上文所述,对命令CCF的更改必须导致新命令代码的定义。因此,需要为将使用该新命令的任何应用程序定义新的直径应用程序。

The IANA considerations for Command Codes are discussed in Section 3.1.

第3.1节讨论了指令代码的IANA注意事项。

1.3.4. Creating New Diameter Applications
1.3.4. 创建新的Diameter应用程序

Every Diameter application specification MUST have an IANA-assigned Application Id (see Section 2.4). The managed Application ID space is flat, and there is no relationship between different Diameter applications with respect to their Application Ids. As such, there is no versioning support provided by these Application Ids themselves; every Diameter application is a standalone application. If the application has a relationship with other Diameter applications, such a relationship is not known to Diameter.

每个Diameter应用规范必须有IANA分配的应用Id(见第2.4节)。托管应用程序ID空间是平坦的,不同直径的应用程序之间没有应用程序ID的关系。因此,这些应用程序ID本身不提供版本控制支持;每个Diameter应用程序都是独立的应用程序。如果应用程序与其他Diameter应用程序存在关系,则Diameter不知道这种关系。

Before describing the rules for creating new Diameter applications, it is important to discuss the semantics of the AVP occurrences as stated in the CCF and the M-bit flag (Section 4.1) for an AVP. There is no relationship imposed between the two; they are set independently.

在描述创建新Diameter应用程序的规则之前,重要的是讨论CCF中所述AVP出现的语义和AVP的M位标志(第4.1节)。两者之间没有强加的关系;它们是独立设置的。

o The CCF indicates what AVPs are placed into a Diameter command by the sender of that command. Often, since there are multiple modes of protocol interactions, many of the AVPs are indicated as optional.

o CCF表示命令发送方将哪些AVP放入Diameter命令中。通常,由于存在多种协议交互模式,许多AVP被指示为可选。

o The M-bit allows the sender to indicate to the receiver whether or not understanding the semantics of an AVP and its content is mandatory. If the M-bit is set by the sender and the receiver does not understand the AVP or the values carried within that AVP, then a failure is generated (see Section 7).

o M位允许发送方向接收方指示是否必须理解AVP及其内容的语义。如果发送方设置了M位,而接收方不理解AVP或该AVP中携带的值,则产生故障(参见第7节)。

It is the decision of the protocol designer when to develop a new Diameter application rather than extending Diameter in other ways. However, a new Diameter application MUST be created when one or more of the following criteria are met:

何时开发新的Diameter应用程序而不是以其他方式扩展Diameter,这是协议设计者的决定。但是,当满足以下一个或多个条件时,必须创建新的直径应用程序:

M-bit Setting

M位设置

An AVP with the M-bit in the MUST column of the AVP flag table is added to an existing Command/Application. An AVP with the M-bit in the MAY column of the AVP flag table is added to an existing Command/Application.

AVP标志表的“必须”列中包含M位的AVP将添加到现有命令/应用程序中。在AVP标志表的MAY列中具有M位的AVP被添加到现有命令/应用程序中。

Note: The M-bit setting for a given AVP is relevant to an Application and each command within that application that includes the AVP. That is, if an AVP appears in two commands for application Foo and the M-bit settings are different in each command, then there should be two AVP flag tables describing when to set the M-bit.

注:给定AVP的M位设置与应用程序以及该应用程序中包含AVP的每个命令相关。也就是说,如果AVP出现在应用程序Foo的两个命令中,并且每个命令中的M位设置不同,那么应该有两个AVP标志表来描述何时设置M位。

Commands

命令

A new command is used within the existing application because either an additional command is added, an existing command has been modified so that a new Command Code had to be registered, or a command has been deleted.

在现有应用程序中使用新命令是因为添加了其他命令、修改了现有命令以便必须注册新命令代码或删除了命令。

AVP Flag bits

AVP标志位

If an existing application changes the meaning/semantics of its AVP Flags or adds new flag bits, then a new Diameter application MUST be created.

如果现有应用程序更改其AVP标志的含义/语义或添加新标志位,则必须创建新的Diameter应用程序。

If the CCF definition of a command allows it, an implementation may add arbitrary optional AVPs with the M-bit cleared (including vendor-specific AVPs) to that command without needing to define a new application. Please refer to Section 11.1.1 for details.

如果命令的CCF定义允许,则实现可以向该命令添加任意可选的M位清除AVP(包括特定于供应商的AVP),而无需定义新的应用程序。详情请参考第11.1.1节。

2. Protocol Overview
2. 协议概述

The base Diameter protocol concerns itself with establishing connections to peers, capabilities negotiation, how messages are sent and routed through peers, and how the connections are eventually torn down. The base protocol also defines certain rules that apply to all message exchanges between Diameter nodes.

base Diameter协议涉及到建立与对等方的连接、功能协商、如何通过对等方发送和路由消息,以及如何最终断开连接。基本协议还定义了适用于Diameter节点之间所有消息交换的特定规则。

Communication between Diameter peers begins with one peer sending a message to another Diameter peer. The set of AVPs included in the message is determined by a particular Diameter application. One AVP that is included to reference a user's session is the Session-Id.

Diameter对等点之间的通信始于一个对等点向另一个Diameter对等点发送消息。消息中包含的AVP集由特定直径应用程序确定。一个用于引用用户会话的AVP是session-Id。

The initial request for authentication and/or authorization of a user would include the Session-Id AVP. The Session-Id is then used in all subsequent messages to identify the user's session (see Section 8 for

对用户的认证和/或授权的初始请求将包括会话Id AVP。然后在所有后续消息中使用会话Id来标识用户的会话(有关详细信息,请参阅第8节)

more information). The communicating party may accept the request or reject it by returning an answer message with the Result-Code AVP set to indicate that an error occurred. The specific behavior of the Diameter server or client receiving a request depends on the Diameter application employed.

(更多信息)。通信方可以通过返回应答消息来接受请求或拒绝请求,应答消息的结果代码AVP设置为指示发生了错误。接收请求的Diameter服务器或客户端的特定行为取决于所使用的Diameter应用程序。

Session state (associated with a Session-Id) MUST be freed upon receipt of the Session-Termination-Request, Session-Termination-Answer, expiration of authorized service time in the Session-Timeout AVP, and according to rules established in a particular Diameter application.

会话状态(与会话Id关联)必须在收到会话终止请求、会话终止应答、会话超时AVP中的授权服务时间到期后,根据特定Diameter应用程序中建立的规则释放。

The base Diameter protocol may be used by itself for accounting applications. For authentication and authorization, it is always extended for a particular application.

基本直径协议本身可用于记帐应用程序。对于身份验证和授权,它总是针对特定的应用程序进行扩展。

Diameter clients MUST support the base protocol, which includes accounting. In addition, they MUST fully support each Diameter application that is needed to implement the client's service, e.g., Network Access Server Requirements (NASREQ) [RFC2881] and/or Mobile IPv4. A Diameter client MUST be referred to as "Diameter X Client" where X is the application that it supports and not a "Diameter Client".

Diameter客户端必须支持基本协议,其中包括记帐。此外,它们必须完全支持实现客户端服务所需的每个Diameter应用程序,例如网络访问服务器要求(NASREQ)[RFC2881]和/或移动IPv4。Diameter客户端必须称为“Diameter X客户端”,其中X是其支持的应用程序,而不是“Diameter客户端”。

Diameter servers MUST support the base protocol, which includes accounting. In addition, they MUST fully support each Diameter application that is needed to implement the intended service, e.g., NASREQ and/or Mobile IPv4. A Diameter server MUST be referred to as "Diameter X Server" where X is the application that it supports, and not a "Diameter Server".

Diameter服务器必须支持基本协议,其中包括记帐。此外,它们必须完全支持实现预期服务所需的每个Diameter应用程序,例如NASREQ和/或移动IPv4。Diameter服务器必须称为“Diameter X服务器”,其中X是其支持的应用程序,而不是“Diameter服务器”。

Diameter relays and redirect agents are transparent to the Diameter applications, but they MUST support the Diameter base protocol, which includes accounting, and all Diameter applications.

Diameter中继和重定向代理对Diameter应用程序是透明的,但它们必须支持Diameter基本协议(包括记帐)和所有Diameter应用程序。

Diameter proxies MUST support the base protocol, which includes accounting. In addition, they MUST fully support each Diameter application that is needed to implement proxied services, e.g., NASREQ and/or Mobile IPv4. A Diameter proxy MUST be referred to as "Diameter X Proxy" where X is the application which it supports, and not a "Diameter Proxy".

Diameter代理必须支持基本协议,其中包括记帐。此外,它们必须完全支持实现代理服务(例如NASREQ和/或移动IPv4)所需的每个Diameter应用程序。直径代理必须称为“直径X代理”,其中X是其支持的应用程序,而不是“直径代理”。

2.1. Transport
2.1. 运输

The Diameter Transport profile is defined in [RFC3539].

[RFC3539]中定义了直径传输剖面。

The base Diameter protocol is run on port 3868 for both TCP [RFC0793] and SCTP [RFC4960]. For TLS [RFC5246] and Datagram Transport Layer Security (DTLS) [RFC6347], a Diameter node that initiates a connection prior to any message exchanges MUST run on port 5658. It is assumed that TLS is run on top of TCP when it is used, and DTLS is run on top of SCTP when it is used.

基本直径协议在TCP[RFC0793]和SCTP[RFC4960]的端口3868上运行。对于TLS[RFC5246]和数据报传输层安全性(DTLS)[RFC6347],在任何消息交换之前启动连接的Diameter节点必须在端口5658上运行。假设TLS在使用时在TCP之上运行,DTLS在使用时在SCTP之上运行。

If the Diameter peer does not support receiving TLS/TCP and DTLS/SCTP connections on port 5658 (i.e., the peer complies only with RFC 3588), then the initiator MAY revert to using TCP or SCTP on port 3868. Note that this scheme is kept only for the purpose of backward compatibility and that there are inherent security vulnerabilities when the initial CER/CEA messages are sent unprotected (see Section 5.6).

如果Diameter对等方不支持在端口5658上接收TLS/TCP和DTLS/SCTP连接(即,对等方仅符合RFC 3588),则发起方可以恢复在端口3868上使用TCP或SCTP。请注意,此方案仅出于向后兼容性的目的而保留,并且当初始CER/CEA消息在未受保护的情况下发送时,存在固有的安全漏洞(参见第5.6节)。

Diameter clients MUST support either TCP or SCTP; agents and servers SHOULD support both.

Diameter客户端必须支持TCP或SCTP;代理和服务器应同时支持这两种功能。

A Diameter node MAY initiate connections from a source port other than the one that it declares it accepts incoming connections on, and it MUST always be prepared to receive connections on port 3868 for TCP or SCTP and port 5658 for TLS/TCP and DTLS/SCTP connections. When DNS-based peer discovery (Section 5.2) is used, the port numbers received from SRV records take precedence over the default ports (3868 and 5658).

Diameter节点可以从其声明接受传入连接的源端口以外的源端口启动连接,并且它必须始终准备好接收TCP或SCTP端口3868上的连接,以及TLS/TCP和DTLS/SCTP连接端口5658上的连接。使用基于DNS的对等发现(第5.2节)时,从SRV记录接收的端口号优先于默认端口(3868和5658)。

A given Diameter instance of the peer state machine MUST NOT use more than one transport connection to communicate with a given peer, unless multiple instances exist on the peer, in which, case a separate connection per process is allowed.

对等状态机的给定Diameter实例不得使用多个传输连接与给定对等进行通信,除非对等上存在多个实例,在这种情况下,允许每个进程单独连接。

When no transport connection exists with a peer, an attempt to connect SHOULD be made periodically. This behavior is handled via the Tc timer (see Section 12 for details), whose recommended value is 30 seconds. There are certain exceptions to this rule, such as when a peer has terminated the transport connection stating that it does not wish to communicate.

当不存在与对等方的传输连接时,应定期尝试连接。此行为通过Tc定时器(详见第12节)处理,其建议值为30秒。此规则存在某些例外情况,例如当对等方终止传输连接并声明不希望通信时。

When connecting to a peer and either zero or more transports are specified, TLS SHOULD be tried first, followed by DTLS, then by TCP, and finally by SCTP. See Section 5.2 for more information on peer discovery.

当连接到对等方并且指定了零个或多个传输时,应该首先尝试TLS,然后是DTL,然后是TCP,最后是SCTP。有关对等发现的更多信息,请参见第5.2节。

Diameter implementations SHOULD be able to interpret ICMP protocol port unreachable messages as explicit indications that the server is not reachable, subject to security policy on trusting such messages. Further guidance regarding the treatment of ICMP errors can be found in [RFC5927] and [RFC5461]. Diameter implementations SHOULD also be able to interpret a reset from the transport and timed-out connection attempts. If Diameter receives data from the lower layer that cannot be parsed or identified as a Diameter error made by the peer, the stream is compromised and cannot be recovered. The transport connection MUST be closed using a RESET call (send a TCP RST bit) or an SCTP ABORT message (graceful closure is compromised).

Diameter实现应能够将ICMP协议端口不可访问消息解释为服务器不可访问的明确指示,并遵守信任此类消息的安全策略。有关ICMP错误处理的进一步指导,请参见[RFC5927]和[RFC5461]。Diameter实现还应该能够解释来自传输的重置和超时连接尝试。如果Diameter从较低的层接收到无法解析或识别为对等方造成的Diameter错误的数据,则流将受损,无法恢复。必须使用重置调用(发送TCP RST位)或SCTP中止消息关闭传输连接(正常关闭受到损害)。

2.1.1. SCTP Guidelines
2.1.1. SCTP指南

Diameter messages SHOULD be mapped into SCTP streams in a way that avoids head-of-the-line (HOL) blocking. Among different ways of performing the mapping that fulfill this requirement it is RECOMMENDED that a Diameter node send every Diameter message (request or response) over stream zero with the unordered flag set. However, Diameter nodes MAY select and implement other design alternatives for avoiding HOL blocking such as using multiple streams with the unordered flag cleared (as originally instructed in RFC 3588). On the receiving side, a Diameter entity MUST be ready to receive Diameter messages over any stream, and it is free to return responses over a different stream. This way, both sides manage the available streams in the sending direction, independently of the streams chosen by the other side to send a particular Diameter message. These messages can be out-of-order and belong to different Diameter sessions.

Diameter消息应该以避免行首(HOL)阻塞的方式映射到SCTP流中。在满足此要求的不同映射执行方式中,建议Diameter节点通过流0发送每个Diameter消息(请求或响应),并设置无序标志。然而,Diameter节点可以选择并实现其他设计备选方案以避免HOL阻塞,例如使用清除无序标志的多个流(如RFC 3588中最初指示的)。在接收端,Diameter实体必须准备好通过任何流接收Diameter消息,并且可以通过不同的流自由返回响应。这样,双方管理发送方向上的可用流,独立于另一方选择发送特定直径消息的流。这些消息可能不符合顺序,属于不同的Diameter会话。

Out-of-order delivery has special concerns during a connection establishment and termination. When a connection is established, the responder side sends a CEA message and moves to R-Open state as specified in Section 5.6. If an application message is sent shortly after the CEA and delivered out-of-order, the initiator side, still in Wait-I-CEA state, will discard the application message and close the connection. In order to avoid this race condition, the receiver side SHOULD NOT use out-of-order delivery methods until the first message has been received from the initiator, proving that it has moved to I-Open state. To trigger such a message, the receiver side could send a DWR immediately after sending a CEA. Upon reception of the corresponding DWA, the receiver side should start using out-of-order delivery methods to counter the HOL blocking.

在连接建立和终止期间,无序交付有特殊问题。当建立连接时,响应方发送CEA消息,并按照第5.6节的规定移动到R-Open状态。如果在CEA之后不久发送了应用程序消息,并且发送顺序不正确,则仍处于Wait-I-CEA状态的发起方将丢弃该应用程序消息并关闭连接。为了避免这种竞争情况,接收方不应使用无序传递方法,直到从发起方收到第一条消息,证明它已移动到I-Open状态。为了触发这样的消息,接收方可以在发送CEA后立即发送DWR。在接收到相应的DWA后,接收方应开始使用无序交付方法来对抗HOL阻塞。

Another race condition may occur when DPR and DPA messages are used. Both DPR and DPA are small in size; thus, they may be delivered to the peer faster than application messages when an out-of-order delivery mechanism is used. Therefore, it is possible that a DPR/DPA

当使用DPR和DPA消息时,可能会出现另一种竞争条件。DPR和DPA的尺寸都很小;因此,当使用无序传递机制时,它们可以比应用程序消息更快地传递到对等方。因此,DPR/DPA可能

exchange completes while application messages are still in transit, resulting in a loss of these messages. An implementation could mitigate this race condition, for example, using timers, and wait for a short period of time for pending application level messages to arrive before proceeding to disconnect the transport connection. Eventually, lost messages are handled by the retransmission mechanism described in Section 5.5.4.

exchange在应用程序消息仍在传输中时完成,导致这些消息丢失。实现可以缓解这种竞争条件,例如,使用计时器,并在继续断开传输连接之前等待一小段时间等待挂起的应用程序级消息到达。最终,丢失的消息由第5.5.4节中描述的重传机制处理。

A Diameter agent SHOULD use dedicated payload protocol identifiers (PPIDs) for clear text and encrypted SCTP DATA chunks instead of only using the unspecified payload protocol identifier (value 0). For this purpose, two PPID values are allocated: the PPID value 46 is for Diameter messages in clear text SCTP DATA chunks, and the PPID value 47 is for Diameter messages in protected DTLS/SCTP DATA chunks.

Diameter代理应该为明文和加密的SCTP数据块使用专用的有效负载协议标识符(PPID),而不是仅使用未指定的有效负载协议标识符(值0)。为此,分配了两个PPID值:PPID值46用于明文SCTP数据块中的Diameter消息,PPID值47用于受保护DTL/SCTP数据块中的Diameter消息。

2.2. Securing Diameter Messages
2.2. 保护直径消息

Connections between Diameter peers SHOULD be protected by TLS/TCP and DTLS/SCTP. All Diameter base protocol implementations MUST support the use of TLS/TCP and DTLS/SCTP. If desired, alternative security mechanisms that are independent of Diameter, such as IPsec [RFC4301], can be deployed to secure connections between peers. The Diameter protocol MUST NOT be used without one of TLS, DTLS, or IPsec.

Diameter对等点之间的连接应受到TLS/TCP和DTLS/SCTP的保护。所有Diameter基本协议实施必须支持TLS/TCP和DTLS/SCTP的使用。如果需要,可以部署独立于Diameter的替代安全机制,如IPsec[RFC4301],以保护对等方之间的连接。在没有TLS、DTL或IPsec的情况下,不得使用Diameter协议。

2.3. Diameter Application Compliance
2.3. 直径应用程序符合性

Application Ids are advertised during the capabilities exchange phase (see Section 5.3). Advertising support of an application implies that the sender supports the functionality specified in the respective Diameter application specification.

应用程序ID在功能交换阶段发布(见第5.3节)。应用程序的广告支持意味着发送方支持相应Diameter应用程序规范中指定的功能。

Implementations MAY add arbitrary optional AVPs with the M-bit cleared (including vendor-specific AVPs) to a command defined in an application, but only if the command's CCF syntax specification allows for it. Please refer to Section 11.1.1 for details.

实现可以向应用程序中定义的命令添加任意可选的M位已清除的AVP(包括特定于供应商的AVP),但前提是该命令的CCF语法规范允许。详情请参考第11.1.1节。

2.4. Application Identifiers
2.4. 应用程序标识符

Each Diameter application MUST have an IANA-assigned Application ID. The base protocol does not require an Application Id since its support is mandatory. During the capabilities exchange, Diameter nodes inform their peers of locally supported applications. Furthermore, all Diameter messages contain an Application Id, which is used in the message forwarding process.

每个Diameter应用程序必须具有IANA分配的应用程序ID。基本协议不需要应用程序ID,因为其支持是强制性的。在功能交换期间,Diameter节点将本地支持的应用程序通知其对等方。此外,所有Diameter消息都包含一个应用程序Id,用于消息转发过程。

The following Application Id values are defined:

定义了以下应用程序Id值:

Diameter common message 0 Diameter base accounting 3 Relay 0xffffffff

直径公用消息0直径基本记帐3继电器0xffffffff

Relay and redirect agents MUST advertise the Relay Application ID, while all other Diameter nodes MUST advertise locally supported applications. The receiver of a Capabilities Exchange message advertising relay service MUST assume that the sender supports all current and future applications.

中继和重定向代理必须播发中继应用程序ID,而所有其他Diameter节点必须播发本地支持的应用程序。功能交换消息广告中继服务的接收方必须假定发送方支持所有当前和未来的应用程序。

Diameter relay and proxy agents are responsible for finding an upstream server that supports the application of a particular message. If none can be found, an error message is returned with the Result-Code AVP set to DIAMETER_UNABLE_TO_DELIVER.

Diameter中继和代理负责查找支持特定消息应用程序的上游服务器。如果找不到,则返回一条错误消息,结果代码AVP设置为DIAMETER\u UNABLE\u to\u DELIVER。

2.5. Connections vs. Sessions
2.5. 连接与会话

This section attempts to provide the reader with an understanding of the difference between "connection" and "session", which are terms used extensively throughout this document.

本节试图让读者了解“连接”和“会话”之间的区别,这是本文档中广泛使用的术语。

A connection refers to a transport-level connection between two peers that is used to send and receive Diameter messages. A session is a logical concept at the application layer that exists between the Diameter client and the Diameter server; it is identified via the Session-Id AVP.

连接是指用于发送和接收Diameter消息的两个对等方之间的传输级连接。会话是应用层的逻辑概念,存在于Diameter客户端和Diameter服务器之间;它通过会话Id AVP进行标识。

             +--------+          +-------+          +--------+
             | Client |          | Relay |          | Server |
             +--------+          +-------+          +--------+
                      <---------->       <---------->
                   peer connection A   peer connection B
        
             +--------+          +-------+          +--------+
             | Client |          | Relay |          | Server |
             +--------+          +-------+          +--------+
                      <---------->       <---------->
                   peer connection A   peer connection B
        
                      <----------------------------->
                              User session x
        
                      <----------------------------->
                              User session x
        

Figure 1: Diameter Connections and Sessions

图1:直径连接和会话

In the example provided in Figure 1, peer connection A is established between the client and the relay. Peer connection B is established between the relay and the server. User session X spans from the client via the relay to the server. Each "user" of a service causes an auth request to be sent, with a unique session identifier. Once accepted by the server, both the client and the server are aware of the session.

在图1中提供的示例中,在客户端和中继之间建立对等连接A。在中继和服务器之间建立对等连接B。用户会话X通过中继从客户端扩展到服务器。服务的每个“用户”都会发送一个具有唯一会话标识符的身份验证请求。一旦被服务器接受,客户端和服务器都会知道会话。

It is important to note that there is no relationship between a connection and a session, and that Diameter messages for multiple sessions are all multiplexed through a single connection. Also, note that Diameter messages pertaining to the session, both application-specific and those that are defined in this document such as ASR/ASA, RAR/RAA, and STR/STA, MUST carry the Application Id of the application. Diameter messages pertaining to peer connection establishment and maintenance such as CER/CEA, DWR/DWA, and DPR/DPA MUST carry an Application Id of zero (0).

需要注意的是,连接和会话之间没有关系,多个会话的Diameter消息都是通过单个连接多路传输的。另外,请注意,与会话相关的Diameter消息,包括特定于应用程序的消息和本文档中定义的消息,如ASR/ASA、RAR/RAA和STR/STA,必须携带应用程序的应用程序Id。与对等连接建立和维护(如CER/CEA、DWR/DWA和DPR/DPA)相关的DIAMER消息必须携带零(0)的应用程序Id。

2.6. Peer Table
2.6. 对等表

The Diameter peer table is used in message forwarding and is referenced by the routing table. A peer table entry contains the following fields:

Diameter对等表用于消息转发,并由路由表引用。对等表条目包含以下字段:

Host Identity

主机标识

Following the conventions described for the DiameterIdentity-derived AVP data format in Section 4.3.1, this field contains the contents of the Origin-Host (Section 6.3) AVP found in the CER or CEA message.

按照第4.3.1节中描述的直径衍生AVP数据格式的约定,此字段包含CER或CEA消息中的原始主机(第6.3节)AVP的内容。

StatusT

状态

This is the state of the peer entry, and it MUST match one of the values listed in Section 5.6.

这是对等条目的状态,它必须与第5.6节中列出的值之一相匹配。

Static or Dynamic

静态还是动态

Specifies whether a peer entry was statically configured or dynamically discovered.

指定对等项是静态配置的还是动态发现的。

Expiration Time

有效期

Specifies the time at which dynamically discovered peer table entries are to be either refreshed or expired. If public key certificates are used for Diameter security (e.g., with TLS), this value MUST NOT be greater than the expiry times in the relevant certificates.

指定刷新或过期动态发现的对等表项的时间。如果公钥证书用于Diameter安全性(例如,与TLS一起使用),则该值不得大于相关证书中的到期时间。

TLS/TCP and DTLS/SCTP Enabled

启用TLS/TCP和DTLS/SCTP

Specifies whether TLS/TCP and DTLS/SCTP is to be used when communicating with the peer.

指定与对等方通信时是否使用TLS/TCP和DTLS/SCTP。

Additional security information, when needed (e.g., keys, certificates).

需要时的附加安全信息(例如,密钥、证书)。

2.7. Routing Table
2.7. 路由表

All Realm-Based routing lookups are performed against what is commonly known as the routing table (see Section 12). Each routing table entry contains the following fields:

所有基于领域的路由查找都是针对通常称为路由表的内容执行的(参见第12节)。每个路由表条目包含以下字段:

Realm Name

域名

This is the field that MUST be used as a primary key in the routing table lookups. Note that some implementations perform their lookups based on longest-match-from-the-right on the realm rather than requiring an exact match.

这是在路由表查找中必须用作主键的字段。请注意,有些实现基于领域右侧的最长匹配执行查找,而不需要精确匹配。

Application Identifier

应用标识符

An application is identified by an Application Id. A route entry can have a different destination based on the Application Id in the message header. This field MUST be used as a secondary key field in routing table lookups.

应用程序由应用程序Id标识。根据消息头中的应用程序Id,路由条目可以具有不同的目的地。此字段必须用作路由表查找中的辅助关键字字段。

Local Action

地方行动

The Local Action field is used to identify how a message should be treated. The following actions are supported:

本地操作字段用于标识应如何处理消息。支持以下操作:

1. LOCAL - Diameter messages that can be satisfied locally and do not need to be routed to another Diameter entity.

1. LOCAL-可以在本地满足且不需要路由到其他Diameter实体的Diameter消息。

2. RELAY - All Diameter messages that fall within this category MUST be routed to a next-hop Diameter entity that is indicated by the identifier described below. Routing is done without modifying any non-routing AVPs. See Section 6.1.9 for relaying guidelines.

2. 中继-属于此类别的所有Diameter消息必须路由到下一跳Diameter实体,该实体由下面描述的标识符指示。在不修改任何非路由AVP的情况下完成路由。中继指南见第6.1.9节。

3. PROXY - All Diameter messages that fall within this category MUST be routed to a next Diameter entity that is indicated by the identifier described below. The local server MAY apply its local policies to the message by including new AVPs to the message prior to routing. See Section 6.1.9 for proxying guidelines.

3. 代理-属于此类别的所有Diameter消息必须路由到下一个Diameter实体,该实体由下面描述的标识符指示。本地服务器可以通过在路由之前将新avp包括到消息来将其本地策略应用到消息。代理指南见第6.1.9节。

4. REDIRECT - Diameter messages that fall within this category MUST have the identity of the home Diameter server(s) appended, and returned to the sender of the message. See Section 6.1.8 for redirection guidelines.

4. 重定向-属于此类别的Diameter邮件必须附加home Diameter服务器的标识,并返回给邮件的发件人。重定向指南见第6.1.8节。

Server Identifier

服务器标识符

The identity of one or more servers to which the message is to be routed. This identity MUST also be present in the Host Identity field of the peer table (Section 2.6). When the Local Action is set to RELAY or PROXY, this field contains the identity of the server(s) to which the message MUST be routed. When the Local Action field is set to REDIRECT, this field contains the identity of one or more servers to which the message MUST be redirected.

消息要路由到的一个或多个服务器的标识。该标识还必须出现在对等表的主机标识字段中(第2.6节)。当本地操作设置为中继或代理时,此字段包含消息必须路由到的服务器的标识。当本地操作字段设置为重定向时,此字段包含消息必须重定向到的一个或多个服务器的标识。

Static or Dynamic

静态还是动态

Specifies whether a route entry was statically configured or dynamically discovered.

指定路由条目是静态配置的还是动态发现的。

Expiration Time

有效期

Specifies the time at which a dynamically discovered route table entry expires. If public key certificates are used for Diameter security (e.g., with TLS), this value MUST NOT be greater than the expiry time in the relevant certificates.

指定动态查找的路由表项过期的时间。如果公钥证书用于Diameter安全性(例如,与TLS一起使用),则该值不得大于相关证书中的到期时间。

It is important to note that Diameter agents MUST support at least one of the LOCAL, RELAY, PROXY, or REDIRECT modes of operation. Agents do not need to support all modes of operation in order to conform with the protocol specification, but they MUST follow the protocol compliance guidelines in Section 2. Relay agents and proxies MUST NOT reorder AVPs.

请务必注意,Diameter代理必须至少支持一种本地、中继、代理或重定向操作模式。代理不需要支持所有操作模式以符合协议规范,但必须遵守第2节中的协议合规指南。中继代理和代理不得重新订购AVP。

The routing table MAY include a default entry that MUST be used for any requests not matching any of the other entries. The routing table MAY consist of only such an entry.

路由表可能包括一个默认条目,该条目必须用于与任何其他条目不匹配的任何请求。路由表可能只包含这样一个条目。

When a request is routed, the target server MUST have advertised the Application Id (see Section 2.4) for the given message or have advertised itself as a relay or proxy agent. Otherwise, an error is returned with the Result-Code AVP set to DIAMETER_UNABLE_TO_DELIVER.

路由请求时,目标服务器必须已公布给定消息的应用程序Id(请参阅第2.4节),或者已将自身作为中继或代理进行公布。否则,返回一个错误,结果代码AVP设置为DIAMETER\u UNABLE\u to\u DELIVER。

2.8. Role of Diameter Agents
2.8. 直径剂的作用

In addition to clients and servers, the Diameter protocol introduces relay, proxy, redirect, and translation agents, each of which is defined in Section 1.2. Diameter agents are useful for several reasons:

除了客户端和服务器之外,Diameter协议还引入了中继、代理、重定向和翻译代理,每种代理都在第1.2节中定义。直径剂之所以有用,有几个原因:

o They can distribute administration of systems to a configurable grouping, including the maintenance of security associations.

o 他们可以将系统管理分配给可配置的组,包括维护安全关联。

o They can be used for concentration of requests from a number of co-located or distributed NAS equipment sets to a set of like user groups.

o 它们可用于将多个同址或分布式NAS设备集的请求集中到一组类似的用户组。

o They can do value-added processing to the requests or responses.

o 他们可以对请求或响应进行增值处理。

o They can be used for load balancing.

o 它们可以用于负载平衡。

o A complex network will have multiple authentication sources, they can sort requests and forward towards the correct target.

o 一个复杂的网络将有多个身份验证源,它们可以对请求进行排序并转发到正确的目标。

The Diameter protocol requires that agents maintain transaction state, which is used for failover purposes. Transaction state implies that upon forwarding a request, its Hop-by-Hop Identifier is saved; the field is replaced with a locally unique identifier, which is restored to its original value when the corresponding answer is received. The request's state is released upon receipt of the answer. A stateless agent is one that only maintains transaction state.

Diameter协议要求代理维护事务状态,事务状态用于故障切换。事务状态意味着在转发请求时,其逐跳标识符被保存;该字段将替换为本地唯一标识符,当收到相应的答案时,该标识符将恢复为其原始值。请求的状态在收到答复后即被释放。无状态代理是只维护事务状态的代理。

The Proxy-Info AVP allows stateless agents to add local state to a Diameter request, with the guarantee that the same state will be present in the answer. However, the protocol's failover procedures require that agents maintain a copy of pending requests.

Proxy Info AVP允许无状态代理向Diameter请求添加本地状态,并保证相同的状态将出现在应答中。但是,协议的故障切换过程要求代理维护挂起请求的副本。

A stateful agent is one that maintains session state information by keeping track of all authorized active sessions. Each authorized session is bound to a particular service, and its state is considered active until either the agent is notified otherwise or the session expires. Each authorized session has an expiration, which is communicated by Diameter servers via the Session-Timeout AVP.

有状态代理通过跟踪所有授权的活动会话来维护会话状态信息。每个授权会话都绑定到特定的服务,其状态被视为活动状态,直到代理收到其他通知或会话过期。每个授权会话都有一个过期时间,由Diameter服务器通过会话超时AVP进行通信。

Maintaining session state may be useful in certain applications, such as:

在某些应用程序中,维护会话状态可能很有用,例如:

o Protocol translation (e.g., RADIUS <-> Diameter)

o 协议转换(例如,半径<->直径)

o Limiting resources authorized to a particular user

o 限制授权给特定用户的资源

o Per-user or per-transaction auditing

o 每用户或每事务审核

A Diameter agent MAY act in a stateful manner for some requests and be stateless for others. A Diameter implementation MAY act as one type of agent for some requests and as another type of agent for others.

Diameter代理可以以有状态的方式处理某些请求,而对于其他请求则是无状态的。Diameter实现可以作为某些请求的一种类型的代理,也可以作为其他请求的另一种类型的代理。

2.8.1. Relay Agents
2.8.1. 中继代理

Relay agents are Diameter agents that accept requests and route messages to other Diameter nodes based on information found in the messages (e.g., the value of the Destination-Realm AVP Section 6.6). This routing decision is performed using a list of supported realms and known peers. This is known as the routing table, as is defined further in Section 2.7.

中继代理是Diameter代理,它根据消息中的信息(例如,目标域AVP第6.6节的值)接受请求并将消息路由到其他Diameter节点。此路由决策使用受支持领域和已知对等方的列表执行。如第2.7节所述,这称为路由表。

Relays may, for example, be used to aggregate requests from multiple Network Access Servers (NASes) within a common geographical area (Point of Presence, POP). The use of relays is advantageous since it eliminates the need for NASes to be configured with the necessary security information they would otherwise require to communicate with Diameter servers in other realms. Likewise, this reduces the configuration load on Diameter servers that would otherwise be necessary when NASes are added, changed, or deleted.

例如,中继可用于聚合来自公共地理区域(存在点,POP)内的多个网络接入服务器(nase)的请求。使用中继器是有利的,因为它不需要为NASE配置必要的安全信息,否则NASE将需要与其他领域中的Diameter服务器通信。类似地,这减少了Diameter服务器上的配置负载,否则,在添加、更改或删除NASE时,这些配置负载是必需的。

Relays modify Diameter messages by inserting and removing routing information, but they do not modify any other portion of a message. Relays SHOULD NOT maintain session state but MUST maintain transaction state.

中继器通过插入和删除路由信息来修改Diameter消息,但不会修改消息的任何其他部分。中继不应保持会话状态,但必须保持事务状态。

       +------+    --------->     +------+     --------->    +------+
       |      |    1. Request     |      |     2. Request    |      |
       | NAS  |                   | DRL  |                   | HMS  |
       |      |    4. Answer      |      |     3. Answer     |      |
       +------+    <---------     +------+     <---------    +------+
    example.net                example.net                example.com
        
       +------+    --------->     +------+     --------->    +------+
       |      |    1. Request     |      |     2. Request    |      |
       | NAS  |                   | DRL  |                   | HMS  |
       |      |    4. Answer      |      |     3. Answer     |      |
       +------+    <---------     +------+     <---------    +------+
    example.net                example.net                example.com
        

Figure 2: Relaying of Diameter messages

图2:Diameter消息的中继

The example provided in Figure 2 depicts a request issued from a NAS, which is an access device, for the user bob@example.com. Prior to issuing the request, the NAS performs a Diameter route lookup, using "example.com" as the key, and determines that the message is to be relayed to a DRL, which is a Diameter relay. The DRL performs the same route lookup as the NAS, and relays the message to the HMS, which is example.com's home server. The HMS identifies that the request can be locally supported (via the realm), processes the authentication and/or authorization request, and replies with an answer, which is routed back to the NAS using saved transaction state.

图2中提供的示例描述了从NAS(一种访问设备)向用户发出的请求bob@example.com. 在发出请求之前,NAS使用“example.com”作为密钥执行Diameter路由查找,并确定消息将中继到DRL,DRL是Diameter中继。DRL执行与NAS相同的路由查找,并将消息中继到HMS,HMS是example.com的主服务器。HMS确定请求可以在本地得到支持(通过域),处理身份验证和/或授权请求,并用应答进行答复,应答将使用保存的事务状态路由回NAS。

Since relays do not perform any application-level processing, they provide relaying services for all Diameter applications; therefore, they MUST advertise the Relay Application Id.

由于继电器不执行任何应用级处理,它们为所有直径应用提供中继服务;因此,它们必须公布中继应用程序Id。

2.8.2. Proxy Agents
2.8.2. 代理

Similar to relays, proxy agents route Diameter messages using the Diameter routing table. However, they differ since they modify messages to implement policy enforcement. This requires that proxies maintain the state of their downstream peers (e.g., access devices) to enforce resource usage, provide admission control, and provide provisioning.

与中继类似,代理使用Diameter路由表路由Diameter消息。但是,它们有所不同,因为它们修改消息以实现策略强制。这要求代理维护其下游对等方(例如,访问设备)的状态,以强制执行资源使用、提供准入控制和提供供应。

Proxies may, for example, be used in call control centers or access ISPs that provide outsourced connections; they can monitor the number and type of ports in use and make allocation and admission decisions according to their configuration.

例如,代理可以用于呼叫控制中心或访问提供外包连接的ISP;他们可以监控正在使用的端口的数量和类型,并根据其配置做出分配和接纳决策。

Since enforcing policies requires an understanding of the service being provided, proxies MUST only advertise the Diameter applications they support.

由于强制执行策略需要了解所提供的服务,因此代理必须仅公布其支持的Diameter应用程序。

2.8.3. Redirect Agents
2.8.3. 重定向代理

Redirect agents are useful in scenarios where the Diameter routing configuration needs to be centralized. An example is a redirect agent that provides services to all members of a consortium, but does not wish to be burdened with relaying all messages between realms. This scenario is advantageous since it does not require that the consortium provide routing updates to its members when changes are made to a member's infrastructure.

重定向代理在需要集中化Diameter路由配置的场景中非常有用。一个例子是重定向代理,它向联合体的所有成员提供服务,但不希望承担在领域之间中继所有消息的负担。这种情况是有利的,因为它不要求联合体在成员的基础设施发生更改时向其成员提供路由更新。

Since redirect agents do not relay messages, and only return an answer with the information necessary for Diameter agents to communicate directly, they do not modify messages. Since redirect agents do not receive answer messages, they cannot maintain session state.

由于重定向代理不中继消息,只返回带有Diameter代理直接通信所需信息的答案,所以它们不会修改消息。由于重定向代理不接收应答消息,因此它们无法维护会话状态。

The example provided in Figure 3 depicts a request issued from the access device, NAS, for the user bob@example.com. The message is forwarded by the NAS to its relay, DRL, which does not have a routing entry in its Diameter routing table for example.com. The DRL has a default route configured to DRD, which is a redirect agent that returns a redirect notification to DRL, as well as the HMS' contact information. Upon receipt of the redirect notification, the DRL establishes a transport connection with the HMS, if one doesn't already exist, and forwards the request to it.

图3中提供的示例描述了从访问设备NAS向用户发出的请求bob@example.com. NAS将消息转发到其中继DRL,DRL在其Diameter routing table(例如.com)中没有路由条目。DRL有一个配置为DRD的默认路由,它是一个重定向代理,向DRL返回重定向通知以及HMS的联系信息。收到重定向通知后,DRL与HMS建立传输连接(如果还不存在),并将请求转发给HMS。

                                  +------+
                                  |      |
                                  | DRD  |
                                  |      |
                                  +------+
                                   ^    |
                       2. Request  |    | 3. Redirection
                                   |    |    Notification
                                   |    v
       +------+    --------->     +------+     --------->    +------+
       |      |    1. Request     |      |     4. Request    |      |
       | NAS  |                   | DRL  |                   | HMS  |
       |      |    6. Answer      |      |     5. Answer     |      |
       +------+    <---------     +------+     <---------    +------+
      example.net                example.net               example.com
        
                                  +------+
                                  |      |
                                  | DRD  |
                                  |      |
                                  +------+
                                   ^    |
                       2. Request  |    | 3. Redirection
                                   |    |    Notification
                                   |    v
       +------+    --------->     +------+     --------->    +------+
       |      |    1. Request     |      |     4. Request    |      |
       | NAS  |                   | DRL  |                   | HMS  |
       |      |    6. Answer      |      |     5. Answer     |      |
       +------+    <---------     +------+     <---------    +------+
      example.net                example.net               example.com
        

Figure 3: Redirecting a Diameter Message

图3:重定向Diameter消息

Since redirect agents do not perform any application-level processing, they provide relaying services for all Diameter applications; therefore, they MUST advertise the Relay Application ID.

由于重定向代理不执行任何应用程序级处理,它们为所有Diameter应用程序提供中继服务;因此,它们必须公布中继应用程序ID。

2.8.4. Translation Agents
2.8.4. 翻译代理

A translation agent is a device that provides translation between two protocols (e.g., RADIUS<->Diameter, TACACS+<->Diameter). Translation agents are likely to be used as aggregation servers to communicate with a Diameter infrastructure, while allowing for the embedded systems to be migrated at a slower pace.

翻译代理是在两个协议(例如RADIUS<->Diameter、TACACS+<->Diameter)之间提供翻译的设备。翻译代理可能被用作聚合服务器,与Diameter基础设施进行通信,同时允许以较慢的速度迁移嵌入式系统。

Given that the Diameter protocol introduces the concept of long-lived authorized sessions, translation agents MUST be session stateful and MUST maintain transaction state.

鉴于Diameter协议引入了长寿命授权会话的概念,翻译代理必须是会话状态的,并且必须维护事务状态。

Translation of messages can only occur if the agent recognizes the application of a particular request; therefore, translation agents MUST only advertise their locally supported applications.

只有当代理识别特定请求的应用时,才能进行消息翻译;因此,翻译代理只能宣传其本地支持的应用程序。

       +------+    --------->     +------+     --------->    +------+
       |      |  RADIUS Request   |      |  Diameter Request |      |
       | NAS  |                   | TLA  |                   | HMS  |
       |      |  RADIUS Answer    |      |  Diameter Answer  |      |
       +------+    <---------     +------+     <---------    +------+
      example.net                example.net               example.com
        
       +------+    --------->     +------+     --------->    +------+
       |      |  RADIUS Request   |      |  Diameter Request |      |
       | NAS  |                   | TLA  |                   | HMS  |
       |      |  RADIUS Answer    |      |  Diameter Answer  |      |
       +------+    <---------     +------+     <---------    +------+
      example.net                example.net               example.com
        

Figure 4: Translation of RADIUS to Diameter

图4:半径到直径的转换

2.9. Diameter Path Authorization
2.9. 直径路径授权

As noted in Section 2.2, Diameter provides transmission-level security for each connection using TLS/TCP and DTLS/SCTP. Therefore, each connection can be authenticated and can be replay and integrity protected.

如第2.2节所述,Diameter使用TLS/TCP和DTLS/SCTP为每个连接提供传输级安全性。因此,可以对每个连接进行身份验证,并可以对其进行重播和完整性保护。

In addition to authenticating each connection, the entire session MUST also be authorized. Before initiating a connection, a Diameter peer MUST check that its peers are authorized to act in their roles. For example, a Diameter peer may be authentic, but that does not mean that it is authorized to act as a Diameter server advertising a set of Diameter applications.

除了验证每个连接之外,还必须对整个会话进行授权。在启动连接之前,Diameter对等方必须检查其对等方是否有权执行其角色。例如,Diameter对等方可能是可信的,但这并不意味着它被授权作为一组Diameter应用程序广告的Diameter服务器。

Prior to bringing up a connection, authorization checks are performed at each connection along the path. Diameter capabilities negotiation (CER/CEA) also MUST be carried out, in order to determine what Diameter applications are supported by each peer. Diameter sessions MUST be routed only through authorized nodes that have advertised support for the Diameter application required by the session.

在建立连接之前,将对路径上的每个连接执行授权检查。还必须进行Diameter能力协商(CER/CEA),以确定每个对等方支持哪些Diameter应用程序。Diameter会话只能通过授权节点进行路由,授权节点已公布对会话所需的Diameter应用程序的支持。

As noted in Section 6.1.9, a relay or proxy agent MUST append a Route-Record AVP to all requests forwarded. The AVP contains the identity of the peer from which the request was received.

如第6.1.9节所述,中继或代理必须将路由记录AVP附加到所有转发的请求中。AVP包含从中接收请求的对等方的标识。

The home Diameter server, prior to authorizing a session, MUST check the Route-Record AVPs to make sure that the route traversed by the request is acceptable. For example, administrators within the home realm may not wish to honor requests that have been routed through an untrusted realm. By authorizing a request, the home Diameter server is implicitly indicating its willingness to engage in the business transaction as specified by any contractual relationship between the server and the previous hop. A DIAMETER_AUTHORIZATION_REJECTED error message (see Section 7.1.5) is sent if the route traversed by the request is unacceptable.

home Diameter服务器在授权会话之前,必须检查路由记录AVPs,以确保请求所穿越的路由是可接受的。例如,主域中的管理员可能不希望接受通过不受信任域路由的请求。通过授权请求,home Diameter服务器暗示其愿意参与服务器与前一跳之间的任何合同关系所指定的业务交易。如果请求通过的路由不可接受,则发送DIAMETER_AUTHORIZATION_REJECTED错误消息(见第7.1.5节)。

A home realm may also wish to check that each accounting request message corresponds to a Diameter response authorizing the session. Accounting requests without corresponding authorization responses SHOULD be subjected to further scrutiny, as should accounting requests indicating a difference between the requested and provided service.

主域还可能希望检查每个记帐请求消息是否对应于授权会话的Diameter响应。没有相应授权响应的会计请求应受到进一步审查,表明请求的服务与提供的服务之间存在差异的会计请求也应受到进一步审查。

Forwarding of an authorization response is considered evidence of a willingness to take on financial risk relative to the session. A local realm may wish to limit this exposure, for example, by establishing credit limits for intermediate realms and refusing to accept responses that would violate those limits. By issuing an

转发授权响应被视为愿意承担与会话相关的财务风险的证据。本地领域可能希望限制这种风险,例如,为中间领域建立信用限额,并拒绝接受违反这些限额的回复。发出

accounting request corresponding to the authorization response, the local realm implicitly indicates its agreement to provide the service indicated in the authorization response. If the service cannot be provided by the local realm, then a DIAMETER_UNABLE_TO_COMPLY error message MUST be sent within the accounting request; a Diameter client receiving an authorization response for a service that it cannot perform MUST NOT substitute an alternate service and then send accounting requests for the alternate service instead.

与授权响应相对应的记帐请求,本地域隐式表示其同意提供授权响应中指示的服务。如果本地域无法提供服务,则必须在记帐请求中发送DIAMETER\u UNABLE\u TO\u Compliance错误消息;Diameter客户端接收到其无法执行的服务的授权响应时,不得替代替代服务,然后发送替代服务的记帐请求。

3. Diameter Header
3. 直径集管

A summary of the Diameter header format is shown below. The fields are transmitted in network byte order.

直径标题格式的摘要如下所示。字段以网络字节顺序传输。

       0                   1                   2                   3
       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
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      |    Version    |                 Message Length                |
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      | Command Flags |                  Command Code                 |
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      |                         Application-ID                        |
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      |                      Hop-by-Hop Identifier                    |
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      |                      End-to-End Identifier                    |
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      |  AVPs ...
      +-+-+-+-+-+-+-+-+-+-+-+-+-
        
       0                   1                   2                   3
       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
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      |    Version    |                 Message Length                |
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      | Command Flags |                  Command Code                 |
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      |                         Application-ID                        |
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      |                      Hop-by-Hop Identifier                    |
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      |                      End-to-End Identifier                    |
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      |  AVPs ...
      +-+-+-+-+-+-+-+-+-+-+-+-+-
        

Version

版本

This Version field MUST be set to 1 to indicate Diameter Version 1.

此版本字段必须设置为1,以指示直径版本1。

Message Length

消息长度

The Message Length field is three octets and indicates the length of the Diameter message including the header fields and the padded AVPs. Thus, the Message Length field is always a multiple of 4.

消息长度字段为三个八位字节,表示直径消息的长度,包括标题字段和填充的AVP。因此,消息长度字段始终是4的倍数。

Command Flags

命令标志

The Command Flags field is eight bits. The following bits are assigned:

命令标志字段为八位。分配了以下位:

          0 1 2 3 4 5 6 7
         +-+-+-+-+-+-+-+-+
         |R P E T r r r r|
         +-+-+-+-+-+-+-+-+
        
          0 1 2 3 4 5 6 7
         +-+-+-+-+-+-+-+-+
         |R P E T r r r r|
         +-+-+-+-+-+-+-+-+
        

R(equest)

R(高等教育)

If set, the message is a request. If cleared, the message is an answer.

如果已设置,则消息为请求。如果清除,则该消息为应答。

P(roxiable)

P(可氧化)

If set, the message MAY be proxied, relayed, or redirected. If cleared, the message MUST be locally processed.

如果设置,消息可以被代理、中继或重定向。如果清除,则必须在本地处理该消息。

E(rror)

E(错误)

If set, the message contains a protocol error, and the message will not conform to the CCF described for this command. Messages with the 'E' bit set are commonly referred to as error messages. This bit MUST NOT be set in request messages (see Section 7.2).

如果设置,则消息包含协议错误,消息将不符合此命令所述的CCF。设置了“E”位的消息通常称为错误消息。不得在请求消息中设置该位(见第7.2节)。

T(Potentially retransmitted message)

T(可能重传的消息)

This flag is set after a link failover procedure, to aid the removal of duplicate requests. It is set when resending requests not yet acknowledged, as an indication of a possible duplicate due to a link failure. This bit MUST be cleared when sending a request for the first time; otherwise, the sender MUST set this flag. Diameter agents only need to be concerned about the number of requests they send based on a single received request; retransmissions by other entities need not be tracked. Diameter agents that receive a request with the T flag set, MUST keep the T flag set in the forwarded request. This flag MUST NOT be set if an error answer message (e.g., a protocol error) has been received for the earlier message. It can be set only in cases where no answer has been received from the server for a request, and the request has been sent again. This flag MUST NOT be set in answer messages.

此标志在链路故障切换过程后设置,以帮助删除重复请求。当重新发送尚未确认的请求时,会设置该参数,作为由于链路故障可能出现重复的指示。第一次发送请求时必须清除该位;否则,发送方必须设置此标志。Diameter代理只需要关心基于单个接收请求发送的请求数量;不需要跟踪其他实体的重传。接收带有T标志集的请求的Diameter代理必须在转发的请求中保留T标志集。如果已收到先前消息的错误应答消息(例如,协议错误),则不得设置此标志。只有在没有从服务器收到请求的应答,并且请求已再次发送的情况下,才能设置此选项。不得在应答消息中设置此标志。

r(eserved)

r(保留)

These flag bits are reserved for future use; they MUST be set to zero and ignored by the receiver.

这些标志位保留供将来使用;接收器必须将它们设置为零并忽略。

Command Code

命令代码

The Command Code field is three octets and is used in order to communicate the command associated with the message. The 24-bit address space is managed by IANA (see Section 3.1). Command Code values 16,777,214 and 16,777,215 (hexadecimal values FFFFFE-FFFFFF) are reserved for experimental use (see Section 11.2).

命令代码字段为三个八位字节,用于传达与消息相关的命令。24位地址空间由IANA管理(见第3.1节)。命令代码值16777214和16777215(十六进制值FFFFF E-FFFFFF)保留供实验使用(见第11.2节)。

Application-ID

应用程序ID

Application-ID is four octets and is used to identify for which application the message is applicable. The application can be an authentication application, an accounting application, or a vendor-specific application.

应用程序ID是四个八位字节,用于标识消息适用于哪个应用程序。该应用程序可以是身份验证应用程序、会计应用程序或特定于供应商的应用程序。

The value of the Application-ID field in the header MUST be the same as any relevant Application-Id AVPs contained in the message.

标头中应用程序ID字段的值必须与消息中包含的任何相关应用程序ID AVP相同。

Hop-by-Hop Identifier

逐跳标识符

The Hop-by-Hop Identifier is an unsigned 32-bit integer field (in network byte order) that aids in matching requests and replies. The sender MUST ensure that the Hop-by-Hop Identifier in a request is unique on a given connection at any given time, and it MAY attempt to ensure that the number is unique across reboots. The sender of an answer message MUST ensure that the Hop-by-Hop Identifier field contains the same value that was found in the corresponding request. The Hop-by-Hop Identifier is normally a monotonically increasing number, whose start value was randomly generated. An answer message that is received with an unknown Hop-by-Hop Identifier MUST be discarded.

逐跳标识符是一个无符号32位整数字段(按网络字节顺序),有助于匹配请求和响应。发送方必须确保请求中的逐跳标识符在任何给定时间在给定连接上都是唯一的,并且可以尝试确保该号码在重新启动时是唯一的。应答消息的发送者必须确保逐跳标识符字段包含在相应请求中找到的相同值。逐跳标识符通常是一个单调递增的数字,其起始值是随机生成的。必须丢弃使用未知逐跳标识符接收的应答消息。

End-to-End Identifier

端到端标识符

The End-to-End Identifier is an unsigned 32-bit integer field (in network byte order) that is used to detect duplicate messages. Upon reboot, implementations MAY set the high order 12 bits to contain the low order 12 bits of current time, and the low order 20 bits to a random value. Senders of request messages MUST insert a unique identifier on each message. The identifier MUST remain locally unique for a period of at least 4 minutes, even across reboots. The originator of an answer message MUST ensure that the End-to-End Identifier field contains the same value that was found in the corresponding request. The End-to-End Identifier MUST NOT be modified by Diameter agents of any kind. The combination of the Origin-Host AVP (Section 6.3) and this field is used to detect duplicates. Duplicate requests SHOULD cause the same answer to be transmitted (modulo the Hop-by-Hop Identifier

端到端标识符是一个无符号32位整数字段(按网络字节顺序),用于检测重复消息。在重新启动时,实现可以将高阶12位设置为包含当前时间的低阶12位,将低阶20位设置为随机值。请求消息的发件人必须在每条消息上插入唯一标识符。标识符必须在至少4分钟内保持本地唯一性,即使在重新启动期间也是如此。应答消息的发起人必须确保端到端标识符字段包含在相应请求中找到的相同值。端到端标识符不得被任何类型的Diameter代理修改。原始主机AVP(第6.3节)和该字段的组合用于检测重复项。重复的请求应导致传输相同的应答(以逐跳标识符为模)

field and any routing AVPs that may be present), and they MUST NOT affect any state that was set when the original request was processed. Duplicate answer messages that are to be locally consumed (see Section 6.2) SHOULD be silently discarded.

字段和可能存在的任何路由AVP),它们不得影响处理原始请求时设置的任何状态。本地使用的重复应答消息(见第6.2节)应被静默丢弃。

AVPs

AVPs

AVPs are a method of encapsulating information relevant to the Diameter message. See Section 4 for more information on AVPs.

AVP是封装与Diameter消息相关的信息的方法。有关AVP的更多信息,请参见第4节。

3.1. Command Codes
3.1. 命令代码

Each command Request/Answer pair is assigned a Command Code, and the sub-type (i.e., request or answer) is identified via the 'R' bit in the Command Flags field of the Diameter header.

每个命令请求/应答对分配一个命令代码,子类型(即请求或应答)通过直径标题的命令标志字段中的“R”位进行标识。

Every Diameter message MUST contain a Command Code in its header's Command Code field, which is used to determine the action that is to be taken for a particular message. The following Command Codes are defined in the Diameter base protocol:

每个Diameter消息必须在其标题的命令代码字段中包含一个命令代码,该字段用于确定要对特定消息执行的操作。以下命令代码在Diameter base协议中定义:

                                                   Section
    Command Name             Abbrev.    Code       Reference
      --------------------------------------------------------
      Abort-Session-Request     ASR       274           8.5.1
      Abort-Session-Answer      ASA       274           8.5.2
      Accounting-Request        ACR       271           9.7.1
      Accounting-Answer         ACA       271           9.7.2
      Capabilities-Exchange-    CER       257           5.3.1
         Request
      Capabilities-Exchange-    CEA       257           5.3.2
         Answer
      Device-Watchdog-Request   DWR       280           5.5.1
      Device-Watchdog-Answer    DWA       280           5.5.2
      Disconnect-Peer-Request   DPR       282           5.4.1
      Disconnect-Peer-Answer    DPA       282           5.4.2
      Re-Auth-Request           RAR       258           8.3.1
      Re-Auth-Answer            RAA       258           8.3.2
      Session-Termination-      STR       275           8.4.1
         Request
      Session-Termination-      STA       275           8.4.2
         Answer
        
                                                   Section
    Command Name             Abbrev.    Code       Reference
      --------------------------------------------------------
      Abort-Session-Request     ASR       274           8.5.1
      Abort-Session-Answer      ASA       274           8.5.2
      Accounting-Request        ACR       271           9.7.1
      Accounting-Answer         ACA       271           9.7.2
      Capabilities-Exchange-    CER       257           5.3.1
         Request
      Capabilities-Exchange-    CEA       257           5.3.2
         Answer
      Device-Watchdog-Request   DWR       280           5.5.1
      Device-Watchdog-Answer    DWA       280           5.5.2
      Disconnect-Peer-Request   DPR       282           5.4.1
      Disconnect-Peer-Answer    DPA       282           5.4.2
      Re-Auth-Request           RAR       258           8.3.1
      Re-Auth-Answer            RAA       258           8.3.2
      Session-Termination-      STR       275           8.4.1
         Request
      Session-Termination-      STA       275           8.4.2
         Answer
        
3.2. Command Code Format Specification
3.2. 命令代码格式规范

Every Command Code defined MUST include a corresponding Command Code Format (CCF) specification, which is used to define the AVPs that MUST or MAY be present when sending the message. The following ABNF specifies the CCF used in the definition:

定义的每个命令代码必须包括相应的命令代码格式(CCF)规范,该规范用于定义发送消息时必须或可能出现的AVP。以下ABNF规定了定义中使用的CCF:

   command-def      = "<" command-name ">" "::=" diameter-message
        
   command-def      = "<" command-name ">" "::=" diameter-message
        
   command-name     = diameter-name
        
   command-name     = diameter-name
        
   diameter-name    = ALPHA *(ALPHA / DIGIT / "-")
        
   diameter-name    = ALPHA *(ALPHA / DIGIT / "-")
        
   diameter-message = header   *fixed  *required *optional
        
   diameter-message = header   *fixed  *required *optional
        
   header           = "<Diameter-Header:" command-id
                         [r-bit] [p-bit] [e-bit] [application-id]">"
        
   header           = "<Diameter-Header:" command-id
                         [r-bit] [p-bit] [e-bit] [application-id]">"
        
   application-id   = 1*DIGIT
        
   application-id   = 1*DIGIT
        
   command-id       = 1*DIGIT
                      ; The Command Code assigned to the command.
        
   command-id       = 1*DIGIT
                      ; The Command Code assigned to the command.
        
   r-bit            = ", REQ"
                      ; If present, the 'R' bit in the Command
                      ; Flags is set, indicating that the message
                      ; is a request as opposed to an answer.
        
   r-bit            = ", REQ"
                      ; If present, the 'R' bit in the Command
                      ; Flags is set, indicating that the message
                      ; is a request as opposed to an answer.
        
   p-bit            = ", PXY"
                      ; If present, the 'P' bit in the Command
                      ; Flags is set, indicating that the message
                      ; is proxiable.
        
   p-bit            = ", PXY"
                      ; If present, the 'P' bit in the Command
                      ; Flags is set, indicating that the message
                      ; is proxiable.
        
   e-bit            = ", ERR"
                      ; If present, the 'E' bit in the Command
                      ; Flags is set, indicating that the answer
                      ; message contains a Result-Code AVP in
                      ; the "protocol error" class.
        
   e-bit            = ", ERR"
                      ; If present, the 'E' bit in the Command
                      ; Flags is set, indicating that the answer
                      ; message contains a Result-Code AVP in
                      ; the "protocol error" class.
        
   fixed            = [qual] "<" avp-spec ">"
                      ; Defines the fixed position of an AVP.
        
   fixed            = [qual] "<" avp-spec ">"
                      ; Defines the fixed position of an AVP.
        
   required         = [qual] "{" avp-spec "}"
                      ; The AVP MUST be present and can appear
                      ; anywhere in the message.
        
   required         = [qual] "{" avp-spec "}"
                      ; The AVP MUST be present and can appear
                      ; anywhere in the message.
        
   optional         = [qual] "[" avp-name "]"
                      ; The avp-name in the 'optional' rule cannot
                      ; evaluate to any AVP Name that is included
                      ; in a fixed or required rule.  The AVP can
                      ; appear anywhere in the message.
                      ;
                      ; NOTE:  "[" and "]" have a slightly different
                      ; meaning than in ABNF.  These braces
                      ; cannot be used to express optional fixed rules
                      ; (such as an optional ICV at the end).  To do
                      ; this, the convention is '0*1fixed'.
        
   optional         = [qual] "[" avp-name "]"
                      ; The avp-name in the 'optional' rule cannot
                      ; evaluate to any AVP Name that is included
                      ; in a fixed or required rule.  The AVP can
                      ; appear anywhere in the message.
                      ;
                      ; NOTE:  "[" and "]" have a slightly different
                      ; meaning than in ABNF.  These braces
                      ; cannot be used to express optional fixed rules
                      ; (such as an optional ICV at the end).  To do
                      ; this, the convention is '0*1fixed'.
        
   qual             = [min] "*" [max]
                      ; See ABNF conventions, RFC 5234, Section 4.
                      ; The absence of any qualifier depends on
                      ; whether it precedes a fixed, required, or
                      ; optional rule.  If a fixed or required rule has
                      ; no qualifier, then exactly one such AVP MUST
                      ; be present.  If an optional rule has no
                      ; qualifier, then 0 or 1 such AVP may be
                      ; present.  If an optional rule has a qualifier,
                      ; then the value of min MUST be 0 if present.
        
   qual             = [min] "*" [max]
                      ; See ABNF conventions, RFC 5234, Section 4.
                      ; The absence of any qualifier depends on
                      ; whether it precedes a fixed, required, or
                      ; optional rule.  If a fixed or required rule has
                      ; no qualifier, then exactly one such AVP MUST
                      ; be present.  If an optional rule has no
                      ; qualifier, then 0 or 1 such AVP may be
                      ; present.  If an optional rule has a qualifier,
                      ; then the value of min MUST be 0 if present.
        
   min              = 1*DIGIT
                      ; The minimum number of times the element may
                      ; be present.  If absent, the default value is 0
                      ; for fixed and optional rules and 1 for
                      ; required rules.  The value MUST be at least 1
                      ; for required rules.
        
   min              = 1*DIGIT
                      ; The minimum number of times the element may
                      ; be present.  If absent, the default value is 0
                      ; for fixed and optional rules and 1 for
                      ; required rules.  The value MUST be at least 1
                      ; for required rules.
        
   max              = 1*DIGIT
                      ; The maximum number of times the element may
                      ; be present.  If absent, the default value is
                      ; infinity.  A value of 0 implies the AVP MUST
                      ; NOT be present.
        
   max              = 1*DIGIT
                      ; The maximum number of times the element may
                      ; be present.  If absent, the default value is
                      ; infinity.  A value of 0 implies the AVP MUST
                      ; NOT be present.
        
   avp-spec         = diameter-name
                      ; The avp-spec has to be an AVP Name, defined
                      ; in the base or extended Diameter
                      ; specifications.
        
   avp-spec         = diameter-name
                      ; The avp-spec has to be an AVP Name, defined
                      ; in the base or extended Diameter
                      ; specifications.
        
   avp-name         = avp-spec / "AVP"
                      ; The string "AVP" stands for *any* arbitrary AVP
                      ; Name, not otherwise listed in that Command Code
                      ; definition.  The inclusion of this string
                      ; is recommended for all CCFs to allow for
                      ; extensibility.
        
   avp-name         = avp-spec / "AVP"
                      ; The string "AVP" stands for *any* arbitrary AVP
                      ; Name, not otherwise listed in that Command Code
                      ; definition.  The inclusion of this string
                      ; is recommended for all CCFs to allow for
                      ; extensibility.
        

The following is a definition of a fictitious Command Code:

以下是虚构命令代码的定义:

   Example-Request ::= < Diameter Header: 9999999, REQ, PXY >
                       { User-Name }
                    1* { Origin-Host }
                     * [ AVP ]
        
   Example-Request ::= < Diameter Header: 9999999, REQ, PXY >
                       { User-Name }
                    1* { Origin-Host }
                     * [ AVP ]
        
3.3. Diameter Command Naming Conventions
3.3. Diameter命令命名约定

Diameter command names typically includes one or more English words followed by the verb "Request" or "Answer". Each English word is delimited by a hyphen. A three-letter acronym for both the request and answer is also normally provided.

Diameter命令名通常包括一个或多个英语单词,后跟动词“Request”或“Answer”。每个英语单词用连字符分隔。通常还提供请求和回答的三个字母缩写。

An example is a message set used to terminate a session. The command name is Session-Terminate-Request and Session-Terminate-Answer, while the acronyms are STR and STA, respectively.

例如,用于终止会话的消息集。命令名为Session Terminate Request和Session Terminate Answer,首字母缩写分别为STR和STA。

Both the request and the answer for a given command share the same Command Code. The request is identified by the R(equest) bit in the Diameter header set to one (1), to ask that a particular action be performed, such as authorizing a user or terminating a session. Once the receiver has completed the request, it issues the corresponding answer, which includes a result code that communicates one of the following:

给定命令的请求和应答共享相同的命令代码。请求由设置为一(1)的Diameter头中的R(equest)位标识,以请求执行特定操作,例如授权用户或终止会话。接收器完成请求后,会发出相应的回答,其中包括一个结果代码,用于传达以下信息之一:

o The request was successful

o 请求成功

o The request failed

o 请求失败

o An additional request has to be sent to provide information the peer requires prior to returning a successful or failed answer.

o 在返回成功或失败的答案之前,必须发送额外的请求以提供对等方所需的信息。

o The receiver could not process the request, but provides information about a Diameter peer that is able to satisfy the request, known as redirect.

o 接收方无法处理该请求,但提供了有关能够满足该请求的Diameter对等方的信息,称为重定向。

Additional information, encoded within AVPs, may also be included in answer messages.

在AVPs中编码的附加信息也可以包括在应答消息中。

4. Diameter AVPs
4. 直径平均值

Diameter AVPs carry specific authentication, accounting, authorization, and routing information as well as configuration details for the request and reply.

Diameter AVP带有特定的身份验证、记帐、授权和路由信息以及请求和应答的配置详细信息。

Each AVP of type OctetString MUST be padded to align on a 32-bit boundary, while other AVP types align naturally. A number of zero-valued bytes are added to the end of the AVP Data field until a word boundary is reached. The length of the padding is not reflected in the AVP Length field.

OctetString类型的每个AVP必须填充以在32位边界上对齐,而其他AVP类型则自然对齐。许多零值字节被添加到AVP数据字段的末尾,直到达到字边界。填充的长度不会反映在AVP长度字段中。

4.1. AVP Header
4.1. AVP报头

The fields in the AVP header MUST be sent in network byte order. The format of the header is:

AVP报头中的字段必须按网络字节顺序发送。标题的格式为:

       0                   1                   2                   3
       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
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      |                           AVP Code                            |
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      |V M P r r r r r|                  AVP Length                   |
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      |                        Vendor-ID (opt)                        |
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      |    Data ...
      +-+-+-+-+-+-+-+-+
        
       0                   1                   2                   3
       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
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      |                           AVP Code                            |
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      |V M P r r r r r|                  AVP Length                   |
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      |                        Vendor-ID (opt)                        |
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      |    Data ...
      +-+-+-+-+-+-+-+-+
        

AVP Code

AVP码

The AVP Code, combined with the Vendor-Id field, identifies the attribute uniquely. AVP numbers 1 through 255 are reserved for reuse of RADIUS attributes, without setting the Vendor-Id field. AVP numbers 256 and above are used for Diameter, which are allocated by IANA (see Section 11.1.1).

AVP代码与供应商Id字段相结合,唯一地标识属性。AVP编号1到255保留用于重复使用RADIUS属性,无需设置供应商Id字段。AVP编号256及以上用于IANA分配的直径(见第11.1.1节)。

AVP Flags

AVP标志

The AVP Flags field informs the receiver how each attribute must be handled. New Diameter applications SHOULD NOT define additional AVP Flag bits. However, note that new Diameter applications MAY define additional bits within the AVP header, and an unrecognized bit SHOULD be considered an error. The sender of the AVP MUST set 'R' (reserved) bits to 0 and the receiver SHOULD ignore all 'R' (reserved) bits. The 'P' bit has been reserved for future usage of end-to-end security. At the time of writing, there are no end-to-end security mechanisms specified; therefore, the 'P' bit SHOULD be set to 0.

AVP标志字段通知接收者必须如何处理每个属性。新直径应用程序不应定义额外的AVP标志位。但是,请注意,新的Diameter应用程序可能会在AVP头中定义额外的位,未识别的位应视为错误。AVP的发送方必须将“R”(保留)位设置为0,接收方应忽略所有“R”(保留)位。“P”位已保留供将来使用端到端安全性。在编写本报告时,未指定端到端安全机制;因此,“P”位应设置为0。

The 'M' bit, known as the Mandatory bit, indicates whether the receiver of the AVP MUST parse and understand the semantics of the AVP including its content. The receiving entity MUST return an appropriate error message if it receives an AVP that has the M-bit

“M”位被称为强制位,指示AVP的接收者是否必须解析和理解AVP的语义,包括其内容。如果接收实体接收到具有M位的AVP,则必须返回适当的错误消息

set but does not understand it. An exception applies when the AVP is embedded within a Grouped AVP. See Section 4.4 for details. Diameter relay and redirect agents MUST NOT reject messages with unrecognized AVPs.

设置但不理解它。当AVP嵌入分组AVP时,例外情况适用。详见第4.4节。Diameter中继和重定向代理不得拒绝具有无法识别的AVP的消息。

The 'M' bit MUST be set according to the rules defined in the application specification that introduces or reuses this AVP. Within a given application, the M-bit setting for an AVP is defined either for all command types or for each command type.

必须根据引入或重用此AVP的应用程序规范中定义的规则设置“M”位。在给定的应用程序中,AVP的M位设置为所有命令类型或每个命令类型定义。

AVPs with the 'M' bit cleared are informational only; a receiver that receives a message with such an AVP that is not supported, or whose value is not supported, MAY simply ignore the AVP.

清除“M”位的AVP仅供参考;接收带有不受支持的AVP或其值不受支持的AVP的消息的接收器可以简单地忽略AVP。

The 'V' bit, known as the Vendor-Specific bit, indicates whether the optional Vendor-ID field is present in the AVP header. When set, the AVP Code belongs to the specific vendor code address space.

“V”位(称为供应商特定位)表示AVP标头中是否存在可选供应商ID字段。设置后,AVP代码属于特定的供应商代码地址空间。

AVP Length

AVP长度

The AVP Length field is three octets, and indicates the number of octets in this AVP including the AVP Code field, AVP Length field, AVP Flags field, Vendor-ID field (if present), and the AVP Data field. If a message is received with an invalid attribute length, the message MUST be rejected.

AVP长度字段为三个八位字节,表示此AVP中的八位字节数,包括AVP代码字段、AVP长度字段、AVP标志字段、供应商ID字段(如果存在)和AVP数据字段。如果收到的消息的属性长度无效,则必须拒绝该消息。

4.1.1. Optional Header Elements
4.1.1. 可选标题元素

The AVP header contains one optional field. This field is only present if the respective bit-flag is enabled.

AVP标头包含一个可选字段。仅当相应的位标志启用时,此字段才会出现。

Vendor-ID

供应商ID

The Vendor-ID field is present if the 'V' bit is set in the AVP Flags field. The optional four-octet Vendor-ID field contains the IANA-assigned "SMI Network Management Private Enterprise Codes" [ENTERPRISE] value, encoded in network byte order. Any vendors or standardization organizations that are also treated like vendors in the IANA-managed "SMI Network Management Private Enterprise Codes" space wishing to implement a vendor-specific Diameter AVP MUST use their own Vendor-ID along with their privately managed AVP address space, guaranteeing that they will not collide with any other vendor's vendor-specific AVP(s) or with future IETF AVPs.

如果在AVP标志字段中设置了“V”位,则存在供应商ID字段。可选的四个八位字节的供应商ID字段包含IANA分配的“SMI网络管理专用企业代码”[Enterprise]值,以网络字节顺序编码。任何被视为IANA管理的“SMI网络管理私有企业代码”空间中的供应商的供应商或标准化组织,如果希望实现供应商特定的Diameter AVP,则必须使用自己的供应商ID及其私有管理的AVP地址空间,保证它们不会与任何其他供应商的供应商特定AVP或未来的IETF AVP发生冲突。

A Vendor-ID value of zero (0) corresponds to the IETF-adopted AVP values, as managed by IANA. Since the absence of the Vendor-ID field implies that the AVP in question is not vendor specific, implementations MUST NOT use the value of zero (0) for the Vendor-ID field.

供应商ID值为零(0)对应于IANA管理的IETF采用的AVP值。由于缺少供应商ID字段意味着所讨论的AVP不是特定于供应商的,因此实现不得对供应商ID字段使用零(0)值。

4.2. Basic AVP Data Formats
4.2. 基本AVP数据格式

The Data field is zero or more octets and contains information specific to the Attribute. The format and length of the Data field is determined by the AVP Code and AVP Length fields. The format of the Data field MUST be one of the following base data types or a data type derived from the base data types. In the event that a new Basic AVP Data Format is needed, a new version of this RFC MUST be created.

数据字段为零个或多个八位字节,包含特定于属性的信息。数据字段的格式和长度由AVP代码和AVP长度字段决定。数据字段的格式必须是以下基本数据类型之一或从基本数据类型派生的数据类型。如果需要新的基本AVP数据格式,则必须创建此RFC的新版本。

OctetString

八进制字符串

The data contains arbitrary data of variable length. Unless otherwise noted, the AVP Length field MUST be set to at least 8 (12 if the 'V' bit is enabled). AVP values of this type that are not a multiple of 4 octets in length are followed by the necessary padding so that the next AVP (if any) will start on a 32-bit boundary.

数据包含长度可变的任意数据。除非另有说明,否则AVP长度字段必须设置为至少8(如果启用了“V”位,则为12)。这种类型的AVP值(长度不是4个八位字节的倍数)后面跟着必要的填充,以便下一个AVP(如果有)将从32位边界开始。

Integer32

整数32

32-bit signed value, in network byte order. The AVP Length field MUST be set to 12 (16 if the 'V' bit is enabled).

32位有符号值,按网络字节顺序。AVP长度字段必须设置为12(如果启用了“V”位,则设置为16)。

Integer64

整数64

64-bit signed value, in network byte order. The AVP Length field MUST be set to 16 (20 if the 'V' bit is enabled).

64位有符号值,按网络字节顺序。AVP长度字段必须设置为16(如果启用了“V”位,则设置为20)。

Unsigned32

未签名32

32-bit unsigned value, in network byte order. The AVP Length field MUST be set to 12 (16 if the 'V' bit is enabled).

32位无符号值,按网络字节顺序。AVP长度字段必须设置为12(如果启用了“V”位,则设置为16)。

Unsigned64

未签名64

64-bit unsigned value, in network byte order. The AVP Length field MUST be set to 16 (20 if the 'V' bit is enabled).

64位无符号值,按网络字节顺序。AVP长度字段必须设置为16(如果启用了“V”位,则设置为20)。

Float32

浮动32

This represents floating point values of single precision as described by [FLOATPOINT]. The 32-bit value is transmitted in network byte order. The AVP Length field MUST be set to 12 (16 if the 'V' bit is enabled).

这表示单精度浮点值,如[FLOATPOINT]所述。32位值以网络字节顺序传输。AVP长度字段必须设置为12(如果启用了“V”位,则设置为16)。

Float64

浮动64

This represents floating point values of double precision as described by [FLOATPOINT]. The 64-bit value is transmitted in network byte order. The AVP Length field MUST be set to 16 (20 if the 'V' bit is enabled).

这表示双精度浮点值,如[FLOATPOINT]所述。64位值以网络字节顺序传输。AVP长度字段必须设置为16(如果启用了“V”位,则设置为20)。

Grouped

分组

The Data field is specified as a sequence of AVPs. These AVPs are concatenated -- including their headers and padding -- in the order in which they are specified and the result encapsulated in the Data field. The AVP Length field is set to 8 (12 if the 'V' bit is enabled) plus the total length of all included AVPs, including their headers and padding. Thus, the AVP Length field of an AVP of type Grouped is always a multiple of 4.

数据字段指定为AVP序列。这些AVP按指定顺序连接在一起(包括它们的头和填充),结果封装在数据字段中。AVP长度字段设置为8(如果启用了“V”位,则为12)加上所有包含的AVP的总长度,包括其标题和填充。因此,分组类型的AVP的AVP长度字段始终是4的倍数。

4.3. Derived AVP Data Formats
4.3. 派生AVP数据格式

In addition to using the Basic AVP Data Formats, applications may define data formats derived from the Basic AVP Data Formats. An application that defines new Derived AVP Data Formats MUST include them in a section titled "Derived AVP Data Formats", using the same format as the definitions below. Each new definition MUST be either defined or listed with a reference to the RFC that defines the format.

除了使用基本AVP数据格式外,应用程序还可以定义从基本AVP数据格式派生的数据格式。定义新的衍生AVP数据格式的应用程序必须使用与以下定义相同的格式将其包含在标题为“衍生AVP数据格式”的部分中。每个新定义必须定义或列出,并引用定义格式的RFC。

4.3.1. Common Derived AVP Data Formats
4.3.1. 通用派生AVP数据格式

The following are commonly used Derived AVP Data Formats.

以下是常用的衍生AVP数据格式。

Address

住址

The Address format is derived from the OctetString Basic AVP Format. It is a discriminated union representing, for example, a 32-bit (IPv4) [RFC0791] or 128-bit (IPv6) [RFC4291] address, most significant octet first. The first two octets of the Address AVP represent the AddressType, which contains an Address Family, defined in [IANAADFAM]. The AddressType is used to discriminate the content and format of the remaining octets.

地址格式源自八进制字符串基本AVP格式。它是一个区分的并集,例如,表示32位(IPv4)[RFC0791]或128位(IPv6)[RFC4291]地址,最重要的八位位组在前。地址AVP的前两个八位字节表示AddressType,其中包含[IANAADFAM]中定义的地址族。AddressType用于区分剩余八位字节的内容和格式。

Time

时间

The Time format is derived from the OctetString Basic AVP Format. The string MUST contain four octets, in the same format as the first four bytes are in the NTP timestamp format. The NTP timestamp format is defined in Section 3 of [RFC5905].

时间格式源自八进制字符串基本AVP格式。字符串必须包含四个八位字节,格式与前四个字节的NTP时间戳格式相同。NTP时间戳格式在[RFC5905]第3节中定义。

This represents the number of seconds since 0h on 1 January 1900 with respect to the Coordinated Universal Time (UTC).

这表示自1900年1月1日0小时起相对于协调世界时(UTC)的秒数。

On 6h 28m 16s UTC, 7 February 2036, the time value will overflow. Simple Network Time Protocol (SNTP) [RFC5905] describes a procedure to extend the time to 2104. This procedure MUST be supported by all Diameter nodes.

2036年2月7日,协调世界时6小时28米16秒,时间值将溢出。简单网络时间协议(SNTP)[RFC5905]描述了将时间延长到2104的过程。所有直径节点都必须支持此过程。

UTF8String

UTF8字符串

The UTF8String format is derived from the OctetString Basic AVP Format. This is a human-readable string represented using the ISO/IEC IS 10646-1 character set, encoded as an OctetString using the UTF-8 transformation format [RFC3629].

UTF8String格式源自八进制字符串基本AVP格式。这是使用ISO/IEC is 10646-1字符集表示的人类可读字符串,使用UTF-8转换格式[RFC3629]编码为八位字符串。

Since additional code points are added by amendments to the 10646 standard from time to time, implementations MUST be prepared to encounter any code point from 0x00000001 to 0x7fffffff. Byte sequences that do not correspond to the valid encoding of a code point into UTF-8 charset or are outside this range are prohibited.

由于额外的代码点是通过对10646标准的不时修订而添加的,因此实现必须准备好遇到从0x00000001到0x7FFFFF的任何代码点。禁止与UTF-8字符集中的代码点的有效编码不对应或超出此范围的字节序列。

The use of control codes SHOULD be avoided. When it is necessary to represent a new line, the control code sequence CR LF SHOULD be used.

应避免使用控制代码。当需要表示新行时,应使用控制代码序列CR LF。

The use of leading or trailing white space SHOULD be avoided.

应避免使用前导或尾随空格。

For code points not directly supported by user interface hardware or software, an alternative means of entry and display, such as hexadecimal, MAY be provided.

对于用户界面硬件或软件不直接支持的代码点,可提供其他输入和显示方式,如十六进制。

For information encoded in 7-bit US-ASCII, the UTF-8 charset is identical to the US-ASCII charset.

对于以7位US-ASCII编码的信息,UTF-8字符集与US-ASCII字符集相同。

UTF-8 may require multiple bytes to represent a single character / code point; thus, the length of a UTF8String in octets may be different from the number of characters encoded.

UTF-8可能需要多个字节来表示单个字符/代码点;因此,以八位字节为单位的UTF8字符串的长度可能与编码的字符数不同。

Note that the AVP Length field of an UTF8String is measured in octets not characters.

请注意,UTF8String的AVP长度字段是以八位字节(而不是字符)度量的。

DiameterIdentity

直径

The DiameterIdentity format is derived from the OctetString Basic AVP Format.

直径格式源自八进制字符串基本AVP格式。

                        DiameterIdentity  = FQDN/Realm
        
                        DiameterIdentity  = FQDN/Realm
        

The DiameterIdentity value is used to uniquely identify either:

直径值用于唯一标识以下任一项:

* A Diameter node for purposes of duplicate connection and routing loop detection.

* 用于重复连接和路由环路检测的直径节点。

* A Realm to determine whether messages can be satisfied locally or whether they must be routed or redirected.

* 一个域,用于确定消息是否可以在本地得到满足,或者消息是否必须路由或重定向。

When a DiameterIdentity value is used to identify a Diameter node, the contents of the string MUST be the Fully Qualified Domain Name (FQDN) of the Diameter node. If multiple Diameter nodes run on the same host, each Diameter node MUST be assigned a unique DiameterIdentity. If a Diameter node can be identified by several FQDNs, a single FQDN should be picked at startup and used as the only DiameterIdentity for that node, whatever the connection on which it is sent. In this document, note that DiameterIdentity is in ASCII form in order to be compatible with existing DNS infrastructure. See Appendix D for interactions between the Diameter protocol and Internationalized Domain Names (IDNs).

当使用DiameterIdentity值标识Diameter节点时,字符串的内容必须是Diameter节点的完全限定域名(FQDN)。如果多个直径节点在同一主机上运行,则必须为每个直径节点指定唯一的直径。如果一个直径节点可以由多个FQDN标识,则应在启动时选取一个FQDN,并将其用作该节点的唯一直径,无论发送该节点的连接是什么。在本文档中,请注意直径为ASCII格式,以便与现有DNS基础设施兼容。有关Diameter协议和国际化域名(IDN)之间的交互,请参见附录D。

DiameterURI

直径

The DiameterURI MUST follow the Uniform Resource Identifiers (RFC 3986) syntax [RFC3986] rules specified below:

DiameterURI必须遵循以下指定的统一资源标识符(RFC 3986)语法[RFC3986]规则:

      "aaa://" FQDN [ port ] [ transport ] [ protocol ]
        
      "aaa://" FQDN [ port ] [ transport ] [ protocol ]
        

; No transport security

; 没有交通安全

      "aaas://" FQDN [ port ] [ transport ] [ protocol ]
        
      "aaas://" FQDN [ port ] [ transport ] [ protocol ]
        

; Transport security used

; 使用的运输安全

      FQDN               = < Fully Qualified Domain Name >
        
      FQDN               = < Fully Qualified Domain Name >
        
      port               = ":" 1*DIGIT
        
      port               = ":" 1*DIGIT
        
                      ; One of the ports used to listen for
                      ; incoming connections.
                      ; If absent, the default Diameter port
                      ; (3868) is assumed if no transport
                      ; security is used and port 5658 when
                      ; transport security (TLS/TCP and DTLS/SCTP)
                      ; is used.
        
                      ; One of the ports used to listen for
                      ; incoming connections.
                      ; If absent, the default Diameter port
                      ; (3868) is assumed if no transport
                      ; security is used and port 5658 when
                      ; transport security (TLS/TCP and DTLS/SCTP)
                      ; is used.
        
      transport          = ";transport=" transport-protocol
        
      transport          = ";transport=" transport-protocol
        
                      ; One of the transports used to listen
                      ; for incoming connections.  If absent,
                      ; the default protocol is assumed to be TCP.
                      ; UDP MUST NOT be used when the aaa-protocol
                      ; field is set to diameter.
        
                      ; One of the transports used to listen
                      ; for incoming connections.  If absent,
                      ; the default protocol is assumed to be TCP.
                      ; UDP MUST NOT be used when the aaa-protocol
                      ; field is set to diameter.
        
      transport-protocol = ( "tcp" / "sctp" / "udp" )
        
      transport-protocol = ( "tcp" / "sctp" / "udp" )
        
      protocol           = ";protocol=" aaa-protocol
        
      protocol           = ";protocol=" aaa-protocol
        

; If absent, the default AAA protocol ; is Diameter.

; 如果没有,默认的AAA协议;是直径。

      aaa-protocol       = ( "diameter" / "radius" / "tacacs+" )
        
      aaa-protocol       = ( "diameter" / "radius" / "tacacs+" )
        

The following are examples of valid Diameter host identities:

以下是有效的Diameter主机标识的示例:

      aaa://host.example.com;transport=tcp
      aaa://host.example.com:6666;transport=tcp
      aaa://host.example.com;protocol=diameter
      aaa://host.example.com:6666;protocol=diameter
      aaa://host.example.com:6666;transport=tcp;protocol=diameter
      aaa://host.example.com:1813;transport=udp;protocol=radius
        
      aaa://host.example.com;transport=tcp
      aaa://host.example.com:6666;transport=tcp
      aaa://host.example.com;protocol=diameter
      aaa://host.example.com:6666;protocol=diameter
      aaa://host.example.com:6666;transport=tcp;protocol=diameter
      aaa://host.example.com:1813;transport=udp;protocol=radius
        

Enumerated

列举

The Enumerated format is derived from the Integer32 Basic AVP Format. The definition contains a list of valid values and their interpretation and is described in the Diameter application introducing the AVP.

枚举格式派生自Integer32基本AVP格式。定义包含有效值及其解释的列表,并在介绍AVP的Diameter应用程序中进行了描述。

IPFilterRule

IPFilterRule

The IPFilterRule format is derived from the OctetString Basic AVP Format and uses the ASCII charset. The rule syntax is a modified subset of ipfw(8) from FreeBSD. Packets may be filtered based on the following information that is associated with it:

IPFilterRule格式源自八进制字符串基本AVP格式,并使用ASCII字符集。规则语法是FreeBSD中ipfw(8)的修改子集。可以基于与分组相关联的以下信息来过滤分组:

Direction (in or out) Source and destination IP address (possibly masked) Protocol Source and destination port (lists or ranges) TCP flags IP fragment flag IP options ICMP types

方向(输入或输出)源和目标IP地址(可能被屏蔽)协议源和目标端口(列表或范围)TCP标志IP片段标志IP选项ICMP类型

Rules for the appropriate direction are evaluated in order, with the first matched rule terminating the evaluation. Each packet is evaluated once. If no rule matches, the packet is dropped if the last rule evaluated was a permit, and passed if the last rule was a deny.

相应方向的规则按顺序求值,第一个匹配的规则终止求值。每个数据包评估一次。如果没有匹配的规则,则如果最后一个评估的规则是许可证,则丢弃数据包;如果最后一个规则是拒绝,则传递数据包。

IPFilterRule filters MUST follow the format:

IPFilterRule筛选器必须遵循以下格式:

action dir proto from src to dst [options]

从src到dst的操作目录协议[选项]

action permit - Allow packets that match the rule. deny - Drop packets that match the rule.

操作允许-允许符合规则的数据包。拒绝-丢弃与规则匹配的数据包。

dir "in" is from the terminal, "out" is to the terminal.

dir“in”来自终端,“out”指向终端。

proto An IP protocol specified by number. The "ip" keyword means any protocol will match.

proto由数字指定的IP协议。“ip”关键字表示任何协议都将匹配。

         src and dst  <address/mask> [ports]
        
         src and dst  <address/mask> [ports]
        

The <address/mask> may be specified as: ipno An IPv4 or IPv6 number in dotted-quad or canonical IPv6 form. Only this exact IP number will match the rule.

<address/mask>可以指定为:ipno一个虚线四元组或规范IPv6形式的IPv4或IPv6号码。只有这个确切的IP号码才符合规则。

ipno/bits An IP number as above with a mask width of the form 192.0.2.10/24. In this case, all IP numbers from 192.0.2.0 to 192.0.2.255 will match. The bit width MUST be valid for the IP version, and the IP number MUST NOT have bits set beyond the mask. For a match to occur, the same IP version must be present in the packet that was used in describing the IP address. To test for a particular IP version, the bits part can be set to zero. The keyword "any" is 0.0.0.0/0 or the IPv6 equivalent. The keyword "assigned" is the address or set of addresses assigned to the terminal. For IPv4, a typical first rule is often "deny in ip! assigned".

ipno/位如上所述的IP号,掩码宽度为192.0.2.10/24。在这种情况下,192.0.2.0到192.0.2.255之间的所有IP号码都将匹配。位宽度必须对IP版本有效,并且IP编号的位设置不得超出掩码。要进行匹配,用于描述IP地址的数据包中必须存在相同的IP版本。要测试特定IP版本,可以将bits部分设置为零。关键字“any”是0.0.0.0/0或IPv6等效值。关键字“assigned”是指分配给终端的地址或地址集。对于IPv4,典型的第一条规则通常是“在ip!分配中拒绝”。

The sense of the match can be inverted by preceding an address with the not modifier (!), causing all other addresses to be matched instead. This does not affect the selection of port numbers.

匹配的意义可以通过在地址前面加not修饰符(!)来颠倒,从而使所有其他地址都匹配。这不会影响端口号的选择。

With the TCP, UDP, and SCTP protocols, optional ports may be specified as:

对于TCP、UDP和SCTP协议,可选端口可以指定为:

                         {port/port-port}[,ports[,...]]
        
                         {port/port-port}[,ports[,...]]
        

The '-' notation specifies a range of ports (including boundaries).

“-”符号指定端口范围(包括边界)。

Fragmented packets that have a non-zero offset (i.e., not the first fragment) will never match a rule that has one or more port specifications. See the frag option for details on matching fragmented packets.

具有非零偏移量(即,不是第一个片段)的分段数据包将永远不会与具有一个或多个端口规范的规则匹配。有关匹配碎片数据包的详细信息,请参阅frag选项。

options: frag Match if the packet is a fragment and this is not the first fragment of the datagram. frag may not be used in conjunction with either tcpflags or TCP/UDP port specifications.

选项:如果数据包是一个片段,而这不是数据报的第一个片段,则frag匹配。frag不能与tcpflags或TCP/UDP端口规范一起使用。

ipoptions spec Match if the IP header contains the comma-separated list of options specified in spec. The supported IP options are:

如果IP标头包含规范中指定的以逗号分隔的选项列表,则ipoptions规范匹配。支持的IP选项包括:

ssrr (strict source route), lsrr (loose source route), rr (record packet route), and ts (timestamp). The absence of a particular option may be denoted with a '!'.

ssrr(严格源路由)、lsrr(松散源路由)、rr(记录包路由)和ts(时间戳)。没有特定选项可以用“!”表示。

tcpoptions spec Match if the TCP header contains the comma-separated list of options specified in spec. The supported TCP options are:

如果TCP标头包含规范中指定的以逗号分隔的选项列表,则tcpoptions规范匹配。支持的TCP选项包括:

mss (maximum segment size), window (tcp window advertisement), sack (selective ack), ts (rfc1323 timestamp), and cc (rfc1644 t/tcp connection count). The absence of a particular option may be denoted with a '!'.

mss(最大段大小)、窗口(tcp窗口广告)、sack(选择性确认)、ts(rfc1323时间戳)和cc(rfc1644 t/tcp连接计数)。没有特定选项可以用“!”表示。

established TCP packets only. Match packets that have the RST or ACK bits set.

仅已建立TCP数据包。匹配设置了RST或ACK位的数据包。

setup TCP packets only. Match packets that have the SYN bit set but no ACK bit.

仅设置TCP数据包。匹配设置了SYN位但没有ACK位的数据包。

tcpflags spec TCP packets only. Match if the TCP header contains the comma-separated list of flags specified in spec. The supported TCP flags are:

tcpflags仅用于规范TCP数据包。如果TCP标头包含规范中指定的以逗号分隔的标志列表,则匹配。支持的TCP标志为:

fin, syn, rst, psh, ack, and urg. The absence of a particular flag may be denoted with a '!'. A rule that contains a tcpflags specification can never match a fragmented packet that has a non-zero offset. See the frag option for details on matching fragmented packets.

fin、syn、rst、psh、ack和urg。没有特定标志可用“!”表示。包含tcpflags规范的规则永远无法匹配具有非零偏移量的碎片数据包。有关匹配碎片数据包的详细信息,请参阅frag选项。

icmptypes types ICMP packets only. Match if the ICMP type is in the list types. The list may be specified as any combination of ranges or individual types separated by commas. Both the numeric values and the symbolic values listed below can be used. The supported ICMP types are:

icmptypes仅类型ICMP数据包。如果ICMP类型在列表类型中,则匹配。该列表可以指定为范围的任意组合或以逗号分隔的单个类型。可以使用下面列出的数值和符号值。支持的ICMP类型包括:

echo reply (0), destination unreachable (3), source quench (4), redirect (5), echo request (8), router advertisement (9), router solicitation (10), time-to-live exceeded (11), IP header bad (12), timestamp request (13), timestamp reply (14), information request (15), information reply (16), address mask request (17), and address mask reply (18).

回显回复(0)、目标不可到达(3)、源猝灭(4)、重定向(5)、回显请求(8)、路由器通告(9)、路由器请求(10)、超过生存时间(11)、IP报头错误(12)、时间戳请求(13)、时间戳回复(14)、信息请求(15)、信息回复(16)、地址掩码请求(17)和地址掩码回复(18)。

There is one kind of packet that the access device MUST always discard, that is an IP fragment with a fragment offset of one. This is a valid packet, but it only has one use, to try to circumvent firewalls.

有一种数据包,接入设备必须始终丢弃,即片段偏移量为1的IP片段。这是一个有效的数据包,但它只有一个用途,即试图绕过防火墙。

An access device that is unable to interpret or apply a deny rule MUST terminate the session. An access device that is unable to interpret or apply a permit rule MAY apply a more restrictive rule. An access device MAY apply deny rules of its own before the supplied rules, for example to protect the access device owner's infrastructure.

无法解释或应用拒绝规则的访问设备必须终止会话。无法解释或应用许可证规则的访问设备可以应用更严格的规则。接入设备可在提供的规则之前应用其自身的拒绝规则,例如,以保护接入设备所有者的基础设施。

4.4. Grouped AVP Values
4.4. 分组平均值

The Diameter protocol allows AVP values of type 'Grouped'. This implies that the Data field is actually a sequence of AVPs. It is possible to include an AVP with a Grouped type within a Grouped type, that is, to nest them. AVPs within an AVP of type Grouped have the same padding requirements as non-Grouped AVPs, as defined in Section 4.4.

Diameter协议允许“分组”类型的AVP值。这意味着数据字段实际上是一个AVP序列。可以在分组类型中包含分组类型的AVP,即嵌套它们。根据第4.4节的定义,分组类型AVP中的AVP与非分组AVP具有相同的填充要求。

The AVP Code numbering space of all AVPs included in a Grouped AVP is the same as for non-Grouped AVPs. Receivers of a Grouped AVP that does not have the 'M' (mandatory) bit set and one or more of the encapsulated AVPs within the group has the 'M' (mandatory) bit set MAY simply be ignored if the Grouped AVP itself is unrecognized. The rule applies even if the encapsulated AVP with its 'M' (mandatory) bit set is further encapsulated within other sub-groups, i.e., other Grouped AVPs embedded within the Grouped AVP.

分组AVP中包含的所有AVP的AVP代码编号空间与非分组AVP的相同。如果分组AVP本身无法识别,则可以忽略未设置“M”(强制)位的分组AVP接收机以及组内一个或多个封装AVP具有“M”(强制)位的接收机。即使封装的AVP及其“M”(强制)位集进一步封装在其他子组中,即嵌入在分组AVP中的其他分组AVP,该规则也适用。

Every Grouped AVP definition MUST include a corresponding grammar, using ABNF [RFC5234] (with modifications), as defined below.

每个分组的AVP定义必须包括一个对应的语法,使用ABNF[RFC5234](经过修改),定义如下。

         grouped-avp-def  = "<" name ">" "::=" avp
        
         grouped-avp-def  = "<" name ">" "::=" avp
        
         name-fmt         = ALPHA *(ALPHA / DIGIT / "-")
        
         name-fmt         = ALPHA *(ALPHA / DIGIT / "-")
        
         name             = name-fmt
                            ; The name has to be the name of an AVP,
                            ; defined in the base or extended Diameter
                            ; specifications.
        
         name             = name-fmt
                            ; The name has to be the name of an AVP,
                            ; defined in the base or extended Diameter
                            ; specifications.
        
         avp              = header *fixed *required *optional
        
         avp              = header *fixed *required *optional
        
         header           = "<" "AVP-Header:" avpcode [vendor] ">"
        
         header           = "<" "AVP-Header:" avpcode [vendor] ">"
        
         avpcode          = 1*DIGIT
                            ; The AVP Code assigned to the Grouped AVP.
        
         avpcode          = 1*DIGIT
                            ; The AVP Code assigned to the Grouped AVP.
        
         vendor           = 1*DIGIT
                            ; The Vendor-ID assigned to the Grouped AVP.
                            ; If absent, the default value of zero is
                            ; used.
        
         vendor           = 1*DIGIT
                            ; The Vendor-ID assigned to the Grouped AVP.
                            ; If absent, the default value of zero is
                            ; used.
        
4.4.1. Example AVP with a Grouped Data Type
4.4.1. 具有分组数据类型的AVP示例

The Example-AVP (AVP Code 999999) is of type Grouped and is used to clarify how Grouped AVP values work. The Grouped Data field has the following CCF grammar:

示例AVP(AVP代码999999)属于分组类型,用于阐明分组AVP值的工作原理。分组数据字段具有以下CCF语法:

         Example-AVP  ::= < AVP Header: 999999 >
                          { Origin-Host }
                        1*{ Session-Id }
                         *[ AVP ]
        
         Example-AVP  ::= < AVP Header: 999999 >
                          { Origin-Host }
                        1*{ Session-Id }
                         *[ AVP ]
        

An Example-AVP with Grouped Data follows.

下面是分组数据的AVP示例。

The Origin-Host AVP (Section 6.3) is required. In this case:

需要原始主机AVP(第6.3节)。在这种情况下:

Origin-Host = "example.com".

Origin Host=“example.com”。

One or more Session-Ids must follow. Here there are two:

必须遵循一个或多个会话ID。这里有两个:

         Session-Id =
           "grump.example.com:33041;23432;893;0AF3B81"
        
         Session-Id =
           "grump.example.com:33041;23432;893;0AF3B81"
        
         Session-Id =
           "grump.example.com:33054;23561;2358;0AF3B82"
        
         Session-Id =
           "grump.example.com:33054;23561;2358;0AF3B82"
        

optional AVPs included are

包括可选的AVP

         Recovery-Policy = <binary>
            2163bc1d0ad82371f6bc09484133c3f09ad74a0dd5346d54195a7cf0b35
            2cabc881839a4fdcfbc1769e2677a4c1fb499284c5f70b48f58503a45c5
            c2d6943f82d5930f2b7c1da640f476f0e9c9572a50db8ea6e51e1c2c7bd
            f8bb43dc995144b8dbe297ac739493946803e1cee3e15d9b765008a1b2a
            cf4ac777c80041d72c01e691cf751dbf86e85f509f3988e5875dc905119
            26841f00f0e29a6d1ddc1a842289d440268681e052b30fb638045f7779c
            1d873c784f054f688f5001559ecff64865ef975f3e60d2fd7966b8c7f92
        
         Recovery-Policy = <binary>
            2163bc1d0ad82371f6bc09484133c3f09ad74a0dd5346d54195a7cf0b35
            2cabc881839a4fdcfbc1769e2677a4c1fb499284c5f70b48f58503a45c5
            c2d6943f82d5930f2b7c1da640f476f0e9c9572a50db8ea6e51e1c2c7bd
            f8bb43dc995144b8dbe297ac739493946803e1cee3e15d9b765008a1b2a
            cf4ac777c80041d72c01e691cf751dbf86e85f509f3988e5875dc905119
            26841f00f0e29a6d1ddc1a842289d440268681e052b30fb638045f7779c
            1d873c784f054f688f5001559ecff64865ef975f3e60d2fd7966b8c7f92
        
         Futuristic-Acct-Record = <binary>
            fe19da5802acd98b07a5b86cb4d5d03f0314ab9ef1ad0b67111ff3b90a0
            57fe29620bf3585fd2dd9fcc38ce62f6cc208c6163c008f4258d1bc88b8
            17694a74ccad3ec69269461b14b2e7a4c111fb239e33714da207983f58c
            41d018d56fe938f3cbf089aac12a912a2f0d1923a9390e5f789cb2e5067
            d3427475e49968f841
        
         Futuristic-Acct-Record = <binary>
            fe19da5802acd98b07a5b86cb4d5d03f0314ab9ef1ad0b67111ff3b90a0
            57fe29620bf3585fd2dd9fcc38ce62f6cc208c6163c008f4258d1bc88b8
            17694a74ccad3ec69269461b14b2e7a4c111fb239e33714da207983f58c
            41d018d56fe938f3cbf089aac12a912a2f0d1923a9390e5f789cb2e5067
            d3427475e49968f841
        

The data for the optional AVPs is represented in hexadecimal form since the format of these AVPs is not known at the time of definition of the Example-AVP group nor (likely) at the time when the example instance of this AVP is interpreted -- except by Diameter implementations that support the same set of AVPs. The encoding example illustrates how padding is used and how length fields are calculated. Also, note that AVPs may be present in the Grouped AVP value that the receiver cannot interpret (here, the Recover-Policy and Futuristic-Acct-Record AVPs). The length of the Example-AVP is the sum of all the length of the member AVPs, including their padding, plus the Example-AVP header size.

可选AVP的数据以十六进制形式表示,因为在定义示例AVP组时,这些AVP的格式未知,在解释该AVP的示例实例时(可能)也未知——支持同一组AVP的Diameter实现除外。编码示例说明了如何使用填充以及如何计算长度字段。另外,请注意,AVP可能存在于接收方无法解释的分组AVP值中(此处为恢复策略和未来的Acct记录AVP)。示例AVP的长度是成员AVP的所有长度(包括其填充)加上示例AVP头大小的总和。

This AVP would be encoded as follows:

该AVP编码如下:

         0       1       2       3       4       5       6       7
      +-------+-------+-------+-------+-------+-------+-------+-------+
   0  |     Example AVP Header (AVP Code = 999999), Length = 496      |
      +-------+-------+-------+-------+-------+-------+-------+-------+
   8  |     Origin-Host AVP Header (AVP Code = 264), Length = 19      |
      +-------+-------+-------+-------+-------+-------+-------+-------+
   16 |  'e'  |  'x'  |  'a'  |  'm'  |  'p'  |  'l'  |  'e'  |  '.'  |
      +-------+-------+-------+-------+-------+-------+-------+-------+
   24 |  'c'  |  'o'  |  'm'  |Padding|     Session-Id AVP Header     |
      +-------+-------+-------+-------+-------+-------+-------+-------+
   32 | (AVP Code = 263), Length = 49 |  'g'  |  'r'  |  'u'  |  'm'  |
      +-------+-------+-------+-------+-------+-------+-------+-------+
                                    . . .
      +-------+-------+-------+-------+-------+-------+-------+-------+
   72 |  'F'  |  '3'  |  'B'  |  '8'  |  '1'  |Padding|Padding|Padding|
      +-------+-------+-------+-------+-------+-------+-------+-------+
   80 |     Session-Id AVP Header (AVP Code = 263), Length = 50       |
      +-------+-------+-------+-------+-------+-------+-------+-------+
   88 |  'g'  |  'r'  |  'u'  |  'm'  |  'p'  |  '.'  |  'e'  |  'x'  |
      +-------+-------+-------+-------+-------+-------+-------+-------+
                                   . . .
      +-------+-------+-------+-------+-------+-------+-------+-------+
   120|  '5'  |  '8'  |  ';'  |  '0'  |  'A'  |  'F'  |  '3'  |  'B'  |
      +-------+-------+-------+-------+-------+-------+-------+-------+
   128|  '8'  |  '2'  |Padding|Padding|  Recovery-Policy Header (AVP  |
      +-------+-------+-------+-------+-------+-------+-------+-------+
   136|  Code = 8341), Length = 223   | 0x21  | 0x63  | 0xbc  | 0x1d  |
      +-------+-------+-------+-------+-------+-------+-------+-------+
   144|  0x0a | 0xd8  | 0x23  | 0x71  | 0xf6  | 0xbc  | 0x09  | 0x48  |
      +-------+-------+-------+-------+-------+-------+-------+-------+
                                    . . .
      +-------+-------+-------+-------+-------+-------+-------+-------+
   352|  0x8c | 0x7f  | 0x92  |Padding| Futuristic-Acct-Record Header |
      +-------+-------+-------+-------+-------+-------+-------+-------+
   328|(AVP Code = 15930),Length = 137| 0xfe  | 0x19  | 0xda  | 0x58  |
      +-------+-------+-------+-------+-------+-------+-------+-------+
   336|  0x02 | 0xac  | 0xd9  | 0x8b  | 0x07  | 0xa5  | 0xb8  | 0xc6  |
      +-------+-------+-------+-------+-------+-------+-------+-------+
                                    . . .
      +-------+-------+-------+-------+-------+-------+-------+-------+
   488|  0xe4 | 0x99  | 0x68  | 0xf8  | 0x41  |Padding|Padding|Padding|
      +-------+-------+-------+-------+-------+-------+-------+-------+
        
         0       1       2       3       4       5       6       7
      +-------+-------+-------+-------+-------+-------+-------+-------+
   0  |     Example AVP Header (AVP Code = 999999), Length = 496      |
      +-------+-------+-------+-------+-------+-------+-------+-------+
   8  |     Origin-Host AVP Header (AVP Code = 264), Length = 19      |
      +-------+-------+-------+-------+-------+-------+-------+-------+
   16 |  'e'  |  'x'  |  'a'  |  'm'  |  'p'  |  'l'  |  'e'  |  '.'  |
      +-------+-------+-------+-------+-------+-------+-------+-------+
   24 |  'c'  |  'o'  |  'm'  |Padding|     Session-Id AVP Header     |
      +-------+-------+-------+-------+-------+-------+-------+-------+
   32 | (AVP Code = 263), Length = 49 |  'g'  |  'r'  |  'u'  |  'm'  |
      +-------+-------+-------+-------+-------+-------+-------+-------+
                                    . . .
      +-------+-------+-------+-------+-------+-------+-------+-------+
   72 |  'F'  |  '3'  |  'B'  |  '8'  |  '1'  |Padding|Padding|Padding|
      +-------+-------+-------+-------+-------+-------+-------+-------+
   80 |     Session-Id AVP Header (AVP Code = 263), Length = 50       |
      +-------+-------+-------+-------+-------+-------+-------+-------+
   88 |  'g'  |  'r'  |  'u'  |  'm'  |  'p'  |  '.'  |  'e'  |  'x'  |
      +-------+-------+-------+-------+-------+-------+-------+-------+
                                   . . .
      +-------+-------+-------+-------+-------+-------+-------+-------+
   120|  '5'  |  '8'  |  ';'  |  '0'  |  'A'  |  'F'  |  '3'  |  'B'  |
      +-------+-------+-------+-------+-------+-------+-------+-------+
   128|  '8'  |  '2'  |Padding|Padding|  Recovery-Policy Header (AVP  |
      +-------+-------+-------+-------+-------+-------+-------+-------+
   136|  Code = 8341), Length = 223   | 0x21  | 0x63  | 0xbc  | 0x1d  |
      +-------+-------+-------+-------+-------+-------+-------+-------+
   144|  0x0a | 0xd8  | 0x23  | 0x71  | 0xf6  | 0xbc  | 0x09  | 0x48  |
      +-------+-------+-------+-------+-------+-------+-------+-------+
                                    . . .
      +-------+-------+-------+-------+-------+-------+-------+-------+
   352|  0x8c | 0x7f  | 0x92  |Padding| Futuristic-Acct-Record Header |
      +-------+-------+-------+-------+-------+-------+-------+-------+
   328|(AVP Code = 15930),Length = 137| 0xfe  | 0x19  | 0xda  | 0x58  |
      +-------+-------+-------+-------+-------+-------+-------+-------+
   336|  0x02 | 0xac  | 0xd9  | 0x8b  | 0x07  | 0xa5  | 0xb8  | 0xc6  |
      +-------+-------+-------+-------+-------+-------+-------+-------+
                                    . . .
      +-------+-------+-------+-------+-------+-------+-------+-------+
   488|  0xe4 | 0x99  | 0x68  | 0xf8  | 0x41  |Padding|Padding|Padding|
      +-------+-------+-------+-------+-------+-------+-------+-------+
        
4.5. Diameter Base Protocol AVPs
4.5. Diameter基本协议AVPs

The following table describes the Diameter AVPs defined in the base protocol, their AVP Code values, types, and possible flag values.

下表描述了基本协议中定义的Diameter AVP、其AVP代码值、类型和可能的标志值。

Due to space constraints, the short form DiamIdent is used to represent DiameterIdentity.

由于空间限制,使用缩写形式的二元齿来表示直径。

                                            +----------+
                                            | AVP Flag |
                                            |  rules   |
                                            |----+-----|
                   AVP  Section             |    |MUST |
   Attribute Name  Code Defined  Data Type  |MUST| NOT |
   -----------------------------------------|----+-----|
   Acct-             85  9.8.2   Unsigned32 | M  |  V  |
     Interim-Interval                       |    |     |
   Accounting-      483  9.8.7   Enumerated | M  |  V  |
     Realtime-Required                      |    |     |
   Acct-            50   9.8.5   UTF8String | M  |  V  |
     Multi-Session-Id                       |    |     |
   Accounting-      485  9.8.3   Unsigned32 | M  |  V  |
     Record-Number                          |    |     |
   Accounting-      480  9.8.1   Enumerated | M  |  V  |
     Record-Type                            |    |     |
   Acct-             44  9.8.4   OctetString| M  |  V  |
    Session-Id                              |    |     |
   Accounting-      287  9.8.6   Unsigned64 | M  |  V  |
     Sub-Session-Id                         |    |     |
   Acct-            259  6.9     Unsigned32 | M  |  V  |
     Application-Id                         |    |     |
   Auth-            258  6.8     Unsigned32 | M  |  V  |
     Application-Id                         |    |     |
   Auth-Request-    274  8.7     Enumerated | M  |  V  |
      Type                                  |    |     |
   Authorization-   291  8.9     Unsigned32 | M  |  V  |
     Lifetime                               |    |     |
   Auth-Grace-      276  8.10    Unsigned32 | M  |  V  |
     Period                                 |    |     |
   Auth-Session-    277  8.11    Enumerated | M  |  V  |
     State                                  |    |     |
   Re-Auth-Request- 285  8.12    Enumerated | M  |  V  |
     Type                                   |    |     |
   Class             25  8.20    OctetString| M  |  V  |
   Destination-Host 293  6.5     DiamIdent  | M  |  V  |
   Destination-     283  6.6     DiamIdent  | M  |  V  |
     Realm                                  |    |     |
   Disconnect-Cause 273  5.4.3   Enumerated | M  |  V  |
   Error-Message    281  7.3     UTF8String |    | V,M |
   Error-Reporting- 294  7.4     DiamIdent  |    | V,M |
     Host                                   |    |     |
   Event-Timestamp   55  8.21    Time       | M  |  V  |
   Experimental-    297  7.6     Grouped    | M  |  V  |
      Result                                |    |     |
   -----------------------------------------|----+-----|
        
                                            +----------+
                                            | AVP Flag |
                                            |  rules   |
                                            |----+-----|
                   AVP  Section             |    |MUST |
   Attribute Name  Code Defined  Data Type  |MUST| NOT |
   -----------------------------------------|----+-----|
   Acct-             85  9.8.2   Unsigned32 | M  |  V  |
     Interim-Interval                       |    |     |
   Accounting-      483  9.8.7   Enumerated | M  |  V  |
     Realtime-Required                      |    |     |
   Acct-            50   9.8.5   UTF8String | M  |  V  |
     Multi-Session-Id                       |    |     |
   Accounting-      485  9.8.3   Unsigned32 | M  |  V  |
     Record-Number                          |    |     |
   Accounting-      480  9.8.1   Enumerated | M  |  V  |
     Record-Type                            |    |     |
   Acct-             44  9.8.4   OctetString| M  |  V  |
    Session-Id                              |    |     |
   Accounting-      287  9.8.6   Unsigned64 | M  |  V  |
     Sub-Session-Id                         |    |     |
   Acct-            259  6.9     Unsigned32 | M  |  V  |
     Application-Id                         |    |     |
   Auth-            258  6.8     Unsigned32 | M  |  V  |
     Application-Id                         |    |     |
   Auth-Request-    274  8.7     Enumerated | M  |  V  |
      Type                                  |    |     |
   Authorization-   291  8.9     Unsigned32 | M  |  V  |
     Lifetime                               |    |     |
   Auth-Grace-      276  8.10    Unsigned32 | M  |  V  |
     Period                                 |    |     |
   Auth-Session-    277  8.11    Enumerated | M  |  V  |
     State                                  |    |     |
   Re-Auth-Request- 285  8.12    Enumerated | M  |  V  |
     Type                                   |    |     |
   Class             25  8.20    OctetString| M  |  V  |
   Destination-Host 293  6.5     DiamIdent  | M  |  V  |
   Destination-     283  6.6     DiamIdent  | M  |  V  |
     Realm                                  |    |     |
   Disconnect-Cause 273  5.4.3   Enumerated | M  |  V  |
   Error-Message    281  7.3     UTF8String |    | V,M |
   Error-Reporting- 294  7.4     DiamIdent  |    | V,M |
     Host                                   |    |     |
   Event-Timestamp   55  8.21    Time       | M  |  V  |
   Experimental-    297  7.6     Grouped    | M  |  V  |
      Result                                |    |     |
   -----------------------------------------|----+-----|
        
                                            +----------+
                                            | AVP Flag |
                                            |  rules   |
                                            |----+-----|
                   AVP  Section             |    |MUST |
   Attribute Name  Code Defined  Data Type  |MUST| NOT |
   -----------------------------------------|----+-----|
   Experimental-    298  7.7     Unsigned32 | M  |  V  |
      Result-Code                           |    |     |
   Failed-AVP       279  7.5     Grouped    | M  |  V  |
   Firmware-        267  5.3.4   Unsigned32 |    | V,M |
     Revision                               |    |     |
   Host-IP-Address  257  5.3.5   Address    | M  |  V  |
   Inband-Security                          | M  |  V  |
      -Id           299  6.10    Unsigned32 |    |     |
   Multi-Round-     272  8.19    Unsigned32 | M  |  V  |
     Time-Out                               |    |     |
   Origin-Host      264  6.3     DiamIdent  | M  |  V  |
   Origin-Realm     296  6.4     DiamIdent  | M  |  V  |
   Origin-State-Id  278  8.16    Unsigned32 | M  |  V  |
   Product-Name     269  5.3.7   UTF8String |    | V,M |
   Proxy-Host       280  6.7.3   DiamIdent  | M  |  V  |
   Proxy-Info       284  6.7.2   Grouped    | M  |  V  |
   Proxy-State       33  6.7.4   OctetString| M  |  V  |
   Redirect-Host    292  6.12    DiamURI    | M  |  V  |
   Redirect-Host-   261  6.13    Enumerated | M  |  V  |
      Usage                                 |    |     |
   Redirect-Max-    262  6.14    Unsigned32 | M  |  V  |
      Cache-Time                            |    |     |
   Result-Code      268  7.1     Unsigned32 | M  |  V  |
   Route-Record     282  6.7.1   DiamIdent  | M  |  V  |
   Session-Id       263  8.8     UTF8String | M  |  V  |
   Session-Timeout   27  8.13    Unsigned32 | M  |  V  |
   Session-Binding  270  8.17    Unsigned32 | M  |  V  |
   Session-Server-  271  8.18    Enumerated | M  |  V  |
     Failover                               |    |     |
   Supported-       265  5.3.6   Unsigned32 | M  |  V  |
     Vendor-Id                              |    |     |
   Termination-     295  8.15    Enumerated | M  |  V  |
      Cause                                 |    |     |
   User-Name          1  8.14    UTF8String | M  |  V  |
   Vendor-Id        266  5.3.3   Unsigned32 | M  |  V  |
   Vendor-Specific- 260  6.11    Grouped    | M  |  V  |
      Application-Id                        |    |     |
   -----------------------------------------|----+-----|
        
                                            +----------+
                                            | AVP Flag |
                                            |  rules   |
                                            |----+-----|
                   AVP  Section             |    |MUST |
   Attribute Name  Code Defined  Data Type  |MUST| NOT |
   -----------------------------------------|----+-----|
   Experimental-    298  7.7     Unsigned32 | M  |  V  |
      Result-Code                           |    |     |
   Failed-AVP       279  7.5     Grouped    | M  |  V  |
   Firmware-        267  5.3.4   Unsigned32 |    | V,M |
     Revision                               |    |     |
   Host-IP-Address  257  5.3.5   Address    | M  |  V  |
   Inband-Security                          | M  |  V  |
      -Id           299  6.10    Unsigned32 |    |     |
   Multi-Round-     272  8.19    Unsigned32 | M  |  V  |
     Time-Out                               |    |     |
   Origin-Host      264  6.3     DiamIdent  | M  |  V  |
   Origin-Realm     296  6.4     DiamIdent  | M  |  V  |
   Origin-State-Id  278  8.16    Unsigned32 | M  |  V  |
   Product-Name     269  5.3.7   UTF8String |    | V,M |
   Proxy-Host       280  6.7.3   DiamIdent  | M  |  V  |
   Proxy-Info       284  6.7.2   Grouped    | M  |  V  |
   Proxy-State       33  6.7.4   OctetString| M  |  V  |
   Redirect-Host    292  6.12    DiamURI    | M  |  V  |
   Redirect-Host-   261  6.13    Enumerated | M  |  V  |
      Usage                                 |    |     |
   Redirect-Max-    262  6.14    Unsigned32 | M  |  V  |
      Cache-Time                            |    |     |
   Result-Code      268  7.1     Unsigned32 | M  |  V  |
   Route-Record     282  6.7.1   DiamIdent  | M  |  V  |
   Session-Id       263  8.8     UTF8String | M  |  V  |
   Session-Timeout   27  8.13    Unsigned32 | M  |  V  |
   Session-Binding  270  8.17    Unsigned32 | M  |  V  |
   Session-Server-  271  8.18    Enumerated | M  |  V  |
     Failover                               |    |     |
   Supported-       265  5.3.6   Unsigned32 | M  |  V  |
     Vendor-Id                              |    |     |
   Termination-     295  8.15    Enumerated | M  |  V  |
      Cause                                 |    |     |
   User-Name          1  8.14    UTF8String | M  |  V  |
   Vendor-Id        266  5.3.3   Unsigned32 | M  |  V  |
   Vendor-Specific- 260  6.11    Grouped    | M  |  V  |
      Application-Id                        |    |     |
   -----------------------------------------|----+-----|
        
5. Diameter Peers
5. 直径对等体

This section describes how Diameter nodes establish connections and communicate with peers.

本节介绍Diameter节点如何建立连接并与对等节点通信。

5.1. Peer Connections
5.1. 对等连接

Connections between diameter peers are established using their valid DiameterIdentity. A Diameter node initiating a connection to a peer MUST know the peer's DiameterIdentity. Methods for discovering a Diameter peer can be found in Section 5.2.

直径对等点之间的连接使用其有效直径建立。发起到对等方连接的直径节点必须知道对等方的直径。发现直径对等点的方法见第5.2节。

Although a Diameter node may have many possible peers with which it is able to communicate, it may not be economical to have an established connection to all of them. At a minimum, a Diameter node SHOULD have an established connection with two peers per realm, known as the primary and secondary peers. Of course, a node MAY have additional connections, if it is deemed necessary. Typically, all messages for a realm are sent to the primary peer but, in the event that failover procedures are invoked, any pending requests are sent to the secondary peer. However, implementations are free to load balance requests between a set of peers.

尽管Diameter节点可能有许多可能的对等节点,可以与之通信,但建立与所有对等节点的连接可能并不经济。至少,Diameter节点应该与每个领域的两个对等点建立连接,称为主对等点和辅助对等点。当然,如果认为有必要,节点可以有额外的连接。通常,域的所有消息都会发送到主对等方,但在调用故障转移过程的情况下,任何挂起的请求都会发送到辅助对等方。但是,实现可以在一组对等方之间自由地负载平衡请求。

Note that a given peer MAY act as a primary for a given realm while acting as a secondary for another realm.

请注意,给定的对等方可以作为给定领域的主服务器,而作为另一领域的辅助服务器。

When a peer is deemed suspect, which could occur for various reasons, including not receiving a DWA within an allotted time frame, no new requests should be forwarded to the peer, but failover procedures are invoked. When an active peer is moved to this mode, additional connections SHOULD be established to ensure that the necessary number of active connections exists.

当一个对等方被视为可疑时,可能由于各种原因(包括在分配的时间范围内未接收到DWA),不应将新请求转发给该对等方,但会调用故障转移过程。当活动对等方移动到此模式时,应建立额外的连接,以确保存在必要数量的活动连接。

There are two ways that a peer is removed from the suspect peer list:

有两种方法可以从可疑对等方列表中删除对等方:

1. The peer is no longer reachable, causing the transport connection to be shut down. The peer is moved to the closed state.

1. 对等方不再可访问,导致传输连接关闭。对等方被移动到关闭状态。

2. Three watchdog messages are exchanged with accepted round-trip times, and the connection to the peer is considered stabilized.

2. 三条看门狗消息以可接受的往返时间交换,与对等方的连接被认为是稳定的。

In the event the peer being removed is either the primary or secondary, an alternate peer SHOULD replace the deleted peer and assume the role of either primary or secondary.

如果要删除的对等方是主对等方或次对等方,则应使用备用对等方替换已删除的对等方,并担任主对等方或次对等方的角色。

5.2. Diameter Peer Discovery
5.2. 直径对等发现

Allowing for dynamic Diameter agent discovery makes possible simpler and more robust deployment of Diameter services. In order to promote interoperable implementations of Diameter peer discovery, the following mechanisms (manual configuration and DNS) are described. These are based on existing IETF standards. Both mechanisms MUST be supported by all Diameter implementations; either MAY be used.

允许动态Diameter代理发现使得Diameter服务的部署更简单、更健壮。为了促进Diameter对等发现的互操作实现,描述了以下机制(手动配置和DNS)。这些标准基于现有的IETF标准。所有Diameter实现都必须支持这两种机制;两者都可以使用。

There are two cases where Diameter peer discovery may be performed. The first is when a Diameter client needs to discover a first-hop Diameter agent. The second case is when a Diameter agent needs to discover another agent for further handling of a Diameter operation. In both cases, the following 'search order' is recommended:

有两种情况可以执行Diameter对等发现。第一个是Diameter客户端需要发现第一跳Diameter代理时。第二种情况是,Diameter代理需要发现另一个代理以进一步处理Diameter操作。在这两种情况下,建议采用以下“搜索顺序”:

1. The Diameter implementation consults its list of statically (manually) configured Diameter agent locations. These will be used if they exist and respond.

1. Diameter实现参考其静态(手动)配置的Diameter代理位置列表。如果它们存在并响应,将使用它们。

2. The Diameter implementation performs a NAPTR query for a server in a particular realm. The Diameter implementation has to know, in advance, in which realm to look for a Diameter agent. This could be deduced, for example, from the 'realm' in an NAI on which a Diameter implementation needed to perform a Diameter operation.

2. Diameter实现为特定领域中的服务器执行NAPTR查询。Diameter实现必须事先知道在哪个领域中查找Diameter代理。例如,可以从NAI中的“领域”推断出这一点,DIAMER实现需要在该领域上执行DIAMER操作。

The NAPTR usage in Diameter follows the S-NAPTR DDDS application [RFC3958] in which the SERVICE field includes tags for the desired application and supported application protocol. The application service tag for a Diameter application is 'aaa' and the supported application protocol tags are 'diameter.tcp', 'diameter.sctp', 'diameter.dtls', or 'diameter.tls.tcp' [RFC6408].

NAPTR直径的使用遵循S-NAPTR DDDS应用程序[RFC3958],其中服务字段包括所需应用程序和支持的应用程序协议的标签。Diameter应用程序的应用程序服务标记为“aaa”,支持的应用程序协议标记为“Diameter.tcp”、“Diameter.sctp”、“Diameter.dtls”或“Diameter.tls.tcp”[RFC6408]。

The client can follow the resolution process defined by the S-NAPTR DDDS [RFC3958] application to find a matching SRV, A, or AAAA record of a suitable peer. The domain suffixes in the NAPTR replacement field SHOULD match the domain of the original query. An example can be found in Appendix B.

客户机可以遵循S-NAPTR DDDS[RFC3958]应用程序定义的解析过程,找到合适对等机的匹配SRV、a或AAAA记录。NAPTR替换字段中的域后缀应与原始查询的域匹配。附录B中给出了一个示例。

3. If no NAPTR records are found, the requester directly queries for one of the following SRV records: for Diameter over TCP, use "_diameter._tcp.realm"; for Diameter over TLS, use "_diameters._tcp.realm"; for Diameter over SCTP, use "_diameter._sctp.realm"; for Diameter over DTLS, use "_diameters._sctp.realm". If SRV records are found, then the requester can perform address record query (A RR's and/or AAAA

3. 如果没有找到NAPTR记录,请求者直接查询以下SRV记录之一:对于TCP上的直径,使用“\u Diameter.\u TCP.realm”;对于TLS上的直径,使用“_diameters._tcp.realm”;对于超过SCTP的直径,使用“\u Diameter.\u SCTP.realm”;对于DTL上的直径,请使用“_diameters._sctp.realm”。如果找到SRV记录,则请求者可以执行地址记录查询(RR和/或AAAA)

RR's) for the target hostname specified in the SRV records following the rules given in [RFC2782]. If no SRV records are found, the requester gives up.

根据[RFC2782]中给出的规则,为SRV记录中指定的目标主机名设置RR。如果没有找到SRV记录,请求者将放弃。

If the server is using a site certificate, the domain name in the NAPTR query and the domain name in the replacement field MUST both be valid based on the site certificate handed out by the server in the TLS/TCP and DTLS/SCTP or Internet Key Exchange Protocol (IKE) exchange. Similarly, the domain name in the SRV query and the domain name in the target in the SRV record MUST both be valid based on the same site certificate. Otherwise, an attacker could modify the DNS records to contain replacement values in a different domain, and the client could not validate whether this was the desired behavior or the result of an attack.

如果服务器正在使用站点证书,则根据服务器在TLS/TCP和DTLS/SCTP或Internet密钥交换协议(IKE)交换中分发的站点证书,NAPTR查询中的域名和替换字段中的域名都必须有效。同样,基于相同的站点证书,SRV查询中的域名和SRV记录中目标中的域名必须都有效。否则,攻击者可以修改DNS记录以在不同域中包含替换值,客户端无法验证这是所需行为还是攻击的结果。

Also, the Diameter peer MUST check to make sure that the discovered peers are authorized to act in its role. Authentication via IKE or TLS/TCP and DTLS/SCTP, or validation of DNS RRs via DNSSEC is not sufficient to conclude this. For example, a web server may have obtained a valid TLS/TCP and DTLS/SCTP certificate, and secured RRs may be included in the DNS, but this does not imply that it is authorized to act as a Diameter server.

此外,Diameter对等机必须进行检查,以确保发现的对等机被授权执行其角色。通过IKE或TLS/TCP和DTLS/SCTP进行身份验证,或通过DNSSEC验证DNS RRs不足以得出结论。例如,web服务器可能已获得有效的TLS/TCP和DTLS/SCTP证书,并且DNS中可能包含安全RRs,但这并不意味着它被授权作为Diameter服务器。

Authorization can be achieved, for example, by the configuration of a Diameter server Certification Authority (CA). The server CA issues a certificate to the Diameter server, which includes an Object Identifier (OID) to indicate the subject is a Diameter server in the Extended Key Usage extension [RFC5280]. This certificate is then used during TLS/TCP, DTLS/SCTP, or IKE security negotiation. However, note that, at the time of writing, no Diameter server Certification Authorities exist.

例如,可以通过配置Diameter服务器证书颁发机构(CA)来实现授权。服务器CA向Diameter服务器颁发证书,该证书包括一个对象标识符(OID),用于指示主体是扩展密钥使用扩展[RFC5280]中的Diameter服务器。然后在TLS/TCP、DTLS/SCTP或IKE安全协商期间使用此证书。但是,请注意,在撰写本文时,不存在Diameter服务器认证机构。

A dynamically discovered peer causes an entry in the peer table (see Section 2.6) to be created. Note that entries created via DNS MUST expire (or be refreshed) within the DNS Time to Live (TTL). If a peer is discovered outside of the local realm, a routing table entry (see Section 2.7) for the peer's realm is created. The routing table entry's expiration MUST match the peer's expiration value.

动态发现的对等体导致在对等体表中创建一个条目(参见第2.6节)。请注意,通过DNS创建的条目必须在DNS生存时间(TTL)内过期(或刷新)。如果在本地域之外发现对等方,则会为对等方的域创建一个路由表条目(参见第2.7节)。路由表项的过期必须与对等方的过期值匹配。

5.3. Capabilities Exchange
5.3. 能力交换

When two Diameter peers establish a transport connection, they MUST exchange the Capabilities Exchange messages, as specified in the peer state machine (see Section 5.6). This message allows the discovery of a peer's identity and its capabilities (protocol version number, the identifiers of supported Diameter applications, security mechanisms, etc.).

当两个Diameter对等体建立传输连接时,它们必须按照对等体状态机中的规定交换功能交换消息(参见第5.6节)。此消息允许发现对等方的身份及其功能(协议版本号、支持的Diameter应用程序的标识符、安全机制等)。

The receiver only issues commands to its peers that have advertised support for the Diameter application that defines the command. A Diameter node MUST cache the supported Application Ids in order to ensure that unrecognized commands and/or AVPs are not unnecessarily sent to a peer.

接收器仅向已公布支持定义该命令的Diameter应用程序的对等方发出命令。Diameter节点必须缓存支持的应用程序ID,以确保不会不必要地将无法识别的命令和/或AVP发送到对等方。

A receiver of a Capabilities-Exchange-Request (CER) message that does not have any applications in common with the sender MUST return a Capabilities-Exchange-Answer (CEA) with the Result-Code AVP set to DIAMETER_NO_COMMON_APPLICATION and SHOULD disconnect the transport layer connection. Note that receiving a CER or CEA from a peer advertising itself as a relay (see Section 2.4) MUST be interpreted as having common applications with the peer.

功能交换请求(CER)消息的接收者如果与发送者没有任何共同的应用程序,则必须返回一个功能交换应答(CEA),结果代码AVP设置为DIAMETER\u NO\u common\u APPLICATION,并应断开传输层连接。请注意,从对等方接收CER或CEA广告本身作为中继(见第2.4节)必须解释为与对等方有共同的应用。

The receiver of the Capabilities-Exchange-Request (CER) MUST determine common applications by computing the intersection of its own set of supported Application Ids against all of the Application-Id 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.

能力交换请求(CER)的接收者必须通过计算其自己的一组受支持的应用程序Id与CER中存在的所有应用程序Id AVP(身份验证应用程序Id、账户应用程序Id和供应商特定应用程序Id)的交集来确定公共应用程序。在计算过程中,不得使用供应商特定应用程序Id中的供应商Id AVP值。功能交换应答(CEA)的发送方应包括其所有受支持的应用程序,作为对接收方关于其所有应用程序功能的提示。

Diameter implementations SHOULD first attempt to establish a TLS/TCP and DTLS/SCTP connection prior to the CER/CEA exchange. This protects the capabilities information of both peers. To support older Diameter implementations that do not fully conform to this document, the transport security MAY still be negotiated via an Inband-Security AVP. In this case, the receiver of a Capabilities-Exchange-Request (CER) message that does not have any security mechanisms in common with the sender MUST return a Capabilities-Exchange-Answer (CEA) with the Result-Code AVP set to DIAMETER_NO_COMMON_SECURITY and SHOULD disconnect the transport layer connection.

Diameter实施应首先尝试在CER/CEA交换之前建立TLS/TCP和DTLS/SCTP连接。这将保护两个对等方的功能信息。为支持不完全符合本文件要求的较旧Diameter实施,仍可通过带内安全AVP协商传输安全。在这种情况下,与发送方没有任何共同安全机制的能力交换请求(CER)消息的接收方必须返回一个能力交换应答(CEA),结果代码AVP设置为DIAMETER_NO_common_security,并应断开传输层连接。

CERs received from unknown peers MAY be silently discarded, or a CEA MAY be issued with the Result-Code AVP set to DIAMETER_UNKNOWN_PEER. In both cases, the transport connection is closed. If the local policy permits receiving CERs from unknown hosts, a successful CEA MAY be returned. If a CER from an unknown peer is answered with a successful CEA, the lifetime of the peer entry is equal to the lifetime of the transport connection. In case of a transport failure, all the pending transactions destined to the unknown peer can be discarded.

从未知对等方接收的CER可能会被默默地丢弃,或者CEA可能会被发出,结果代码AVP设置为DIAMETER_unknown_PEER。在这两种情况下,传输连接都是关闭的。如果本地策略允许从未知主机接收CER,则可能返回成功的CEA。如果来自未知对等方的CER得到了成功CEA的应答,则对等方条目的生存期等于传输连接的生存期。在传输失败的情况下,可以丢弃所有发送到未知对等方的挂起事务。

The CER and CEA messages MUST NOT be proxied, redirected, or relayed.

CER和CEA消息不得被代理、重定向或中继。

Since the CER/CEA messages cannot be proxied, it is still possible that an upstream agent will receive a message for which it has no available peers to handle the application that corresponds to the Command Code. In such instances, the 'E' bit is set in the answer message (Section 7) with the Result-Code AVP set to DIAMETER_UNABLE_TO_DELIVER to inform the downstream agent to take action (e.g., re-routing request to an alternate peer).

由于CER/CEA消息无法代理,因此上游代理仍有可能接收到一条消息,该消息没有可用的对等方来处理与命令代码对应的应用程序。在这种情况下,“E”位在应答消息(第7节)中设置,结果代码AVP设置为DIAMETER_UNABLE_to_DELIVER,以通知下游代理采取行动(例如,将请求重新路由到备用对等方)。

With the exception of the Capabilities-Exchange-Request message, a message of type Request that includes the Auth-Application-Id or Acct-Application-Id AVPs, or a message with an application-specific Command Code MAY only be forwarded to a host that has explicitly advertised support for the application (or has advertised the Relay Application Id).

除功能交换请求消息外,包含身份验证应用程序Id或Acct应用程序Id AVPs的请求类型的消息,或具有特定于应用程序的命令代码的消息,只能转发到已明确公布对应用程序的支持(或已公布中继应用程序Id)的主机。

5.3.1. Capabilities-Exchange-Request
5.3.1. 能力交换请求

The Capabilities-Exchange-Request (CER), indicated by the Command Code set to 257 and the Command Flags' 'R' bit set, is sent to exchange local capabilities. Upon detection of a transport failure, this message MUST NOT be sent to an alternate peer.

由设置为257的命令代码和设置的命令标志“R”位指示的功能交换请求(CER)被发送到Exchange本地功能。在检测到传输故障时,不得将此消息发送给备用对等方。

When Diameter is run over SCTP [RFC4960] or DTLS/SCTP [RFC6083], which allow for connections to span multiple interfaces and multiple IP addresses, the Capabilities-Exchange-Request message MUST contain one Host-IP-Address AVP for each potential IP address that MAY be locally used when transmitting Diameter messages.

当Diameter通过SCTP[RFC4960]或DTLS/SCTP[RFC6083]运行时,允许连接跨越多个接口和多个IP地址,则功能交换请求消息必须包含一个主机IP地址AVP,用于传输Diameter消息时可能在本地使用的每个潜在IP地址。

Message Format

消息格式

         <CER> ::= < Diameter Header: 257, REQ >
                   { Origin-Host }
                   { Origin-Realm }
                1* { Host-IP-Address }
                   { Vendor-Id }
                   { Product-Name }
                   [ Origin-State-Id ]
                 * [ Supported-Vendor-Id ]
                 * [ Auth-Application-Id ]
                 * [ Inband-Security-Id ]
                 * [ Acct-Application-Id ]
                 * [ Vendor-Specific-Application-Id ]
                   [ Firmware-Revision ]
                 * [ AVP ]
        
         <CER> ::= < Diameter Header: 257, REQ >
                   { Origin-Host }
                   { Origin-Realm }
                1* { Host-IP-Address }
                   { Vendor-Id }
                   { Product-Name }
                   [ Origin-State-Id ]
                 * [ Supported-Vendor-Id ]
                 * [ Auth-Application-Id ]
                 * [ Inband-Security-Id ]
                 * [ Acct-Application-Id ]
                 * [ Vendor-Specific-Application-Id ]
                   [ Firmware-Revision ]
                 * [ AVP ]
        
5.3.2. Capabilities-Exchange-Answer
5.3.2. 能力交换答案

The Capabilities-Exchange-Answer (CEA), indicated by the Command Code set to 257 and the Command Flags' 'R' bit cleared, is sent in response to a CER message.

发送功能交换应答(CEA)以响应CER消息,该应答由设置为257的命令代码和清除的命令标志“R”位表示。

When Diameter is run over SCTP [RFC4960] or DTLS/SCTP [RFC6083], which allow connections to span multiple interfaces, hence, multiple IP addresses, the Capabilities-Exchange-Answer message MUST contain one Host-IP-Address AVP for each potential IP address that MAY be locally used when transmitting Diameter messages.

当Diameter在SCTP[RFC4960]或DTLS/SCTP[RFC6083]上运行时,允许连接跨越多个接口,因此,多个IP地址,对于传输Diameter消息时可能在本地使用的每个潜在IP地址,功能交换应答消息必须包含一个主机IP地址AVP。

Message Format

消息格式

         <CEA> ::= < Diameter Header: 257 >
                   { Result-Code }
                   { Origin-Host }
                   { Origin-Realm }
                1* { Host-IP-Address }
                   { Vendor-Id }
                   { Product-Name }
                   [ Origin-State-Id ]
                   [ Error-Message ]
                   [ Failed-AVP ]
                 * [ Supported-Vendor-Id ]
                 * [ Auth-Application-Id ]
                 * [ Inband-Security-Id ]
                 * [ Acct-Application-Id ]
                 * [ Vendor-Specific-Application-Id ]
                   [ Firmware-Revision ]
                 * [ AVP ]
        
         <CEA> ::= < Diameter Header: 257 >
                   { Result-Code }
                   { Origin-Host }
                   { Origin-Realm }
                1* { Host-IP-Address }
                   { Vendor-Id }
                   { Product-Name }
                   [ Origin-State-Id ]
                   [ Error-Message ]
                   [ Failed-AVP ]
                 * [ Supported-Vendor-Id ]
                 * [ Auth-Application-Id ]
                 * [ Inband-Security-Id ]
                 * [ Acct-Application-Id ]
                 * [ Vendor-Specific-Application-Id ]
                   [ Firmware-Revision ]
                 * [ AVP ]
        
5.3.3. Vendor-Id AVP
5.3.3. 供应商Id AVP

The Vendor-Id AVP (AVP Code 266) is of type Unsigned32 and contains the IANA "SMI Network Management Private Enterprise Codes" [ENTERPRISE] value assigned to the Diameter Software vendor. It is envisioned that the combination of the Vendor-Id, Product-Name (Section 5.3.7), and Firmware-Revision (Section 5.3.4) AVPs may provide useful debugging information.

供应商Id AVP(AVP代码266)的类型为Unsigned32,包含分配给Diameter软件供应商的IANA“SMI网络管理专用企业代码”[Enterprise]值。可以预见,供应商Id、产品名称(第5.3.7节)和固件版本(第5.3.4节)AVP的组合可以提供有用的调试信息。

A Vendor-Id value of zero in the CER or CEA message is reserved and indicates that this field is ignored.

CER或CEA消息中的供应商Id值为零,表示此字段被忽略。

5.3.4. Firmware-Revision AVP
5.3.4. 固件版本AVP

The Firmware-Revision AVP (AVP Code 267) is of type Unsigned32 and is used to inform a Diameter peer of the firmware revision of the issuing device.

固件版本AVP(AVP代码267)的类型为Unsigned32,用于向Diameter对等方通知发布设备的固件版本。

For devices that do not have a firmware revision (general-purpose computers running Diameter software modules, for instance), the revision of the Diameter software module may be reported instead.

对于没有固件版本的设备(例如,运行Diameter软件模块的通用计算机),可以报告Diameter软件模块的版本。

5.3.5. Host-IP-Address AVP
5.3.5. 主机IP地址

The Host-IP-Address AVP (AVP Code 257) is of type Address and is used to inform a Diameter peer of the sender's IP address. All source addresses that a Diameter node expects to use with SCTP [RFC4960] or DTLS/SCTP [RFC6083] MUST be advertised in the CER and CEA messages by including a Host-IP-Address AVP for each address.

主机IP地址AVP(AVP代码257)属于Address类型,用于通知Diameter对等方发送方的IP地址。Diameter节点希望与SCTP[RFC4960]或DTLS/SCTP[RFC6083]一起使用的所有源地址都必须在CER和CEA消息中公布,包括每个地址的主机IP地址AVP。

5.3.6. Supported-Vendor-Id AVP
5.3.6. 支持的供应商Id AVP

The Supported-Vendor-Id AVP (AVP Code 265) is of type Unsigned32 and contains the IANA "SMI Network Management Private Enterprise Codes" [ENTERPRISE] value assigned to a vendor other than the device vendor but including the application vendor. This is used in the CER and CEA messages in order to inform the peer that the sender supports (a subset of) the Vendor-Specific AVPs defined by the vendor identified in this AVP. The value of this AVP MUST NOT be set to zero. Multiple instances of this AVP containing the same value SHOULD NOT be sent.

支持的供应商Id AVP(AVP代码265)的类型为Unsigned32,包含IANA“SMI网络管理专用企业代码”[Enterprise]值,该值分配给设备供应商以外的供应商,但包括应用程序供应商。这在CER和CEA消息中使用,以便通知对等方发送方支持由该AVP中标识的供应商定义的供应商特定AVP(其子集)。此AVP的值不得设置为零。不应发送包含相同值的此AVP的多个实例。

5.3.7. Product-Name AVP
5.3.7. 产品名称AVP

The Product-Name AVP (AVP Code 269) is of type UTF8String and contains the vendor-assigned name for the product. The Product-Name AVP SHOULD remain constant across firmware revisions for the same product.

产品名称AVP(AVP代码269)为UTF8String类型,包含供应商为产品指定的名称。在同一产品的固件版本中,产品名称AVP应保持不变。

5.4. Disconnecting Peer Connections
5.4. 断开对等连接

When a Diameter node disconnects one of its transport connections, its peer cannot know the reason for the disconnect and will most likely assume that a connectivity problem occurred or that the peer has rebooted. In these cases, the peer may periodically attempt to reconnect, as stated in Section 2.1. In the event that the disconnect was a result of either a shortage of internal resources or simply that the node in question has no intentions of forwarding any Diameter messages to the peer in the foreseeable future, a periodic

当Diameter节点断开其一个传输连接时,其对等方无法知道断开的原因,并且极有可能假定发生了连接问题或对等方已重新启动。在这些情况下,对等方可能会定期尝试重新连接,如第2.1节所述。如果断开连接是由于内部资源不足或仅仅是相关节点在可预见的将来无意将任何Diameter消息转发给对等方造成的,则定期

connection request would not be welcomed. The Disconnection-Reason AVP contains the reason the Diameter node issued the Disconnect-Peer-Request message.

连接请求将不受欢迎。断开原因AVP包含Diameter节点发出断开对等请求消息的原因。

The Disconnect-Peer-Request message is used by a Diameter node to inform its peer of its intent to disconnect the transport layer and that the peer shouldn't reconnect unless it has a valid reason to do so (e.g., message to be forwarded). Upon receipt of the message, the Disconnect-Peer-Answer message is returned, which SHOULD contain an error if messages have recently been forwarded, and are likely in flight, which would otherwise cause a race condition.

Diameter节点使用Disconnect Peer Request(断开对等方请求)消息通知其对等方其断开传输层的意图,并且对等方不应重新连接,除非其具有这样做的有效理由(例如,要转发的消息)。收到消息后,将返回断开对等应答消息,如果消息最近已转发,则该消息应包含一个错误,并且很可能在飞行中,否则将导致竞争条件。

The receiver of the Disconnect-Peer-Answer message initiates the transport disconnect. The sender of the Disconnect-Peer-Answer message should be able to detect the transport closure and clean up the connection.

断开对等应答消息的接收器启动传输断开。断开对等应答消息的发送方应该能够检测到传输关闭并清理连接。

5.4.1. Disconnect-Peer-Request
5.4.1. 断开对等请求

The Disconnect-Peer-Request (DPR), indicated by the Command Code set to 282 and the Command Flags' 'R' bit set, is sent to a peer to inform it of its intentions to shut down the transport connection. Upon detection of a transport failure, this message MUST NOT be sent to an alternate peer.

断开对等请求(DPR)由设置为282的命令代码和设置的命令标志“R”位指示,发送给对等方,通知其关闭传输连接的意图。在检测到传输故障时,不得将此消息发送给备用对等方。

Message Format

消息格式

         <DPR>  ::= < Diameter Header: 282, REQ >
                    { Origin-Host }
                    { Origin-Realm }
                    { Disconnect-Cause }
                  * [ AVP ]
        
         <DPR>  ::= < Diameter Header: 282, REQ >
                    { Origin-Host }
                    { Origin-Realm }
                    { Disconnect-Cause }
                  * [ AVP ]
        
5.4.2. Disconnect-Peer-Answer
5.4.2. 断开对等应答

The Disconnect-Peer-Answer (DPA), indicated by the Command Code set to 282 and the Command Flags' 'R' bit cleared, is sent as a response to the Disconnect-Peer-Request message. Upon receipt of this message, the transport connection is shut down.

断开对等应答(DPA)由设置为282的命令代码和清除的命令标志“R”位指示,作为对断开对等请求消息的响应发送。收到此消息后,传输连接将关闭。

Message Format

消息格式

         <DPA>  ::= < Diameter Header: 282 >
                    { Result-Code }
                    { Origin-Host }
                    { Origin-Realm }
                    [ Error-Message ]
                    [ Failed-AVP ]
                  * [ AVP ]
        
         <DPA>  ::= < Diameter Header: 282 >
                    { Result-Code }
                    { Origin-Host }
                    { Origin-Realm }
                    [ Error-Message ]
                    [ Failed-AVP ]
                  * [ AVP ]
        
5.4.3. Disconnect-Cause AVP
5.4.3. 断开原因AVP

The Disconnect-Cause AVP (AVP Code 273) is of type Enumerated. A Diameter node MUST include this AVP in the Disconnect-Peer-Request message to inform the peer of the reason for its intention to shut down the transport connection. The following values are supported:

断开原因AVP(AVP代码273)属于枚举类型。Diameter节点必须在Disconnect Peer请求消息中包含此AVP,以通知对等方其关闭传输连接的原因。支持以下值:

REBOOTING 0 A scheduled reboot is imminent. A receiver of a DPR with above result code MAY attempt reconnection.

重新启动0计划的重新启动即将到来。具有上述结果代码的DPR接收器可能会尝试重新连接。

BUSY 1 The peer's internal resources are constrained, and it has determined that the transport connection needs to be closed. A receiver of a DPR with above result code SHOULD NOT attempt reconnection.

忙碌1对等方的内部资源受到限制,并且已确定需要关闭传输连接。具有上述结果代码的DPR接收器不应尝试重新连接。

DO_NOT_WANT_TO_TALK_TO_YOU 2 The peer has determined that it does not see a need for the transport connection to exist, since it does not expect any messages to be exchanged in the near future. A receiver of a DPR with above result code SHOULD NOT attempt reconnection.

DO_NOT_WANT_TO_TALK_TO_YOU 2对等方已确定不需要存在传输连接,因为它不希望在不久的将来交换任何消息。具有上述结果代码的DPR接收器不应尝试重新连接。

5.5. Transport Failure Detection
5.5. 传输故障检测

Given the nature of the Diameter protocol, it is recommended that transport failures be detected as soon as possible. Detecting such failures will minimize the occurrence of messages sent to unavailable agents, resulting in unnecessary delays, and will provide better failover performance. The Device-Watchdog-Request and Device-Watchdog-Answer messages, defined in this section, are used to pro-actively detect transport failures.

鉴于Diameter协议的性质,建议尽快检测传输故障。检测此类故障将最大限度地减少发送到不可用代理的消息的发生,从而导致不必要的延迟,并将提供更好的故障切换性能。本节中定义的设备看门狗请求和设备看门狗应答消息用于主动检测传输故障。

5.5.1. Device-Watchdog-Request
5.5.1. 设备监视程序请求

The Device-Watchdog-Request (DWR), indicated by the Command Code set to 280 and the Command Flags' 'R' bit set, is sent to a peer when no traffic has been exchanged between two peers (see Section 5.5.3). Upon detection of a transport failure, this message MUST NOT be sent to an alternate peer.

设备看门狗请求(DWR)由设置为280的命令代码和设置的命令标志“R”位表示,当两个对等方之间没有流量交换时,将发送给对等方(见第5.5.3节)。在检测到传输故障时,不得将此消息发送给备用对等方。

Message Format

消息格式

         <DWR>  ::= < Diameter Header: 280, REQ >
                    { Origin-Host }
                    { Origin-Realm }
                    [ Origin-State-Id ]
                  * [ AVP ]
        
         <DWR>  ::= < Diameter Header: 280, REQ >
                    { Origin-Host }
                    { Origin-Realm }
                    [ Origin-State-Id ]
                  * [ AVP ]
        
5.5.2. Device-Watchdog-Answer
5.5.2. 设备监视器应答

The Device-Watchdog-Answer (DWA), indicated by the Command Code set to 280 and the Command Flags' 'R' bit cleared, is sent as a response to the Device-Watchdog-Request message.

设备看门狗应答(DWA)由设置为280的命令代码和清除的命令标志“R”位指示,作为对设备看门狗请求消息的响应发送。

Message Format

消息格式

         <DWA>  ::= < Diameter Header: 280 >
                    { Result-Code }
                    { Origin-Host }
                    { Origin-Realm }
                    [ Error-Message ]
                    [ Failed-AVP ]
                    [ Origin-State-Id ]
                  * [ AVP ]
        
         <DWA>  ::= < Diameter Header: 280 >
                    { Result-Code }
                    { Origin-Host }
                    { Origin-Realm }
                    [ Error-Message ]
                    [ Failed-AVP ]
                    [ Origin-State-Id ]
                  * [ AVP ]
        
5.5.3. Transport Failure Algorithm
5.5.3. 传输失败算法

The transport failure algorithm is defined in [RFC3539]. All Diameter implementations MUST support the algorithm defined in that specification in order to be compliant to the Diameter base protocol.

传输故障算法在[RFC3539]中定义。所有Diameter实现必须支持该规范中定义的算法,以符合Diameter基本协议。

5.5.4. Failover and Failback Procedures
5.5.4. 故障切换和回切过程

In the event that a transport failure is detected with a peer, it is necessary for all pending request messages to be forwarded to an alternate agent, if possible. This is commonly referred to as "failover".

如果对等方检测到传输失败,则有必要将所有挂起的请求消息转发给备用代理(如果可能)。这通常称为“故障转移”。

In order for a Diameter node to perform failover procedures, it is necessary for the node to maintain a pending message queue for a given peer. When an answer message is received, the corresponding request is removed from the queue. The Hop-by-Hop Identifier field is used to match the answer with the queued request.

为了让Diameter节点执行故障转移过程,该节点必须为给定对等方维护挂起的消息队列。当收到应答消息时,相应的请求将从队列中删除。逐跳标识符字段用于将答案与排队请求相匹配。

When a transport failure is detected, if possible, all messages in the queue are sent to an alternate agent with the T flag set. On booting a Diameter client or agent, the T flag is also set on any remaining records in non-volatile storage that are still waiting to be transmitted. An example of a case where it is not possible to forward the message to an alternate server is when the message has a fixed destination, and the unavailable peer is the message's final destination (see Destination-Host AVP). Such an error requires that the agent return an answer message with the 'E' bit set and the Result-Code AVP set to DIAMETER_UNABLE_TO_DELIVER.

如果可能,当检测到传输失败时,队列中的所有消息都会发送到设置了T标志的备用代理。在引导Diameter客户机或代理时,还将在非易失性存储器中仍在等待传输的任何剩余记录上设置T标志。无法将消息转发到备用服务器的情况的一个示例是,消息具有固定的目的地,而不可用的对等方是消息的最终目的地(请参阅目的地主机AVP)。此类错误要求代理返回一条应答消息,其中设置了“E”位,结果代码AVP设置为DIAMETER\u UNABLE\u to\u DELIVER。

It is important to note that multiple identical requests or answers MAY be received as a result of a failover. The End-to-End Identifier field in the Diameter header along with the Origin-Host AVP MUST be used to identify duplicate messages.

需要注意的是,故障切换可能会收到多个相同的请求或响应。必须使用Diameter标头中的端到端标识符字段以及原始主机AVP来标识重复消息。

As described in Section 2.1, a connection request should be periodically attempted with the failed peer in order to re-establish the transport connection. Once a connection has been successfully established, messages can once again be forwarded to the peer. This is commonly referred to as "failback".

如第2.1节所述,应定期尝试与故障对等方进行连接请求,以便重新建立传输连接。成功建立连接后,可以再次将消息转发给对等方。这通常被称为“故障回复”。

5.6. Peer State Machine
5.6. 对等状态机

This section contains a finite state machine that MUST be observed by all Diameter implementations. Each Diameter node MUST follow the state machine described below when communicating with each peer. Multiple actions are separated by commas, and may continue on succeeding lines, as space requires. Similarly, state and next state may also span multiple lines, as space requires.

本节包含所有Diameter实现都必须遵守的有限状态机。当与每个对等节点通信时,每个Diameter节点必须遵循下面描述的状态机。多个操作由逗号分隔,并可根据空间要求在后续行上继续。类似地,根据空间要求,状态和下一状态也可能跨越多行。

This state machine is closely coupled with the state machine described in [RFC3539], which is used to open, close, failover, probe, and reopen transport connections. In particular, note that [RFC3539] requires the use of watchdog messages to probe connections. For Diameter, DWR and DWA messages are to be used.

此状态机与[RFC3539]中描述的状态机紧密耦合,用于打开、关闭、故障切换、探测和重新打开传输连接。特别要注意的是,[RFC3539]需要使用看门狗消息来探测连接。对于直径,将使用DWR和DWA消息。

The I- prefix is used to represent the initiator (connecting) connection, while the R- prefix is used to represent the responder (listening) connection. The lack of a prefix indicates that the event or action is the same regardless of the connection on which the event occurred.

I-前缀用于表示发起方(连接)连接,而R-前缀用于表示响应方(侦听)连接。缺少前缀表示无论事件发生在哪个连接上,事件或操作都是相同的。

The stable states that a state machine may be in are Closed, I-Open, and R-Open; all other states are intermediate. Note that I-Open and R-Open are equivalent except for whether the initiator or responder transport connection is used for communication.

状态机可能处于的稳定状态为关闭、I-打开和R-打开;所有其他状态都是中间状态。请注意,I-Open和R-Open是等效的,但启动器或响应程序传输连接是否用于通信除外。

A CER message is always sent on the initiating connection immediately after the connection request is successfully completed. In the case of an election, one of the two connections will shut down. The responder connection will survive if the Origin-Host of the local Diameter entity is higher than that of the peer; the initiator connection will survive if the peer's Origin-Host is higher. All subsequent messages are sent on the surviving connection. Note that the results of an election on one peer are guaranteed to be the inverse of the results on the other.

连接请求成功完成后,CER消息始终会立即在启动连接时发送。在选举的情况下,两个连接中的一个将关闭。如果本地Diameter实体的源主机高于对等主机,则响应方连接将继续存在;如果对等方的源主机更高,则启动器连接将继续存在。所有后续消息都将在尚存的连接上发送。请注意,一方的选举结果保证与另一方的选举结果相反。

For TLS/TCP and DTLS/SCTP usage, a TLS/TCP and DTLS/SCTP handshake SHOULD begin when both ends are in the closed state prior to any Diameter message exchanges. The TLS/TCP and DTLS/SCTP connection SHOULD be established before sending any CER or CEA message to secure and protect the capabilities information of both peers. The TLS/TCP and DTLS/SCTP connection SHOULD be disconnected when the state machine moves to the closed state. When connecting to responders that do not conform to this document (i.e., older Diameter implementations that are not prepared to received TLS/TCP and DTLS/ SCTP connections in the closed state), the initial TLS/TCP and DTLS/ SCTP connection attempt will fail. The initiator MAY then attempt to connect via TCP or SCTP and initiate the TLS/TCP and DTLS/SCTP handshake when both ends are in the open state. If the handshake is successful, all further messages will be sent via TLS/TCP and DTLS/ SCTP. If the handshake fails, both ends move to the closed state.

对于TLS/TCP和DTLS/SCTP的使用,在任何Diameter消息交换之前,当两端都处于关闭状态时,应开始TLS/TCP和DTLS/SCTP握手。在发送任何CER或CEA消息之前,应建立TLS/TCP和DTLS/SCTP连接,以保护两个对等方的能力信息。当状态机移动到关闭状态时,应断开TLS/TCP和DTLS/SCTP连接。当连接到不符合本文档要求的响应程序时(即,旧的Diameter实现不准备在关闭状态下接收TLS/TCP和DTLS/SCTP连接),初始TLS/TCP和DTLS/SCTP连接尝试将失败。然后,启动器可尝试通过TCP或SCTP进行连接,并在两端处于打开状态时启动TLS/TCP和DTLS/SCTP握手。如果握手成功,所有进一步的消息将通过TLS/TCP和DTLS/SCTP发送。如果握手失败,两端都会移动到关闭状态。

The state machine constrains only the behavior of a Diameter implementation as seen by Diameter peers through events on the wire.

状态机仅约束Diameter实现的行为,正如Diameter对等方通过连线上的事件所看到的那样。

Any implementation that produces equivalent results is considered compliant.

任何产生等效结果的实现都被视为符合要求。

      state            event              action         next state
      -----------------------------------------------------------------
      Closed           Start            I-Snd-Conn-Req   Wait-Conn-Ack
                       R-Conn-CER       R-Accept,        R-Open
                                        Process-CER,
                                        R-Snd-CEA
        
      state            event              action         next state
      -----------------------------------------------------------------
      Closed           Start            I-Snd-Conn-Req   Wait-Conn-Ack
                       R-Conn-CER       R-Accept,        R-Open
                                        Process-CER,
                                        R-Snd-CEA
        

Wait-Conn-Ack I-Rcv-Conn-Ack I-Snd-CER Wait-I-CEA I-Rcv-Conn-Nack Cleanup Closed R-Conn-CER R-Accept, Wait-Conn-Ack/ Process-CER Elect Timeout Error Closed

等待连接确认I-Rcv-Conn-Ack I-Snd-CER等待-I-CEA I-Rcv-Conn-Nack清理关闭R-Conn-CER R-Accept,等待连接确认/进程CER选择超时错误关闭

Wait-I-CEA I-Rcv-CEA Process-CEA I-Open R-Conn-CER R-Accept, Wait-Returns Process-CER, Elect I-Peer-Disc I-Disc Closed I-Rcv-Non-CEA Error Closed Timeout Error Closed

Wait-I-CEA I-Rcv-CEA进程CEA I-Open R-Conn-CER R-Accept,等待返回进程CER,选择I-Peer-Disc I-Disc Closed I-Rcv-Non-CEA错误关闭超时错误关闭

Wait-Conn-Ack/ I-Rcv-Conn-Ack I-Snd-CER,Elect Wait-Returns Elect I-Rcv-Conn-Nack R-Snd-CEA R-Open R-Peer-Disc R-Disc Wait-Conn-Ack R-Conn-CER R-Reject Wait-Conn-Ack/ Elect Timeout Error Closed

Wait Conn Ack/I-Rcv-Conn-Ack I-Snd-CER,Elect Wait返回Elect I-Rcv-Conn-Nack R-Snd-CEA R-Open R-Peer-Disc R-Disc Wait Conn Ack R-Conn-CER R-Reject Wait Conn Ack/Elect超时错误关闭

Wait-Returns Win-Election I-Disc,R-Snd-CEA R-Open I-Peer-Disc I-Disc, R-Open R-Snd-CEA I-Rcv-CEA R-Disc I-Open R-Peer-Disc R-Disc Wait-I-CEA R-Conn-CER R-Reject Wait-Returns Timeout Error Closed

等待返回赢选I-Disc,R-Snd-CEA R-Open I-Peer-Disc I-Disc,R-Open R-Snd-CEA I-Rcv-CEA R-Disc I-Open R-Peer-Disc R-Disc Wait-I-CEA R-Conn-CER R-Reject等待返回超时错误关闭

R-Open Send-Message R-Snd-Message R-Open R-Rcv-Message Process R-Open R-Rcv-DWR Process-DWR, R-Open R-Snd-DWA R-Rcv-DWA Process-DWA R-Open R-Conn-CER R-Reject R-Open Stop R-Snd-DPR Closing R-Rcv-DPR R-Snd-DPA Closing R-Peer-Disc R-Disc Closed

R-Open发送消息R-Snd-Message R-Open R-Rcv-Message流程R-Open R-Rcv-DWR流程DWR,R-Open R-Snd-DWA R-Rcv-DWA流程DWA R-Open R-Conn-CER R-Reject R-Open停止R-Snd-DPR-Rcv-DPA关闭R-Peer-Disc R-Disc关闭

I-Open Send-Message I-Snd-Message I-Open I-Rcv-Message Process I-Open I-Rcv-DWR Process-DWR, I-Open I-Snd-DWA I-Rcv-DWA Process-DWA I-Open R-Conn-CER R-Reject I-Open Stop I-Snd-DPR Closing I-Rcv-DPR I-Snd-DPA Closing I-Peer-Disc I-Disc Closed

I-Open发送消息I-Snd-Message I-Open I-Rcv-Message流程I-Open I-Rcv-DWR流程DWR,I-Open I-Snd-DWA I-Rcv-DWA流程DWA I-Open R-Conn-CER R R-Reject I-Open停止I-Snd-DPR关闭I-Rcv-DPR关闭I-Peer-Disc I-Disc关闭

Closing I-Rcv-DPA I-Disc Closed R-Rcv-DPA R-Disc Closed Timeout Error Closed I-Peer-Disc I-Disc Closed R-Peer-Disc R-Disc Closed

关闭I-Rcv-DPA I-Disc关闭R-Rcv-DPA R-Disc关闭超时错误关闭I-Peer-Disc I-Disc关闭R-Peer-Disc R-Disc关闭

5.6.1. Incoming Connections
5.6.1. 传入连接

When a connection request is received from a Diameter peer, it is not, in the general case, possible to know the identity of that peer until a CER is received from it. This is because host and port determine the identity of a Diameter peer; the source port of an incoming connection is arbitrary. Upon receipt of a CER, the identity of the connecting peer can be uniquely determined from the Origin-Host.

当从Diameter对等方接收到连接请求时,在一般情况下,只有在从其接收到CER后才能知道该对等方的身份。这是因为主机和端口决定了直径对等的身份;传入连接的源端口是任意的。在收到CER后,可以从源主机唯一地确定连接对等方的身份。

For this reason, a Diameter peer must employ logic separate from the state machine to receive connection requests, accept them, and await the CER. Once the CER arrives on a new connection, the Origin-Host that identifies the peer is used to locate the state machine associated with that peer, and the new connection and CER are passed to the state machine as an R-Conn-CER event.

因此,Diameter对等机必须使用与状态机分离的逻辑来接收连接请求、接受它们并等待CER。一旦CER到达一个新连接,标识对等机的源主机将用于定位与该对等机关联的状态机,并且新连接和CER将作为R-Conn-CER事件传递给状态机。

The logic that handles incoming connections SHOULD close and discard the connection if any message other than a CER arrives or if an implementation-defined timeout occurs prior to receipt of CER.

如果CER以外的任何消息到达,或者如果在收到CER之前发生了实现定义的超时,则处理传入连接的逻辑应关闭并放弃连接。

Because handling of incoming connections up to and including receipt of a CER requires logic, separate from that of any individual state machine associated with a particular peer, it is described separately in this section rather than in the state machine above.

由于处理CER之前(包括接收CER)的传入连接需要与与特定对等方关联的任何单个状态机的逻辑分开的逻辑,因此在本节中单独描述,而不是在上面的状态机中描述。

5.6.2. Events
5.6.2. 事件

Transitions and actions in the automaton are caused by events. In this section, we will ignore the I- and R- prefixes, since the actual event would be identical, but it would occur on one of two possible connections.

自动机中的转换和操作是由事件引起的。在本节中,我们将忽略I和R前缀,因为实际事件是相同的,但它将发生在两个可能的连接之一上。

Start The Diameter application has signaled that a connection should be initiated with the peer.

启动Diameter应用程序已发出信号,表示应启动与对等方的连接。

R-Conn-CER An acknowledgement is received stating that the transport connection has been established, and the associated CER has arrived.

R-Conn-CER接收到一个确认,说明传输连接已经建立,并且相关的CER已经到达。

Rcv-Conn-Ack A positive acknowledgement is received confirming that the transport connection is established.

Rcv Conn Ack收到确认传输连接已建立的肯定确认。

Rcv-Conn-Nack A negative acknowledgement was received stating that the transport connection was not established.

Rcv Conn Nack收到否定确认,表示未建立传输连接。

Timeout An application-defined timer has expired while waiting for some event.

超时等待某个事件时,应用程序定义的计时器已过期。

Rcv-CER A CER message from the peer was received.

Rcv CER接收到来自对等方的CER消息。

Rcv-CEA A CEA message from the peer was received.

Rcv CEA收到来自对等方的CEA消息。

Rcv-Non-CEA A message, other than a CEA, from the peer was received.

Rcv Non CEA收到来自对等方的消息(CEA除外)。

Peer-Disc A disconnection indication from the peer was received.

对等磁盘接收到来自对等磁盘的断开指示。

Rcv-DPR A DPR message from the peer was received.

Rcv DPR接收到来自对等方的DPR消息。

Rcv-DPA A DPA message from the peer was received.

Rcv DPA接收到来自对等方的DPA消息。

Win-Election An election was held, and the local node was the winner.

赢得选举举行了选举,本地节点是赢家。

Send-Message A message is to be sent.

发送消息要发送的消息。

Rcv-Message A message other than CER, CEA, DPR, DPA, DWR, or DWA was received.

Rcv消息收到CER、CEA、DPR、DPA、DWR或DWA以外的消息。

Stop The Diameter application has signaled that a connection should be terminated (e.g., on system shutdown).

Stop Diameter应用程序已发出终止连接的信号(例如,在系统关闭时)。

5.6.3. Actions
5.6.3. 行动

Actions in the automaton are caused by events and typically indicate the transmission of packets and/or an action to be taken on the connection. In this section, we will ignore the I- and R- prefixes, since the actual action would be identical, but it would occur on one of two possible connections.

自动机中的操作由事件引起,通常表示数据包的传输和/或连接上要采取的操作。在本节中,我们将忽略I和R前缀,因为实际操作是相同的,但它将发生在两个可能的连接之一上。

Snd-Conn-Req A transport connection is initiated with the peer.

Snd Conn Req与对等方启动传输连接。

Accept The incoming connection associated with the R-Conn-CER is accepted as the responder connection.

接受与R-Conn-CER关联的传入连接被接受为响应程序连接。

Reject The incoming connection associated with the R-Conn-CER is disconnected.

拒绝与R-Conn-CER断开关联的传入连接。

Process-CER The CER associated with the R-Conn-CER is processed.

处理CER处理与R-Conn-CER关联的CER。

Snd-CER A CER message is sent to the peer.

Snd CER向对等方发送CER消息。

Snd-CEA A CEA message is sent to the peer.

Snd CEA向对等方发送CEA消息。

Cleanup If necessary, the connection is shut down, and any local resources are freed.

如有必要,将关闭连接并释放所有本地资源。

Error The transport layer connection is disconnected, either politely or abortively, in response to an error condition. Local resources are freed.

错误传输层连接被断开,无论是礼貌的还是失败的,以响应错误条件。释放本地资源。

Process-CEA A received CEA is processed.

处理CEA处理接收到的CEA。

Snd-DPR A DPR message is sent to the peer.

Snd DPR向对等方发送DPR消息。

Snd-DPA A DPA message is sent to the peer.

Snd DPA向对等方发送DPA消息。

Disc The transport layer connection is disconnected, and local resources are freed.

光盘传输层连接已断开,本地资源已释放。

Elect An election occurs (see Section 5.6.4 for more information).

选举发生时(更多信息见第5.6.4节)。

Snd-Message A message is sent.

Snd消息发送一条消息。

Snd-DWR A DWR message is sent.

Snd DWR发送DWR消息。

Snd-DWA A DWA message is sent.

Snd DWA发送DWA消息。

Process-DWR The DWR message is serviced.

处理DWR将为DWR消息提供服务。

Process-DWA The DWA message is serviced.

处理DWA—DWA消息得到服务。

Process A message is serviced.

处理一条消息。

5.6.4. The Election Process
5.6.4. 选举过程

The election is performed on the responder. The responder compares the Origin-Host received in the CER with its own Origin-Host as two streams of octets. If the local Origin-Host lexicographically succeeds the received Origin-Host, a Win-Election event is issued locally. Diameter identities are in ASCII form; therefore, the lexical comparison is consistent with DNS case insensitivity, where octets that fall in the ASCII range 'a' through 'z' MUST compare equally to their uppercase counterparts between 'A' and 'Z'. See Appendix D for interactions between the Diameter protocol and Internationalized Domain Name (IDNs).

对响应者执行选择。响应者将CER中接收的源主机与其自身的源主机作为两个八位字节流进行比较。如果本地源主机按字典顺序继承接收到的源主机,则在本地发出Win Election事件。直径标识采用ASCII格式;因此,词法比较与DNS大小写不敏感一致,其中ASCII范围“a”到“z”内的八位字节必须与大写字母“a”和“z”之间的八位字节进行同等比较。有关Diameter协议和国际化域名(IDNs)之间的交互,请参见附录D。

The winner of the election MUST close the connection it initiated. Historically, maintaining the responder side of a connection was more efficient than maintaining the initiator side. However, current practices makes this distinction irrelevant.

选举的获胜者必须关闭它所启动的连接。从历史上看,维护连接的响应方比维护发起方更有效。然而,目前的做法使这一区别变得无关紧要。

6. Diameter Message Processing
6. Diameter消息处理

This section describes how Diameter requests and answers are created and processed.

本节介绍如何创建和处理Diameter请求和应答。

6.1. Diameter Request Routing Overview
6.1. Diameter请求路由概述

A request is sent towards its final destination using one of the following three combinations of the Destination-Realm and Destination-Host AVPs:

使用目标域和目标主机AVP的以下三种组合之一将请求发送到其最终目标:

o A request that is not able to be proxied (such as a CER) MUST NOT contain either Destination-Realm or Destination-Host AVPs.

o 无法代理的请求(如CER)不得包含目标域或目标主机AVP。

o A request that needs to be sent to a home server serving a specific realm, but not to a specific server (such as the first request of a series of round trips), MUST contain a Destination-Realm AVP but MUST NOT contain a Destination-Host AVP. For Diameter clients, the value of the Destination-Realm AVP MAY be extracted from the User-Name AVP, or other methods.

o 需要发送到服务于特定领域的家庭服务器而不是特定服务器的请求(例如一系列往返的第一个请求)必须包含目标领域AVP,但不得包含目标主机AVP。对于Diameter客户端,可以从用户名AVP或其他方法提取目标领域AVP的值。

o Otherwise, a request that needs to be sent to a specific home server among those serving a given realm MUST contain both the Destination-Realm and Destination-Host AVPs.

o 否则,需要发送到服务于给定领域的特定家庭服务器的请求必须同时包含目标领域和目标主机AVP。

The Destination-Host AVP is used as described above when the destination of the request is fixed, which includes:

当请求的目的地是固定的时,如上所述使用目的地主机AVP,其包括:

o Authentication requests that span multiple round trips.

o 跨越多个往返的身份验证请求。

o A Diameter message that uses a security mechanism that makes use of a pre-established session key shared between the source and the final destination of the message.

o 使用安全机制的Diameter消息,该安全机制利用消息源和最终目标之间共享的预先建立的会话密钥。

o Server-initiated messages that MUST be received by a specific Diameter client (e.g., access device), such as the Abort-Session-Request message, which is used to request that a particular user's session be terminated.

o 必须由特定Diameter客户端(例如,访问设备)接收的服务器启动的消息,如中止会话请求消息,用于请求终止特定用户的会话。

Note that an agent can only forward a request to a host described in the Destination-Host AVP if the host in question is included in its peer table (see Section 2.6). Otherwise, the request is routed based on the Destination-Realm only (see Section 6.1.6).

请注意,如果目标主机AVP中描述的主机包含在其对等表中,则代理只能将请求转发给该主机(请参见第2.6节)。否则,请求将仅基于目标域进行路由(参见第6.1.6节)。

When a message is received, the message is processed in the following order:

收到消息后,将按以下顺序处理该消息:

o If the message is destined for the local host, the procedures listed in Section 6.1.4 are followed.

o 如果消息的目的地是本地主机,则遵循第6.1.4节中列出的程序。

o If the message is intended for a Diameter peer with whom the local host is able to directly communicate, the procedures listed in Section 6.1.5 are followed. This is known as "Request Forwarding".

o 如果该消息针对本地主机能够直接通信的Diameter对等机,则应遵循第6.1.5节中列出的程序。这称为“请求转发”。

o The procedure listed in Section 6.1.6 is followed, which is known as "Request Routing".

o 遵循第6.1.6节中列出的程序,即“请求路由”。

o If none of the above are successful, an answer is returned with the Result-Code set to DIAMETER_UNABLE_TO_DELIVER, with the 'E' bit set.

o 如果上述操作均未成功,则返回一个答案,结果代码设置为DIAMETER\u UNABLE\u to\u DELIVER,并设置了“E”位。

For routing of Diameter messages to work within an administrative domain, all Diameter nodes within the realm MUST be peers.

要在管理域中路由Diameter消息,域中的所有Diameter节点都必须是对等节点。

The overview contained in this section (6.1) is intended to provide general guidelines to Diameter developers. Implementations are free to use different methods than the ones described here as long as they conform to the requirements specified in Sections 6.1.1 through 6.1.9. See Section 7 for more details on error handling.

本节(6.1)中的概述旨在为直径开发者提供一般指南。只要符合第6.1.1节至第6.1.9节规定的要求,实施可自由使用不同于此处所述的方法。有关错误处理的更多详细信息,请参见第7节。

6.1.1. Originating a Request
6.1.1. 发起请求

When creating a request, in addition to any other procedures described in the application definition for that specific request, the following procedures MUST be followed:

创建请求时,除了该特定请求的应用程序定义中描述的任何其他过程外,还必须遵循以下过程:

o the Command Code is set to the appropriate value;

o 将命令代码设置为适当的值;

o the 'R' bit is set;

o 设置“R”位;

o the End-to-End Identifier is set to a locally unique value;

o 将端到端标识符设置为本地唯一值;

o the Origin-Host and Origin-Realm AVPs MUST be set to the appropriate values, used to identify the source of the message; and

o 源主机和源域AVP必须设置为适当的值,用于标识消息源;和

o the Destination-Host and Destination-Realm AVPs MUST be set to the appropriate values, as described in Section 6.1.

o 如第6.1节所述,必须将目标主机和目标域AVP设置为适当的值。

6.1.2. Sending a Request
6.1.2. 发送请求

When sending a request, originated either locally or as the result of a forwarding or routing operation, the following procedures SHOULD be followed:

当发送本地发起的请求或转发或路由操作的结果时,应遵循以下过程:

o The Hop-by-Hop Identifier SHOULD be set to a locally unique value.

o 逐跳标识符应设置为本地唯一值。

o The message SHOULD be saved in the list of pending requests.

o 消息应保存在挂起的请求列表中。

Other actions to perform on the message based on the particular role the agent is playing are described in the following sections.

根据代理所扮演的特定角色对消息执行的其他操作将在以下部分中描述。

6.1.3. Receiving Requests
6.1.3. 接收请求

A relay or proxy agent MUST check for forwarding loops when receiving requests. A loop is detected if the server finds its own identity in a Route-Record AVP. When such an event occurs, the agent MUST answer with the Result-Code AVP set to DIAMETER_LOOP_DETECTED.

中继或代理在接收请求时必须检查转发循环。如果服务器在路由记录AVP中找到自己的标识,则会检测到循环。当发生此类事件时,代理必须使用设置为DIAMETER_LOOP_DETECTED的结果代码AVP进行应答。

6.1.4. Processing Local Requests
6.1.4. 处理本地请求

A request is known to be for local consumption when one of the following conditions occurs:

当出现以下情况之一时,已知请求是本地消费:

o The Destination-Host AVP contains the local host's identity;

o 目的主机AVP包含本地主机的标识;

o The Destination-Host AVP is not present, the Destination-Realm AVP contains a realm the server is configured to process locally, and the Diameter application is locally supported; or

o 目标主机AVP不存在,目标领域AVP包含服务器配置为本地处理的领域,并且Diameter应用程序在本地受支持;或

o Both the Destination-Host and the Destination-Realm are not present.

o 目标主机和目标域都不存在。

When a request is locally processed, the rules in Section 6.2 should be used to generate the corresponding answer.

当本地处理请求时,应使用第6.2节中的规则生成相应的答案。

6.1.5. Request Forwarding
6.1.5. 请求转发

Request forwarding is done using the Diameter peer table. The Diameter peer table contains all of the peers with which the local node is able to directly communicate.

请求转发使用Diameter对等表完成。Diameter对等表包含本地节点能够直接与之通信的所有对等点。

When a request is received, and the host encoded in the Destination-Host AVP is one that is present in the peer table, the message SHOULD be forwarded to the peer.

当接收到请求,并且目标主机AVP中编码的主机是对等表中存在的主机时,应将消息转发给对等机。

6.1.6. Request Routing
6.1.6. 请求路由

Diameter request message routing is done via realms and Application Ids. A Diameter message that may be forwarded by Diameter agents (proxies, redirect agents, or relay agents) MUST include the target realm in the Destination-Realm AVP. Request routing SHOULD rely on the Destination-Realm AVP and the Application Id present in the request message header to aid in the routing decision. The realm MAY be retrieved from the User-Name AVP, which is in the form of a Network Access Identifier (NAI). The realm portion of the NAI is inserted in the Destination-Realm AVP.

Diameter请求消息路由通过领域和应用程序ID完成。可由Diameter代理(代理、重定向代理或中继代理)转发的Diameter消息必须在目标域AVP中包含目标域。请求路由应该依赖于目标域AVP和请求消息头中存在的应用程序Id来帮助路由决策。可以从用户名AVP检索领域,用户名AVP是网络访问标识符(NAI)的形式。NAI的领域部分插入到目标领域AVP中。

Diameter agents MAY have a list of locally supported realms and applications, and they MAY have a list of externally supported realms and applications. When a request is received that includes a realm and/or application that is not locally supported, the message is routed to the peer configured in the routing table (see Section 2.7).

Diameter Agent可能有一个本地支持的领域和应用程序列表,也可能有一个外部支持的领域和应用程序列表。当接收到包含本地不支持的领域和/或应用程序的请求时,消息将路由到路由表中配置的对等方(请参阅第2.7节)。

Realm names and Application Ids are the minimum supported routing criteria, additional information may be needed to support redirect semantics.

领域名称和应用程序ID是受支持的最低路由标准,可能需要其他信息来支持重定向语义。

6.1.7. Predictive Loop Avoidance
6.1.7. 预测环路避免

Before forwarding or routing a request, Diameter agents, in addition to performing the processing described in Section 6.1.3, SHOULD check for the presence of a candidate route's peer identity in any of the Route-Record AVPs. In the event of the agent detecting the presence of a candidate route's peer identity in a Route-Record AVP, the agent MUST ignore such a route for the Diameter request message and attempt alternate routes if any exist. In case all the candidate routes are eliminated by the above criteria, the agent SHOULD return a DIAMETER_UNABLE_TO_DELIVER message.

在转发或路由请求之前,Diameter代理除了执行第6.1.3节中描述的处理外,还应检查任何路由记录AVP中是否存在候选路由的对等身份。如果代理检测到路由记录AVP中存在候选路由的对等身份,代理必须忽略Diameter请求消息的此类路由,并尝试备用路由(如果存在)。如果上述条件排除了所有候选路由,则代理应返回DIAMETER\u UNABLE\u TO\u DELIVER消息。

6.1.8. Redirecting Requests
6.1.8. 重定向请求

When a redirect agent receives a request whose routing entry is set to REDIRECT, it MUST reply with an answer message with the 'E' bit set, while maintaining the Hop-by-Hop Identifier in the header, and include the Result-Code AVP to DIAMETER_REDIRECT_INDICATION. Each of the servers associated with the routing entry are added in a separate Redirect-Host AVP.

当重定向代理接收到路由条目设置为重定向的请求时,它必须使用设置为“E”位的应答消息进行回复,同时在报头中保留逐跳标识符,并包括结果代码AVP to DIAMETER_redirect_指示。与路由条目关联的每个服务器都添加到单独的重定向主机AVP中。

                     +------------------+
                     |     Diameter     |
                     |  Redirect Agent  |
                     +------------------+
                      ^    |    2. command + 'E' bit
       1. Request     |    |    Result-Code =
      joe@example.com |    |    DIAMETER_REDIRECT_INDICATION +
                      |    |    Redirect-Host AVP(s)
                      |    v
                  +-------------+  3. Request  +-------------+
                  | example.com |------------->| example.net |
                  |    Relay    |              |   Diameter  |
                  |    Agent    |<-------------|    Server   |
                  +-------------+  4. Answer   +-------------+
        
                     +------------------+
                     |     Diameter     |
                     |  Redirect Agent  |
                     +------------------+
                      ^    |    2. command + 'E' bit
       1. Request     |    |    Result-Code =
      joe@example.com |    |    DIAMETER_REDIRECT_INDICATION +
                      |    |    Redirect-Host AVP(s)
                      |    v
                  +-------------+  3. Request  +-------------+
                  | example.com |------------->| example.net |
                  |    Relay    |              |   Diameter  |
                  |    Agent    |<-------------|    Server   |
                  +-------------+  4. Answer   +-------------+
        

Figure 5: Diameter Redirect Agent

图5:直径重定向代理

The receiver of an answer message with the 'E' bit set and the Result-Code AVP set to DIAMETER_REDIRECT_INDICATION uses the Hop-by-Hop Identifier in the Diameter header to identify the request in the pending message queue (see Section 5.5.4) that is to be redirected. If no transport connection exists with the new peer, one is created, and the request is sent directly to it.

设置了“E”位且结果代码AVP设置为DIAMETER_REDIRECT_指示的应答消息的接收器使用DIAMETER标头中的逐跳标识符来识别待重定向消息队列(见第5.5.4节)中的请求。如果不存在与新对等方的传输连接,则会创建一个连接,并将请求直接发送给它。

Multiple Redirect-Host AVPs are allowed. The receiver of the answer message with the 'E' bit set selects exactly one of these hosts as the destination of the redirected message.

允许多个重定向主机AVP。设置了“E”位的应答消息的接收者恰好选择其中一个主机作为重定向消息的目的地。

When the Redirect-Host-Usage AVP included in the answer message has a non-zero value, a route entry for the redirect indications is created and cached by the receiver. The redirect usage for such a route entry is set by the value of Redirect-Host-Usage AVP and the lifetime of the cached route entry is set by Redirect-Max-Cache-Time AVP value.

当应答消息中包含的重定向主机使用AVP具有非零值时,接收器将创建并缓存重定向指示的路由条目。此类路由项的重定向使用由重定向主机使用AVP的值设置,而缓存路由项的生存期由重定向最大缓存时间AVP值设置。

It is possible that multiple redirect indications can create multiple cached route entries differing only in their redirect usage and the peer to forward messages to. As an example, two(2) route entries that are created by two(2) redirect indications results in two(2)

多个重定向指示可能会创建多个缓存路由条目,这些条目仅在重定向使用和转发消息的对等方方面有所不同。例如,由两(2)个重定向指示创建的两(2)个路由条目将导致两(2)个

cached routes for the same realm and Application Id. However, one has a redirect usage of ALL_SESSION, where matching requests will be forwarded to one peer; the other has a redirect usage of ALL_REALM, where request are forwarded to another peer. Therefore, an incoming request that matches the realm and Application Id of both routes will need additional resolution. In such a case, a routing precedence rule MUST be used against the redirect usage value to resolve the contention. The precedence rule can be found in Section 6.13.

同一领域和应用程序Id的缓存路由。但是,其中一个具有对所有_会话的重定向使用,其中匹配的请求将转发给一个对等方;另一个重定向使用ALL_REALM,其中请求被转发到另一个对等方。因此,匹配两条路由的领域和应用程序Id的传入请求将需要额外的解析。在这种情况下,必须针对重定向使用值使用路由优先级规则来解决争用。优先规则见第6.13节。

6.1.9. Relaying and Proxying Requests
6.1.9. 中继和代理请求

A relay or proxy agent MUST append a Route-Record AVP to all requests forwarded. The AVP contains the identity of the peer from which the request was received.

中继或代理必须将路由记录AVP附加到所有转发的请求。AVP包含从中接收请求的对等方的标识。

The Hop-by-Hop Identifier in the request is saved and replaced with a locally unique value. The source of the request is also saved, which includes the IP address, port, and protocol.

请求中的逐跳标识符将被保存并替换为本地唯一值。还保存了请求的源,其中包括IP地址、端口和协议。

A relay or proxy agent MAY include the Proxy-Info AVP in requests if it requires access to any local state information when the corresponding response is received. The Proxy-Info AVP has security implications as state information is distributed to other entities. As such, it is RECOMMENDED that the content of the Proxy-Info AVP be protected with cryptographic mechanisms, for example, by using a keyed message digest such as HMAC-SHA1 [RFC2104]. Such a mechanism, however, requires the management of keys, although only locally at the Diameter server. Still, a full description of the management of the keys used to protect the Proxy-Info AVP is beyond the scope of this document. Below is a list of common recommendations:

如果中继或代理在接收到相应响应时需要访问任何本地状态信息,则中继或代理可以在请求中包括代理信息AVP。代理信息AVP具有安全含义,因为状态信息被分发给其他实体。因此,建议使用加密机制保护代理信息AVP的内容,例如,通过使用诸如HMAC-SHA1[RFC2104]的密钥消息摘要。然而,这种机制需要密钥管理,尽管仅在Diameter服务器上进行本地管理。不过,对用于保护代理信息AVP的密钥管理的完整描述超出了本文档的范围。以下是常见建议列表:

o The keys should be generated securely following the randomness recommendations in [RFC4086].

o 密钥应按照[RFC4086]中的随机性建议安全生成。

o The keys and cryptographic protection algorithms should be at least 128 bits in strength.

o 密钥和密码保护算法的强度应至少为128位。

o The keys should not be used for any other purpose than generating and verifying instances of the Proxy-Info AVP.

o 密钥不得用于生成和验证代理信息AVP实例以外的任何其他用途。

o The keys should be changed regularly.

o 钥匙应该定期更换。

o The keys should be changed if the AVP format or cryptographic protection algorithms change.

o 如果AVP格式或加密保护算法发生更改,则应更改密钥。

The message is then forwarded to the next hop, as identified in the routing table.

然后将消息转发到路由表中标识的下一个跃点。

Figure 6 provides an example of message routing using the procedures listed in these sections.

图6提供了使用这些部分中列出的过程进行消息路由的示例。

       (Origin-Host=nas.example.net)    (Origin-Host=nas.example.net)
       (Origin-Realm=example.net)       (Origin-Realm=example.net)
       (Destination-Realm=example.com)  (Destination-Realm=example.com)
                                        (Route-Record=nas.example.net)
      +------+      ------>      +------+      ------>      +------+
      |      |     (Request)     |      |      (Request)    |      |
      | NAS  +-------------------+ DRL  +-------------------+ HMS  |
      |      |                   |      |                   |      |
      +------+     <------       +------+     <------       +------+
     example.net    (Answer)   example.net     (Answer)   example.com
          (Origin-Host=hms.example.com)   (Origin-Host=hms.example.com)
          (Origin-Realm=example.com)      (Origin-Realm=example.com)
        
       (Origin-Host=nas.example.net)    (Origin-Host=nas.example.net)
       (Origin-Realm=example.net)       (Origin-Realm=example.net)
       (Destination-Realm=example.com)  (Destination-Realm=example.com)
                                        (Route-Record=nas.example.net)
      +------+      ------>      +------+      ------>      +------+
      |      |     (Request)     |      |      (Request)    |      |
      | NAS  +-------------------+ DRL  +-------------------+ HMS  |
      |      |                   |      |                   |      |
      +------+     <------       +------+     <------       +------+
     example.net    (Answer)   example.net     (Answer)   example.com
          (Origin-Host=hms.example.com)   (Origin-Host=hms.example.com)
          (Origin-Realm=example.com)      (Origin-Realm=example.com)
        

Figure 6: Routing of Diameter messages

图6:Diameter消息的路由

Relay and proxy agents are not required to perform full inspection of incoming messages. At a minimum, validation of the message header and relevant routing AVPs has to be done when relaying messages. Proxy agents may optionally perform more in-depth message validation for applications in which it is interested.

中继和代理不需要对传入消息执行完全检查。在中继消息时,至少必须对消息头和相关路由AVP进行验证。代理可以选择对其感兴趣的应用程序执行更深入的消息验证。

6.2. Diameter Answer Processing
6.2. 直径应答处理

When a request is locally processed, the following procedures MUST be applied to create the associated answer, in addition to any additional procedures that MAY be discussed in the Diameter application defining the command:

在本地处理请求时,除了定义命令的Diameter应用程序中可能讨论的任何附加过程外,还必须应用以下过程来创建相关的答案:

o The same Hop-by-Hop Identifier in the request is used in the answer.

o 在应答中使用请求中相同的逐跳标识符。

o The local host's identity is encoded in the Origin-Host AVP.

o 本地主机的身份在源主机AVP中编码。

o The Destination-Host and Destination-Realm AVPs MUST NOT be present in the answer message.

o 应答消息中不得存在目标主机和目标域AVP。

o The Result-Code AVP is added with its value indicating success or failure.

o 结果代码AVP与指示成功或失败的值一起添加。

o If the Session-Id is present in the request, it MUST be included in the answer.

o 如果请求中存在会话Id,则必须将其包含在应答中。

o Any Proxy-Info AVPs in the request MUST be added to the answer message, in the same order they were present in the request.

o 请求中的任何代理信息AVP都必须按请求中的顺序添加到应答消息中。

o The 'P' bit is set to the same value as the one in the request.

o “P”位设置为与请求中的相同值。

o The same End-to-End identifier in the request is used in the answer.

o 在应答中使用请求中相同的端到端标识符。

Note that the error messages (see Section 7) are also subjected to the above processing rules.

请注意,错误消息(参见第7节)也受上述处理规则的约束。

6.2.1. Processing Received Answers
6.2.1. 处理收到的答复

A Diameter client or proxy MUST match the Hop-by-Hop Identifier in an answer received against the list of pending requests. The corresponding message should be removed from the list of pending requests. It SHOULD ignore answers received that do not match a known Hop-by-Hop Identifier.

Diameter客户端或代理必须与收到的应答中的逐跳标识符与挂起的请求列表相匹配。应该从挂起的请求列表中删除相应的消息。它应该忽略接收到的与已知逐跳标识符不匹配的答案。

6.2.2. Relaying and Proxying Answers
6.2.2. 中继和代理应答

If the answer is for a request that was proxied or relayed, the agent MUST restore the original value of the Diameter header's Hop-by-Hop Identifier field.

如果答案是针对代理或中继的请求,则代理必须恢复Diameter标头逐跳标识符字段的原始值。

If the last Proxy-Info AVP in the message is targeted to the local Diameter server, the AVP MUST be removed before the answer is forwarded.

如果消息中的最后一个代理信息AVP是针对本地Diameter服务器的,则必须在转发答案之前删除该AVP。

If a relay or proxy agent receives an answer with a Result-Code AVP indicating a failure, it MUST NOT modify the contents of the AVP. Any additional local errors detected SHOULD be logged but not reflected in the Result-Code AVP. If the agent receives an answer message with a Result-Code AVP indicating success, and it wishes to modify the AVP to indicate an error, it MUST modify the Result-Code AVP to contain the appropriate error in the message destined towards the access device as well as include the Error-Reporting-Host AVP; it MUST also issue an STR on behalf of the access device towards the Diameter server.

如果中继或代理收到一个结果代码为AVP的答案,表示出现故障,则不得修改AVP的内容。应记录检测到的任何其他本地错误,但不应反映在结果代码AVP中。如果代理接收到结果代码AVP指示成功的应答消息,并且它希望修改AVP以指示错误,那么它必须修改结果代码AVP以在目的地为接入设备的消息中包含适当的错误,并且包括错误报告主机AVP;它还必须代表接入设备向Diameter服务器发出STR。

The agent MUST then send the answer to the host that it received the original request from.

然后,代理必须将应答发送给它从中接收原始请求的主机。

6.3. Origin-Host AVP
6.3. 源主机AVP

The Origin-Host AVP (AVP Code 264) is of type DiameterIdentity, and it MUST be present in all Diameter messages. This AVP identifies the endpoint that originated the Diameter message. Relay agents MUST NOT modify this AVP.

源主机AVP(AVP代码264)的类型为DiameterIdentity,并且它必须出现在所有Diameter消息中。此AVP标识发起Diameter消息的端点。中继代理不得修改此AVP。

The value of the Origin-Host AVP is guaranteed to be unique within a single host.

原始主机AVP的值保证在单个主机中是唯一的。

Note that the Origin-Host AVP may resolve to more than one address as the Diameter peer may support more than one address.

注意,源主机AVP可以解析为多个地址,因为Diameter对等机可以支持多个地址。

This AVP SHOULD be placed as close to the Diameter header as possible.

该AVP应尽可能靠近直径集管。

6.4. Origin-Realm AVP
6.4. 起源域AVP

The Origin-Realm AVP (AVP Code 296) is of type DiameterIdentity. This AVP contains the Realm of the originator of any Diameter message and MUST be present in all messages.

起源域AVP(AVP代码296)为直径类型。此AVP包含任何Diameter消息的发起者的域,并且必须出现在所有消息中。

This AVP SHOULD be placed as close to the Diameter header as possible.

该AVP应尽可能靠近直径集管。

6.5. Destination-Host AVP
6.5. 目的主机AVP

The Destination-Host AVP (AVP Code 293) is of type DiameterIdentity. This AVP MUST be present in all unsolicited agent initiated messages, MAY be present in request messages, and MUST NOT be present in answer messages.

目的主机AVP(AVP代码293)的类型为diameteridenty。此AVP必须出现在所有未经请求的代理启动的消息中,可能出现在请求消息中,并且不得出现在应答消息中。

The absence of the Destination-Host AVP will cause a message to be sent to any Diameter server supporting the application within the realm specified in Destination-Realm AVP.

缺少目标主机AVP将导致向目标领域AVP中指定的领域内支持应用程序的任何Diameter服务器发送消息。

This AVP SHOULD be placed as close to the Diameter header as possible.

该AVP应尽可能靠近直径集管。

6.6. Destination-Realm AVP
6.6. 目的域AVP

The Destination-Realm AVP (AVP Code 283) is of type DiameterIdentity and contains the realm to which the message is to be routed. The Destination-Realm AVP MUST NOT be present in answer messages. Diameter clients insert the realm portion of the User-Name AVP. Diameter servers initiating a request message use the value of the Origin-Realm AVP from a previous message received from the intended target host (unless it is known a priori). When present, the Destination-Realm AVP is used to perform message routing decisions.

目标域AVP(AVP代码283)的类型为DiameterIdentity,包含消息要路由到的域。应答消息中不得存在目标域AVP。Diameter客户端插入用户名AVP的领域部分。发起请求消息的Diameter服务器使用从预期目标主机接收的先前消息中的源域AVP值(除非事先已知)。当存在时,目标域AVP用于执行消息路由决策。

The CCF for a request message that includes the Destination-Realm AVP SHOULD list the Destination-Realm AVP as a required AVP (an AVP indicated as {AVP}); otherwise, the message is inherently a non-routable message.

包含目标领域AVP的请求消息的CCF应将目标领域AVP列为所需AVP(指示为{AVP}的AVP);否则,消息本身就是不可路由的消息。

This AVP SHOULD be placed as close to the Diameter header as possible.

该AVP应尽可能靠近直径集管。

6.7. Routing AVPs
6.7. 路由AVPs

The AVPs defined in this section are Diameter AVPs used for routing purposes. These AVPs change as Diameter messages are processed by agents.

本节中定义的AVP是用于布线目的的直径AVP。这些AVP随着代理处理直径消息而变化。

6.7.1. Route-Record AVP
6.7.1. 路线记录

The Route-Record AVP (AVP Code 282) is of type DiameterIdentity. The identity added in this AVP MUST be the same as the one received in the Origin-Host of the Capabilities Exchange message.

路线记录AVP(AVP代码282)为直径类型。此AVP中添加的标识必须与功能交换消息的源主机中接收的标识相同。

6.7.2. Proxy-Info AVP
6.7.2. 代理信息AVP

The Proxy-Info AVP (AVP Code 284) is of type Grouped. This AVP contains the identity and local state information of the Diameter node that creates and adds it to a message. The Grouped Data field has the following CCF grammar:

代理信息AVP(AVP代码284)属于分组类型。此AVP包含创建Diameter节点并将其添加到消息中的Diameter节点的标识和本地状态信息。分组数据字段具有以下CCF语法:

         Proxy-Info ::= < AVP Header: 284 >
                        { Proxy-Host }
                        { Proxy-State }
                      * [ AVP ]
        
         Proxy-Info ::= < AVP Header: 284 >
                        { Proxy-Host }
                        { Proxy-State }
                      * [ AVP ]
        
6.7.3. Proxy-Host AVP
6.7.3. 代理主机

The Proxy-Host AVP (AVP Code 280) is of type DiameterIdentity. This AVP contains the identity of the host that added the Proxy-Info AVP.

代理主机AVP(AVP代码280)的类型为diameteridenty。此AVP包含添加代理信息AVP的主机的标识。

6.7.4. Proxy-State AVP
6.7.4. 代理状态AVP

The Proxy-State AVP (AVP Code 33) is of type OctetString. It contains state information that would otherwise be stored at the Diameter entity that created it. As such, this AVP MUST be treated as opaque data by other Diameter entities.

代理状态AVP(AVP代码33)为OctetString类型。它包含否则将存储在创建它的Diameter实体中的状态信息。因此,其他直径实体必须将该AVP视为不透明数据。

6.8. Auth-Application-Id AVP
6.8. 身份验证应用程序Id AVP

The Auth-Application-Id AVP (AVP Code 258) is of type Unsigned32 and is used in order to advertise support of the Authentication and Authorization portion of an application (see Section 2.4). If present in a message other than CER and CEA, the value of the Auth-Application-Id AVP MUST match the Application Id present in the Diameter message header.

身份验证应用程序Id AVP(AVP代码258)的类型为Unsigned32,用于公布对应用程序的身份验证和授权部分的支持(参见第2.4节)。如果存在于CER和CEA以外的消息中,则验证应用程序Id AVP的值必须与Diameter消息头中存在的应用程序Id匹配。

6.9. Acct-Application-Id AVP
6.9. 帐户应用程序Id AVP

The Acct-Application-Id AVP (AVP Code 259) is of type Unsigned32 and is used in order to advertise support of the accounting portion of an application (see Section 2.4). If present in a message other than CER and CEA, the value of the Acct-Application-Id AVP MUST match the Application Id present in the Diameter message header.

账户应用程序Id AVP(AVP代码259)的类型为Unsigned32,用于公布对应用程序会计部分的支持(参见第2.4节)。如果存在于CER和CEA以外的消息中,则Acct应用程序Id AVP的值必须与Diameter消息头中存在的应用程序Id相匹配。

6.10. Inband-Security-Id AVP
6.10. 带内安全Id AVP

The Inband-Security-Id AVP (AVP Code 299) is of type Unsigned32 and is used in order to advertise support of the security portion of the application. The use of this AVP in CER and CEA messages is NOT RECOMMENDED. Instead, discovery of a Diameter entity's security capabilities can be done either through static configuration or via Diameter Peer Discovery as described in Section 5.2.

带内安全Id AVP(AVP代码299)的类型为Unsigned32,用于公布对应用程序安全部分的支持。不建议在CER和CEA消息中使用此AVP。相反,可以通过静态配置或第5.2节所述的Diameter对等发现来发现Diameter实体的安全功能。

The following values are supported:

支持以下值:

NO_INBAND_SECURITY 0

无带内安全0

This peer does not support TLS/TCP and DTLS/SCTP. This is the default value, if the AVP is omitted.

此对等方不支持TLS/TCP和DTLS/SCTP。如果省略AVP,这是默认值。

TLS 1

TLS 1

This node supports TLS/TCP [RFC5246] and DTLS/SCTP [RFC6083] security.

此节点支持TLS/TCP[RFC5246]和DTLS/SCTP[RFC6083]安全性。

6.11. Vendor-Specific-Application-Id AVP
6.11. 特定于供应商的应用程序Id AVP

The Vendor-Specific-Application-Id AVP (AVP Code 260) is of type Grouped and is used to advertise support of a vendor-specific Diameter application. Exactly one instance of either Auth-Application-Id or Acct-Application-Id AVP MUST be present. The Application Id carried by either Auth-Application-Id or Acct-Application-Id AVP MUST comply with vendor-specific Application Id assignment described in Section 11.3. It MUST also match the Application Id present in the Diameter header except when used in a CER or CEA message.

特定于供应商的应用程序Id AVP(AVP代码260)属于分组类型,用于公布对特定于供应商的应用程序的支持。必须仅存在一个身份验证应用程序Id或帐户应用程序Id AVP的实例。由Auth Application Id或Acct Application Id AVP携带的应用程序Id必须符合第11.3节中描述的供应商特定应用程序Id分配。除在CER或CEA消息中使用外,它还必须与直径标题中的应用程序Id匹配。

The Vendor-Id AVP is an informational AVP pertaining to the vendor who may have authorship of the vendor-specific Diameter application. It MUST NOT be used as a means of defining a completely separate vendor-specific Application Id space.

供应商Id AVP是关于可能拥有供应商特定直径应用程序作者的供应商的信息性AVP。不得将其用作定义完全独立的特定于供应商的应用程序Id空间的方法。

The Vendor-Specific-Application-Id AVP SHOULD be placed as close to the Diameter header as possible.

供应商特定的应用程序Id AVP应尽可能靠近直径集管。

AVP Format

AVP格式

      <Vendor-Specific-Application-Id> ::= < AVP Header: 260 >
                                           { Vendor-Id }
                                           [ Auth-Application-Id ]
                                           [ Acct-Application-Id ]
        
      <Vendor-Specific-Application-Id> ::= < AVP Header: 260 >
                                           { Vendor-Id }
                                           [ Auth-Application-Id ]
                                           [ Acct-Application-Id ]
        

A Vendor-Specific-Application-Id AVP MUST contain exactly one of either Auth-Application-Id or Acct-Application-Id. If a Vendor-Specific-Application-Id is received without one of these two AVPs, then the recipient SHOULD issue an answer with a Result-Code set to DIAMETER_MISSING_AVP. The answer SHOULD also include a Failed-AVP, which MUST contain an example of an Auth-Application-Id AVP and an Acct-Application-Id AVP.

特定于供应商的应用程序Id AVP必须正好包含Auth Application Id或Acct-Application-Id中的一个。如果收到的特定于供应商的应用程序Id没有这两个AVP中的一个,则收件人应发出一个答案,并将结果代码设置为DIAMETER_MISSING_AVP。答案还应包括失败的AVP,其中必须包含身份验证应用程序Id AVP和帐户应用程序Id AVP的示例。

If a Vendor-Specific-Application-Id is received that contains both Auth-Application-Id and Acct-Application-Id, then the recipient MUST issue an answer with Result-Code set to DIAMETER_AVP_OCCURS_TOO_MANY_TIMES. The answer MUST also include a Failed-AVP, which MUST contain the received Auth-Application-Id AVP and Acct-Application-Id AVP.

如果收到的供应商特定应用程序Id同时包含身份验证应用程序Id和账户应用程序Id,则收件人必须发出一个应答,应答结果代码设置为DIAMETER\u AVP\u ocurses\u TOO\u。答案还必须包括失败的AVP,该AVP必须包含收到的身份验证应用程序Id AVP和帐户应用程序Id AVP。

6.12. Redirect-Host AVP
6.12. 重定向主机AVP

The Redirect-Host AVP (AVP Code 292) is of type DiameterURI. One or more instances of this AVP MUST be present if the answer message's 'E' bit is set and the Result-Code AVP is set to DIAMETER_REDIRECT_INDICATION.

重定向主机AVP(AVP代码292)的类型为DiameterURI。如果应答消息的“E”位被设置,且结果代码AVP被设置为直径\重定向\指示,则必须存在该AVP的一个或多个实例。

Upon receiving the above, the receiving Diameter node SHOULD forward the request directly to one of the hosts identified in these AVPs. The server contained in the selected Redirect-Host AVP SHOULD be used for all messages matching the criteria set by the Redirect-Host-Usage AVP.

收到上述请求后,接收Diameter节点应将请求直接转发给这些avp中标识的主机之一。所选重定向主机AVP中包含的服务器应用于与重定向主机使用AVP设置的条件匹配的所有消息。

6.13. Redirect-Host-Usage AVP
6.13. 重定向主机使用AVP

The Redirect-Host-Usage AVP (AVP Code 261) is of type Enumerated. This AVP MAY be present in answer messages whose 'E' bit is set and the Result-Code AVP is set to DIAMETER_REDIRECT_INDICATION.

重定向主机使用AVP(AVP代码261)是枚举的类型。该AVP可能出现在设置了“E”位且结果代码AVP设置为DIAMETER_REDIRECT_指示的应答消息中。

When present, this AVP provides hints about how the routing entry resulting from the Redirect-Host is to be used. The following values are supported:

当存在时,此AVP提供有关如何使用重定向主机产生的路由条目的提示。支持以下值:

DONT_CACHE 0

不要缓存0

The host specified in the Redirect-Host AVP SHOULD NOT be cached. This is the default value.

不应缓存重定向主机AVP中指定的主机。这是默认值。

ALL_SESSION 1

所有课程1

All messages within the same session, as defined by the same value of the Session-ID AVP SHOULD be sent to the host specified in the Redirect-Host AVP.

由会话ID AVP的相同值定义的同一会话中的所有消息都应发送到重定向主机AVP中指定的主机。

ALL_REALM 2

全域2

All messages destined for the realm requested SHOULD be sent to the host specified in the Redirect-Host AVP.

所有发送到所请求领域的消息都应发送到重定向主机AVP中指定的主机。

REALM_AND_APPLICATION 3

领域和应用程序3

All messages for the application requested to the realm specified SHOULD be sent to the host specified in the Redirect-Host AVP.

请求到指定领域的应用程序的所有消息都应发送到重定向主机AVP中指定的主机。

ALL_APPLICATION 4

所有应用程序4

All messages for the application requested SHOULD be sent to the host specified in the Redirect-Host AVP.

应将请求的应用程序的所有消息发送到重定向主机AVP中指定的主机。

ALL_HOST 5

所有主持人5

All messages that would be sent to the host that generated the Redirect-Host SHOULD be sent to the host specified in the Redirect-Host AVP.

将发送到生成重定向主机的主机的所有消息都应发送到重定向主机AVP中指定的主机。

ALL_USER 6

所有用户6

All messages for the user requested SHOULD be sent to the host specified in the Redirect-Host AVP.

应将请求用户的所有消息发送到重定向主机AVP中指定的主机。

When multiple cached routes are created by redirect indications and they differ only in redirect usage and peers to forward requests to (see Section 6.1.8), a precedence rule MUST be applied to the redirect usage values of the cached routes during normal routing to resolve contentions that may occur. The precedence rule is the order that dictate which redirect usage should be considered before any other as they appear. The order is as follows:

当通过重定向指示创建多个缓存路由时,它们仅在重定向使用和转发请求的对等方方面有所不同(请参见第6.1.8节),在正常路由过程中,必须对缓存路由的重定向使用值应用优先规则,以解决可能发生的冲突。优先规则是一种顺序,它规定了在出现任何其他重定向用法之前,应该先考虑哪些重定向用法。命令如下:

1. ALL_SESSION

1. 全体会议

2. ALL_USER

2. 所有用户

3. REALM_AND_APPLICATION

3. 领域和应用程序

4. ALL_REALM

4. 全域

5. ALL_APPLICATION

5. 所有应用程序

6. ALL_HOST

6. 所有主机

6.14. Redirect-Max-Cache-Time AVP
6.14. 重定向最大缓存时间AVP

The Redirect-Max-Cache-Time AVP (AVP Code 262) is of type Unsigned32. This AVP MUST be present in answer messages whose 'E' bit is set, whose Result-Code AVP is set to DIAMETER_REDIRECT_INDICATION, and whose Redirect-Host-Usage AVP set to a non-zero value.

重定向最大缓存时间AVP(AVP代码262)的类型为Unsigned32。此AVP必须出现在应答消息中,其“E”位已设置,其结果代码AVP设置为DIAMETER_REDIRECT_指示,且其重定向主机使用AVP设置为非零值。

This AVP contains the maximum number of seconds the peer and route table entries, created as a result of the Redirect-Host, SHOULD be cached. Note that once a host is no longer reachable, any associated cache, peer, and routing table entries MUST be deleted.

此AVP包含因重定向主机而创建的对等和路由表项应缓存的最大秒数。请注意,一旦主机不再可访问,则必须删除所有关联的缓存、对等和路由表项。

7. Error Handling
7. 错误处理

There are two different types of errors in Diameter; protocol errors and application errors. A protocol error is one that occurs at the base protocol level and MAY require per-hop attention (e.g., a message routing error). Application errors, on the other hand, generally occur due to a problem with a function specified in a Diameter application (e.g., user authentication, missing AVP).

直径有两种不同类型的误差;协议错误和应用程序错误。协议错误发生在基本协议级别,可能需要每跳注意(例如,消息路由错误)。另一方面,应用程序错误通常是由于Diameter应用程序中指定的功能出现问题(例如,用户身份验证、缺少AVP)而导致的。

Result-Code AVP values that are used to report protocol errors MUST only be present in answer messages whose 'E' bit is set. When a request message is received that causes a protocol error, an answer message is returned with the 'E' bit set, and the Result-Code AVP is set to the appropriate protocol error value. As the answer is sent back towards the originator of the request, each proxy or relay agent MAY take action on the message.

用于报告协议错误的结果代码AVP值只能出现在设置了“E”位的应答消息中。当接收到导致协议错误的请求消息时,将返回带有“E”位设置的应答消息,并将结果代码AVP设置为适当的协议错误值。当应答被发送回请求的发起人时,每个代理或中继代理都可以对消息采取操作。

                          1. Request        +---------+ Link Broken
                +-------------------------->|Diameter |----///----+
                |     +---------------------|         |           v
         +------+--+  | 2. answer + 'E' set | Relay 2 |     +--------+
         |Diameter |<-+ (Unable to Forward) +---------+     |Diameter|
         |         |                                        |  Home  |
         | Relay 1 |--+                     +---------+     | Server |
         +---------+  |   3. Request        |Diameter |     +--------+
                      +-------------------->|         |           ^
                                            | Relay 3 |-----------+
                                            +---------+
        
                          1. Request        +---------+ Link Broken
                +-------------------------->|Diameter |----///----+
                |     +---------------------|         |           v
         +------+--+  | 2. answer + 'E' set | Relay 2 |     +--------+
         |Diameter |<-+ (Unable to Forward) +---------+     |Diameter|
         |         |                                        |  Home  |
         | Relay 1 |--+                     +---------+     | Server |
         +---------+  |   3. Request        |Diameter |     +--------+
                      +-------------------->|         |           ^
                                            | Relay 3 |-----------+
                                            +---------+
        

Figure 7: Example of Protocol Error Causing Answer Message

图7:导致应答消息的协议错误示例

Figure 7 provides an example of a message forwarded upstream by a Diameter relay. When the message is received by Relay 2, and it detects that it cannot forward the request to the home server, an answer message is returned with the 'E' bit set and the Result-Code AVP set to DIAMETER_UNABLE_TO_DELIVER. Given that this error falls within the protocol error category, Relay 1 would take special action, and given the error, attempt to route the message through its alternate Relay 3.

图7提供了Diameter中继向上游转发的消息示例。当中继2接收到消息,并且它检测到无法将请求转发到家庭服务器时,将返回一条应答消息,其中设置了“E”位,结果代码AVP设置为DIAMETER\u UNABLE\u to\u DELIVER。鉴于此错误属于协议错误类别,中继器1将采取特殊措施,并鉴于此错误,尝试通过其备用中继器3路由消息。

            +---------+ 1. Request  +---------+ 2. Request  +---------+
            | Access  |------------>|Diameter |------------>|Diameter |
            |         |             |         |             |  Home   |
            | Device  |<------------|  Relay  |<------------| Server  |
            +---------+  4. Answer  +---------+  3. Answer  +---------+
                       (Missing AVP)           (Missing AVP)
        
            +---------+ 1. Request  +---------+ 2. Request  +---------+
            | Access  |------------>|Diameter |------------>|Diameter |
            |         |             |         |             |  Home   |
            | Device  |<------------|  Relay  |<------------| Server  |
            +---------+  4. Answer  +---------+  3. Answer  +---------+
                       (Missing AVP)           (Missing AVP)
        

Figure 8: Example of Application Error Answer Message

图8:应用程序错误应答消息示例

Figure 8 provides an example of a Diameter message that caused an application error. When application errors occur, the Diameter entity reporting the error clears the 'R' bit in the Command Flags and adds the Result-Code AVP with the proper value. Application errors do not require any proxy or relay agent involvement; therefore, the message would be forwarded back to the originator of the request.

图8提供了导致应用程序错误的Diameter消息的示例。当出现应用程序错误时,报告错误的Diameter实体将清除命令标志中的“R”位,并将结果代码AVP与正确的值相加。应用程序错误不需要任何代理或中继代理参与;因此,消息将转发回请求的发起人。

In the case where the answer message itself contains errors, any related session SHOULD be terminated by sending an STR or ASR message. The Termination-Cause AVP in the STR MAY be filled with the appropriate value to indicate the cause of the error. An application MAY also send an application-specific request instead of an STR or ASR message to signal the error in the case where no state is maintained or to allow for some form of error recovery with the corresponding Diameter entity.

如果应答消息本身包含错误,则应通过发送STR或ASR消息终止任何相关会话。STR中的终止原因AVP可以填入适当的值,以指示错误的原因。应用程序还可以发送特定于应用程序的请求,而不是STR或ASR消息,以在没有保持状态的情况下发出错误信号,或者允许使用相应的Diameter实体进行某种形式的错误恢复。

There are certain Result-Code AVP application errors that require additional AVPs to be present in the answer. In these cases, the Diameter node that sets the Result-Code AVP to indicate the error MUST add the AVPs. Examples are as follows:

存在某些结果代码AVP应用程序错误,需要在答案中显示其他AVP。在这些情况下,设置结果代码AVP以指示错误的直径节点必须添加AVP。举例如下:

o A request with an unrecognized AVP is received with the 'M' bit (Mandatory bit) set causes an answer to be sent with the Result-Code AVP set to DIAMETER_AVP_UNSUPPORTED and the Failed-AVP AVP containing the offending AVP.

o 接收到带有无法识别的AVP的请求时,设置了“M”位(强制位)将导致发送应答,结果代码AVP设置为DIAMETER_AVP_UNSUPPORTED,失败的AVP AVP包含有问题的AVP。

o A request with an AVP that is received with an unrecognized value causes an answer to be returned with the Result-Code AVP set to DIAMETER_INVALID_AVP_VALUE, with the Failed-AVP AVP containing the AVP causing the error.

o 接收到的AVP请求的值无法识别,导致返回结果代码AVP设置为DIAMETER_INVALID_AVP_value,失败的AVP AVP包含导致错误的AVP。

o A received command that is missing AVPs that are defined as required in the commands CCF; examples are AVPs indicated as {AVP}. The receiver issues an answer with the Result-Code set to DIAMETER_MISSING_AVP and creates an AVP with the AVP Code and other fields set as expected in the missing AVP. The created AVP is then added to the Failed-AVP AVP.

o 接收到的命令缺少在命令CCF中定义为必需的AVP;示例是表示为{AVP}的AVP。接收器发出一个答案,结果代码设置为DIAMETER_MISSING_AVP,并创建一个AVP,其中AVP代码和其他字段设置为MISSING AVP中的预期值。然后将创建的AVP添加到失败的AVP AVP中。

The Result-Code AVP describes the error that the Diameter node encountered in its processing. In case there are multiple errors, the Diameter node MUST report only the first error it encountered (detected possibly in some implementation-dependent order). The specific errors that can be described by this AVP are described in the following section.

结果代码AVP描述了Diameter节点在处理过程中遇到的错误。如果存在多个错误,Diameter节点必须只报告它遇到的第一个错误(可能以某种依赖于实现的顺序检测到)。本AVP可以描述的具体错误在下一节中描述。

7.1. Result-Code AVP
7.1. 结果代码

The Result-Code AVP (AVP Code 268) is of type Unsigned32 and indicates whether a particular request was completed successfully or an error occurred. All Diameter answer messages in IETF-defined Diameter application specifications MUST include one Result-Code AVP. A non-successful Result-Code AVP (one containing a non-2xxx value other than DIAMETER_REDIRECT_INDICATION) MUST include the Error-Reporting-Host AVP if the host setting the Result-Code AVP is different from the identity encoded in the Origin-Host AVP.

结果代码AVP(AVP代码268)的类型为Unsigned32,指示特定请求是成功完成还是发生错误。IETF定义的Diameter应用规范中的所有Diameter应答消息必须包含一个结果代码AVP。如果设置结果代码AVP的主机与源主机AVP中编码的标识不同,则未成功的结果代码AVP(包含除直径\重定向\指示以外的非2xxx值)必须包括错误报告主机AVP。

The Result-Code data field contains an IANA-managed 32-bit address space representing errors (see Section 11.3.2). Diameter provides the following classes of errors, all identified by the thousands digit in the decimal notation:

结果代码数据字段包含表示错误的IANA管理的32位地址空间(见第11.3.2节)。Diameter提供以下类别的错误,所有错误均以十进制表示法中的千位数字表示:

o 1xxx (Informational)

o 1xxx(信息性)

o 2xxx (Success)

o 2xxx(成功)

o 3xxx (Protocol Errors)

o 3xxx(协议错误)

o 4xxx (Transient Failures)

o 4xxx(瞬时故障)

o 5xxx (Permanent Failure)

o 5xxx(永久性故障)

An unrecognized class (one whose first digit is not defined in this section) MUST be handled as a permanent failure.

无法识别的类(其第一个数字未在本节中定义)必须作为永久故障处理。

7.1.1. Informational
7.1.1. 信息的

Errors that fall within this category are used to inform the requester that a request could not be satisfied, and additional action is required on its part before access is granted.

属于此类的错误用于通知请求者无法满足请求,并且在授予访问权限之前,请求者需要采取额外的措施。

DIAMETER_MULTI_ROUND_AUTH 1001

直径多圆认证1001

This informational error is returned by a Diameter server to inform the access device that the authentication mechanism being used requires multiple round trips, and a subsequent request needs to be issued in order for access to be granted.

Diameter服务器返回此信息性错误,以通知访问设备所使用的身份验证机制需要多次往返,并且需要发出后续请求才能授予访问权限。

7.1.2. Success
7.1.2. 成功

Errors that fall within the Success category are used to inform a peer that a request has been successfully completed.

属于成功类别的错误用于通知对等方请求已成功完成。

DIAMETER_SUCCESS 2001

2001年的成功

The request was successfully completed.

请求已成功完成。

DIAMETER_LIMITED_SUCCESS 2002

DIAMETER_LIMITED_成功2002

When returned, the request was successfully completed, but additional processing is required by the application in order to provide service to the user.

返回时,请求已成功完成,但应用程序需要额外的处理才能向用户提供服务。

7.1.3. Protocol Errors
7.1.3. 协议错误

Errors that fall within the Protocol Error category SHOULD be treated on a per-hop basis, and Diameter proxies MAY attempt to correct the error, if it is possible. Note that these errors MUST only be used in answer messages whose 'E' bit is set.

属于协议错误类别的错误应按每跳处理,如果可能,Diameter代理可能会尝试更正错误。请注意,这些错误只能在设置了“E”位的应答消息中使用。

DIAMETER_COMMAND_UNSUPPORTED 3001

直径\u命令\u不支持3001

This error code is used when a Diameter entity receives a message with a Command Code that it does not support.

当Diameter实体接收到包含其不支持的命令代码的消息时,将使用此错误代码。

DIAMETER_UNABLE_TO_DELIVER 3002

直径\u无法\u交付\u 3002

This error is given when Diameter cannot deliver the message to the destination, either because no host within the realm supporting the required application was available to process the request or because the Destination-Host AVP was given without the associated Destination-Realm AVP.

当Diameter无法将消息传递到目标时,会出现此错误,这可能是因为域内没有支持所需应用程序的主机可用于处理请求,或者是因为提供的目标主机AVP没有关联的目标域AVP。

DIAMETER_REALM_NOT_SERVED 3003

直径\u领域\u未\u服务3003

The intended realm of the request is not recognized.

无法识别请求的预期领域。

DIAMETER_TOO_BUSY 3004

直径\u太忙\u 3004

When returned, a Diameter node SHOULD attempt to send the message to an alternate peer. This error MUST only be used when a specific server is requested, and it cannot provide the requested service.

返回时,Diameter节点应尝试将消息发送到备用对等方。此错误只能在请求特定服务器时使用,并且该服务器无法提供请求的服务。

DIAMETER_LOOP_DETECTED 3005

检测到直径\u环\u 3005

An agent detected a loop while trying to get the message to the intended recipient. The message MAY be sent to an alternate peer, if one is available, but the peer reporting the error has identified a configuration problem.

代理在尝试将邮件发送给目标收件人时检测到循环。消息可以发送到备用对等方(如果有),但报告错误的对等方已识别出配置问题。

DIAMETER_REDIRECT_INDICATION 3006

直径\u重定向\u指示3006

A redirect agent has determined that the request could not be satisfied locally, and the initiator of the request SHOULD direct the request directly to the server, whose contact information has been added to the response. When set, the Redirect-Host AVP MUST be present.

重定向代理已确定无法在本地满足请求,请求的发起人应将请求直接发送到服务器,服务器的联系信息已添加到响应中。设置时,重定向主机AVP必须存在。

DIAMETER_APPLICATION_UNSUPPORTED 3007

直径\u应用\u不支持3007

A request was sent for an application that is not supported.

为不受支持的应用程序发送了请求。

DIAMETER_INVALID_HDR_BITS 3008

直径\u无效\u HDR\u位3008

A request was received whose bits in the Diameter header were set either to an invalid combination or to a value that is inconsistent with the Command Code's definition.

收到一个请求,其Diameter头中的位被设置为无效组合或与命令代码定义不一致的值。

DIAMETER_INVALID_AVP_BITS 3009

直径\u无效\u平均值\u位3009

A request was received that included an AVP whose flag bits are set to an unrecognized value or that is inconsistent with the AVP's definition.

接收到一个请求,该请求包含一个AVP,其标志位被设置为无法识别的值,或者与AVP的定义不一致。

DIAMETER_UNKNOWN_PEER 3010

直径\u未知\u对等3010

A CER was received from an unknown peer.

从未知对等方接收到CER。

7.1.4. Transient Failures
7.1.4. 瞬时故障

Errors that fall within the transient failures category are used to inform a peer that the request could not be satisfied at the time it was received but MAY be able to satisfy the request in the future. Note that these errors MUST be used in answer messages whose 'E' bit is not set.

属于瞬态故障类别的错误用于通知对等方在收到请求时无法满足请求,但将来可能能够满足请求。请注意,这些错误必须在未设置“E”位的应答消息中使用。

DIAMETER_AUTHENTICATION_REJECTED 4001

直径\u认证\u被拒绝4001

The authentication process for the user failed, most likely due to an invalid password used by the user. Further attempts MUST only be tried after prompting the user for a new password.

用户的身份验证过程失败,很可能是由于用户使用的密码无效。只有在提示用户输入新密码后,才能尝试进一步尝试。

DIAMETER_OUT_OF_SPACE 4002

空间4002的直径

A Diameter node received the accounting request but was unable to commit it to stable storage due to a temporary lack of space.

Diameter节点接收到记帐请求,但由于临时空间不足,无法将其提交到稳定存储。

ELECTION_LOST 4003

选举失利4003

The peer has determined that it has lost the election process and has therefore disconnected the transport connection.

对等方已确定其已丢失选举过程,因此已断开传输连接。

7.1.5. Permanent Failures
7.1.5. 永久性故障

Errors that fall within the permanent failures category are used to inform the peer that the request failed and should not be attempted again. Note that these errors SHOULD be used in answer messages whose 'E' bit is not set. In error conditions where it is not possible or efficient to compose application-specific answer grammar, answer messages with the 'E' bit set and which comply to the grammar described in Section 7.2 MAY also be used for permanent errors.

属于永久故障类别的错误用于通知对等方请求失败,不应再次尝试。请注意,这些错误应在未设置“E”位的应答消息中使用。在无法或无法有效地编写特定于应用程序的应答语法的错误情况下,具有“E”位集且符合第7.2节所述语法的应答消息也可用于永久性错误。

DIAMETER_AVP_UNSUPPORTED 5001

直径\u平均值\u无支撑5001

The peer received a message that contained an AVP that is not recognized or supported and was marked with the 'M' (Mandatory) bit. A Diameter message with this error MUST contain one or more Failed-AVP AVPs containing the AVPs that caused the failure.

对等方收到一条消息,该消息包含一个不可识别或不受支持的AVP,并被标记为“M”(强制)位。带有此错误的Diameter消息必须包含一个或多个失败的AVP AVP,其中包含导致故障的AVP。

DIAMETER_UNKNOWN_SESSION_ID 5002

直径未知会话ID 5002

The request contained an unknown Session-Id.

请求包含未知的会话Id。

DIAMETER_AUTHORIZATION_REJECTED 5003

直径\u授权\u被拒绝5003

A request was received for which the user could not be authorized. This error could occur if the service requested is not permitted to the user.

接收到一个无法授权用户的请求。如果用户不允许请求的服务,则可能发生此错误。

DIAMETER_INVALID_AVP_VALUE 5004

直径\u无效\u平均值\u值5004

The request contained an AVP with an invalid value in its data portion. A Diameter message indicating this error MUST include the offending AVPs within a Failed-AVP AVP.

该请求包含数据部分中具有无效值的AVP。指示此错误的Diameter消息必须包括故障AVP AVP中的违规AVP。

DIAMETER_MISSING_AVP 5005

直径\u缺失\u AVP 5005

The request did not contain an AVP that is required by the Command Code definition. If this value is sent in the Result-Code AVP, a Failed-AVP AVP SHOULD be included in the message. The Failed-AVP AVP MUST contain an example of the missing AVP complete with the Vendor-Id if applicable. The value field of the missing AVP should be of correct minimum length and contain zeroes.

请求不包含命令代码定义所需的AVP。如果在结果代码AVP中发送此值,则消息中应包含失败的AVP AVP。失败的AVP AVP必须包含缺失的AVP示例,并附上供应商Id(如适用)。缺失AVP的值字段应具有正确的最小长度并包含零。

DIAMETER_RESOURCES_EXCEEDED 5006

直径超过5006

A request was received that cannot be authorized because the user has already expended allowed resources. An example of this error condition is when a user that is restricted to one dial-up PPP port attempts to establish a second PPP connection.

已收到无法授权的请求,因为用户已消耗了允许的资源。此错误情况的一个示例是,当限制为一个拨号PPP端口的用户尝试建立第二个PPP连接时。

DIAMETER_CONTRADICTING_AVPS 5007

直径与AVPS 5007相矛盾

The Home Diameter server has detected AVPs in the request that contradicted each other, and it is not willing to provide service to the user. The Failed-AVP AVP MUST be present, which contain the AVPs that contradicted each other.

Home Diameter服务器在请求中检测到相互矛盾的AVP,它不愿意向用户提供服务。失败的AVP AVP必须存在,其中包含相互矛盾的AVP。

DIAMETER_AVP_NOT_ALLOWED 5008

不允许的平均直径5008

A message was received with an AVP that MUST NOT be present. The Failed-AVP AVP MUST be included and contain a copy of the offending AVP.

接收到一条AVP消息,该AVP必须不存在。必须包括失败的AVP AVP,并包含有问题的AVP的副本。

DIAMETER_AVP_OCCURS_TOO_MANY_TIMES 5009

直径平均值出现次数过多5009

A message was received that included an AVP that appeared more often than permitted in the message definition. The Failed-AVP AVP MUST be included and contain a copy of the first instance of the offending AVP that exceeded the maximum number of occurrences.

接收到一条包含AVP的消息,该AVP出现的频率超过了消息定义中允许的频率。必须包括失败的AVP AVP,并包含超过最大出现次数的违规AVP的第一个实例的副本。

DIAMETER_NO_COMMON_APPLICATION 5010

直径\u无\u普通\u应用5010

This error is returned by a Diameter node that receives a CER whereby no applications are common between the CER sending peer and the CER receiving peer.

此错误由接收CER的Diameter节点返回,CER发送对等方和CER接收对等方之间没有共同的应用程序。

DIAMETER_UNSUPPORTED_VERSION 5011

直径不受支持版本5011

This error is returned when a request was received, whose version number is unsupported.

收到版本号不受支持的请求时返回此错误。

DIAMETER_UNABLE_TO_COMPLY 5012

直径不能符合5012

This error is returned when a request is rejected for unspecified reasons.

由于未指定的原因拒绝请求时,将返回此错误。

DIAMETER_INVALID_BIT_IN_HEADER 5013

直径\u头5013中的\u位\u无效

This error is returned when a reserved bit in the Diameter header is set to one (1) or the bits in the Diameter header are set incorrectly.

当直径标头中的保留位设置为一(1)或直径标头中的位设置不正确时,将返回此错误。

DIAMETER_INVALID_AVP_LENGTH 5014

直径\u无效\u平均值\u长度5014

The request contained an AVP with an invalid length. A Diameter message indicating this error MUST include the offending AVPs within a Failed-AVP AVP. In cases where the erroneous AVP length value exceeds the message length or is less than the minimum AVP header length, it is sufficient to include the offending AVP header and a zero filled payload of the minimum required length for the payloads data type. If the AVP is a Grouped AVP, the Grouped AVP header with an empty payload would be sufficient to indicate the offending AVP. In the case where the offending AVP header cannot be fully decoded when the AVP length is less than

请求包含长度无效的AVP。指示此错误的Diameter消息必须包括故障AVP AVP中的违规AVP。在错误的AVP长度值超过消息长度或小于最小AVP报头长度的情况下,包括有问题的AVP报头和有效载荷数据类型的最小所需长度的零填充有效载荷就足够了。如果AVP是分组AVP,则具有空有效负载的分组AVP报头将足以指示违规AVP。当AVP长度小于时,在有问题的AVP报头无法完全解码的情况下

the minimum AVP header length, it is sufficient to include an offending AVP header that is formulated by padding the incomplete AVP header with zero up to the minimum AVP header length.

最小AVP报头长度,包括一个有问题的AVP报头就足够了,该报头是通过将不完整的AVP报头填充为零,直到最小AVP报头长度。

DIAMETER_INVALID_MESSAGE_LENGTH 5015

直径\u无效\u消息\u长度5015

This error is returned when a request is received with an invalid message length.

当接收到消息长度无效的请求时,将返回此错误。

DIAMETER_INVALID_AVP_BIT_COMBO 5016

直径\u无效\u AVP\u位\u组合5016

The request contained an AVP with which is not allowed to have the given value in the AVP Flags field. A Diameter message indicating this error MUST include the offending AVPs within a Failed-AVP AVP.

该请求包含一个AVP,不允许其在AVP标志字段中具有给定值。指示此错误的Diameter消息必须包括故障AVP AVP中的违规AVP。

DIAMETER_NO_COMMON_SECURITY 5017

直径\u编号\u普通\u安全5017

This error is returned when a CER message is received, and there are no common security mechanisms supported between the peers. A Capabilities-Exchange-Answer (CEA) message MUST be returned with the Result-Code AVP set to DIAMETER_NO_COMMON_SECURITY.

当接收到CER消息且对等方之间不支持公共安全机制时,将返回此错误。返回功能交换应答(CEA)消息时,必须将结果代码AVP设置为DIAMETER\u NO\u COMMON\u SECURITY。

7.2. Error Bit
7.2. 错误位

The 'E' (Error Bit) in the Diameter header is set when the request caused a protocol-related error (see Section 7.1.3). A message with the 'E' bit MUST NOT be sent as a response to an answer message. Note that a message with the 'E' bit set is still subjected to the processing rules defined in Section 6.2. When set, the answer message will not conform to the CCF specification for the command; instead, it and will conform to the following CCF:

当请求导致协议相关错误时(见第7.1.3节),设置Diameter头中的“E”(错误位)。带有“E”位的消息不得作为应答消息的响应发送。请注意,设置了“E”位的消息仍需遵守第6.2节中定义的处理规则。设置时,应答消息将不符合命令的CCF规范;相反,它将符合以下CCF:

Message Format

消息格式

      <answer-message> ::= < Diameter Header: code, ERR [, PXY] >
                        0*1< Session-Id >
                           { Origin-Host }
                           { Origin-Realm }
                           { Result-Code }
                           [ Origin-State-Id ]
                           [ Error-Message ]
                           [ Error-Reporting-Host ]
                           [ Failed-AVP ]
                           [ Experimental-Result ]
                         * [ Proxy-Info ]
                         * [ AVP ]
        
      <answer-message> ::= < Diameter Header: code, ERR [, PXY] >
                        0*1< Session-Id >
                           { Origin-Host }
                           { Origin-Realm }
                           { Result-Code }
                           [ Origin-State-Id ]
                           [ Error-Message ]
                           [ Error-Reporting-Host ]
                           [ Failed-AVP ]
                           [ Experimental-Result ]
                         * [ Proxy-Info ]
                         * [ AVP ]
        

Note that the code used in the header is the same than the one found in the request message, but with the 'R' bit cleared and the 'E' bit set. The 'P' bit in the header is set to the same value as the one found in the request message.

请注意,标头中使用的代码与请求消息中的代码相同,但清除了“R”位并设置了“E”位。标头中的“P”位设置为与请求消息中的相同值。

7.3. Error-Message AVP
7.3. 错误消息AVP

The Error-Message AVP (AVP Code 281) is of type UTF8String. It MAY accompany a Result-Code AVP as a human-readable error message. The Error-Message AVP is not intended to be useful in an environment where error messages are processed automatically. It SHOULD NOT be expected that the content of this AVP be parsed by network entities.

错误消息AVP(AVP代码281)的类型为UTF8String。它可以作为人类可读的错误消息伴随结果代码AVP。错误消息AVP不适用于自动处理错误消息的环境。不应期望网络实体解析此AVP的内容。

7.4. Error-Reporting-Host AVP
7.4. 报告主机AVP时出错

The Error-Reporting-Host AVP (AVP Code 294) is of type DiameterIdentity. This AVP contains the identity of the Diameter host that sent the Result-Code AVP to a value other than 2001 (Success), only if the host setting the Result-Code is different from the one encoded in the Origin-Host AVP. This AVP is intended to be used for troubleshooting purposes, and it MUST be set when the Result-Code AVP indicates a failure.

错误报告主机AVP(AVP代码294)的类型为DiameterIdentity。仅当设置结果代码的主机与源主机AVP中编码的主机不同时,此AVP包含将结果代码AVP发送到除2001(成功)之外的值的Diameter主机的标识。该AVP旨在用于故障排除目的,必须在结果代码AVP指示故障时设置。

7.5. Failed-AVP AVP
7.5. 失败的AVP

The Failed-AVP AVP (AVP Code 279) is of type Grouped and provides debugging information in cases where a request is rejected or not fully processed due to erroneous information in a specific AVP. The value of the Result-Code AVP will provide information on the reason for the Failed-AVP AVP. A Diameter answer message SHOULD contain an instance of the Failed-AVP AVP that corresponds to the error indicated by the Result-Code AVP. For practical purposes, this Failed-AVP would typically refer to the first AVP processing error that a Diameter node encounters.

失败的AVP AVP(AVP代码279)属于分组类型,并且在由于特定AVP中的错误信息导致请求被拒绝或未完全处理的情况下提供调试信息。结果代码AVP的值将提供有关AVP AVP失败原因的信息。Diameter应答消息应包含与结果代码AVP指示的错误相对应的失败AVP AVP实例。出于实际目的,此失败的AVP通常指Diameter节点遇到的第一个AVP处理错误。

The possible reasons for this AVP are the presence of an improperly constructed AVP, an unsupported or unrecognized AVP, an invalid AVP value, the omission of a required AVP, the presence of an explicitly excluded AVP (see tables in Section 10) or the presence of two or more occurrences of an AVP that is restricted to 0, 1, or 0-1 occurrences.

该AVP的可能原因是存在构造不当的AVP、不受支持或无法识别的AVP、无效的AVP值、遗漏所需的AVP、存在明确排除的AVP(见第10节中的表格)或存在两次或两次以上限制为0、1或0-1次的AVP。

A Diameter message SHOULD contain one Failed-AVP AVP, containing the entire AVP that could not be processed successfully. If the failure reason is omission of a required AVP, an AVP with the missing AVP code, the missing Vendor-Id, and a zero-filled payload of the minimum required length for the omitted AVP will be added. If the failure reason is an invalid AVP length where the reported length is less

Diameter消息应包含一个失败的AVP AVP,其中包含无法成功处理的整个AVP。如果故障原因是遗漏了所需的AVP,则将添加一个带有遗漏的AVP代码的AVP、遗漏的供应商Id以及遗漏的AVP所需最小长度的零填充有效载荷。如果故障原因是报告长度小于的无效AVP长度

than the minimum AVP header length or greater than the reported message length, a copy of the offending AVP header and a zero-filled payload of the minimum required length SHOULD be added.

大于最小AVP头长度或大于报告的消息长度,应添加有问题的AVP头的副本和最小所需长度的零填充有效负载。

In the case where the offending AVP is embedded within a Grouped AVP, the Failed-AVP MAY contain the grouped AVP, which in turn contains the single offending AVP. The same method MAY be employed if the grouped AVP itself is embedded in yet another grouped AVP and so on. In this case, the Failed-AVP MAY contain the grouped AVP hierarchy up to the single offending AVP. This enables the recipient to detect the location of the offending AVP when embedded in a group.

在违规AVP嵌入分组AVP的情况下,故障AVP可能包含分组AVP,分组AVP又包含单个违规AVP。如果分组AVP本身嵌入到另一分组AVP中,则可以采用相同的方法,以此类推。在这种情况下,失败的AVP可能包含分组的AVP层次结构,直至单个违规AVP。这使接收者能够在嵌入到组中时检测出有问题的AVP的位置。

AVP Format

AVP格式

         <Failed-AVP> ::= < AVP Header: 279 >
                       1* {AVP}
        
         <Failed-AVP> ::= < AVP Header: 279 >
                       1* {AVP}
        
7.6. Experimental-Result AVP
7.6. 实验结果AVP

The Experimental-Result AVP (AVP Code 297) is of type Grouped, and indicates whether a particular vendor-specific request was completed successfully or whether an error occurred. This AVP has the following structure:

实验结果AVP(AVP代码297)属于分组类型,指示特定供应商的请求是否成功完成或是否发生错误。该AVP具有以下结构:

AVP Format

AVP格式

         Experimental-Result ::= < AVP Header: 297 >
                                 { Vendor-Id }
                                 { Experimental-Result-Code }
        
         Experimental-Result ::= < AVP Header: 297 >
                                 { Vendor-Id }
                                 { Experimental-Result-Code }
        

The Vendor-Id AVP (see Section 5.3.3) in this grouped AVP identifies the vendor responsible for the assignment of the result code that follows. All Diameter answer messages defined in vendor-specific applications MUST include either one Result-Code AVP or one Experimental-Result AVP.

本分组AVP中的供应商Id AVP(见第5.3.3节)标识了负责分配以下结果代码的供应商。供应商特定应用程序中定义的所有Diameter应答消息必须包含一个结果代码AVP或一个实验结果AVP。

7.7. Experimental-Result-Code AVP
7.7. 实验结果代码AVP

The Experimental-Result-Code AVP (AVP Code 298) is of type Unsigned32 and contains a vendor-assigned value representing the result of processing the request.

实验结果代码AVP(AVP代码298)的类型为Unsigned32,包含供应商分配的值,表示处理请求的结果。

It is recommended that vendor-specific result codes follow the same conventions given for the Result-Code AVP regarding the different types of result codes and the handling of errors (for non-2xxx values).

对于不同类型的结果代码和错误处理(对于非2xxx值),建议供应商特定的结果代码遵循为结果代码AVP提供的相同约定。

8. Diameter User Sessions
8. Diameter用户会话

In general, Diameter can provide two different types of services to applications. The first involves authentication and authorization, and it can optionally make use of accounting. The second only makes use of accounting.

通常,Diameter可以为应用程序提供两种不同类型的服务。第一个涉及身份验证和授权,它可以选择使用记帐。第二种方法只使用会计。

When a service makes use of the authentication and/or authorization portion of an application, and a user requests access to the network, the Diameter client issues an auth request to its local server. The auth request is defined in a service-specific Diameter application (e.g., NASREQ). The request contains a Session-Id AVP, which is used in subsequent messages (e.g., subsequent authorization, accounting, etc.) relating to the user's session. The Session-Id AVP is a means for the client and servers to correlate a Diameter message with a user session.

当服务使用应用程序的身份验证和/或授权部分,并且用户请求访问网络时,Diameter客户端向其本地服务器发出身份验证请求。认证请求在特定于服务的Diameter应用程序(例如NASREQ)中定义。该请求包含会话Id AVP,该会话Id AVP用于与用户会话相关的后续消息(例如,后续授权、记帐等)。会话Id AVP是客户端和服务器将Diameter消息与用户会话关联的一种方法。

When a Diameter server authorizes a user to implement network resources for a finite amount of time, and it is willing to extend the authorization via a future request, it MUST add the Authorization- Lifetime AVP to the answer message. The Authorization-Lifetime AVP defines the maximum number of seconds a user MAY make use of the resources before another authorization request is expected by the server. The Auth-Grace-Period AVP contains the number of seconds following the expiration of the Authorization-Lifetime, after which the server will release all state information related to the user's session. Note that if payment for services is expected by the serving realm from the user's home realm, the Authorization-Lifetime AVP, combined with the Auth-Grace-Period AVP, implies the maximum length of the session for which the home realm is willing to be fiscally responsible. Services provided past the expiration of the Authorization-Lifetime and Auth-Grace-Period AVPs are the responsibility of the access device. Of course, the actual cost of services rendered is clearly outside the scope of the protocol.

当Diameter服务器授权用户在有限的时间内实现网络资源,并且它愿意通过未来的请求扩展授权时,它必须将授权-生存期AVP添加到应答消息中。授权生存期AVP定义了在服务器预期另一个授权请求之前,用户可以使用资源的最大秒数。授权宽限期AVP包含授权生存期到期后的秒数,在此秒数之后,服务器将释放与用户会话相关的所有状态信息。请注意,如果服务领域期望从用户的主领域支付服务费用,则授权生存期AVP与身份验证宽限期AVP相结合,意味着主领域愿意承担财政责任的会话的最大长度。在授权生命周期和授权宽限期AVP到期后提供的服务由接入设备负责。当然,提供服务的实际成本显然超出了协议的范围。

An access device that does not expect to send a re-authorization or a session termination request to the server MAY include the Auth-Session-State AVP with the value set to NO_STATE_MAINTAINED as a hint to the server. If the server accepts the hint, it agrees that since no session termination message will be received once service to the user is terminated, it cannot maintain state for the session. If the answer message from the server contains a different value in the Auth-Session-State AVP (or the default value if the AVP is absent), the access device MUST follow the server's directives. Note that the value NO_STATE_MAINTAINED MUST NOT be set in subsequent re-authorization requests and answers.

不希望向服务器发送重新授权或会话终止请求的接入设备可以包括Auth会话状态AVP,其值设置为NO_State_,作为对服务器的提示。如果服务器接受该提示,则它同意,因为一旦终止对用户的服务,就不会收到会话终止消息,所以它无法维护会话的状态。如果来自服务器的应答消息在身份验证会话状态AVP中包含不同的值(如果没有AVP,则为默认值),则访问设备必须遵循服务器的指令。请注意,在随后的重新授权请求和应答中,不得设置NO_STATE_mainted值。

The base protocol does not include any authorization request messages, since these are largely application-specific and are defined in a Diameter application document. However, the base protocol does define a set of messages that are used to terminate user sessions. These are used to allow servers that maintain state information to free resources.

基本协议不包括任何授权请求消息,因为这些消息主要是特定于应用程序的,并且在Diameter应用程序文档中定义。但是,基本协议确实定义了一组用于终止用户会话的消息。这些用于允许维护状态信息的服务器释放资源。

When a service only makes use of the accounting portion of the Diameter protocol, even in combination with an application, the Session-Id is still used to identify user sessions. However, the session termination messages are not used, since a session is signaled as being terminated by issuing an accounting stop message.

当服务仅使用Diameter协议的记帐部分时,即使与应用程序结合使用,会话Id仍用于标识用户会话。但是,不使用会话终止消息,因为通过发出记帐停止消息,会话被通知为正在终止。

Diameter may also be used for services that cannot be easily categorized as authentication, authorization, or accounting (e.g., certain Third Generation Partnership Project Internet Multimedia System (3GPP IMS) interfaces). In such cases, the finite state machine defined in subsequent sections may not be applicable. Therefore, the application itself MAY need to define its own finite state machine. However, such application-specific state machines SHOULD follow the general state machine framework outlined in this document such as the use of Session-Id AVPs and the use of STR/STA, ASR/ASA messages for stateful sessions.

Diameter还可用于不能轻松归类为认证、授权或记帐的服务(例如,某些第三代合作伙伴项目互联网多媒体系统(3GPP IMS)接口)。在这种情况下,后续章节中定义的有限状态机可能不适用。因此,应用程序本身可能需要定义自己的有限状态机。但是,此类特定于应用程序的状态机应遵循本文档中概述的通用状态机框架,例如会话Id AVPs的使用以及有状态会话的STR/STA、ASR/ASA消息的使用。

8.1. Authorization Session State Machine
8.1. 授权会话状态机

This section contains a set of finite state machines, which represent the life cycle of Diameter sessions and which MUST be observed by all Diameter implementations that make use of the authentication and/or authorization portion of a Diameter application. The term "Service-Specific" below refers to a message defined in a Diameter application (e.g., Mobile IPv4, NASREQ).

本节包含一组有限状态机,这些状态机表示Diameter会话的生命周期,所有使用Diameter应用程序的身份验证和/或授权部分的Diameter实现都必须遵守这些状态机。下面的术语“特定于服务”是指在Diameter应用程序(例如,移动IPv4、NASREQ)中定义的消息。

There are four different authorization session state machines supported in the Diameter base protocol. The first two describe a session in which the server is maintaining session state, indicated by the value of the Auth-Session-State AVP (or its absence). One describes the session from a client perspective, the other from a server perspective. The second two state machines are used when the server does not maintain session state. Here again, one describes the session from a client perspective, the other from a server perspective.

Diameter基本协议支持四种不同的授权会话状态机。前两个描述服务器正在维护会话状态的会话,由Auth session state AVP的值(或其不存在)表示。一个从客户机角度描述会话,另一个从服务器角度描述会话。当服务器不维护会话状态时,使用第二个两个状态机。这里,一个从客户机角度描述会话,另一个从服务器角度描述会话。

When a session is moved to the Idle state, any resources that were allocated for the particular session must be released. Any event not listed in the state machines MUST be considered an error condition, and an answer, if applicable, MUST be returned to the originator of the message.

当会话移动到空闲状态时,必须释放为特定会话分配的所有资源。任何未在状态机中列出的事件都必须视为错误情况,并且如果适用,必须将答案返回给消息的发起人。

In the case that an application does not support re-auth, the state transitions related to server-initiated re-auth, when both client and server sessions maintain state (e.g., Send RAR, Pending, Receive RAA), MAY be ignored.

在应用程序不支持重新身份验证的情况下,当客户端和服务器会话都保持状态(例如,发送RAR、挂起、接收RAA)时,可能会忽略与服务器启动的重新身份验证相关的状态转换。

In the state table, the event "Failure to send X" means that the Diameter agent is unable to send command X to the desired destination. This could be due to the peer being down or due to the peer sending back a transient failure or temporary protocol error notification DIAMETER_TOO_BUSY or DIAMETER_LOOP_DETECTED in the Result-Code AVP of the corresponding Answer command. The event 'X successfully sent' is the complement of 'Failure to send X'.

在状态表中,“发送X失败”事件表示Diameter代理无法将命令X发送到所需的目标。这可能是由于对等机停机或对等机发回瞬态故障或临时协议错误通知DIAMETER\u TOO\u BUSY或DIAMETER\u LOOP\u(在相应应答命令的结果代码AVP中检测到)。事件“X成功发送”是“X发送失败”的补充。

The following state machine is observed by a client when state is maintained on the server:

在服务器上维护状态时,客户端会观察到以下状态机:

                              CLIENT, STATEFUL
      State     Event                          Action       New State
      ---------------------------------------------------------------
      Idle      Client or device requests      Send         Pending
                access                         service-
                                               specific
                                               auth req
        
                              CLIENT, STATEFUL
      State     Event                          Action       New State
      ---------------------------------------------------------------
      Idle      Client or device requests      Send         Pending
                access                         service-
                                               specific
                                               auth req
        

Idle ASR Received Send ASA Idle for unknown session with Result-Code = UNKNOWN_ SESSION_ID

Idle ASR接收发送ASA Idle用于未知会话,结果代码=未知会话ID

Idle RAR Received Send RAA Idle for unknown session with Result-Code = UNKNOWN_ SESSION_ID

Idle RAR接收发送RAA Idle用于未知会话,结果代码=未知会话ID

Pending Successful service-specific Grant Open authorization answer Access received with default Auth-Session-State value

使用默认身份验证会话状态值接收到挂起的特定于服务的授权打开授权应答访问

Pending Successful service-specific Sent STR Discon authorization answer received, but service not provided

已收到挂起的特定于服务的已发送STR Discon授权应答,但未提供服务

Pending Error processing successful Sent STR Discon service-specific authorization answer

处理成功发送的STR Discon服务特定授权应答的挂起错误

Pending Failed service-specific Clean up Idle authorization answer received

接收到挂起的失败服务特定清理空闲授权应答

Open User or client device Send Open requests access to service service-specific auth req

开放用户或客户端设备发送开放请求访问特定于服务的身份验证请求

Open Successful service-specific Provide Open authorization answer received service

打开成功的特定服务提供打开的授权应答接收服务

Open Failed service-specific Discon. Idle authorization answer user/device received.

打开失败的服务特定Discon。接收到空闲授权应答用户/设备。

Open RAR received and client will Send RAA Open perform subsequent re-auth with Result-Code = SUCCESS

Open RAR已收到,客户端将发送RAA Open执行后续重新验证,结果代码=SUCCESS

Open RAR received and client will Send RAA Idle not perform subsequent with re-auth Result-Code != SUCCESS, Discon. user/device

打开接收到的RAR,客户端将发送RAA Idle not perform后续重新验证结果代码!=成功,迪斯科。用户/设备

Open Session-Timeout expires on Send STR Discon access device

发送STR Discon访问设备上的打开会话超时过期

Open ASR received, Send ASA Discon client will comply with with request to end the Result-Code = session = SUCCESS, Send STR.

打开收到的ASR,发送ASA Discon客户端将按照请求结束结果代码=会话=成功,发送STR。

Open ASR Received, Send ASA Open client will not comply with with request to end the Result-Code != session != SUCCESS

收到打开ASR,发送ASA打开客户端将不符合结束结果代码的请求!=会话!=成功

Open Authorization-Lifetime + Send STR Discon Auth-Grace-Period expires on access device

在访问设备上打开授权生存期+发送STR Discon Auth宽限期到期

Discon ASR received Send ASA Discon

Discon ASR接收发送ASA Discon

Discon STA received Discon. Idle user/device

Discon STA收到Discon。空闲用户/设备

The following state machine is observed by a server when it is maintaining state for the session:

服务器在维护会话状态时会观察到以下状态机:

                             SERVER, STATEFUL
      State     Event                          Action       New State
      ---------------------------------------------------------------
      Idle      Service-specific authorization Send         Open
                request received, and          successful
                user is authorized             service-
                                               specific
                                               answer
        
                             SERVER, STATEFUL
      State     Event                          Action       New State
      ---------------------------------------------------------------
      Idle      Service-specific authorization Send         Open
                request received, and          successful
                user is authorized             service-
                                               specific
                                               answer
        

Idle Service-specific authorization Send Idle request received, and failed user is not authorized service-specific answer

收到空闲服务特定授权发送空闲请求,失败用户未获得特定服务授权应答

Open Service-specific authorization Send Open request received, and user successful is authorized service-specific answer

打开特定于服务的授权发送收到的打开请求,用户成功是特定于服务的授权应答

Open Service-specific authorization Send Idle request received, and user failed is not authorized service-specific answer, Clean up

打开收到的服务特定授权发送空闲请求,用户失败,未授权服务特定应答,清除

Open Home server wants to confirm Send RAR Pending authentication and/or authorization of the user

Open Home server希望确认发送RAR挂起用户的身份验证和/或授权

Pending Received RAA with a failed Clean up Idle Result-Code

挂起接收到的RAA,清除空闲结果代码失败

Pending Received RAA with Result-Code Update Open = SUCCESS session

挂起收到的RAA,结果代码更新打开=成功会话

Open Home server wants to Send ASR Discon terminate the service

Open Home server希望发送ASR Discon以终止服务

Open Authorization-Lifetime (and Clean up Idle Auth-Grace-Period) expires on home server

家庭服务器上的开放授权生存期(和清除空闲身份验证宽限期)过期

Open Session-Timeout expires on Clean up Idle home server

清理空闲主服务器上的打开会话超时过期

Discon Failure to send ASR Wait, Discon resend ASR

Discon发送ASR等待失败,Discon重新发送ASR

Discon ASR successfully sent and Clean up Idle ASA Received with Result-Code

Discon ASR成功发送并清除接收到的空闲ASA,结果代码为

Not ASA Received None No Change Discon

非ASA未收到任何变更Discon

Any STR Received Send STA, Idle Clean up

收到任何STR发送STA,空闲清理

The following state machine is observed by a client when state is not maintained on the server:

当服务器上未维护状态时,客户端会观察到以下状态机:

                              CLIENT, STATELESS
      State     Event                          Action       New State
      ---------------------------------------------------------------
      Idle      Client or device requests      Send         Pending
                access                         service-
                                               specific
                                               auth req
        
                              CLIENT, STATELESS
      State     Event                          Action       New State
      ---------------------------------------------------------------
      Idle      Client or device requests      Send         Pending
                access                         service-
                                               specific
                                               auth req
        

Pending Successful service-specific Grant Open authorization answer access received with Auth-Session-State set to NO_STATE_MAINTAINED

等待成功的特定于服务的授权打开授权应答访问,已接收到授权会话状态设置为NO_State_的访问

Pending Failed service-specific Clean up Idle authorization answer received

接收到挂起的失败服务特定清理空闲授权应答

Open Session-Timeout expires on Discon. Idle access device user/device

Discon上的打开会话超时过期。空闲访问设备用户/设备

Open Service to user is terminated Discon. Idle user/device

向用户开放的服务在Discon中终止。空闲用户/设备

The following state machine is observed by a server when it is not maintaining state for the session:

当服务器未维护会话状态时,会观察到以下状态机:

                              SERVER, STATELESS
      State     Event                          Action       New State
      ---------------------------------------------------------------
      Idle      Service-specific authorization Send         Idle
                request received, and          service-
                successfully processed         specific
                                               answer
        
                              SERVER, STATELESS
      State     Event                          Action       New State
      ---------------------------------------------------------------
      Idle      Service-specific authorization Send         Idle
                request received, and          service-
                successfully processed         specific
                                               answer
        
8.2. Accounting Session State Machine
8.2. 记帐会话状态机

The following state machines MUST be supported for applications that have an accounting portion or that require only accounting services. The first state machine is to be observed by clients.

具有记帐部分或仅需要记帐服务的应用程序必须支持以下状态机。客户端将观察第一个状态机。

See Section 9.7 for Accounting Command Codes and Section 9.8 for Accounting AVPs.

会计命令代码见第9.7节,会计AVP见第9.8节。

The server side in the accounting state machine depends in some cases on the particular application. The Diameter base protocol defines a default state machine that MUST be followed by all applications that have not specified other state machines. This is the second state machine in this section described below.

记帐状态机中的服务器端在某些情况下取决于特定的应用程序。Diameter base协议定义了默认状态机,所有未指定其他状态机的应用程序都必须遵循该默认状态机。这是本节中的第二个状态机,如下所述。

The default server side state machine requires the reception of accounting records in any order and at any time, and it does not place any standards requirement on the processing of these records. Implementations of Diameter may perform checking, ordering, correlation, fraud detection, and other tasks based on these records. AVPs may need to be inspected as a part of these tasks. The tasks can happen either immediately after record reception or in a post-processing phase. However, as these tasks are typically application or even policy dependent, they are not standardized by the Diameter specifications. Applications MAY define requirements on when to accept accounting records based on the used value of Accounting-Realtime-Required AVP, credit-limit checks, and so on.

默认的服务器端状态机要求在任何时间以任何顺序接收会计记录,并且不对这些记录的处理提出任何标准要求。Diameter的实现可以基于这些记录执行检查、排序、关联、欺诈检测和其他任务。AVP可能需要作为这些任务的一部分进行检查。这些任务可以在收到记录后立即执行,也可以在后处理阶段执行。但是,由于这些任务通常依赖于应用程序,甚至依赖于策略,因此它们没有通过直径规范进行标准化。应用程序可以根据会计实时所需AVP、信用限额检查等的使用值定义何时接受会计记录的要求。

However, the Diameter base protocol defines one optional server side state machine that MAY be followed by applications that require keeping track of the session state at the accounting server. Note that such tracking is incompatible with the ability to sustain long duration connectivity problems. Therefore, the use of this state machine is recommended only in applications where the value of the Accounting-Realtime-Required AVP is DELIVER_AND_GRANT; hence, accounting connectivity problems are required to cause the serviced user to be disconnected. Otherwise, records produced by the client

但是,Diameter基本协议定义了一个可选的服务器端状态机,应用程序可能会跟踪记帐服务器上的会话状态。请注意,这种跟踪与维持长时间连接问题的能力不兼容。因此,建议仅在会计实时所需AVP值为DELIVER_和_GRANT的应用中使用此状态机;因此,需要记帐连接问题来导致服务用户断开连接。否则,由客户生成的记录

may be lost by the server, which no longer accepts them after the connectivity is re-established. This state machine is the third state machine in this section. The state machine is supervised by a supervision session timer Ts, whose value should be reasonably higher than the Acct_Interim_Interval value. Ts MAY be set to two times the value of the Acct_Interim_Interval so as to avoid the accounting session in the Diameter server to change to Idle state in case of short transient network failure.

可能会被服务器丢失,在重新建立连接后,服务器不再接受它们。此状态机是本节中的第三个状态机。状态机由监控会话计时器Ts进行监控,其值应合理高于Acct_中间_间隔值。Ts可以设置为Acct_中间_间隔值的两倍,以避免Diameter服务器中的记帐会话在短暂网络故障时变为空闲状态。

Any event not listed in the state machines MUST be considered as an error condition, and a corresponding answer, if applicable, MUST be returned to the originator of the message.

任何未在状态机中列出的事件都必须视为错误情况,如果适用,必须将相应的答案返回给消息的发起人。

In the state table, the event "Failure to send" means that the Diameter client is unable to communicate with the desired destination. This could be due to the peer being down, or due to the peer sending back a transient failure or temporary protocol error notification DIAMETER_OUT_OF_SPACE, DIAMETER_TOO_BUSY, or DIAMETER_LOOP_DETECTED in the Result-Code AVP of the Accounting Answer command.

在状态表中,“发送失败”事件表示Diameter客户端无法与所需目标通信。这可能是由于对等机停机,或者是由于对等机发回暂时故障或临时协议错误通知DIAMETER_OUT_OF_SPACE,DIAMETER_TOO_BUSY,或者在Accounting Answer命令的结果代码AVP中检测到DIAMETER_LOOP_。

The event "Failed answer" means that the Diameter client received a non-transient failure notification in the Accounting Answer command.

事件“应答失败”表示Diameter客户端在Accounting answer命令中收到非暂时性故障通知。

Note that the action "Disconnect user/dev" MUST also have an effect on the authorization session state table, e.g., cause the STR message to be sent, if the given application has both authentication/ authorization and accounting portions.

请注意,如果给定应用程序同时具有身份验证/授权和记帐部分,则操作“Disconnect user/dev”还必须对授权会话状态表产生影响,例如,导致发送STR消息。

The states PendingS, PendingI, PendingL, PendingE, and PendingB stand for pending states to wait for an answer to an accounting request related to a Start, Interim, Stop, Event, or buffered record, respectively.

状态PendingS、PendingI、PendingL、PendingE和PendingB分别代表等待与开始、中间、停止、事件或缓冲记录相关的记帐请求的响应的挂起状态。

                            CLIENT, ACCOUNTING
      State     Event                          Action       New State
      ---------------------------------------------------------------
      Idle      Client or device requests      Send         PendingS
                access                         accounting
                                               start req.
        
                            CLIENT, ACCOUNTING
      State     Event                          Action       New State
      ---------------------------------------------------------------
      Idle      Client or device requests      Send         PendingS
                access                         accounting
                                               start req.
        

Idle Client or device requests Send PendingE a one-time service accounting event req

空闲客户端或设备请求向PendingE发送一个一次性服务记帐事件请求

Idle Records in storage Send PendingB record

存储器中的空闲记录发送挂起B记录

PendingS Successful accounting Open start answer received

已收到待决事项成功会计开放式开始回答

PendingS Failure to send and buffer Store Open space available and real time Start not equal to DELIVER_AND_GRANT Record

挂起发送和缓冲区存储可用开放空间失败,实时启动不等于交付和授予记录

PendingS Failure to send and no buffer Open space available and real time equal to GRANT_AND_LOSE

挂起发送失败,且没有可用的缓冲区开放空间,实时等于GRANT_和_LOSE

PendingS Failure to send and no Disconnect Idle buffer space available and user/dev real time not equal to GRANT_AND_LOSE

挂起发送失败且无断开连接可用空闲缓冲区空间,用户/开发人员实时不等于GRANT_和_LOSE

PendingS Failed accounting start answer Open received and real time equal to GRANT_AND_LOSE

PendingS Failed accounting start Response Open received实时等于GRANT_和_LOSE

PendingS Failed accounting start answer Disconnect Idle received and real time not user/dev equal to GRANT_AND_LOSE

挂起失败记帐开始应答断开连接收到空闲和实时用户/开发不等于授予和丢失

PendingS User service terminated Store PendingS stop record

挂起用户服务终止存储挂起停止记录

Open Interim interval elapses Send PendingI accounting interim record

打开临时间隔已过发送PendingI会计临时记录

Open User service terminated Send PendingL accounting stop req.

打开用户服务终止发送挂起记帐停止请求。

PendingI Successful accounting interim Open answer received

收到PendingI成功的会计期中公开回答

PendingI Failure to send and (buffer Store Open space available or old interim record can be overwritten) record and real time not equal to DELIVER_AND_GRANT

PendingI未能发送和(缓冲区存储开放空间可用或旧的临时记录可能被覆盖)记录和实时不等于交付和授予

PendingI Failure to send and no buffer Open space available and real time equal to GRANT_AND_LOSE

PendingI发送失败且没有可用的缓冲区开放空间,实时等于GRANT_和_LOSE

PendingI Failure to send and no Disconnect Idle buffer space available and user/dev real time not equal to GRANT_AND_LOSE

PendingI发送失败且无断开连接可用空闲缓冲区空间,用户/开发人员实时不等于GRANT_和_LOSE

PendingI Failed accounting interim Open answer received and real time equal to GRANT_AND_LOSE

收到PendingI未通过会计期中公开回答,实时等于GRANT_和_LOSE

PendingI Failed accounting interim Disconnect Idle answer received and user/dev real time not equal to GRANT_AND_LOSE

PendingI失败,收到空闲应答,用户/dev实时不等于GRANT_和_LOSE

PendingI User service terminated Store PendingI stop record PendingE Successful accounting Idle event answer received

PendingI用户服务已终止存储PendingI停止记录PendingE已收到成功的记帐空闲事件应答

PendingE Failure to send and buffer Store Idle space available event record

PendingE发送和缓冲区存储可用空闲空间失败事件记录

PendingE Failure to send and no buffer Idle space available

PendingE发送失败,没有可用的缓冲区空闲空间

PendingE Failed accounting event answer Idle received

收到PendingE失败的记帐事件应答空闲

PendingB Successful accounting answer Delete Idle received record

PendingB成功的会计应答删除空闲接收记录

PendingB Failure to send Idle

PendingB发送空闲数据失败

PendingB Failed accounting answer Delete Idle received record

PendingB会计应答失败删除空闲接收记录

PendingL Successful accounting Idle stop answer received

收到PendingL成功记帐空闲停止应答

PendingL Failure to send and buffer Store Idle space available stop record

PendingL发送和缓冲区存储空闲空间可用停止记录失败

PendingL Failure to send and no buffer Idle space available

PendingL发送失败,没有可用的缓冲区空闲空间

PendingL Failed accounting stop answer Idle received

收到PendingL失败的记帐停止应答空闲

                       SERVER, STATELESS ACCOUNTING
      State     Event                          Action       New State
      ---------------------------------------------------------------
        
                       SERVER, STATELESS ACCOUNTING
      State     Event                          Action       New State
      ---------------------------------------------------------------
        

Idle Accounting start request Send Idle received and successfully accounting processed. start answer

空闲记帐启动请求发送空闲已接收并已成功处理记帐。开始回答

Idle Accounting event request Send Idle received and successfully accounting processed. event answer

空闲记帐事件请求发送空闲已接收并已成功处理记帐。事件回答

Idle Interim record received Send Idle and successfully processed. accounting interim answer

收到空闲临时记录发送空闲并成功处理。会计中期答复

Idle Accounting stop request Send Idle received and successfully accounting processed stop answer

空闲记帐停止请求发送空闲收到并成功记帐处理停止应答

Idle Accounting request received; Send Idle no space left to store accounting records answer; Result-Code = OUT_OF_ SPACE

收到闲置会计请求;发送空闲无空间存储的会计记录应答;结果代码=空间不足

                            SERVER, STATEFUL ACCOUNTING
      State     Event                          Action       New State
      ---------------------------------------------------------------
        
                            SERVER, STATEFUL ACCOUNTING
      State     Event                          Action       New State
      ---------------------------------------------------------------
        

Idle Accounting start request Send Open received and successfully accounting processed. start answer; Start Ts

空闲记帐启动请求发送打开已收到并已成功处理记帐。开始回答;启动Ts

Idle Accounting event request Send Idle received and successfully accounting processed. event answer Idle Accounting request received; Send Idle no space left to store accounting records answer; Result-Code = OUT_OF_ SPACE

空闲记帐事件请求发送空闲已接收并已成功处理记帐。收到事件应答空闲记帐请求;发送空闲无空间存储的会计记录应答;结果代码=空间不足

Open Interim record received Send Open and successfully processed. accounting interim answer; Restart Ts

打开收到的临时记录发送打开并成功处理。会计中期答复;重新启动Ts

Open Accounting stop request Send Idle received and successfully accounting processed stop answer; Stop Ts

打开会计停止请求发送空闲接收并成功处理会计停止应答;停下来

      Open      Accounting request received;   Send         Idle
                no space left to store         accounting
                records                        answer;
                                               Result-Code =
                                               OUT_OF_
                                               SPACE;
                                               Stop Ts
        
      Open      Accounting request received;   Send         Idle
                no space left to store         accounting
                records                        answer;
                                               Result-Code =
                                               OUT_OF_
                                               SPACE;
                                               Stop Ts
        

Open Session supervision timer Ts Stop Ts Idle expired

打开会话监视计时器Ts停止Ts空闲已过期

8.3. Server-Initiated Re-Auth
8.3. 服务器启动的重新身份验证

A Diameter server may initiate a re-authentication and/or re-authorization service for a particular session by issuing a Re-Auth-Request (RAR).

Diameter服务器可以通过发出重新身份验证请求(RAR)为特定会话启动重新身份验证和/或重新授权服务。

For example, for prepaid services, the Diameter server that originally authorized a session may need some confirmation that the user is still using the services.

例如,对于预付费服务,最初授权会话的Diameter服务器可能需要确认用户仍在使用服务。

An access device that receives an RAR message with the Session-Id equal to a currently active session MUST initiate a re-auth towards the user, if the service supports this particular feature. Each Diameter application MUST state whether server-initiated re-auth is supported, since some applications do not allow access devices to prompt the user for re-auth.

如果服务支持此特定功能,则接收会话Id等于当前活动会话的RAR消息的访问设备必须向用户发起重新身份验证。每个Diameter应用程序必须说明是否支持服务器启动的重新身份验证,因为某些应用程序不允许访问设备提示用户重新身份验证。

8.3.1. Re-Auth-Request
8.3.1. 重新授权请求

The Re-Auth-Request (RAR), indicated by the Command Code set to 258 and the message flags' 'R' bit set, may be sent by any server to the access device that is providing session service, to request that the user be re-authenticated and/or re-authorized.

由设置为258的命令代码和消息标志“R”位集指示的重新身份验证请求(RAR)可由任何服务器发送到提供会话服务的接入设备,以请求对用户进行重新身份验证和/或重新授权。

Message Format

消息格式

         <RAR>  ::= < Diameter Header: 258, REQ, PXY >
                    < Session-Id >
                    { Origin-Host }
                    { Origin-Realm }
                    { Destination-Realm }
                    { Destination-Host }
                    { Auth-Application-Id }
                    { Re-Auth-Request-Type }
                    [ User-Name ]
                    [ Origin-State-Id ]
                  * [ Proxy-Info ]
                  * [ Route-Record ]
                  * [ AVP ]
        
         <RAR>  ::= < Diameter Header: 258, REQ, PXY >
                    < Session-Id >
                    { Origin-Host }
                    { Origin-Realm }
                    { Destination-Realm }
                    { Destination-Host }
                    { Auth-Application-Id }
                    { Re-Auth-Request-Type }
                    [ User-Name ]
                    [ Origin-State-Id ]
                  * [ Proxy-Info ]
                  * [ Route-Record ]
                  * [ AVP ]
        
8.3.2. Re-Auth-Answer
8.3.2. 重新验证答案

The Re-Auth-Answer (RAA), indicated by the Command Code set to 258 and the message flags' 'R' bit clear, is sent in response to the RAR. The Result-Code AVP MUST be present, and it indicates the disposition of the request.

重新验证应答(RAA)由设置为258的命令代码和消息标志“R”位清除指示,发送该应答以响应RAR。结果代码AVP必须存在,并且它指示请求的处理。

A successful RAA message MUST be followed by an application-specific authentication and/or authorization message.

成功的RAA消息后面必须有特定于应用程序的身份验证和/或授权消息。

Message Format

消息格式

         <RAA>  ::= < Diameter Header: 258, PXY >
                    < Session-Id >
                    { Result-Code }
                    { Origin-Host }
                    { Origin-Realm }
                    [ User-Name ]
                    [ Origin-State-Id ]
                    [ Error-Message ]
                    [ Error-Reporting-Host ]
                    [ Failed-AVP ]
                  * [ Redirect-Host ]
                    [ Redirect-Host-Usage ]
                    [ Redirect-Max-Cache-Time ]
                  * [ Proxy-Info ]
                  * [ AVP ]
        
         <RAA>  ::= < Diameter Header: 258, PXY >
                    < Session-Id >
                    { Result-Code }
                    { Origin-Host }
                    { Origin-Realm }
                    [ User-Name ]
                    [ Origin-State-Id ]
                    [ Error-Message ]
                    [ Error-Reporting-Host ]
                    [ Failed-AVP ]
                  * [ Redirect-Host ]
                    [ Redirect-Host-Usage ]
                    [ Redirect-Max-Cache-Time ]
                  * [ Proxy-Info ]
                  * [ AVP ]
        
8.4. Session Termination
8.4. 会话终止

It is necessary for a Diameter server that authorized a session, for which it is maintaining state, to be notified when that session is no longer active, both for tracking purposes as well as to allow stateful agents to release any resources that they may have provided for the user's session. For sessions whose state is not being maintained, this section is not used.

授权会话的Diameter服务器需要在该会话不再处于活动状态时得到通知,以便进行跟踪,并允许有状态代理释放其为用户会话提供的任何资源。对于未维护其状态的会话,不使用此部分。

When a user session that required Diameter authorization terminates, the access device that provided the service MUST issue a Session-Termination-Request (STR) message to the Diameter server that authorized the service, to notify it that the session is no longer active. An STR MUST be issued when a user session terminates for any reason, including user logoff, expiration of Session-Timeout, administrative action, termination upon receipt of an Abort-Session-Request (see below), orderly shutdown of the access device, etc.

当需要Diameter授权的用户会话终止时,提供服务的访问设备必须向授权该服务的Diameter服务器发出会话终止请求(STR)消息,通知其会话不再处于活动状态。当用户会话因任何原因终止时,必须发出STR,包括用户注销、会话超时过期、管理操作、在收到中止会话请求时终止(见下文)、有序关闭访问设备等。

The access device also MUST issue an STR for a session that was authorized but never actually started. This could occur, for example, due to a sudden resource shortage in the access device, or because the access device is unwilling to provide the type of service requested in the authorization, or because the access device does not support a mandatory AVP returned in the authorization, etc.

访问设备还必须为已授权但从未实际启动的会话发出STR。这可能发生,例如,由于接入设备中的突然资源短缺,或者因为接入设备不愿意提供授权中请求的服务类型,或者因为接入设备不支持授权中返回的强制AVP,等等。

It is also possible that a session that was authorized is never actually started due to action of a proxy. For example, a proxy may

也有可能由于代理的操作,已授权的会话从未实际启动。例如,代理可以

modify an authorization answer, converting the result from success to failure, prior to forwarding the message to the access device. If the answer did not contain an Auth-Session-State AVP with the value NO_STATE_MAINTAINED, a proxy that causes an authorized session not to be started MUST issue an STR to the Diameter server that authorized the session, since the access device has no way of knowing that the session had been authorized.

在将消息转发到接入设备之前,修改授权应答,将结果从成功转换为失败。如果答案不包含值为NO_State_maintenanted的身份验证会话状态AVP,则导致授权会话未启动的代理必须向授权会话的Diameter服务器发出STR,因为访问设备无法知道会话已被授权。

A Diameter server that receives an STR message MUST clean up resources (e.g., session state) associated with the Session-Id specified in the STR and return a Session-Termination-Answer.

接收STR消息的Diameter服务器必须清理与STR中指定的会话Id关联的资源(例如,会话状态),并返回会话终止应答。

A Diameter server also MUST clean up resources when the Session-Timeout expires, or when the Authorization-Lifetime and the Auth-Grace-Period AVPs expire without receipt of a re-authorization request, regardless of whether an STR for that session is received. The access device is not expected to provide service beyond the expiration of these timers; thus, expiration of either of these timers implies that the access device may have unexpectedly shut down.

Diameter服务器还必须在会话超时到期时清理资源,或者在授权生存期和授权宽限期AVP到期而未收到重新授权请求时清理资源,无论是否收到该会话的STR。接入设备预计不会在这些定时器到期后提供服务;因此,这些定时器中的任何一个的到期意味着接入设备可能已经意外地关闭。

8.4.1. Session-Termination-Request
8.4.1. 会话终止请求

The Session-Termination-Request (STR), indicated by the Command Code set to 275 and the Command Flags' 'R' bit set, is sent by a Diameter client or by a Diameter proxy to inform the Diameter server that an authenticated and/or authorized session is being terminated.

会话终止请求(STR)由设置为275的命令代码和设置的命令标志“R”位表示,由Diameter客户端或Diameter代理发送,以通知Diameter服务器正在终止经过身份验证和/或授权的会话。

Message Format

消息格式

        <STR>  ::= < Diameter Header: 275, REQ, PXY >
                   < Session-Id >
                   { Origin-Host }
                   { Origin-Realm }
                   { Destination-Realm }
                   { Auth-Application-Id }
                   { Termination-Cause }
                   [ User-Name ]
                   [ Destination-Host ]
                 * [ Class ]
                   [ Origin-State-Id ]
                 * [ Proxy-Info ]
                 * [ Route-Record ]
                 * [ AVP ]
        
        <STR>  ::= < Diameter Header: 275, REQ, PXY >
                   < Session-Id >
                   { Origin-Host }
                   { Origin-Realm }
                   { Destination-Realm }
                   { Auth-Application-Id }
                   { Termination-Cause }
                   [ User-Name ]
                   [ Destination-Host ]
                 * [ Class ]
                   [ Origin-State-Id ]
                 * [ Proxy-Info ]
                 * [ Route-Record ]
                 * [ AVP ]
        
8.4.2. Session-Termination-Answer
8.4.2. 会话终止应答

The Session-Termination-Answer (STA), indicated by the Command Code set to 275 and the message flags' 'R' bit clear, is sent by the Diameter server to acknowledge the notification that the session has been terminated. The Result-Code AVP MUST be present, and it MAY contain an indication that an error occurred while servicing the STR.

Diameter服务器发送会话终止应答(STA),由设置为275的命令代码和消息标志“R”位清除指示,以确认会话已终止的通知。结果代码AVP必须存在,并且可能包含维修STR时发生错误的指示。

Upon sending or receipt of the STA, the Diameter server MUST release all resources for the session indicated by the Session-Id AVP. Any intermediate server in the Proxy-Chain MAY also release any resources, if necessary.

发送或接收STA后,Diameter服务器必须释放会话Id AVP指示的会话的所有资源。如有必要,代理链中的任何中间服务器也可以释放任何资源。

Message Format

消息格式

         <STA> ::= < Diameter Header: 275, PXY >
                    < Session-Id >
                    { Result-Code }
                    { Origin-Host }
                    { Origin-Realm }
                    [ User-Name ]
                  * [ Class ]
                    [ Error-Message ]
                    [ Error-Reporting-Host ]
                    [ Failed-AVP ]
                    [ Origin-State-Id ]
                  * [ Redirect-Host ]
                    [ Redirect-Host-Usage ]
                    [ Redirect-Max-Cache-Time ]
                  * [ Proxy-Info ]
                  * [ AVP ]
        
         <STA> ::= < Diameter Header: 275, PXY >
                    < Session-Id >
                    { Result-Code }
                    { Origin-Host }
                    { Origin-Realm }
                    [ User-Name ]
                  * [ Class ]
                    [ Error-Message ]
                    [ Error-Reporting-Host ]
                    [ Failed-AVP ]
                    [ Origin-State-Id ]
                  * [ Redirect-Host ]
                    [ Redirect-Host-Usage ]
                    [ Redirect-Max-Cache-Time ]
                  * [ Proxy-Info ]
                  * [ AVP ]
        
8.5. Aborting a Session
8.5. 中止会话

A Diameter server may request that the access device stop providing service for a particular session by issuing an Abort-Session-Request (ASR).

Diameter服务器可以通过发出中止会话请求(ASR)来请求接入设备停止为特定会话提供服务。

For example, the Diameter server that originally authorized the session may be required to cause that session to be stopped for lack of credit or other reasons that were not anticipated when the session was first authorized.

例如,最初授权该会话的Diameter服务器可能需要导致该会话因缺乏信用或其他原因而停止,这些原因在会话首次授权时是不可预料的。

An access device that receives an ASR with Session-ID equal to a currently active session MAY stop the session. Whether the access device stops the session or not is implementation and/or configuration dependent. For example, an access device may honor ASRs from certain agents only. In any case, the access device MUST

接收会话ID等于当前活动会话的ASR的接入设备可以停止会话。接入设备是否停止会话取决于实现和/或配置。例如,接入设备可能只接受来自某些代理的ASR。在任何情况下,接入设备必须

respond with an Abort-Session-Answer, including a Result-Code AVP to indicate what action it took.

使用中止会话应答进行响应,包括结果代码AVP,以指示所采取的操作。

8.5.1. Abort-Session-Request
8.5.1. 中止会话请求

The Abort-Session-Request (ASR), indicated by the Command Code set to 274 and the message flags' 'R' bit set, may be sent by any Diameter server or any Diameter proxy to the access device that is providing session service, to request that the session identified by the Session-Id be stopped.

中止会话请求(ASR)由设置为274的命令代码和消息标志“R”位集指示,可由任何Diameter服务器或任何Diameter代理发送到提供会话服务的访问设备,以请求停止会话Id标识的会话。

Message Format

消息格式

         <ASR>  ::= < Diameter Header: 274, REQ, PXY >
                    < Session-Id >
                    { Origin-Host }
                    { Origin-Realm }
                    { Destination-Realm }
                    { Destination-Host }
                    { Auth-Application-Id }
                    [ User-Name ]
                    [ Origin-State-Id ]
                  * [ Proxy-Info ]
                  * [ Route-Record ]
                  * [ AVP ]
        
         <ASR>  ::= < Diameter Header: 274, REQ, PXY >
                    < Session-Id >
                    { Origin-Host }
                    { Origin-Realm }
                    { Destination-Realm }
                    { Destination-Host }
                    { Auth-Application-Id }
                    [ User-Name ]
                    [ Origin-State-Id ]
                  * [ Proxy-Info ]
                  * [ Route-Record ]
                  * [ AVP ]
        
8.5.2. Abort-Session-Answer
8.5.2. 中止会话应答

The Abort-Session-Answer (ASA), indicated by the Command Code set to 274 and the message flags' 'R' bit clear, is sent in response to the ASR. The Result-Code AVP MUST be present and indicates the disposition of the request.

中止会话应答(ASA)由设置为274的命令代码和消息标志“R”位清除指示,发送该应答以响应ASR。结果代码AVP必须存在,并指示请求的处理。

If the session identified by Session-Id in the ASR was successfully terminated, the Result-Code is set to DIAMETER_SUCCESS. If the session is not currently active, the Result-Code is set to DIAMETER_UNKNOWN_SESSION_ID. If the access device does not stop the session for any other reason, the Result-Code is set to DIAMETER_UNABLE_TO_COMPLY.

如果ASR中由会话Id标识的会话已成功终止,则结果代码将设置为DIAMETER\u SUCCESS。如果会话当前未处于活动状态,则结果代码将设置为DIAMETER\u UNKNOWN\u session\u ID。如果访问设备未因任何其他原因停止会话,则结果代码将设置为DIAMETER\u UNABLE\u to\u Compliance。

Message Format

消息格式

         <ASA>  ::= < Diameter Header: 274, PXY >
                    < Session-Id >
                    { Result-Code }
                    { Origin-Host }
                    { Origin-Realm }
                    [ User-Name ]
                    [ Origin-State-Id ]
                    [ Error-Message ]
                    [ Error-Reporting-Host ]
                    [ Failed-AVP ]
                  * [ Redirect-Host ]
                    [ Redirect-Host-Usage ]
                    [ Redirect-Max-Cache-Time ]
                  * [ Proxy-Info ]
                  * [ AVP ]
        
         <ASA>  ::= < Diameter Header: 274, PXY >
                    < Session-Id >
                    { Result-Code }
                    { Origin-Host }
                    { Origin-Realm }
                    [ User-Name ]
                    [ Origin-State-Id ]
                    [ Error-Message ]
                    [ Error-Reporting-Host ]
                    [ Failed-AVP ]
                  * [ Redirect-Host ]
                    [ Redirect-Host-Usage ]
                    [ Redirect-Max-Cache-Time ]
                  * [ Proxy-Info ]
                  * [ AVP ]
        
8.6. Inferring Session Termination from Origin-State-Id
8.6. 从原始状态Id推断会话终止

The Origin-State-Id is used to allow detection of terminated sessions for which no STR would have been issued, due to unanticipated shutdown of an access device.

原始状态Id用于检测由于访问设备意外关闭而不会发出STR的终止会话。

A Diameter client or access device increments the value of the Origin-State-Id every time it is started or powered up. The new Origin-State-Id is then sent in the CER/CEA message immediately upon connection to the server. The Diameter server receiving the new Origin-State-Id can determine whether the sending Diameter client had abruptly shut down by comparing the old value of the Origin-State-Id it has kept for that specific client is less than the new value and whether it has un-terminated sessions originating from that client.

Diameter客户端或访问设备在每次启动或通电时都会增加原始状态Id的值。连接到服务器后,新的原始状态Id立即在CER/CEA消息中发送。接收新的源状态Id的Diameter服务器可以通过比较发送Diameter客户端为该特定客户端保留的源状态Id的旧值是否小于新值以及是否有来自该客户端的未终止会话来确定发送Diameter客户端是否突然关闭。

An access device can also include the Origin-State-Id in request messages other than the CER if there are relays or proxies in between the access device and the server. In this case, however, the server cannot discover that the access device has been restarted unless and until it receives a new request from it. Therefore, this mechanism is more opportunistic across proxies and relays.

如果在接入设备和服务器之间存在中继或代理,则接入设备还可以在除CER之外的请求消息中包括源状态Id。但是,在这种情况下,服务器无法发现访问设备已重新启动,除非并直到它收到来自它的新请求。因此,这种机制在代理和中继之间更具机会主义。

The Diameter server may assume that all sessions that were active prior to detection of a client restart have been terminated. The Diameter server MAY clean up all session state associated with such lost sessions, and it MAY also issue STRs for all such lost sessions that were authorized on upstream servers, to allow session state to be cleaned up globally.

Diameter服务器可能假设在检测到客户端重新启动之前处于活动状态的所有会话都已终止。Diameter服务器可以清理与此类丢失会话相关联的所有会话状态,并且还可以为上游服务器上授权的所有此类丢失会话颁发STR,以允许全局清理会话状态。

8.7. Auth-Request-Type AVP
8.7. 身份验证请求类型AVP

The Auth-Request-Type AVP (AVP Code 274) is of type Enumerated and is included in application-specific auth requests to inform the peers whether a user is to be authenticated only, authorized only, or both. Note any value other than both MAY cause RADIUS interoperability issues. The following values are defined:

身份验证请求类型AVP(AVP代码274)是枚举的类型,并且包括在特定于应用程序的身份验证请求中,以通知对等方是否仅对用户进行身份验证、仅对其进行授权,或者两者都进行身份验证。注:除两者之外的任何值都可能导致RADIUS互操作性问题。定义了以下值:

AUTHENTICATE_ONLY 1

仅验证1

The request being sent is for authentication only, and it MUST contain the relevant application-specific authentication AVPs that are needed by the Diameter server to authenticate the user.

发送的请求仅用于身份验证,它必须包含Diameter服务器验证用户所需的相关特定于应用程序的身份验证AVP。

AUTHORIZE_ONLY 2

仅授权2

The request being sent is for authorization only, and it MUST contain the application-specific authorization AVPs that are necessary to identify the service being requested/offered.

发送的请求仅用于授权,并且必须包含识别所请求/提供的服务所需的特定于应用程序的授权AVP。

AUTHORIZE_AUTHENTICATE 3

授权/验证3

The request contains a request for both authentication and authorization. The request MUST include both the relevant application-specific authentication information and authorization information necessary to identify the service being requested/ offered.

该请求包含对身份验证和授权的请求。请求必须包括相关的特定于应用程序的身份验证信息和识别所请求/提供的服务所需的授权信息。

8.8. Session-Id AVP
8.8. 会话Id AVP

The Session-Id AVP (AVP Code 263) is of type UTF8String and is used to identify a specific session (see Section 8). All messages pertaining to a specific session MUST include only one Session-Id AVP, and the same value MUST be used throughout the life of a session. When present, the Session-Id SHOULD appear immediately following the Diameter header (see Section 3).

会话Id AVP(AVP代码263)为UTF8String类型,用于识别特定会话(参见第8节)。与特定会话相关的所有消息必须仅包含一个会话Id AVP,并且在会话的整个生命周期中必须使用相同的值。出现时,会话Id应紧跟在直径标题之后(见第3节)。

The Session-Id MUST be globally and eternally unique, as it is meant to uniquely identify a user session without reference to any other information, and it may be needed to correlate historical authentication information with accounting information. The Session-Id includes a mandatory portion and an implementation-defined portion; a recommended format for the implementation-defined portion is outlined below.

会话Id必须是全局且永久唯一的,因为它意味着在不参考任何其他信息的情况下唯一地标识用户会话,并且可能需要将历史身份验证信息与记帐信息关联起来。会话Id包括强制部分和实现定义部分;下面概述了实施定义部分的推荐格式。

The Session-Id MUST begin with the sender's identity encoded in the DiameterIdentity type (see Section 4.3.1). The remainder of the Session-Id is delimited by a ";" character, and it MAY be any

会话Id必须以直径类型编码的发送方身份开始(见第4.3.1节)。会话Id的其余部分由“;”字符分隔,可以是任意字符

sequence that the client can guarantee to be eternally unique; however, the following format is recommended, (square brackets [] indicate an optional element):

客户可以保证永远唯一的顺序;但是,建议使用以下格式(方括号[]表示可选元素):

      <DiameterIdentity>;<high 32 bits>;<low 32 bits>[;<optional value>]
        
      <DiameterIdentity>;<high 32 bits>;<low 32 bits>[;<optional value>]
        

<high 32 bits> and <low 32 bits> are decimal representations of the high and low 32 bits of a monotonically increasing 64-bit value. The 64-bit value is rendered in two part to simplify formatting by 32-bit processors. At startup, the high 32 bits of the 64-bit value MAY be initialized to the time in NTP format [RFC5905], and the low 32 bits MAY be initialized to zero. This will for practical purposes eliminate the possibility of overlapping Session-Ids after a reboot, assuming the reboot process takes longer than a second. Alternatively, an implementation MAY keep track of the increasing value in non-volatile memory.

<高32位>和<低32位>是单调递增64位值的高32位和低32位的十进制表示。64位值分两部分呈现,以简化32位处理器的格式设置。启动时,64位值的高32位可初始化为NTP格式[RFC5905]的时间,低32位可初始化为零。这将为实际目的消除重新启动后会话ID重叠的可能性,前提是重新启动过程耗时超过一秒钟。或者,实现可以跟踪非易失性存储器中的增加值。

<optional value> is implementation specific, but it may include a modem's device Id, a Layer 2 address, timestamp, etc.

<optional value>是特定于实现的,但它可能包括调制解调器的设备Id、第2层地址、时间戳等。

Example, in which there is no optional value:

示例,其中没有可选值:

accesspoint7.example.com;1876543210;523

accesspoint7.example.com;1876543210;523

Example, in which there is an optional value:

示例,其中有一个可选值:

     accesspoint7.example.com;1876543210;523;mobile@200.1.1.88
        
     accesspoint7.example.com;1876543210;523;mobile@200.1.1.88
        

The Session-Id is created by the Diameter application initiating the session, which, in most cases, is done by the client. Note that a Session-Id MAY be used for both the authentication, authorization, and accounting commands of a given application.

会话Id由启动会话的Diameter应用程序创建,在大多数情况下,会话Id由客户端完成。请注意,会话Id可用于给定应用程序的身份验证、授权和记帐命令。

8.9. Authorization-Lifetime AVP
8.9. 授权生存期AVP

The Authorization-Lifetime AVP (AVP Code 291) is of type Unsigned32 and contains the maximum number of seconds of service to be provided to the user before the user is to be re-authenticated and/or re-authorized. Care should be taken when the Authorization-Lifetime value is determined, since a low, non-zero value could create significant Diameter traffic, which could congest both the network and the agents.

授权生存期AVP(AVP代码291)的类型为Unsigned32,并且包含在对用户进行重新认证和/或重新授权之前向用户提供服务的最大秒数。在确定授权生存期值时应小心,因为较低的非零值可能会产生较大的直径流量,这可能导致网络和代理拥塞。

A value of zero (0) means that immediate re-auth is necessary by the access device. The absence of this AVP, or a value of all ones (meaning all bits in the 32-bit field are set to one) means no re-auth is expected.

值为零(0)表示访问设备需要立即重新身份验证。如果没有此AVP,或值为all one(意味着32位字段中的所有位都设置为1),则表示不需要重新验证。

If both this AVP and the Session-Timeout AVP are present in a message, the value of the latter MUST NOT be smaller than the Authorization-Lifetime AVP.

如果消息中同时存在此AVP和会话超时AVP,则后者的值不得小于授权生存期AVP。

An Authorization-Lifetime AVP MAY be present in re-authorization messages, and it contains the number of seconds the user is authorized to receive service from the time the re-auth answer message is received by the access device.

授权生存期AVP可以存在于重新授权消息中,并且它包含从接入设备接收到重新授权应答消息时起用户被授权接收服务的秒数。

This AVP MAY be provided by the client as a hint of the maximum lifetime that it is willing to accept. The server MUST return a value that is equal to, or smaller than, the one provided by the client.

该AVP可由客户提供,作为其愿意接受的最长生存期的提示。服务器返回的值必须等于或小于客户端提供的值。

8.10. Auth-Grace-Period AVP
8.10. 授权宽限期

The Auth-Grace-Period AVP (AVP Code 276) is of type Unsigned32 and contains the number of seconds the Diameter server will wait following the expiration of the Authorization-Lifetime AVP before cleaning up resources for the session.

身份验证宽限期AVP(AVP代码276)的类型为Unsigned32,包含Diameter服务器在授权生存期AVP过期后,在清理会话资源之前将等待的秒数。

8.11. Auth-Session-State AVP
8.11. 身份验证会话状态AVP

The Auth-Session-State AVP (AVP Code 277) is of type Enumerated and specifies whether state is maintained for a particular session. The client MAY include this AVP in requests as a hint to the server, but the value in the server's answer message is binding. The following values are supported:

身份验证会话状态AVP(AVP代码277)属于枚举类型,并指定是否为特定会话维护状态。客户端可以在请求中包含此AVP作为对服务器的提示,但服务器应答消息中的值是绑定的。支持以下值:

STATE_MAINTAINED 0

状态保持0

This value is used to specify that session state is being maintained, and the access device MUST issue a session termination message when service to the user is terminated. This is the default value.

该值用于指定正在维护会话状态,并且当终止对用户的服务时,访问设备必须发出会话终止消息。这是默认值。

NO_STATE_MAINTAINED 1

无状态1

This value is used to specify that no session termination messages will be sent by the access device upon expiration of the Authorization-Lifetime.

此值用于指定在授权生存期到期时,访问设备不会发送任何会话终止消息。

8.12. Re-Auth-Request-Type AVP
8.12. 重新验证请求类型AVP

The Re-Auth-Request-Type AVP (AVP Code 285) is of type Enumerated and is included in application-specific auth answers to inform the client of the action expected upon expiration of the Authorization-Lifetime.

重新身份验证请求类型AVP(AVP代码285)属于枚举类型,并包含在特定于应用程序的身份验证应答中,以在授权生命周期到期时通知客户端预期的操作。

If the answer message contains an Authorization-Lifetime AVP with a positive value, the Re-Auth-Request-Type AVP MUST be present in an answer message. The following values are defined:

如果应答消息包含具有正值的授权生存期AVP,则应答消息中必须存在重新验证请求类型AVP。定义了以下值:

AUTHORIZE_ONLY 0

仅授权0

An authorization only re-auth is expected upon expiration of the Authorization-Lifetime. This is the default value if the AVP is not present in answer messages that include the Authorization-Lifetime.

在授权生存期到期时,需要仅授权的重新授权。如果AVP未出现在包含授权生存期的应答消息中,则这是默认值。

AUTHORIZE_AUTHENTICATE 1

授权/验证1

An authentication and authorization re-auth is expected upon expiration of the Authorization-Lifetime.

在授权生存期到期时,需要进行身份验证和授权重新验证。

8.13. Session-Timeout AVP
8.13. 会话超时

The Session-Timeout AVP (AVP Code 27) [RFC2865] is of type Unsigned32 and contains the maximum number of seconds of service to be provided to the user before termination of the session. When both the Session-Timeout and the Authorization-Lifetime AVPs are present in an answer message, the former MUST be equal to or greater than the value of the latter.

会话超时AVP(AVP代码27)[RFC2865]的类型为Unsigned32,并且包含在会话终止之前向用户提供服务的最大秒数。当应答消息中同时存在会话超时和授权生存期AVP时,前者必须等于或大于后者的值。

A session that terminates on an access device due to the expiration of the Session-Timeout MUST cause an STR to be issued, unless both the access device and the home server had previously agreed that no session termination messages would be sent (see Section 8).

由于会话超时过期而在访问设备上终止的会话必须导致发出STR,除非访问设备和家庭服务器之前都同意不发送会话终止消息(参见第8节)。

A Session-Timeout AVP MAY be present in a re-authorization answer message, and it contains the remaining number of seconds from the beginning of the re-auth.

会话超时AVP可能出现在重新授权应答消息中,它包含从重新授权开始的剩余秒数。

A value of zero, or the absence of this AVP, means that this session has an unlimited number of seconds before termination.

值为零或没有此AVP表示此会话在终止前有无限秒数。

This AVP MAY be provided by the client as a hint of the maximum timeout that it is willing to accept. However, the server MAY return a value that is equal to, or smaller than, the one provided by the client.

该AVP可由客户端提供,作为其愿意接受的最大超时的提示。但是,服务器返回的值可能等于或小于客户端提供的值。

8.14. User-Name AVP
8.14. 用户名AVP

The User-Name AVP (AVP Code 1) [RFC2865] is of type UTF8String, which contains the User-Name, in a format consistent with the NAI specification [RFC4282].

用户名AVP(AVP代码1)[RFC2865]为UTF8String类型,其中包含用户名,格式与NAI规范[RFC4282]一致。

8.15. Termination-Cause AVP
8.15. 终止原因

The Termination-Cause AVP (AVP Code 295) is of type Enumerated, and is used to indicate the reason why a session was terminated on the access device. The currently assigned values for this AVP can be found in the IANA registry for Termination-Cause AVP Values [IANATCV].

终止原因AVP(AVP代码295)是枚举的类型,用于指示会话在接入设备上终止的原因。当前为此AVP分配的值可在IANA注册表中找到终止原因AVP值[IANATCV]。

8.16. Origin-State-Id AVP
8.16. 起源国Id AVP

The Origin-State-Id AVP (AVP Code 278), of type Unsigned32, is a monotonically increasing value that is advanced whenever a Diameter entity restarts with loss of previous state, for example, upon reboot. Origin-State-Id MAY be included in any Diameter message, including CER.

类型为Unsigned32的原始状态Id AVP(AVP代码278)是一个单调递增的值,每当Diameter实体在丢失先前状态的情况下重新启动时(例如,在重新启动时),该值将提前。原始状态Id可以包含在任何Diameter消息中,包括CER。

A Diameter entity issuing this AVP MUST create a higher value for this AVP each time its state is reset. A Diameter entity MAY set Origin-State-Id to the time of startup, or it MAY use an incrementing counter retained in non-volatile memory across restarts.

每次重置此AVP的状态时,发出此AVP的Diameter实体必须为此AVP创建更高的值。Diameter实体可以将原始状态Id设置为启动时间,也可以在重启期间使用非易失性内存中保留的递增计数器。

The Origin-State-Id, if present, MUST reflect the state of the entity indicated by Origin-Host. If a proxy modifies Origin-Host, it MUST either remove Origin-State-Id or modify it appropriately as well. Typically, Origin-State-Id is used by an access device that always starts up with no active sessions; that is, any session active prior to restart will have been lost. By including Origin-State-Id in a message, it allows other Diameter entities to infer that sessions associated with a lower Origin-State-Id are no longer active. If an access device does not intend for such inferences to be made, it MUST either not include Origin-State-Id in any message or set its value to 0.

原始状态Id(如果存在)必须反映原始主机指示的实体状态。如果代理修改源主机,则必须删除源状态Id或对其进行适当修改。通常,原始状态Id由总是在没有活动会话的情况下启动的接入设备使用;也就是说,重新启动之前的任何活动会话都将丢失。通过在消息中包含原始状态Id,它允许其他Diameter实体推断与较低原始状态Id关联的会话不再处于活动状态。如果访问设备不打算进行此类推断,则它必须在任何消息中不包含原始状态Id,或将其值设置为0。

8.17. Session-Binding AVP
8.17. 会话绑定AVP

The Session-Binding AVP (AVP Code 270) is of type Unsigned32, and it MAY be present in application-specific authorization answer messages. If present, this AVP MAY inform the Diameter client that all future application-specific re-auth and Session-Termination-Request messages for this session MUST be sent to the same authorization server.

会话绑定AVP(AVP代码270)的类型为Unsigned32,它可能出现在特定于应用程序的授权应答消息中。如果存在,该AVP可能会通知Diameter客户端,该会话的所有未来特定于应用程序的重新身份验证和会话终止请求消息必须发送到同一授权服务器。

This field is a bit mask, and the following bits have been defined:

该字段是位掩码,定义了以下位:

RE_AUTH 1

重新授权1

When set, future re-auth messages for this session MUST NOT include the Destination-Host AVP. When cleared, the default value, the Destination-Host AVP MUST be present in all re-auth messages for this session.

设置后,此会话的未来重新身份验证消息不得包括目标主机AVP。清除此选项时,默认值“目标主机AVP”必须出现在此会话的所有重新身份验证消息中。

STR 2

str2

When set, the STR message for this session MUST NOT include the Destination-Host AVP. When cleared, the default value, the Destination-Host AVP MUST be present in the STR message for this session.

设置后,此会话的STR消息不得包括目标主机AVP。清除时,默认值为目标主机AVP必须出现在该会话的STR消息中。

ACCOUNTING 4

会计4

When set, all accounting messages for this session MUST NOT include the Destination-Host AVP. When cleared, the default value, the Destination-Host AVP, if known, MUST be present in all accounting messages for this session.

设置后,此会话的所有记帐消息不得包括目标主机AVP。清除此选项后,默认值目标主机AVP(如果已知)必须出现在此会话的所有记帐消息中。

8.18. Session-Server-Failover AVP
8.18. 会话服务器故障转移AVP

The Session-Server-Failover AVP (AVP Code 271) is of type Enumerated and MAY be present in application-specific authorization answer messages that either do not include the Session-Binding AVP or include the Session-Binding AVP with any of the bits set to a zero value. If present, this AVP MAY inform the Diameter client that if a re-auth or STR message fails due to a delivery problem, the Diameter client SHOULD issue a subsequent message without the Destination-Host AVP. When absent, the default value is REFUSE_SERVICE.

会话服务器故障转移AVP(AVP代码271)是枚举的类型,并且可以存在于不包括会话绑定AVP或包括会话绑定AVP且任何比特设置为零值的应用特定授权应答消息中。如果存在,此AVP可通知Diameter客户端,如果由于传递问题导致重新验证或STR消息失败,Diameter客户端应在没有目标主机AVP的情况下发出后续消息。不存在时,默认值为拒绝服务。

The following values are supported:

支持以下值:

REFUSE_SERVICE 0

拒绝服务0

If either the re-auth or the STR message delivery fails, terminate service with the user and do not attempt any subsequent attempts.

如果重新验证或STR消息传递失败,请终止与用户的服务,并且不要尝试任何后续尝试。

TRY_AGAIN 1

再试一次1

If either the re-auth or the STR message delivery fails, resend the failed message without the Destination-Host AVP present.

如果重新验证或STR消息传递失败,请在目标主机AVP不存在的情况下重新发送失败的消息。

ALLOW_SERVICE 2

允许_服务2

If re-auth message delivery fails, assume that re-authorization succeeded. If STR message delivery fails, terminate the session.

如果重新授权消息传递失败,则假定重新授权成功。如果STR消息传递失败,请终止会话。

TRY_AGAIN_ALLOW_SERVICE 3

请重试\u是否允许\u服务3

If either the re-auth or the STR message delivery fails, resend the failed message without the Destination-Host AVP present. If the second delivery fails for re-auth, assume re-authorization succeeded. If the second delivery fails for STR, terminate the session.

如果重新验证或STR消息传递失败,请在目标主机AVP不存在的情况下重新发送失败的消息。如果重新授权的第二次传递失败,则假定重新授权成功。如果STR的第二次传递失败,请终止会话。

8.19. Multi-Round-Time-Out AVP
8.19. 多轮超时AVP

The Multi-Round-Time-Out AVP (AVP Code 272) is of type Unsigned32 and SHOULD be present in application-specific authorization answer messages whose Result-Code AVP is set to DIAMETER_MULTI_ROUND_AUTH. This AVP contains the maximum number of seconds that the access device MUST provide the user in responding to an authentication request.

多轮超时AVP(AVP代码272)的类型为Unsigned32,应出现在结果代码AVP设置为DIAMETER\u Multi\u Round\u AUTH的特定于应用程序的授权应答消息中。此AVP包含接入设备在响应身份验证请求时必须向用户提供的最大秒数。

8.20. Class AVP
8.20. 类AVP

The Class AVP (AVP Code 25) is of type OctetString and is used by Diameter servers to return state information to the access device. When one or more Class AVPs are present in application-specific authorization answer messages, they MUST be present in subsequent re-authorization, session termination and accounting messages. Class AVPs found in a re-authorization answer message override the ones found in any previous authorization answer message. Diameter server implementations SHOULD NOT return Class AVPs that require more than 4096 bytes of storage on the Diameter client. A Diameter client that receives Class AVPs whose size exceeds local available storage MUST terminate the session.

AVP类(AVP代码25)为OctetString类型,由Diameter服务器用于向访问设备返回状态信息。当一个或多个类AVP出现在特定于应用程序的授权应答消息中时,它们必须出现在随后的重新授权、会话终止和记帐消息中。在重新授权应答消息中找到的类AVP覆盖在任何以前的授权应答消息中找到的类AVP。Diameter服务器实现不应返回在Diameter客户端上需要4096字节以上存储的类AVP。接收大小超过本地可用存储的AVP类的Diameter客户端必须终止会话。

8.21. Event-Timestamp AVP
8.21. 事件时间戳

The Event-Timestamp (AVP Code 55) is of type Time and MAY be included in an Accounting-Request and Accounting-Answer messages to record the time that the reported event occurred, in seconds since January 1, 1900 00:00 UTC.

事件时间戳(AVP代码55)为时间类型,可包含在记帐请求和记帐应答消息中,以记录报告事件发生的时间,以秒为单位,从1900年1月1日00:00 UTC开始。

9. Accounting
9. 会计

This accounting protocol is based on a server directed model with capabilities for real-time delivery of accounting information. Several fault resilience methods [RFC2975] have been built into the protocol in order minimize loss of accounting data in various fault situations and under different assumptions about the capabilities of the used devices.

此记帐协议基于服务器导向模型,具有实时传递记帐信息的功能。协议中内置了几种故障恢复方法[RFC2975],以便在各种故障情况下以及对所用设备能力的不同假设下,将记帐数据的损失降至最低。

9.1. Server Directed Model
9.1. 服务器导向模型

The server directed model means that the device generating the accounting data gets information from either the authorization server (if contacted) or the accounting server regarding the way accounting data shall be forwarded. This information includes accounting record timeliness requirements.

服务器导向模型意味着生成会计数据的设备从授权服务器(如果联系)或会计服务器获取有关会计数据转发方式的信息。该信息包括会计记录及时性要求。

As discussed in [RFC2975], real-time transfer of accounting records is a requirement, such as the need to perform credit-limit checks and fraud detection. Note that batch accounting is not a requirement, and is therefore not supported by Diameter. Should batched accounting be required in the future, a new Diameter application will need to be created, or it could be handled using another protocol. Note, however, that even if at the Diameter layer, accounting requests are processed one by one; transport protocols used under Diameter typically batch several requests in the same packet under heavy traffic conditions. This may be sufficient for many applications.

如[RFC2975]所述,会计记录的实时传输是一项要求,例如需要执行信用额度检查和欺诈检测。请注意,批量核算不是一项要求,因此直径不支持批量核算。如果将来需要成批记帐,则需要创建新的Diameter应用程序,或者可以使用其他协议处理。然而,请注意,即使在Diameter层,记帐请求也会逐个处理;在Diameter下使用的传输协议通常在高流量条件下对同一数据包中的多个请求进行批处理。这对于许多应用来说已经足够了。

The authorization server (chain) directs the selection of proper transfer strategy, based on its knowledge of the user and relationships of roaming partnerships. The server (or agents) uses the Acct-Interim-Interval and Accounting-Realtime-Required AVPs to control the operation of the Diameter peer operating as a client. The Acct-Interim-Interval AVP, when present, instructs the Diameter node acting as a client to produce accounting records continuously even during a session. Accounting-Realtime-Required AVP is used to control the behavior of the client when the transfer of accounting records from the Diameter client is delayed or unsuccessful.

授权服务器(链)根据其对用户和漫游伙伴关系的了解,指导选择适当的传输策略。服务器(或代理)使用Acct中间间隔和会计实时所需的AVP来控制作为客户端运行的Diameter对等机的操作。Acct中间间隔AVP(如果存在)指示充当客户端的Diameter节点连续生成会计记录,即使在会话期间也是如此。Accounting Realtime Required AVP用于在Diameter客户端的会计记录传输延迟或不成功时控制客户端的行为。

The Diameter accounting server MAY override the interim interval or the real-time requirements by including the Acct-Interim-Interval or Accounting-Realtime-Required AVP in the Accounting-Answer message. When one of these AVPs is present, the latest value received SHOULD be used in further accounting activities for the same session.

Diameter accounting server可以通过在accounting应答消息中包含Acct Missional interval或accounting Realtime Required AVP来覆盖临时间隔或实时要求。当其中一个AVP存在时,收到的最新值应用于同一会话的进一步记帐活动。

9.2. Protocol Messages
9.2. 协议消息

A Diameter node that receives a successful authentication and/or authorization message from the Diameter server SHOULD collect accounting information for the session. The Accounting-Request message is used to transmit the accounting information to the Diameter server, which MUST reply with the Accounting-Answer message to confirm reception. The Accounting-Answer message includes the Result-Code AVP, which MAY indicate that an error was present in the accounting message. The value of the Accounting-Realtime-Required AVP received earlier for the session in question may indicate that the user's session has to be terminated when a rejected Accounting-Request message was received.

从Diameter服务器接收成功身份验证和/或授权消息的Diameter节点应收集会话的记帐信息。记帐请求消息用于将记帐信息传输到Diameter服务器,Diameter服务器必须使用记帐应答消息进行应答以确认接收。记帐应答消息包括结果代码AVP,这可能表明记帐消息中存在错误。先前接收到的有关会话的Accounting Realtime Required AVP的值可能表明,当接收到拒绝的记帐请求消息时,必须终止用户的会话。

9.3. Accounting Application Extension and Requirements
9.3. 会计应用程序扩展和要求

Each Diameter application (e.g., NASREQ, Mobile IP) SHOULD define its service-specific AVPs that MUST be present in the Accounting-Request message in a section titled "Accounting AVPs". The application MUST assume that the AVPs described in this document will be present in all Accounting messages, so only their respective service-specific AVPs need to be defined in that section.

每个Diameter应用程序(如NASREQ、移动IP)应定义其特定于服务的AVP,这些AVP必须出现在标题为“会计AVP”的部分中的会计请求消息中。应用程序必须假设本文档中描述的AVP将出现在所有记帐消息中,因此该部分只需定义其各自的特定于服务的AVP。

Applications have the option of using one or both of the following accounting application extension models:

应用程序可以选择使用以下一种或两种会计应用程序扩展模型:

Split Accounting Service

分割会计服务

The accounting message will carry the Application Id of the Diameter base accounting application (see Section 2.4). Accounting messages may be routed to Diameter nodes other than the corresponding Diameter application. These nodes might be centralized accounting servers that provide accounting service for multiple different Diameter applications. These nodes MUST advertise the Diameter base accounting Application Id during capabilities exchange.

记帐消息将携带直径基础记帐应用程序的应用程序Id(见第2.4节)。记帐消息可以路由到Diameter节点,而不是相应的Diameter应用程序。这些节点可能是为多个不同直径的应用程序提供记帐服务的集中式记帐服务器。在功能交换期间,这些节点必须公布Diameter base accounting应用程序Id。

Coupled Accounting Service

耦合会计服务

The accounting message will carry the Application Id of the application that is using it. The application itself will process the received accounting records or forward them to an accounting server. There is no accounting application advertisement required during capabilities exchange, and the accounting messages will be routed the same way as any of the other application messages.

记帐消息将携带正在使用它的应用程序的应用程序Id。应用程序本身将处理收到的会计记录或将其转发给会计服务器。在功能交换期间不需要记帐应用程序播发,记帐消息的路由方式将与任何其他应用程序消息相同。

In cases where an application does not define its own accounting service, it is preferred that the split accounting model be used.

如果应用程序没有定义自己的会计服务,则最好使用拆分会计模型。

9.4. Fault Resilience
9.4. 故障恢复能力

Diameter base protocol mechanisms are used to overcome small message loss and network faults of a temporary nature.

Diameter基本协议机制用于克服暂时性的小消息丢失和网络故障。

Diameter peers acting as clients MUST implement the use of failover to guard against server failures and certain network failures. Diameter peers acting as agents or related off-line processing systems MUST detect duplicate accounting records caused by the sending of the same record to several servers and duplication of messages in transit. This detection MUST be based on the inspection of the Session-Id and Accounting-Record-Number AVP pairs. Appendix C discusses duplicate detection needs and implementation issues.

充当客户机的Diameter对等机必须实现故障切换,以防止服务器故障和某些网络故障。充当代理或相关离线处理系统的Diameter对等方必须检测到由于向多个服务器发送相同记录和传输中重复消息而导致的重复记帐记录。此检测必须基于对会话Id和记帐记录编号AVP对的检查。附录C讨论了重复检测需求和实施问题。

Diameter clients MAY have non-volatile memory for the safe storage of accounting records over reboots or extended network failures, network partitions, and server failures. If such memory is available, the client SHOULD store new accounting records there as soon as the records are created and until a positive acknowledgement of their reception from the Diameter server has been received. Upon a reboot, the client MUST start sending the records in the non-volatile memory to the accounting server with the appropriate modifications in termination cause, session length, and other relevant information in the records.

Diameter客户端可能具有非易失性内存,用于在重新启动或扩展网络故障、网络分区和服务器故障时安全存储记帐记录。如果此类内存可用,则客户机应在创建记录后立即将新的会计记录存储在那里,直到收到Diameter服务器对其接收的肯定确认。重新启动后,客户端必须开始将非易失性内存中的记录发送到记帐服务器,并对终止原因、会话长度和记录中的其他相关信息进行适当修改。

A further application of this protocol may include AVPs to control the maximum number of accounting records that may be stored in the Diameter client without committing them to the non-volatile memory or transferring them to the Diameter server.

该协议的进一步应用可包括avp,以控制可存储在Diameter客户端中的最大记帐记录数,而无需将其提交到非易失性存储器或将其传输到Diameter服务器。

The client SHOULD NOT remove the accounting data from any of its memory areas before the correct Accounting-Answer has been received. The client MAY remove the oldest, undelivered, or as yet unacknowledged accounting data if it runs out of resources such as memory. It is an implementation-dependent matter for the client to accept new sessions under this condition.

在收到正确的记帐应答之前,客户端不应从其任何内存区域中删除记帐数据。如果资源(如内存)不足,客户端可能会删除最旧、未送达或尚未确认的记帐数据。在这种情况下,客户端接受新会话取决于实现。

9.5. Accounting Records
9.5. 会计记录

In all accounting records, the Session-Id AVP MUST be present; the User-Name AVP MUST be present if it is available to the Diameter client.

在所有会计记录中,会话Id AVP必须存在;如果Diameter客户端可用,则必须提供用户名AVP。

Different types of accounting records are sent depending on the actual type of accounted service and the authorization server's directions for interim accounting. If the accounted service is a

根据记帐服务的实际类型和授权服务器的临时记帐指示,将发送不同类型的记帐记录。如果记帐服务是

one-time event, meaning that the start and stop of the event are simultaneous, then the Accounting-Record-Type AVP MUST be present and set to the value EVENT_RECORD.

一次性事件,意味着事件的开始和停止是同时发生的,那么会计记录类型AVP必须存在,并设置为值event_Record。

If the accounted service is of a measurable length, then the AVP MUST use the values START_RECORD, STOP_RECORD, and possibly, INTERIM_RECORD. If the authorization server has not directed interim accounting to be enabled for the session, two accounting records MUST be generated for each service of type session. When the initial Accounting-Request for a given session is sent, the Accounting-Record-Type AVP MUST be set to the value START_RECORD. When the last Accounting-Request is sent, the value MUST be STOP_RECORD.

如果记账服务具有可测量的长度,则AVP必须使用值START_RECORD、STOP_RECORD,以及可能的中间_RECORD。如果授权服务器未指示为会话启用临时记帐,则必须为会话类型的每个服务生成两条记帐记录。发送给定会话的初始记帐请求时,记帐记录类型AVP必须设置为值START_Record。发送最后一个记帐请求时,该值必须为STOP_记录。

If the authorization server has directed interim accounting to be enabled, the Diameter client MUST produce additional records between the START_RECORD and STOP_RECORD, marked INTERIM_RECORD. The production of these records is directed by Acct-Interim-Interval as well as any re-authentication or re-authorization of the session. The Diameter client MUST overwrite any previous interim accounting records that are locally stored for delivery, if a new record is being generated for the same session. This ensures that only one pending interim record can exist on an access device for any given session.

如果授权服务器已指示启用临时记帐,则Diameter客户端必须在START_记录和STOP_记录之间生成附加记录,并标记为“临时_记录”。这些记录的生成由Acct临时间隔以及会话的任何重新身份验证或重新授权来指导。如果正在为同一会话生成新记录,Diameter客户端必须覆盖本地存储以供传递的任何以前的临时会计记录。这可确保任何给定会话的访问设备上只能存在一条挂起的临时记录。

A particular value of Accounting-Sub-Session-Id MUST appear only in one sequence of accounting records from a Diameter client, except for the purposes of retransmission. The one sequence that is sent MUST be either one record with Accounting-Record-Type AVP set to the value EVENT_RECORD or several records starting with one having the value START_RECORD, followed by zero or more INTERIM_RECORDs and a single STOP_RECORD. A particular Diameter application specification MUST define the type of sequences that MUST be used.

记帐子会话Id的特定值只能出现在Diameter客户端的一个记帐记录序列中,但用于重新传输的情况除外。发送的一个序列必须是一个会计记录类型AVP设置为值事件记录的记录,或多个记录,从一个具有值开始记录开始,然后是零个或多个临时记录和一个停止记录。特定直径应用规范必须定义必须使用的序列类型。

9.6. Correlation of Accounting Records
9.6. 会计记录的相关性

If an application uses accounting messages, it can correlate accounting records with a specific application session by using the Session-Id of the particular application session in the accounting messages. Accounting messages MAY also use a different Session-Id from that of the application sessions, in which case, other session-related information is needed to perform correlation.

如果应用程序使用记帐消息,它可以通过在记帐消息中使用特定应用程序会话的会话Id将记帐记录与特定应用程序会话关联起来。记帐消息还可以使用不同于应用程序会话的会话Id,在这种情况下,需要其他会话相关信息来执行关联。

In cases where an application requires multiple accounting sub-sessions, an Accounting-Sub-Session-Id AVP is used to differentiate each sub-session. The Session-Id would remain constant for all sub-sessions and is used to correlate all the sub-sessions to a particular application session. Note that receiving a STOP_RECORD

在应用程序需要多个记帐子会话的情况下,记帐子会话Id AVP用于区分每个子会话。对于所有子会话,会话Id将保持不变,并用于将所有子会话与特定应用程序会话关联。请注意,收到STOP_记录

with no Accounting-Sub-Session-Id AVP when sub-sessions were originally used in the START_RECORD messages implies that all sub-sessions are terminated.

当子会话最初用于START_记录消息时,如果没有记帐子会话Id AVP,则表示所有子会话都已终止。

There are also cases where an application needs to correlate multiple application sessions into a single accounting record; the accounting record may span multiple different Diameter applications and sessions used by the same user at a given time. In such cases, the Acct-Multi-Session-Id AVP is used. The Acct-Multi-Session-Id AVP SHOULD be signaled by the server to the access device (typically, during authorization) when it determines that a request belongs to an existing session. The access device MUST then include the Acct-Multi-Session-Id AVP in all subsequent accounting messages.

还有一些情况下,应用程序需要将多个应用程序会话关联到一个会计记录中;会计记录可以跨越同一用户在给定时间使用的多个不同Diameter应用程序和会话。在这种情况下,使用Acct多会话Id AVP。当Acct多会话Id AVP确定请求属于现有会话时,服务器应向访问设备发送信号(通常在授权期间)。然后,接入设备必须在所有后续记帐消息中包含Acct多会话Id AVP。

The Acct-Multi-Session-Id AVP MAY include the value of the original Session-Id. Its contents are implementation specific, but the MUST be globally unique across other Acct-Multi-Session-Ids and MUST NOT change during the life of a session.

Acct多会话Id AVP可能包括原始会话Id的值。其内容是特定于实现的,但在其他Acct多会话Id中必须是全局唯一的,并且在会话生命周期内不得更改。

A Diameter application document MUST define the exact concept of a session that is being accounted, and it MAY define the concept of a multi-session. For instance, the NASREQ DIAMETER application treats a single PPP connection to a Network Access Server as one session and a set of Multilink PPP sessions as one multi-session.

Diameter应用程序文档必须定义正在记帐的会话的确切概念,并且可以定义多会话的概念。例如,NASREQ DIAMETER应用程序将到网络访问服务器的单个PPP连接视为一个会话,将一组多链路PPP会话视为一个多会话。

9.7. Accounting Command Codes
9.7. 会计指令代码

This section defines Command Code values that MUST be supported by all Diameter implementations that provide accounting services.

本节定义了提供记帐服务的所有Diameter实现必须支持的命令代码值。

9.7.1. Accounting-Request
9.7.1. 会计请求

The Accounting-Request (ACR) command, indicated by the Command Code field set to 271 and the Command Flags' 'R' bit set, is sent by a Diameter node, acting as a client, in order to exchange accounting information with a peer.

记帐请求(ACR)命令由设置为271的命令代码字段和命令标志“R”位集指示,由充当客户端的Diameter节点发送,以便与对等方交换记帐信息。

In addition to the AVPs listed below, Accounting-Request messages SHOULD include service-specific accounting AVPs.

除了下面列出的AVP之外,记帐请求消息还应包括特定于服务的记帐AVP。

Message Format

消息格式

         <ACR> ::= < Diameter Header: 271, REQ, PXY >
                   < Session-Id >
                   { Origin-Host }
                   { Origin-Realm }
                   { Destination-Realm }
                   { Accounting-Record-Type }
                   { Accounting-Record-Number }
                   [ Acct-Application-Id ]
                   [ Vendor-Specific-Application-Id ]
                   [ User-Name ]
                   [ Destination-Host ]
                   [ Accounting-Sub-Session-Id ]
                   [ Acct-Session-Id ]
                   [ Acct-Multi-Session-Id ]
                   [ Acct-Interim-Interval ]
                   [ Accounting-Realtime-Required ]
                   [ Origin-State-Id ]
                   [ Event-Timestamp ]
                 * [ Proxy-Info ]
                 * [ Route-Record ]
                 * [ AVP ]
        
         <ACR> ::= < Diameter Header: 271, REQ, PXY >
                   < Session-Id >
                   { Origin-Host }
                   { Origin-Realm }
                   { Destination-Realm }
                   { Accounting-Record-Type }
                   { Accounting-Record-Number }
                   [ Acct-Application-Id ]
                   [ Vendor-Specific-Application-Id ]
                   [ User-Name ]
                   [ Destination-Host ]
                   [ Accounting-Sub-Session-Id ]
                   [ Acct-Session-Id ]
                   [ Acct-Multi-Session-Id ]
                   [ Acct-Interim-Interval ]
                   [ Accounting-Realtime-Required ]
                   [ Origin-State-Id ]
                   [ Event-Timestamp ]
                 * [ Proxy-Info ]
                 * [ Route-Record ]
                 * [ AVP ]
        
9.7.2. Accounting-Answer
9.7.2. 会计回答

The Accounting-Answer (ACA) command, indicated by the Command Code field set to 271 and the Command Flags' 'R' bit cleared, is used to acknowledge an Accounting-Request command. The Accounting-Answer command contains the same Session-Id as the corresponding request.

记帐应答(ACA)命令由设置为271的命令代码字段和清除的命令标志“R”位指示,用于确认记帐请求命令。记帐应答命令包含与相应请求相同的会话Id。

Only the target Diameter server, known as the home Diameter server, SHOULD respond with the Accounting-Answer command.

只有目标Diameter服务器(称为home Diameter服务器)应使用记帐应答命令进行响应。

In addition to the AVPs listed below, Accounting-Answer messages SHOULD include service-specific accounting AVPs.

除了下面列出的AVP之外,记帐应答消息还应包括特定于服务的记帐AVP。

Message Format

消息格式

         <ACA> ::= < Diameter Header: 271, PXY >
                   < Session-Id >
                   { Result-Code }
                   { Origin-Host }
                   { Origin-Realm }
                   { Accounting-Record-Type }
                   { Accounting-Record-Number }
                   [ Acct-Application-Id ]
                   [ Vendor-Specific-Application-Id ]
                   [ User-Name ]
                   [ Accounting-Sub-Session-Id ]
                   [ Acct-Session-Id ]
                   [ Acct-Multi-Session-Id ]
                   [ Error-Message ]
                   [ Error-Reporting-Host ]
                   [ Failed-AVP ]
                   [ Acct-Interim-Interval ]
                   [ Accounting-Realtime-Required ]
                   [ Origin-State-Id ]
                   [ Event-Timestamp ]
                 * [ Proxy-Info ]
                 * [ AVP ]
        
         <ACA> ::= < Diameter Header: 271, PXY >
                   < Session-Id >
                   { Result-Code }
                   { Origin-Host }
                   { Origin-Realm }
                   { Accounting-Record-Type }
                   { Accounting-Record-Number }
                   [ Acct-Application-Id ]
                   [ Vendor-Specific-Application-Id ]
                   [ User-Name ]
                   [ Accounting-Sub-Session-Id ]
                   [ Acct-Session-Id ]
                   [ Acct-Multi-Session-Id ]
                   [ Error-Message ]
                   [ Error-Reporting-Host ]
                   [ Failed-AVP ]
                   [ Acct-Interim-Interval ]
                   [ Accounting-Realtime-Required ]
                   [ Origin-State-Id ]
                   [ Event-Timestamp ]
                 * [ Proxy-Info ]
                 * [ AVP ]
        
9.8. Accounting AVPs
9.8. 会计AVPs

This section contains AVPs that describe accounting usage information related to a specific session.

本节包含描述与特定会话相关的记帐使用信息的AVP。

9.8.1. Accounting-Record-Type AVP
9.8.1. 会计记录类型AVP

The Accounting-Record-Type AVP (AVP Code 480) is of type Enumerated and contains the type of accounting record being sent. The following values are currently defined for the Accounting-Record-Type AVP:

会计记录类型AVP(AVP代码480)为枚举类型,包含正在发送的会计记录类型。当前为会计记录类型AVP定义了以下值:

EVENT_RECORD 1

事件记录1

An Accounting Event Record is used to indicate that a one-time event has occurred (meaning that the start and end of the event are simultaneous). This record contains all information relevant to the service, and it is the only record of the service.

会计事件记录用于指示一次性事件已经发生(意味着事件的开始和结束是同时发生的)。此记录包含与服务相关的所有信息,并且是该服务的唯一记录。

START_RECORD 2

开始记录2

Accounting Start, Interim, and Stop Records are used to indicate that a service of a measurable length has been given. An Accounting Start Record is used to initiate an accounting session and contains accounting information that is relevant to the initiation of the session.

会计开始、中期和停止记录用于表明已提供了可测量长度的服务。记帐开始记录用于启动记帐会话,并包含与会话启动相关的记帐信息。

INTERIM_RECORD 3

临时记录3

An Interim Accounting Record contains cumulative accounting information for an existing accounting session. Interim Accounting Records SHOULD be sent every time a re-authentication or re-authorization occurs. Further, additional interim record triggers MAY be defined by application-specific Diameter applications. The selection of whether to use INTERIM_RECORD records is done by the Acct-Interim-Interval AVP.

临时会计记录包含现有会计会话的累积会计信息。每次重新认证或重新授权时,应发送临时会计记录。此外,附加的临时记录触发器可由特定于应用程序的Diameter应用程序定义。是否使用临时记录的选择由Acct临时间隔AVP完成。

STOP_RECORD 4

停止记录4

An Accounting Stop Record is sent to terminate an accounting session and contains cumulative accounting information relevant to the existing session.

发送记帐停止记录以终止记帐会话,并包含与现有会话相关的累积记帐信息。

9.8.2. Acct-Interim-Interval AVP
9.8.2. 会计中间期平均值

The Acct-Interim-Interval AVP (AVP Code 85) is of type Unsigned32 and is sent from the Diameter home authorization server to the Diameter client. The client uses information in this AVP to decide how and when to produce accounting records. With different values in this AVP, service sessions can result in one, two, or two+N accounting records, based on the needs of the home organization. The following accounting record production behavior is directed by the inclusion of this AVP:

Acct中间间隔AVP(AVP代码85)的类型为Unsigned32,从Diameter home授权服务器发送到Diameter客户端。客户使用本AVP中的信息来决定如何以及何时生成会计记录。使用此AVP中的不同值,服务会话可以根据主组织的需要生成一个、两个或两个+N会计记录。以下会计记录制作行为受本AVP的指导:

1. The omission of the Acct-Interim-Interval AVP or its inclusion with Value field set to 0 means that EVENT_RECORD, START_RECORD, and STOP_RECORD are produced, as appropriate for the service.

1. 省略Acct中间间隔AVP或将其包含在值字段设置为0的情况下,意味着根据服务的需要生成事件记录、开始记录和停止记录。

2. The inclusion of the AVP with Value field set to a non-zero value means that INTERIM_RECORD records MUST be produced between the START_RECORD and STOP_RECORD records. The Value field of this AVP is the nominal interval between these records in seconds. The Diameter node that originates the accounting information, known as the client, MUST produce the first INTERIM_RECORD record roughly at the time when this nominal interval has elapsed from

2. 将AVP的值字段设置为非零值意味着必须在开始记录和停止记录之间生成临时记录。此AVP的值字段是这些记录之间的标称间隔(以秒为单位)。发起会计信息的Diameter节点(称为客户端)必须大致在该标称间隔从开始到结束时生成第一个临时_记录

the START_RECORD, the next one again as the interval has elapsed once more, and so on until the session ends and a STOP_RECORD record is produced.

开始记录,下一个记录随着时间间隔再次过去,依此类推,直到会话结束并生成停止记录。

The client MUST ensure that the interim record production times are randomized so that large accounting message storms are not created either among records or around a common service start time.

客户必须确保临时记录的生成时间是随机的,以便在记录之间或在公共服务开始时间附近不会创建大型记帐消息风暴。

9.8.3. Accounting-Record-Number AVP
9.8.3. 会计记录编号

The Accounting-Record-Number AVP (AVP Code 485) is of type Unsigned32 and identifies this record within one session. As Session-Id AVPs are globally unique, the combination of Session-Id and Accounting-Record-Number AVPs is also globally unique and can be used in matching accounting records with confirmations. An easy way to produce unique numbers is to set the value to 0 for records of type EVENT_RECORD and START_RECORD and set the value to 1 for the first INTERIM_RECORD, 2 for the second, and so on until the value for STOP_RECORD is one more than for the last INTERIM_RECORD.

会计记录编号AVP(AVP代码485)的类型为Unsigned32,并在一个会话中标识该记录。由于会话Id AVP是全局唯一的,会话Id和会计记录编号AVP的组合也是全局唯一的,可用于将会计记录与确认进行匹配。生成唯一数字的一种简单方法是,将EVENT_RECORD和START_RECORD类型的记录的值设置为0,并将第一个临时_记录的值设置为1,第二个临时_记录的值设置为2,依此类推,直到STOP_记录的值比最后一个临时_记录的值多一个。

9.8.4. Acct-Session-Id AVP
9.8.4. 帐户会话Id AVP

The Acct-Session-Id AVP (AVP Code 44) is of type OctetString is only used when RADIUS/Diameter translation occurs. This AVP contains the contents of the RADIUS Acct-Session-Id attribute.

Acct会话Id AVP(AVP代码44)为OctetString类型,仅在发生半径/直径转换时使用。此AVP包含RADIUS Acct会话Id属性的内容。

9.8.5. Acct-Multi-Session-Id AVP
9.8.5. 帐户多会话Id AVP

The Acct-Multi-Session-Id AVP (AVP Code 50) is of type UTF8String, following the format specified in Section 8.8. The Acct-Multi-Session-Id AVP is used to link multiple related accounting sessions, where each session would have a unique Session-Id but the same Acct-Multi-Session-Id AVP. This AVP MAY be returned by the Diameter server in an authorization answer, and it MUST be used in all accounting messages for the given session.

Acct多会话Id AVP(AVP代码50)为UTF8String类型,采用第8.8节规定的格式。Acct多会话Id AVP用于链接多个相关的记帐会话,其中每个会话都有一个唯一的会话Id,但具有相同的Acct多会话Id AVP。Diameter服务器可以在授权应答中返回此AVP,并且必须在给定会话的所有记帐消息中使用此AVP。

9.8.6. Accounting-Sub-Session-Id AVP
9.8.6. 记帐子会话Id AVP

The Accounting-Sub-Session-Id AVP (AVP Code 287) is of type Unsigned64 and contains the accounting sub-session identifier. The combination of the Session-Id and this AVP MUST be unique per sub-session, and the value of this AVP MUST be monotonically increased by one for all new sub-sessions. The absence of this AVP implies no sub-sessions are in use, with the exception of an Accounting-Request whose Accounting-Record-Type is set to STOP_RECORD. A STOP_RECORD message with no Accounting-Sub-Session-Id AVP present will signal the termination of all sub-sessions for a given Session-Id.

记帐子会话Id AVP(AVP代码287)的类型为Unsigned64,并且包含记帐子会话标识符。会话Id和该AVP的组合在每个子会话中必须是唯一的,并且对于所有新的子会话,该AVP的值必须单调地增加1。没有此AVP意味着没有子会话在使用,会计记录类型设置为STOP_Record的会计请求除外。不存在记帐子会话Id AVP的STOP_RECORD消息将发出给定会话Id的所有子会话终止的信号。

9.8.7. Accounting-Realtime-Required AVP
9.8.7. 会计实时要求AVP

The Accounting-Realtime-Required AVP (AVP Code 483) is of type Enumerated and is sent from the Diameter home authorization server to the Diameter client or in the Accounting-Answer from the accounting server. The client uses information in this AVP to decide what to do if the sending of accounting records to the accounting server has been temporarily prevented due to, for instance, a network problem.

会计实时所需的AVP(AVP代码483)属于枚举类型,从Diameter home授权服务器发送到Diameter客户端,或在会计服务器的会计应答中发送。客户机使用此AVP中的信息来决定如果由于例如网络问题而暂时阻止向会计服务器发送会计记录,该怎么办。

DELIVER_AND_GRANT 1

交付和授予1

The AVP with Value field set to DELIVER_AND_GRANT means that the service MUST only be granted as long as there is a connection to an accounting server. Note that the set of alternative accounting servers are treated as one server in this sense. Having to move the accounting record stream to a backup server is not a reason to discontinue the service to the user.

AVP with Value字段设置为DELIVER_和_GRANT意味着只有在连接到记帐服务器时才必须授予服务。请注意,从这个意义上讲,备用记帐服务器集被视为一台服务器。必须将记帐记录流移动到备份服务器并不是停止向用户提供服务的理由。

GRANT_AND_STORE 2

GRANT_和_商店2

The AVP with Value field set to GRANT_AND_STORE means that service SHOULD be granted if there is a connection, or as long as records can still be stored as described in Section 9.4.

AVP with Value字段设置为GRANT_和_STORE意味着,如果存在连接,或者只要记录仍然可以按照第9.4节所述存储,就应该授予服务。

This is the default behavior if the AVP isn't included in the reply from the authorization server.

如果来自授权服务器的回复中未包含AVP,则这是默认行为。

GRANT_AND_LOSE 3

给你和你输3分

The AVP with Value field set to GRANT_AND_LOSE means that service SHOULD be granted even if the records cannot be delivered or stored.

AVP with Value字段设置为GRANT_和_LOSE意味着即使记录无法传递或存储,也应授予服务。

10. AVP Occurrence Tables
10. AVP发生表

The following tables present the AVPs defined in this document and specify in which Diameter messages they MAY or MAY NOT be present. AVPs that occur only inside a Grouped AVP are not shown in these tables.

下表显示了本文档中定义的AVP,并指定了它们可能存在或不存在的Diameter消息。这些表中未显示仅出现在分组AVP内的AVP。

The tables use the following symbols:

这些表使用以下符号:

0 The AVP MUST NOT be present in the message.

0消息中不得出现AVP。

0+ Zero or more instances of the AVP MAY be present in the message.

消息中可能存在0+零个或多个AVP实例。

0-1 Zero or one instance of the AVP MAY be present in the message. It is considered an error if there are more than one instance of the AVP.

0-1消息中可能存在零个或一个AVP实例。如果AVP有多个实例,则视为错误。

1 One instance of the AVP MUST be present in the message.

1消息中必须有一个AVP实例。

1+ At least one instance of the AVP MUST be present in the message.

1+消息中必须至少存在一个AVP实例。

10.1. Base Protocol Command AVP Table
10.1. 基本协议命令AVP表

The table in this section is limited to the non-Accounting Command Codes defined in this specification.

本节中的表格仅限于本规范中定义的非会计命令代码。

                       +-----------------------------------------------+
                       |                  Command Code                 |
                       +---+---+---+---+---+---+---+---+---+---+---+---+
   Attribute Name      |CER|CEA|DPR|DPA|DWR|DWA|RAR|RAA|ASR|ASA|STR|STA|
   --------------------+---+---+---+---+---+---+---+---+---+---+---+---+
   Acct-Interim-       |0  |0  |0  |0  |0  |0  |0-1|0  |0  |0  |0  |0  |
     Interval          |   |   |   |   |   |   |   |   |   |   |   |   |
   Accounting-Realtime-|0  |0  |0  |0  |0  |0  |0-1|0  |0  |0  |0  |0  |
     Required          |   |   |   |   |   |   |   |   |   |   |   |   |
   Acct-Application-Id |0+ |0+ |0  |0  |0  |0  |0  |0  |0  |0  |0  |0  |
   Auth-Application-Id |0+ |0+ |0  |0  |0  |0  |1  |0  |1  |0  |1  |0  |
   Auth-Grace-Period   |0  |0  |0  |0  |0  |0  |0  |0  |0  |0  |0  |0  |
   Auth-Request-Type   |0  |0  |0  |0  |0  |0  |0  |0  |0  |0  |0  |0  |
   Auth-Session-State  |0  |0  |0  |0  |0  |0  |0  |0  |0  |0  |0  |0  |
   Authorization-      |0  |0  |0  |0  |0  |0  |0  |0  |0  |0  |0  |0  |
     Lifetime          |   |   |   |   |   |   |   |   |   |   |   |   |
   Class               |0  |0  |0  |0  |0  |0  |0  |0  |0  |0  |0+ |0+ |
   Destination-Host    |0  |0  |0  |0  |0  |0  |1  |0  |1  |0  |0-1|0  |
   Destination-Realm   |0  |0  |0  |0  |0  |0  |1  |0  |1  |0  |1  |0  |
   Disconnect-Cause    |0  |0  |1  |0  |0  |0  |0  |0  |0  |0  |0  |0  |
   Error-Message       |0  |0-1|0  |0-1|0  |0-1|0  |0-1|0  |0-1|0  |0-1|
   Error-Reporting-Host|0  |0  |0  |0  |0  |0  |0  |0-1|0  |0-1|0  |0-1|
   Failed-AVP          |0  |0-1|0  |0-1|0  |0-1|0  |0-1|0  |0-1|0  |0-1|
   Firmware-Revision   |0-1|0-1|0  |0  |0  |0  |0  |0  |0  |0  |0  |0  |
   Host-IP-Address     |1+ |1+ |0  |0  |0  |0  |0  |0  |0  |0  |0  |0  |
   Inband-Security-Id  |0  |0  |0  |0  |0  |0  |0  |0  |0  |0  |0  |0  |
   Multi-Round-Time-Out|0  |0  |0  |0  |0  |0  |0  |0  |0  |0  |0  |0  |
        
                       +-----------------------------------------------+
                       |                  Command Code                 |
                       +---+---+---+---+---+---+---+---+---+---+---+---+
   Attribute Name      |CER|CEA|DPR|DPA|DWR|DWA|RAR|RAA|ASR|ASA|STR|STA|
   --------------------+---+---+---+---+---+---+---+---+---+---+---+---+
   Acct-Interim-       |0  |0  |0  |0  |0  |0  |0-1|0  |0  |0  |0  |0  |
     Interval          |   |   |   |   |   |   |   |   |   |   |   |   |
   Accounting-Realtime-|0  |0  |0  |0  |0  |0  |0-1|0  |0  |0  |0  |0  |
     Required          |   |   |   |   |   |   |   |   |   |   |   |   |
   Acct-Application-Id |0+ |0+ |0  |0  |0  |0  |0  |0  |0  |0  |0  |0  |
   Auth-Application-Id |0+ |0+ |0  |0  |0  |0  |1  |0  |1  |0  |1  |0  |
   Auth-Grace-Period   |0  |0  |0  |0  |0  |0  |0  |0  |0  |0  |0  |0  |
   Auth-Request-Type   |0  |0  |0  |0  |0  |0  |0  |0  |0  |0  |0  |0  |
   Auth-Session-State  |0  |0  |0  |0  |0  |0  |0  |0  |0  |0  |0  |0  |
   Authorization-      |0  |0  |0  |0  |0  |0  |0  |0  |0  |0  |0  |0  |
     Lifetime          |   |   |   |   |   |   |   |   |   |   |   |   |
   Class               |0  |0  |0  |0  |0  |0  |0  |0  |0  |0  |0+ |0+ |
   Destination-Host    |0  |0  |0  |0  |0  |0  |1  |0  |1  |0  |0-1|0  |
   Destination-Realm   |0  |0  |0  |0  |0  |0  |1  |0  |1  |0  |1  |0  |
   Disconnect-Cause    |0  |0  |1  |0  |0  |0  |0  |0  |0  |0  |0  |0  |
   Error-Message       |0  |0-1|0  |0-1|0  |0-1|0  |0-1|0  |0-1|0  |0-1|
   Error-Reporting-Host|0  |0  |0  |0  |0  |0  |0  |0-1|0  |0-1|0  |0-1|
   Failed-AVP          |0  |0-1|0  |0-1|0  |0-1|0  |0-1|0  |0-1|0  |0-1|
   Firmware-Revision   |0-1|0-1|0  |0  |0  |0  |0  |0  |0  |0  |0  |0  |
   Host-IP-Address     |1+ |1+ |0  |0  |0  |0  |0  |0  |0  |0  |0  |0  |
   Inband-Security-Id  |0  |0  |0  |0  |0  |0  |0  |0  |0  |0  |0  |0  |
   Multi-Round-Time-Out|0  |0  |0  |0  |0  |0  |0  |0  |0  |0  |0  |0  |
        
   Origin-Host         |1  |1  |1  |1  |1  |1  |1  |1  |1  |1  |1  |1  |
   Origin-Realm        |1  |1  |1  |1  |1  |1  |1  |1  |1  |1  |1  |1  |
   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|
   Product-Name        |1  |1  |0  |0  |0  |0  |0  |0  |0  |0  |0  |0  |
   Proxy-Info          |0  |0  |0  |0  |0  |0  |0+ |0+ |0+ |0+ |0+ |0+ |
   Redirect-Host       |0  |0  |0  |0  |0  |0  |0  |0+ |0  |0+ |0  |0+ |
   Redirect-Host-Usage |0  |0  |0  |0  |0  |0  |0  |0-1|0  |0-1|0  |0-1|
   Redirect-Max-Cache- |0  |0  |0  |0  |0  |0  |0  |0-1|0  |0-1|0  |0-1|
     Time              |   |   |   |   |   |   |   |   |   |   |   |   |
   Result-Code         |0  |1  |0  |1  |0  |1  |0  |1  |0  |1  |0  |1  |
   Re-Auth-Request-Type|0  |0  |0  |0  |0  |0  |1  |0  |0  |0  |0  |0  |
   Route-Record        |0  |0  |0  |0  |0  |0  |0+ |0  |0+ |0  |0+ |0  |
   Session-Binding     |0  |0  |0  |0  |0  |0  |0  |0  |0  |0  |0  |0  |
   Session-Id          |0  |0  |0  |0  |0  |0  |1  |1  |1  |1  |1  |1  |
   Session-Server-     |0  |0  |0  |0  |0  |0  |0  |0  |0  |0  |0  |0  |
     Failover          |   |   |   |   |   |   |   |   |   |   |   |   |
   Session-Timeout     |0  |0  |0  |0  |0  |0  |0  |0  |0  |0  |0  |0  |
   Supported-Vendor-Id |0+ |0+ |0  |0  |0  |0  |0  |0  |0  |0  |0  |0  |
   Termination-Cause   |0  |0  |0  |0  |0  |0  |0  |0  |0  |0  |1  |0  |
   User-Name           |0  |0  |0  |0  |0  |0  |0-1|0-1|0-1|0-1|0-1|0-1|
   Vendor-Id           |1  |1  |0  |0  |0  |0  |0  |0  |0  |0  |0  |0  |
   Vendor-Specific-    |0+ |0+ |0  |0  |0  |0  |0  |0  |0  |0  |0  |0  |
     Application-Id    |   |   |   |   |   |   |   |   |   |   |   |   |
   --------------------+---+---+---+---+---+---+---+---+---+---+---+---+
        
   Origin-Host         |1  |1  |1  |1  |1  |1  |1  |1  |1  |1  |1  |1  |
   Origin-Realm        |1  |1  |1  |1  |1  |1  |1  |1  |1  |1  |1  |1  |
   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|
   Product-Name        |1  |1  |0  |0  |0  |0  |0  |0  |0  |0  |0  |0  |
   Proxy-Info          |0  |0  |0  |0  |0  |0  |0+ |0+ |0+ |0+ |0+ |0+ |
   Redirect-Host       |0  |0  |0  |0  |0  |0  |0  |0+ |0  |0+ |0  |0+ |
   Redirect-Host-Usage |0  |0  |0  |0  |0  |0  |0  |0-1|0  |0-1|0  |0-1|
   Redirect-Max-Cache- |0  |0  |0  |0  |0  |0  |0  |0-1|0  |0-1|0  |0-1|
     Time              |   |   |   |   |   |   |   |   |   |   |   |   |
   Result-Code         |0  |1  |0  |1  |0  |1  |0  |1  |0  |1  |0  |1  |
   Re-Auth-Request-Type|0  |0  |0  |0  |0  |0  |1  |0  |0  |0  |0  |0  |
   Route-Record        |0  |0  |0  |0  |0  |0  |0+ |0  |0+ |0  |0+ |0  |
   Session-Binding     |0  |0  |0  |0  |0  |0  |0  |0  |0  |0  |0  |0  |
   Session-Id          |0  |0  |0  |0  |0  |0  |1  |1  |1  |1  |1  |1  |
   Session-Server-     |0  |0  |0  |0  |0  |0  |0  |0  |0  |0  |0  |0  |
     Failover          |   |   |   |   |   |   |   |   |   |   |   |   |
   Session-Timeout     |0  |0  |0  |0  |0  |0  |0  |0  |0  |0  |0  |0  |
   Supported-Vendor-Id |0+ |0+ |0  |0  |0  |0  |0  |0  |0  |0  |0  |0  |
   Termination-Cause   |0  |0  |0  |0  |0  |0  |0  |0  |0  |0  |1  |0  |
   User-Name           |0  |0  |0  |0  |0  |0  |0-1|0-1|0-1|0-1|0-1|0-1|
   Vendor-Id           |1  |1  |0  |0  |0  |0  |0  |0  |0  |0  |0  |0  |
   Vendor-Specific-    |0+ |0+ |0  |0  |0  |0  |0  |0  |0  |0  |0  |0  |
     Application-Id    |   |   |   |   |   |   |   |   |   |   |   |   |
   --------------------+---+---+---+---+---+---+---+---+---+---+---+---+
        
10.2. Accounting AVP Table
10.2. 会计平均值表

The table in this section is used to represent which AVPs defined in this document are to be present in the Accounting messages. These AVP occurrence requirements are guidelines, which may be expanded, and/or overridden by application-specific requirements in the Diameter applications documents.

本节中的表格用于表示本文档中定义的哪些AVP将出现在记帐消息中。这些AVP发生要求是指南,可由Diameter应用文件中的应用特定要求扩展和/或覆盖。

                                    +-----------+
                                    |  Command  |
                                    |    Code   |
                                    +-----+-----+
      Attribute Name                | ACR | ACA |
      ------------------------------+-----+-----+
      Acct-Interim-Interval         | 0-1 | 0-1 |
      Acct-Multi-Session-Id         | 0-1 | 0-1 |
      Accounting-Record-Number      | 1   | 1   |
      Accounting-Record-Type        | 1   | 1   |
      Acct-Session-Id               | 0-1 | 0-1 |
      Accounting-Sub-Session-Id     | 0-1 | 0-1 |
      Accounting-Realtime-Required  | 0-1 | 0-1 |
      Acct-Application-Id           | 0-1 | 0-1 |
      Auth-Application-Id           | 0   | 0   |
      Class                         | 0+  | 0+  |
      Destination-Host              | 0-1 | 0   |
      Destination-Realm             | 1   | 0   |
      Error-Reporting-Host          | 0   | 0+  |
      Event-Timestamp               | 0-1 | 0-1 |
      Failed-AVP                    | 0   | 0-1 |
      Origin-Host                   | 1   | 1   |
      Origin-Realm                  | 1   | 1   |
      Proxy-Info                    | 0+  | 0+  |
      Route-Record                  | 0+  | 0   |
      Result-Code                   | 0   | 1   |
      Session-Id                    | 1   | 1   |
      Termination-Cause             | 0   | 0   |
      User-Name                     | 0-1 | 0-1 |
      Vendor-Specific-Application-Id| 0-1 | 0-1 |
      ------------------------------+-----+-----+
        
                                    +-----------+
                                    |  Command  |
                                    |    Code   |
                                    +-----+-----+
      Attribute Name                | ACR | ACA |
      ------------------------------+-----+-----+
      Acct-Interim-Interval         | 0-1 | 0-1 |
      Acct-Multi-Session-Id         | 0-1 | 0-1 |
      Accounting-Record-Number      | 1   | 1   |
      Accounting-Record-Type        | 1   | 1   |
      Acct-Session-Id               | 0-1 | 0-1 |
      Accounting-Sub-Session-Id     | 0-1 | 0-1 |
      Accounting-Realtime-Required  | 0-1 | 0-1 |
      Acct-Application-Id           | 0-1 | 0-1 |
      Auth-Application-Id           | 0   | 0   |
      Class                         | 0+  | 0+  |
      Destination-Host              | 0-1 | 0   |
      Destination-Realm             | 1   | 0   |
      Error-Reporting-Host          | 0   | 0+  |
      Event-Timestamp               | 0-1 | 0-1 |
      Failed-AVP                    | 0   | 0-1 |
      Origin-Host                   | 1   | 1   |
      Origin-Realm                  | 1   | 1   |
      Proxy-Info                    | 0+  | 0+  |
      Route-Record                  | 0+  | 0   |
      Result-Code                   | 0   | 1   |
      Session-Id                    | 1   | 1   |
      Termination-Cause             | 0   | 0   |
      User-Name                     | 0-1 | 0-1 |
      Vendor-Specific-Application-Id| 0-1 | 0-1 |
      ------------------------------+-----+-----+
        
11. IANA Considerations
11. IANA考虑

This section provides guidance to the Internet Assigned Numbers Authority (IANA) regarding registration of values related to the Diameter protocol, in accordance with [RFC5226]. Existing IANA registries and assignments put in place by RFC 3588 remain the same unless explicitly updated or deprecated in this section.

本节根据[RFC5226]向互联网分配号码管理局(IANA)提供有关Diameter协议相关值注册的指南。RFC 3588实施的现有IANA注册和分配保持不变,除非在本节中明确更新或弃用。

11.1. AVP Header
11.1. AVP报头

As defined in Section 4, the AVP header contains three fields that require IANA namespace management: the AVP Code, Vendor-ID, and Flags fields.

如第4节所定义,AVP头包含三个需要IANA命名空间管理的字段:AVP代码、供应商ID和标志字段。

11.1.1. AVP Codes
11.1.1. AVP码

There are multiple namespaces. Vendors can have their own AVP Codes namespace that will be identified by their Vendor-ID (also known as Enterprise-Number), and they control the assignments of their vendor-specific AVP Codes within their own namespace. The absence of a Vendor-ID or a Vendor-ID value of zero (0) identifies the IETF AVP Codes namespace, which is under IANA control. The AVP Codes and sometimes possible values in an AVP are controlled and maintained by IANA. AVP Code 0 is not used. AVP Codes 1-255 are managed separately as RADIUS Attribute Types. Where a Vendor-Specific AVP is implemented by more than one vendor, allocation of global AVPs should be encouraged instead.

有多个名称空间。供应商可以拥有自己的AVP代码名称空间,该名称空间将由其供应商ID(也称为企业编号)标识,并且他们可以在自己的名称空间内控制其供应商特定AVP代码的分配。缺少供应商ID或供应商ID值为零(0)表示IETF AVP代码命名空间,该命名空间受IANA控制。AVP代码和AVP中有时可能的值由IANA控制和维护。未使用AVP代码0。AVP代码1-255作为半径属性类型单独管理。如果供应商特定的AVP由多个供应商实施,则应鼓励分配全球AVP。

AVPs may be allocated following Expert Review (by a Designated Expert) with Specification Required [RFC5226]. A block allocation (release of more than three AVPs at a time for a given purpose) requires IETF Review [RFC5226].

AVP可在专家审查(由指定专家)后按照要求的规范分配[RFC5226]。块分配(为特定目的一次发布三个以上AVP)需要IETF审查[RFC5226]。

11.1.2. AVP Flags
11.1.2. AVP标志

Section 4.1 describes the existing AVP Flags. The remaining bits can only be assigned via a Standards Action [RFC5226].

第4.1节描述了现有的AVP标志。剩余位只能通过标准操作[RFC5226]分配。

11.2. Diameter Header
11.2. 直径集管
11.2.1. Command Codes
11.2.1. 命令代码

For the Diameter header, the Command Code namespace allocation has changed. The new allocation rules are as follows:

对于Diameter标头,命令代码命名空间分配已更改。新的分配规则如下:

The Command Code values 256 - 8,388,607 (0x100 to 0x7fffff) are for permanent, standard commands, allocated by IETF Review [RFC5226].

命令代码值256-8388607(0x100至0x7fffff)用于IETF Review[RFC5226]分配的永久性标准命令。

The values 8,388,608 - 16,777,213 (0x800000 - 0xfffffd) are reserved for vendor-specific Command Codes, to be allocated on a First Come, First Served basis by IANA [RFC5226]. The request to IANA for a Vendor-Specific Command Code SHOULD include a reference to a publicly available specification that documents the command in sufficient detail to aid in interoperability between independent implementations. If the specification cannot be made publicly available, the request for a vendor-specific Command Code MUST include the contact information of persons and/or entities responsible for authoring and maintaining the command.

值8388608-16777213(0x800000-0xfffffd)保留给供应商特定的命令代码,由IANA按照先到先得的原则分配[RFC5226]。向IANA请求特定于供应商的命令代码时,应包括对公开可用规范的引用,该规范详细记录了命令,以帮助独立实现之间的互操作性。如果规范无法公开,则供应商特定命令代码的请求必须包括负责编写和维护命令的人员和/或实体的联系信息。

The values 16,777,214 and 16,777,215 (hexadecimal values 0xfffffe - 0xffffff) are reserved for experimental commands. As these codes are only for experimental and testing purposes, no guarantee is made for interoperability between Diameter peers using experimental commands.

值16777214和16777215(十六进制值0xfffffe-0xffffff)保留用于实验命令。由于这些代码仅用于实验和测试目的,因此无法保证使用实验命令的Diameter对等机之间的互操作性。

11.2.2. Command Flags
11.2.2. 命令标志

Section 3 describes the existing Command Flags field. The remaining bits can only be assigned via a Standards Action [RFC5226].

第3节描述了现有的命令标志字段。剩余位只能通过标准操作[RFC5226]分配。

11.3. AVP Values
11.3. AVP值

For AVP values, the Experimental-Result-Code AVP value allocation has been added; see Section 11.3.1. The old AVP value allocation rule, IETF Consensus, has been updated to IETF Review as per [RFC5226], and affected AVPs are listed as reminders.

对于AVP值,增加了实验结果代码AVP值分配;见第11.3.1节。旧的AVP值分配规则IETF Consensus已根据[RFC5226]更新为IETF Review,受影响的AVP列为提醒。

11.3.1. Experimental-Result-Code AVP
11.3.1. 实验结果代码AVP

Values for this AVP are purely local to the indicated vendor, and no IANA registry is maintained for them.

此AVP的值仅为指定供应商的本地值,不为其维护IANA注册表。

11.3.2. Result-Code AVP Values
11.3.2. 结果代码AVP值

New values are available for assignment via IETF Review [RFC5226].

新值可通过IETF评审[RFC5226]分配。

11.3.3. Accounting-Record-Type AVP Values
11.3.3. 会计记录类型AVP值

New values are available for assignment via IETF Review [RFC5226].

新值可通过IETF评审[RFC5226]分配。

11.3.4. Termination-Cause AVP Values
11.3.4. 终止原因AVP值

New values are available for assignment via IETF Review [RFC5226].

新值可通过IETF评审[RFC5226]分配。

11.3.5. Redirect-Host-Usage AVP Values
11.3.5. 重定向主机使用AVP值

New values are available for assignment via IETF Review [RFC5226].

新值可通过IETF评审[RFC5226]分配。

11.3.6. Session-Server-Failover AVP Values
11.3.6. 会话服务器故障转移AVP值

New values are available for assignment via IETF Review [RFC5226].

新值可通过IETF评审[RFC5226]分配。

11.3.7. Session-Binding AVP Values
11.3.7. 会话绑定AVP值

New values are available for assignment via IETF Review [RFC5226].

新值可通过IETF评审[RFC5226]分配。

11.3.8. Disconnect-Cause AVP Values
11.3.8. 断开原因AVP值

New values are available for assignment via IETF Review [RFC5226].

新值可通过IETF评审[RFC5226]分配。

11.3.9. Auth-Request-Type AVP Values
11.3.9. 身份验证请求类型AVP值

New values are available for assignment via IETF Review [RFC5226].

新值可通过IETF评审[RFC5226]分配。

11.3.10. Auth-Session-State AVP Values
11.3.10. 验证会话状态AVP值

New values are available for assignment via IETF Review [RFC5226].

新值可通过IETF评审[RFC5226]分配。

11.3.11. Re-Auth-Request-Type AVP Values
11.3.11. 重新验证请求类型AVP值

New values are available for assignment via IETF Review [RFC5226].

新值可通过IETF评审[RFC5226]分配。

11.3.12. Accounting-Realtime-Required AVP Values
11.3.12. 会计实时所需AVP值

New values are available for assignment via IETF Review [RFC5226].

新值可通过IETF评审[RFC5226]分配。

11.3.13. Inband-Security-Id AVP (code 299)
11.3.13. 带内安全Id AVP(代码299)

The use of this AVP has been deprecated.

已不推荐使用此AVP。

11.4. _diameters Service Name and Port Number Registration
11.4. _diameters服务名称和端口号注册

IANA has registered the "_diameters" service name and assigned port numbers for TLS/TCP and DTLS/SCTP according to the guidelines given in [RFC6335].

IANA已根据[RFC6335]中给出的指南,为TLS/TCP和DTLS/SCTP注册了“直径”服务名称和分配的端口号。

Service Name: _diameters

服务名称:

Transport Protocols: TCP, SCTP

传输协议:TCP、SCTP

      Assignee:             IESG <iesg@ietf.org>
        
      Assignee:             IESG <iesg@ietf.org>
        
      Contact:              IETF Chair <chair@ietf.org>
        
      Contact:              IETF Chair <chair@ietf.org>
        
      Description:          Diameter over TLS/TCP and DTLS/SCTP
        
      Description:          Diameter over TLS/TCP and DTLS/SCTP
        

Reference: RFC 6733

参考:RFC 6733

Port Number: 5868, from the User Range

端口号:5868,来自用户范围

11.5. SCTP Payload Protocol Identifiers
11.5. SCTP有效负载协议标识符

Two SCTP payload protocol identifiers have been registered in the SCTP Payload Protocol Identifiers registry:

两个SCTP有效负载协议标识符已在SCTP有效负载协议标识符注册表中注册:

    Value | SCTP Payload Protocol Identifier
   -------|-----------------------------------
     46   | Diameter in a SCTP DATA chunk
     47   | Diameter in a DTLS/SCTP DATA chunk
        
    Value | SCTP Payload Protocol Identifier
   -------|-----------------------------------
     46   | Diameter in a SCTP DATA chunk
     47   | Diameter in a DTLS/SCTP DATA chunk
        
11.6. S-NAPTR Parameters
11.6. S-NAPTR参数

The following tag has been registered in the S-NAPTR Application Protocol Tags registry:

以下标记已在S-NAPTR应用程序协议标记注册表中注册:

   Tag                | Protocol
   -------------------|---------
   diameter.dtls.sctp | DTLS/SCTP
        
   Tag                | Protocol
   -------------------|---------
   diameter.dtls.sctp | DTLS/SCTP
        
12. Diameter Protocol-Related Configurable Parameters
12. 与Diameter协议相关的可配置参数

This section contains the configurable parameters that are found throughout this document:

本节包含可在本文档中找到的可配置参数:

Diameter Peer

直径对等体

A Diameter entity MAY communicate with peers that are statically configured. A statically configured Diameter peer would require that either the IP address or the fully qualified domain name (FQDN) be supplied, which would then be used to resolve through DNS.

Diameter实体可以与静态配置的对等体通信。静态配置的Diameter对等方需要提供IP地址或完全限定的域名(FQDN),然后使用该域名通过DNS进行解析。

Routing Table

路由表

A Diameter proxy server routes messages based on the realm portion of a Network Access Identifier (NAI). The server MUST have a table of Realm Names, and the address of the peer to which the message must be forwarded. The routing table MAY also include a "default route", which is typically used for all messages that cannot be locally processed.

Diameter代理服务器根据网络访问标识符(NAI)的领域部分路由消息。服务器必须有一个域名表,以及消息必须转发到的对等方的地址。路由表还可以包括“默认路由”,该路由通常用于无法在本地处理的所有消息。

Tc timer

Tc定时器

The Tc timer controls the frequency that transport connection attempts are done to a peer with whom no active transport connection exists. The recommended value is 30 seconds.

Tc定时器控制对不存在活动传输连接的对等方进行传输连接尝试的频率。建议值为30秒。

13. Security Considerations
13. 安全考虑

The Diameter base protocol messages SHOULD be secured by using TLS [RFC5246] or DTLS/SCTP [RFC6083]. Additional security mechanisms such as IPsec [RFC4301] MAY also be deployed to secure connections between peers. However, all Diameter base protocol implementations MUST support the use of TLS/TCP and DTLS/SCTP, and the Diameter protocol MUST NOT be used without one of TLS, DTLS, or IPsec.

应使用TLS[RFC5246]或DTLS/SCTP[RFC6083]保护Diameter基本协议消息。还可以部署额外的安全机制,如IPsec[RFC4301],以保护对等方之间的连接。但是,所有Diameter基本协议实现必须支持TLS/TCP和DTLS/SCTP的使用,并且在没有TLS、DTLS或IPsec的情况下,不得使用Diameter协议。

If a Diameter connection is to be protected via TLS/TCP and DTLS/SCTP or IPsec, then TLS/TCP and DTLS/SCTP or IPsec/IKE SHOULD begin prior to any Diameter message exchange. All security parameters for TLS/ TCP and DTLS/SCTP or IPsec are configured independent of the Diameter protocol. All Diameter messages will be sent through the TLS/TCP and DTLS/SCTP or IPsec connection after a successful setup.

如果要通过TLS/TCP和DTLS/SCTP或IPsec保护Diameter连接,则TLS/TCP和DTLS/SCTP或IPsec/IKE应在任何Diameter消息交换之前开始。TLS/TCP和DTLS/SCTP或IPsec的所有安全参数的配置独立于Diameter协议。成功安装后,所有Diameter消息将通过TLS/TCP和DTLS/SCTP或IPsec连接发送。

For TLS/TCP and DTLS/SCTP connections to be established in the open state, the CER/CEA exchange MUST include an Inband-Security-ID AVP with a value of TLS/TCP and DTLS/SCTP. The TLS/TCP and DTLS/SCTP handshake will begin when both ends successfully reach the open state, after completion of the CER/CEA exchange. If the TLS/TCP and DTLS/SCTP handshake is successful, all further messages will be sent via TLS/TCP and DTLS/SCTP. If the handshake fails, both ends MUST move to the closed state. See Section 13.1 for more details.

要在开放状态下建立TLS/TCP和DTLS/SCTP连接,CER/CEA交换必须包括带内安全ID AVP,其值为TLS/TCP和DTLS/SCTP。在CER/CEA交换完成后,当两端成功达到打开状态时,TLS/TCP和DTLS/SCTP握手将开始。如果TLS/TCP和DTLS/SCTP握手成功,所有进一步的消息将通过TLS/TCP和DTLS/SCTP发送。如果握手失败,两端必须移动到关闭状态。详见第13.1节。

13.1. TLS/TCP and DTLS/SCTP Usage
13.1. TLS/TCP和DTLS/SCTP的使用

Diameter nodes using TLS/TCP and DTLS/SCTP for security MUST mutually authenticate as part of TLS/TCP and DTLS/SCTP session establishment. In order to ensure mutual authentication, the Diameter node acting as the TLS/TCP and DTLS/SCTP server MUST request a certificate from the Diameter node acting as TLS/TCP and DTLS/SCTP client, and the Diameter node acting as the TLS/TCP and DTLS/SCTP client MUST be prepared to supply a certificate on request.

作为TLS/TCP和DTLS/SCTP会话建立的一部分,使用TLS/TCP和DTLS/SCTP进行安全保护的Diameter节点必须相互验证。为了确保相互身份验证,充当TLS/TCP和DTLS/SCTP服务器的Diameter节点必须从充当TLS/TCP和DTLS/SCTP客户端的Diameter节点请求证书,并且充当TLS/TCP和DTLS/SCTP客户端的Diameter节点必须准备好根据请求提供证书。

Diameter nodes MUST be able to negotiate the following TLS/TCP and DTLS/SCTP cipher suites:

Diameter节点必须能够协商以下TLS/TCP和DTLS/SCTP密码套件:

TLS_RSA_WITH_RC4_128_MD5 TLS_RSA_WITH_RC4_128_SHA TLS_RSA_WITH_3DES_EDE_CBC_SHA

TLS_RSA_与RC4_128_MD5 TLS_RSA_与RC4_128_SHA TLS_RSA_与CBC_SHA

Diameter nodes SHOULD be able to negotiate the following TLS/TCP and DTLS/SCTP cipher suite:

Diameter节点应能够协商以下TLS/TCP和DTLS/SCTP密码套件:

TLS_RSA_WITH_AES_128_CBC_SHA

TLS_RSA_与_AES_128_CBC_SHA

Note that it is quite possible that support for the TLS_RSA_WITH_AES_128_CBC_SHA cipher suite will be REQUIRED at some future date. Diameter nodes MAY negotiate other TLS/TCP and DTLS/ SCTP cipher suites.

请注意,在将来的某个日期,很可能需要支持TLS_RSA_和_AES_128_CBC_SHA密码套件。Diameter节点可以协商其他TLS/TCP和DTLS/SCTP密码套件。

If public key certificates are used for Diameter security (for example, with TLS), the value of the expiration times in the routing and peer tables MUST NOT be greater than the expiry time in the relevant certificates.

如果公钥证书用于Diameter安全性(例如,使用TLS),则路由表和对等表中的过期时间值不得大于相关证书中的过期时间。

13.2. Peer-to-Peer Considerations
13.2. 点对点考虑

As with any peer-to-peer protocol, proper configuration of the trust model within a Diameter peer is essential to security. When certificates are used, it is necessary to configure the root certificate authorities trusted by the Diameter peer. These root CAs are likely to be unique to Diameter usage and distinct from the root CAs that might be trusted for other purposes such as Web browsing. In general, it is expected that those root CAs will be configured so as to reflect the business relationships between the organization hosting the Diameter peer and other organizations. As a result, a Diameter peer will typically not be configured to allow connectivity with any arbitrary peer. With certificate authentication, Diameter peers may not be known beforehand and therefore peer discovery may be required.

与任何对等协议一样,在Diameter对等内正确配置信任模型对安全性至关重要。使用证书时,需要配置Diameter对等方信任的根证书颁发机构。这些根CA可能是Diameter使用的唯一根CA,并且不同于可用于其他目的(如Web浏览)的根CA。一般来说,预期这些根CA将被配置为反映承载Diameter对等体的组织与其他组织之间的业务关系。因此,Diameter对等机通常不会配置为允许与任何任意对等机进行连接。通过证书身份验证,Diameter对等点可能事先不知道,因此可能需要对等点发现。

13.3. AVP Considerations
13.3. AVP考虑因素

Diameter AVPs often contain security-sensitive data; for example, user passwords and location data, network addresses and cryptographic keys. The following AVPs defined in this document are considered to be security-sensitive:

Diameter AVP通常包含安全敏感数据;例如,用户密码和位置数据、网络地址和加密密钥。本文件中定义的以下AVP被视为安全敏感:

o Acct-Interim-Interval

o 会计过渡期

o Accounting-Realtime-Required

o 会计实时要求

o Acct-Multi-Session-Id

o 帐户多会话Id

o Accounting-Record-Number

o 会计记录编号

o Accounting-Record-Type

o 会计记录类型

o Accounting-Session-Id

o 记帐会话Id

o Accounting-Sub-Session-Id

o 记帐子会话Id

o Class

o 班

o Session-Id

o 会话Id

o Session-Binding

o 会话绑定

o Session-Server-Failover

o 会话服务器故障切换

o User-Name

o 用户名

Diameter messages containing these or any other AVPs considered to be security-sensitive MUST only be sent protected via mutually authenticated TLS or IPsec. In addition, those messages MUST NOT be sent via intermediate nodes unless there is end-to-end security between the originator and recipient or the originator has locally trusted configuration that indicates that end-to-end security is not needed. For example, end-to-end security may not be required in the case where an intermediary node is known to be operated as part of the same administrative domain as the endpoints so that an ability to successfully compromise the intermediary would imply a high probability of being able to compromise the endpoints as well. Note that no end-to-end security mechanism is specified in this document.

包含这些或任何其他视为安全敏感的AVP的Diameter消息只能通过相互认证的TLS或IPsec进行发送保护。此外,这些消息不得通过中间节点发送,除非发端人和收件人之间存在端到端安全性,或者发端人具有本地受信任的配置,表明不需要端到端安全性。例如,在已知中间节点作为与端点相同的管理域的一部分操作的情况下,可能不需要端到端安全性,因此成功地危害中间节点的能力将意味着也能够危害端点的高概率。请注意,本文档中未指定端到端安全机制。

14. References
14. 工具书类
14.1. Normative References
14.1. 规范性引用文件

[FLOATPOINT] Institute of Electrical and Electronics Engineers, "IEEE Standard for Binary Floating-Point Arithmetic, ANSI/IEEE Standard 754-1985", August 1985.

[浮点]电气和电子工程师协会,“IEEE二进制浮点算法标准,ANSI/IEEE标准754-1985”,1985年8月。

[IANAADFAM] IANA, "Address Family Numbers", <http://www.iana.org/assignments/address-family-numbers>.

[IANAADFAM]IANA,“地址系列号”<http://www.iana.org/assignments/address-family-numbers>.

[RFC0791] Postel, J., "Internet Protocol", STD 5, RFC 791, September 1981.

[RFC0791]Postel,J.,“互联网协议”,STD 5,RFC 7911981年9月。

[RFC0793] Postel, J., "Transmission Control Protocol", STD 7, RFC 793, September 1981.

[RFC0793]Postel,J.,“传输控制协议”,标准7,RFC 793,1981年9月。

[RFC2119] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, March 1997.

[RFC2119]Bradner,S.,“RFC中用于表示需求水平的关键词”,BCP 14,RFC 2119,1997年3月。

[RFC3492] Costello, A., "Punycode: A Bootstring encoding of Unicode for Internationalized Domain Names in Applications (IDNA)", RFC 3492, March 2003.

[RFC3492]Costello,A.,“Punycode:应用程序中国际化域名的Unicode引导字符串编码(IDNA)”,RFC 3492,2003年3月。

[RFC3539] Aboba, B. and J. Wood, "Authentication, Authorization and Accounting (AAA) Transport Profile", RFC 3539, June 2003.

[RFC3539]Aboba,B.和J.Wood,“认证、授权和会计(AAA)传输概要”,RFC 3539,2003年6月。

[RFC3629] Yergeau, F., "UTF-8, a transformation format of ISO 10646", STD 63, RFC 3629, November 2003.

[RFC3629]Yergeau,F.,“UTF-8,ISO 10646的转换格式”,STD 63,RFC 3629,2003年11月。

[RFC3958] Daigle, L. and A. Newton, "Domain-Based Application Service Location Using SRV RRs and the Dynamic Delegation Discovery Service (DDDS)", RFC 3958, January 2005.

[RFC3958]Daigle,L.和A.Newton,“使用SRV RRs和动态委托发现服务(DDDS)的基于域的应用程序服务定位”,RFC 3958,2005年1月。

[RFC3986] Berners-Lee, T., Fielding, R., and L. Masinter, "Uniform Resource Identifier (URI): Generic Syntax", STD 66, RFC 3986, January 2005.

[RFC3986]Berners Lee,T.,Fielding,R.,和L.Masinter,“统一资源标识符(URI):通用语法”,STD 66,RFC 3986,2005年1月。

[RFC4004] Calhoun, P., Johansson, T., Perkins, C., Hiller, T., and P. McCann, "Diameter Mobile IPv4 Application", RFC 4004, August 2005.

[RFC4004]Calhoun,P.,Johansson,T.,Perkins,C.,Hiller,T.,和P.McCann,“Diameter移动IPv4应用”,RFC 40042005年8月。

[RFC4005] Calhoun, P., Zorn, G., Spence, D., and D. Mitton, "Diameter Network Access Server Application", RFC 4005, August 2005.

[RFC4005]Calhoun,P.,Zorn,G.,Spence,D.,和D.Mitton,“Diameter网络访问服务器应用”,RFC 4005,2005年8月。

[RFC4006] Hakala, H., Mattila, L., Koskinen, J-P., Stura, M., and J. Loughney, "Diameter Credit-Control Application", RFC 4006, August 2005.

[RFC4006]Hakala,H.,Mattila,L.,Koskinen,J-P.,Stura,M.,和J.Loughney,“直径信用控制应用”,RFC 4006,2005年8月。

[RFC4086] Eastlake, D., Schiller, J., and S. Crocker, "Randomness Requirements for Security", BCP 106, RFC 4086, June 2005.

[RFC4086]Eastlake,D.,Schiller,J.,和S.Crocker,“安全的随机性要求”,BCP 106,RFC 4086,2005年6月。

[RFC4282] Aboba, B., Beadles, M., Arkko, J., and P. Eronen, "The Network Access Identifier", RFC 4282, December 2005.

[RFC4282]Aboba,B.,Beadles,M.,Arkko,J.,和P.Erenen,“网络访问标识符”,RFC 42822005年12月。

[RFC4291] Hinden, R. and S. Deering, "IP Version 6 Addressing Architecture", RFC 4291, February 2006.

[RFC4291]Hinden,R.和S.Deering,“IP版本6寻址体系结构”,RFC 42912006年2月。

[RFC4960] Stewart, R., "Stream Control Transmission Protocol", RFC 4960, September 2007.

[RFC4960]Stewart,R.,“流控制传输协议”,RFC 49602007年9月。

[RFC5226] Narten, T. and H. Alvestrand, "Guidelines for Writing an IANA Considerations Section in RFCs", BCP 26, RFC 5226, May 2008.

[RFC5226]Narten,T.和H.Alvestrand,“在RFCs中编写IANA注意事项部分的指南”,BCP 26,RFC 5226,2008年5月。

[RFC5234] Crocker, D. and P. Overell, "Augmented BNF for Syntax Specifications: ABNF", STD 68, RFC 5234, January 2008.

[RFC5234]Crocker,D.和P.Overell,“语法规范的扩充BNF:ABNF”,STD 68,RFC 5234,2008年1月。

[RFC5246] Dierks, T. and E. Rescorla, "The Transport Layer Security (TLS) Protocol Version 1.2", RFC 5246, August 2008.

[RFC5246]Dierks,T.和E.Rescorla,“传输层安全(TLS)协议版本1.2”,RFC 5246,2008年8月。

[RFC5280] Cooper, D., Santesson, S., Farrell, S., Boeyen, S., Housley, R., and W. Polk, "Internet X.509 Public Key Infrastructure Certificate and Certificate Revocation List (CRL) Profile", RFC 5280, May 2008.

[RFC5280]Cooper,D.,Santesson,S.,Farrell,S.,Boeyen,S.,Housley,R.,和W.Polk,“Internet X.509公钥基础设施证书和证书撤销列表(CRL)配置文件”,RFC 52802008年5月。

[RFC5729] Korhonen, J., Jones, M., Morand, L., and T. Tsou, "Clarifications on the Routing of Diameter Requests Based on the Username and the Realm", RFC 5729, December 2009.

[RFC5729]Korhonen,J.,Jones,M.,Morand,L.,和T.Tsou,“关于基于用户名和领域的Diameter请求路由的澄清”,RFC 57292009年12月。

[RFC5890] Klensin, J., "Internationalized Domain Names for Applications (IDNA): Definitions and Document Framework", RFC 5890, August 2010.

[RFC5890]Klensin,J.,“应用程序的国际化域名(IDNA):定义和文档框架”,RFC 58902010年8月。

[RFC5891] Klensin, J., "Internationalized Domain Names in Applications (IDNA): Protocol", RFC 5891, August 2010.

[RFC5891]Klensin,J.,“应用程序中的国际化域名(IDNA):协议”,RFC 58912010年8月。

[RFC6083] Tuexen, M., Seggelmann, R., and E. Rescorla, "Datagram Transport Layer Security (DTLS) for Stream Control Transmission Protocol (SCTP)", RFC 6083, January 2011.

[RFC6083]Tuexen,M.,Seggelmann,R.,和E.Rescorla,“流控制传输协议(SCTP)的数据报传输层安全性(DTLS)”,RFC 6083,2011年1月。

[RFC6347] Rescorla, E. and N. Modadugu, "Datagram Transport Layer Security Version 1.2", RFC 6347, January 2012.

[RFC6347]Rescorla,E.和N.Modadugu,“数据报传输层安全版本1.2”,RFC 6347,2012年1月。

[RFC6408] Jones, M., Korhonen, J., and L. Morand, "Diameter Straightforward-Naming Authority Pointer (S-NAPTR) Usage", RFC 6408, November 2011.

[RFC6408]Jones,M.,Korhonen,J.和L.Morand,“直接命名机构指针(S-NAPTR)的使用”,RFC 6408,2011年11月。

14.2. Informative References
14.2. 资料性引用

[ENTERPRISE] IANA, "SMI Network Management Private Enterprise Codes", <http://www.iana.org/assignments/enterprise-numbers>.

[企业]IANA,“SMI网络管理私有企业代码”<http://www.iana.org/assignments/enterprise-numbers>.

[IANATCV] IANA, "Termination-Cause AVP Values (code 295)", <http://www.iana.org/assignments/aaa-parameters/ aaa-parameters.xml#aaa-parameters-16>.

[IANATCV]IANA,“终止原因AVP值(代码295)”<http://www.iana.org/assignments/aaa-parameters/ aaa parameters.xml#aaa-parameters-16>。

[RFC1492] Finseth, C., "An Access Control Protocol, Sometimes Called TACACS", RFC 1492, July 1993.

[RFC1492]Finseth,C.,“访问控制协议,有时称为TACACS”,RFC 1492,1993年7月。

[RFC1661] Simpson, W., "The Point-to-Point Protocol (PPP)", STD 51, RFC 1661, July 1994.

[RFC1661]辛普森,W.“点对点协议(PPP)”,标准51,RFC1661,1994年7月。

[RFC2104] Krawczyk, H., Bellare, M., and R. Canetti, "HMAC: Keyed-Hashing for Message Authentication", RFC 2104, February 1997.

[RFC2104]Krawczyk,H.,Bellare,M.,和R.Canetti,“HMAC:用于消息认证的键控哈希”,RFC 2104,1997年2月。

[RFC2782] Gulbrandsen, A., Vixie, P., and L. Esibov, "A DNS RR for specifying the location of services (DNS SRV)", RFC 2782, February 2000.

[RFC2782]Gulbrandsen,A.,Vixie,P.和L.Esibov,“用于指定服务位置(DNS SRV)的DNS RR”,RFC 2782,2000年2月。

[RFC2865] Rigney, C., Willens, S., Rubens, A., and W. Simpson, "Remote Authentication Dial In User Service (RADIUS)", RFC 2865, June 2000.

[RFC2865]Rigney,C.,Willens,S.,Rubens,A.,和W.Simpson,“远程认证拨入用户服务(RADIUS)”,RFC 28652000年6月。

[RFC2866] Rigney, C., "RADIUS Accounting", RFC 2866, June 2000.

[RFC2866]Rigney,C.,“半径会计”,RFC 28662000年6月。

[RFC2869] Rigney, C., Willats, W., and P. Calhoun, "RADIUS Extensions", RFC 2869, June 2000.

[RFC2869]Rigney,C.,Willats,W.,和P.Calhoun,“半径延伸”,RFC 2869,2000年6月。

[RFC2881] Mitton, D. and M. Beadles, "Network Access Server Requirements Next Generation (NASREQNG) NAS Model", RFC 2881, July 2000.

[RFC2881]Mitton,D.和M.Beadles,“网络访问服务器要求下一代(NASREQNG)NAS模型”,RFC 28812000年7月。

[RFC2975] Aboba, B., Arkko, J., and D. Harrington, "Introduction to Accounting Management", RFC 2975, October 2000.

[RFC2975]Aboba,B.,Arkko,J.,和D.Harrington,“会计管理导论”,RFC 29752000年10月。

[RFC2989] Aboba, B., Calhoun, P., Glass, S., Hiller, T., McCann, P., Shiino, H., Walsh, P., Zorn, G., Dommety, G., Perkins, C., Patil, B., Mitton, D., Manning, S., Beadles, M., Chen, X., Sivalingham, S., Hameed, A., Munson, M., Jacobs, S., Lim, B., Hirschman, B., Hsu, R., Koo, H., Lipford, M., Campbell, E., Xu, Y., Baba, S., and E. Jaques, "Criteria for Evaluating AAA Protocols for Network Access", RFC 2989, November 2000.

[RFC2989]Aboba,B.,Calhoun,P.,Glass,S.,Hiller,T.,McCann,P.,Shiino,H.,Walsh,P.,Zorn,G.,Dommety,G.,Perkins,C.,Patil,B.,Mitton,D.,Manning,S.,Beadles,M.,Chen,X.,Sivalingham,S.,Hameed,A.,Munson,M.,Jacobs,S.,Lim,B.,Hirschman,B.,Hsu,R.,Koo,H.,Lipford,M.,Campbell,E.,Xu,Y.,Y.,Baba,S.,E.Jaques,“评估网络接入AAA协议的标准”,RFC 2989,2000年11月。

[RFC3162] Aboba, B., Zorn, G., and D. Mitton, "RADIUS and IPv6", RFC 3162, August 2001.

[RFC3162]Aboba,B.,Zorn,G.和D.Mitton,“RADIUS和IPv6”,RFC 3162,2001年8月。

[RFC3748] Aboba, B., Blunk, L., Vollbrecht, J., Carlson, J., and H. Levkowetz, "Extensible Authentication Protocol (EAP)", RFC 3748, June 2004.

[RFC3748]Aboba,B.,Blunk,L.,Vollbrecht,J.,Carlson,J.,和H.Levkowetz,“可扩展身份验证协议(EAP)”,RFC 3748,2004年6月。

[RFC4301] Kent, S. and K. Seo, "Security Architecture for the Internet Protocol", RFC 4301, December 2005.

[RFC4301]Kent,S.和K.Seo,“互联网协议的安全架构”,RFC 43012005年12月。

[RFC4690] Klensin, J., Faltstrom, P., Karp, C., and IAB, "Review and Recommendations for Internationalized Domain Names (IDNs)", RFC 4690, September 2006.

[RFC4690]Klensin,J.,Faltstrom,P.,Karp,C.,和IAB,“国际化域名(IDN)的审查和建议”,RFC 46902006年9月。

[RFC5176] Chiba, M., Dommety, G., Eklund, M., Mitton, D., and B. Aboba, "Dynamic Authorization Extensions to Remote Authentication Dial In User Service (RADIUS)", RFC 5176, January 2008.

[RFC5176]Chiba,M.,Dommety,G.,Eklund,M.,Mitton,D.,和B.Aboba,“远程认证拨号用户服务(RADIUS)的动态授权扩展”,RFC 51762008年1月。

[RFC5461] Gont, F., "TCP's Reaction to Soft Errors", RFC 5461, February 2009.

[RFC5461]Gont,F.,“TCP对软错误的反应”,RFC 54612009年2月。

[RFC5905] Mills, D., Martin, J., Burbank, J., and W. Kasch, "Network Time Protocol Version 4: Protocol and Algorithms Specification", RFC 5905, June 2010.

[RFC5905]Mills,D.,Martin,J.,Burbank,J.,和W.Kasch,“网络时间协议版本4:协议和算法规范”,RFC 59052010年6月。

[RFC5927] Gont, F., "ICMP Attacks against TCP", RFC 5927, July 2010.

[RFC5927]Gont,F.,“针对TCP的ICMP攻击”,RFC 5927,2010年7月。

[RFC6335] Cotton, M., Eggert, L., Touch, J., Westerlund, M., and S. Cheshire, "Internet Assigned Numbers Authority (IANA) Procedures for the Management of the Service Name and Transport Protocol Port Number Registry", BCP 165, RFC 6335, August 2011.

[RFC6335]Cotton,M.,Eggert,L.,Touch,J.,Westerlund,M.,和S.Cheshire,“互联网分配号码管理局(IANA)服务名称和传输协议端口号注册管理程序”,BCP 165,RFC 63352011年8月。

[RFC6737] Kang, J. and G. Zorn, "The Diameter Capabilities Update Application", RFC 6737, October 2012.

[RFC6737]Kang,J.和G.Zorn,“直径能力更新应用”,RFC 6737,2012年10月。

Appendix A. Acknowledgements
附录A.确认书
A.1. This Document
A.1. 本文件

The authors would like to thank the following people that have provided proposals and contributions to this document:

作者要感谢为本文件提供建议和贡献的以下人员:

To Vishnu Ram and Satendra Gera for their contributions on capabilities updates, predictive loop avoidance, as well as many other technical proposals. To Tolga Asveren for his insights and contributions on almost all of the proposed solutions incorporated into this document. To Timothy Smith for helping on the capabilities Update and other topics. To Tony Zhang for providing fixes to loopholes on composing Failed-AVPs as well as many other issues and topics. To Jan Nordqvist for clearly stating the usage of Application Ids. To Anders Kristensen for providing needed technical opinions. To David Frascone for providing invaluable review of the document. To Mark Jones for providing clarifying text on vendor command codes and other vendor-specific indicators. To Victor Pascual and Sebastien Decugis for new text and recommendations on SCTP/DTLS. To Jouni Korhonen for taking over the editing task and resolving last bits from versions 27 through 29.

感谢毗瑟奴拉姆和萨坦德拉·杰拉在能力更新、预测环路避免以及许多其他技术建议方面的贡献。感谢Tolga Asveren对本文件中几乎所有拟议解决方案的见解和贡献。感谢Timothy Smith就功能更新和其他主题提供帮助。感谢Tony Zhang为编写失败的AVP以及许多其他问题和主题的漏洞提供修复。向Jan Nordqvist明确说明应用程序ID的使用。感谢Anders Kristensen提供所需的技术意见。感谢David Frascone对该文件进行了宝贵的审查。标记Jones,以提供有关供应商命令代码和其他供应商特定指标的澄清文本。向Victor Pascual和Sebastien Decugis提交关于SCTP/DTL的新文本和建议。转给Jouni Korhonen,以接管编辑任务并解析版本27到29的最后一位。

Special thanks to the Diameter extensibility design team, which helped resolve the tricky question of mandatory AVPs and ABNF semantics. The members of this team are as follows:

特别感谢Diameter扩展性设计团队,该团队帮助解决了强制AVP和ABNF语义的棘手问题。该小组成员如下:

Avi Lior, Jari Arkko, Glen Zorn, Lionel Morand, Mark Jones, Tolga Asveren, Jouni Korhonen, and Glenn McGregor.

阿维·利奥、贾里·阿尔科、格伦·佐恩、莱昂内尔·莫兰、马克·琼斯、托尔加·阿斯维伦、朱尼·科霍宁和格伦·麦克格雷戈。

Special thanks also to people who have provided invaluable comments and inputs especially in resolving controversial issues:

还特别感谢特别是在解决争议问题方面提供宝贵意见和投入的人士:

Glen Zorn, Yoshihiro Ohba, Marco Stura, Stephen Farrel, Pete Resnick, Peter Saint-Andre, Robert Sparks, Krishna Prasad, Sean Turner, Barry Leiba, and Pasi Eronen.

格伦·佐恩、大叶吉弘、马可·斯图拉、斯蒂芬·法雷尔、皮特·雷斯尼克、彼得·圣安德烈、罗伯特·斯帕克斯、克里希纳·普拉萨德、肖恩·特纳、巴里·莱巴和帕西·艾隆。

Finally, we would like to thank the original authors of this document:

最后,我们要感谢本文件的原始作者:

Pat Calhoun, John Loughney, Jari Arkko, Erik Guttman, and Glen Zorn.

帕特·卡尔霍恩、约翰·拉夫尼、贾里·阿尔科、埃里克·古特曼和格伦·佐恩。

Their invaluable knowledge and experience has given us a robust and flexible AAA protocol that many people have seen great value in adopting. We greatly appreciate their support and stewardship for the continued improvements of Diameter as a protocol. We would also like to extend our gratitude to folks aside from the authors who have

他们宝贵的知识和经验为我们提供了一个强大而灵活的AAA协议,许多人认为采用该协议非常有价值。我们非常感谢他们对Diameter作为一项协议的持续改进的支持和指导。我们也要感谢除了作者之外的其他人

assisted and contributed to the original version of this document. Their efforts significantly contributed to the success of Diameter.

协助并促成了本文件的原始版本。他们的努力大大促进了Diameter的成功。

A.2. RFC 3588
A.2. RFC3588

The authors would like to thank Nenad Trifunovic, Tony Johansson and Pankaj Patel for their participation in the pre-IETF Document Reading Party. Allison Mankin, Jonathan Wood, and Bernard Aboba provided invaluable assistance in working out transport issues and this was also the case with Steven Bellovin in the security area.

作者要感谢内纳德·特里富诺维奇、托尼·约翰逊和潘卡吉·帕特尔参加IETF前文件阅读聚会。Allison Mankin、Jonathan Wood和Bernard Aboba在解决交通问题方面提供了宝贵的帮助,Steven Bellovin在安全领域也是如此。

Paul Funk and David Mitton were instrumental in getting the Peer State Machine correct, and our deep thanks go to them for their time.

保罗·芬克(Paul Funk)和大卫·米顿(David Mitton)在纠正对等状态机方面发挥了重要作用,我们深切感谢他们花了这么多时间。

Text in this document was also provided by Paul Funk, Mark Eklund, Mark Jones, and Dave Spence. Jacques Caron provided many great comments as a result of a thorough review of the spec.

本文中的文本也由Paul Funk、Mark Eklund、Mark Jones和Dave Spence提供。雅克·卡隆(Jacques Caron)对规范进行了彻底的审查,提出了许多很好的意见。

The authors would also like to acknowledge the following people for their contribution in the development of the Diameter protocol:

作者还想感谢以下人员在Diameter协议制定过程中的贡献:

Allan C. Rubens, Haseeb Akhtar, William Bulley, Stephen Farrell, David Frascone, Daniel C. Fox, Lol Grant, Ignacio Goyret, Nancy Greene, Peter Heitman, Fredrik Johansson, Mark Jones, Martin Julien, Bob Kopacz, Paul Krumviede, Fergal Ladley, Ryan Moats, Victor Muslin, Kenneth Peirce, John Schnizlein, Sumit Vakil, John R. Vollbrecht, and Jeff Weisberg.

艾伦·C·鲁本斯、哈塞布·阿克塔、威廉·布里、斯蒂芬·法雷尔、大卫·弗雷斯科、丹尼尔·C·福克斯、洛尔·格兰特、伊格纳西奥·戈雷特、南希·格林、彼得·海特曼、弗雷德里克·约翰森、马克·琼斯、马丁·朱利安、鲍勃·科帕茨、保罗·克鲁姆维德、费格尔·拉德利、瑞安·莫茨、维克多·穆斯林、肯尼斯·皮尔斯、约翰·施尼兹莱因、苏米特·瓦基尔、约翰·R·沃尔布雷特、,还有杰夫·韦斯伯格。

Finally, Pat Calhoun would like to thank Sun Microsystems since most of the effort put into this document was done while he was in their employ.

最后,Pat Calhoun要感谢Sun Microsystems,因为在本文档中投入的大部分精力都是在他任职期间完成的。

Appendix B. S-NAPTR Example
附录B S-NAPTR示例

As an example, consider a client that wishes to resolve aaa: ex1.example.com. The client performs a NAPTR query for that domain, and the following NAPTR records are returned:

作为一个例子,考虑一个希望解析AAA:Ex1.ExpLo.com的客户端。客户端对该域执行NAPTR查询,并返回以下NAPTR记录:

;; order pref flags service regexp replacement IN NAPTR 50 50 "s" "aaa:diameter.tls.tcp" "" _diameter._tls.ex1.example.com IN NAPTR 100 50 "s" "aaa:diameter.tcp" "" _aaa._tcp.ex1.example.com IN NAPTR 150 50 "s" "aaa:diameter.sctp" "" _diameter._sctp.ex1.example.com

;; order pref将NAPTR 50 50“s”中的服务regexp替换标记为“aaa:diameter.tls.tcp”“”NAPTR 100 50“s”中的“aaa:diameter.tcp”“”中的“U diameter.”tls.ex1.example.com“aaa:diameter.sctp”“”中的“aaa:diameter.sctp”“”中的“U diameter.”sctp.ex1.example.com

This indicates that the server supports TLS, TCP, and SCTP in that order. If the client supports TLS, TLS will be used, targeted to a

这表示服务器按顺序支持TLS、TCP和SCTP。如果客户端支持TLS,则将使用TLS,目标是

host determined by an SRV lookup of _diameter._tls.ex1.example.com. That lookup would return:

主机由SRV查找_diameter._tls.ex1.example.com确定。该查找将返回:

;; Priority Weight Port Target IN SRV 0 1 5060 server1.ex1.example.com IN SRV 0 2 5060 server2.ex1.example.com

;; SRV 0 2 5060 server2.ex1.example.com中SRV 0 1 5060 server1.ex1.example.com中的优先级权重端口目标

As an alternative example, a client that wishes to resolve aaa: ex2.example.com. The client performs a NAPTR query for that domain, and the following NAPTR records are returned:

另一个示例是,希望解析aaa的客户端:ex2.example.com。客户端对该域执行NAPTR查询,并返回以下NAPTR记录:

;; order pref flags service regexp replacement IN NAPTR 150 50 "a" "aaa:diameter.tls.tcp" "" server1.ex2.example.com IN NAPTR 150 50 "a" "aaa:diameter.tls.tcp" "" server2.ex2.example.com

;; order pref在NAPTR 150 50“a”“aaa:diameter.tls.tcp”“server1.ex2.example.com中的NAPTR 150 50“a”“aaa:diameter.tls.tcp”“server2.ex2.example.com中标记服务regexp替换

This indicates that the server supports TCP available at the returned host names.

这表示服务器支持在返回的主机名上可用的TCP。

Appendix C. Duplicate Detection
附录C.重复检测

As described in Section 9.4, accounting record duplicate detection is based on session identifiers. Duplicates can appear for various reasons:

如第9.4节所述,会计记录重复检测基于会话标识符。出现重复项的原因有多种:

o Failover to an alternate server. Where close to real-time performance is required, failover thresholds need to be kept low. This may lead to an increased likelihood of duplicates. Failover can occur at the client or within Diameter agents.

o 故障转移到备用服务器。在需要接近实时性能的情况下,故障切换阈值需要保持较低。这可能导致重复的可能性增加。故障转移可以发生在客户端或Diameter代理内。

o Failure of a client or agent after sending a record from non-volatile memory, but prior to receipt of an application-layer ACK and deletion of the record to be sent. This will result in retransmission of the record soon after the client or agent has rebooted.

o 从非易失性存储器发送记录后,但在收到应用层ACK并删除要发送的记录之前,客户端或代理出现故障。这将导致在客户端或代理重新启动后不久重新传输记录。

o Duplicates received from RADIUS gateways. Since the retransmission behavior of RADIUS is not defined within [RFC2865], the likelihood of duplication will vary according to the implementation.

o 从RADIUS网关接收的副本。由于[RFC2865]中未定义RADIUS的重传行为,因此复制的可能性将根据实现情况而变化。

o Implementation problems and misconfiguration.

o 实现问题和错误配置。

The T flag is used as an indication of an application-layer retransmission event, e.g., due to failover to an alternate server. It is defined only for request messages sent by Diameter clients or agents. For instance, after a reboot, a client may not know whether

T标志用于指示应用层重新传输事件,例如,由于故障切换到备用服务器而导致的事件。它仅为Diameter客户端或代理发送的请求消息定义。例如,重新启动后,客户端可能不知道

it has already tried to send the accounting records in its non-volatile memory before the reboot occurred. Diameter servers MAY use the T flag as an aid when processing requests and detecting duplicate messages. However, servers that do this MUST ensure that duplicates are found even when the first transmitted request arrives at the server after the retransmitted request. It can be used only in cases where no answer has been received from the server for a request and the request is sent again, (e.g., due to a failover to an alternate peer, due to a recovered primary peer or due to a client re-sending a stored record from non-volatile memory such as after reboot of a client or agent).

在重新启动之前,它已尝试在其非易失性内存中发送记帐记录。Diameter服务器在处理请求和检测重复消息时可以使用T标志作为辅助。但是,执行此操作的服务器必须确保即使在重新传输请求之后第一个传输的请求到达服务器时也能找到重复的请求。只有在服务器未收到请求的应答且请求再次发送的情况下(例如,由于故障切换到备用对等方、由于恢复的主对等方或由于客户端从非易失性内存重新发送存储记录,例如在客户端或代理重新启动后),才可以使用此功能。

In some cases, the Diameter accounting server can delay the duplicate detection and accounting record processing until a post-processing phase takes place. At that time records are likely to be sorted according to the included User-Name and duplicate elimination is easy in this case. In other situations, it may be necessary to perform real-time duplicate detection, such as when credit limits are imposed or real-time fraud detection is desired.

在某些情况下,Diameter accounting server可以将重复检测和记帐记录处理延迟到后处理阶段。此时,可能会根据包含的用户名对记录进行排序,在这种情况下很容易消除重复。在其他情况下,可能需要执行实时重复检测,例如当施加信用限额或需要实时欺诈检测时。

In general, only generation of duplicates due to failover or re-sending of records in non-volatile storage can be reliably detected by Diameter clients or agents. In such cases, the Diameter client or agents can mark the message as a possible duplicate by setting the T flag. Since the Diameter server is responsible for duplicate detection, it can choose whether or not to make use of the T flag, in order to optimize duplicate detection. Since the T flag does not affect interoperability, and it may not be needed by some servers, generation of the T flag is REQUIRED for Diameter clients and agents, but it MAY be implemented by Diameter servers.

通常,Diameter客户端或代理只能可靠地检测到由于故障转移或重新发送非易失性存储中的记录而生成的副本。在这种情况下,Diameter客户端或代理可以通过设置T标志将消息标记为可能的副本。由于Diameter服务器负责重复检测,因此它可以选择是否使用T标志,以优化重复检测。由于T标志不影响互操作性,并且某些服务器可能不需要T标志,因此Diameter客户端和代理需要生成T标志,但可以由Diameter服务器实现。

As an example, it can be usually be assumed that duplicates appear within a time window of longest recorded network partition or device fault, perhaps a day. So only records within this time window need to be looked at in the backward direction. Secondly, hashing techniques or other schemes, such as the use of the T flag in the received messages, may be used to eliminate the need to do a full search even in this set except for rare cases.

例如,通常可以假设在记录的最长网络分区或设备故障的时间窗口内(可能是一天)出现重复项。因此,只有在这个时间窗口内的记录需要反向查看。第二,可以使用散列技术或其他方案,例如在接收到的消息中使用T标志,以消除即使在该集合中进行完全搜索的需要,除了少数情况。

The following is an example of how the T flag may be used by the server to detect duplicate requests.

以下是服务器如何使用T标志来检测重复请求的示例。

A Diameter server MAY check the T flag of the received message to determine if the record is a possible duplicate. If the T flag is set in the request message, the server searches for a duplicate within a configurable duplication time window backward and forward. This limits database searching to those records where the T flag is set. In a well-run network, network partitions and

Diameter服务器可以检查所接收消息的T标志,以确定记录是否可能重复。如果在请求消息中设置了T标志,服务器将在可配置的复制时间窗口内前后搜索复制。这将数据库搜索限制为设置了T标志的记录。在运行良好的网络中,网络分区和

device faults will presumably be rare events, so this approach represents a substantial optimization of the duplicate detection process. During failover, it is possible for the original record to be received after the T-flag-marked record, due to differences in network delays experienced along the path by the original and duplicate transmissions. The likelihood of this occurring increases as the failover interval is decreased. In order to be able to detect duplicates that are out of order, the Diameter server should use backward and forward time windows when performing duplicate checking for the T-flag-marked request. For example, in order to allow time for the original record to exit the network and be recorded by the accounting server, the Diameter server can delay processing records with the T flag set until a time period TIME_WAIT + RECORD_PROCESSING_TIME has elapsed after the closing of the original transport connection. After this time period, it may check the T-flag-marked records against the database with relative assurance that the original records, if sent, have been received and recorded.

设备故障可能是罕见的事件,因此这种方法代表了对重复检测过程的实质性优化。在故障切换期间,由于原始传输和重复传输在路径上经历的网络延迟不同,原始记录可能会在标记有T标志的记录之后接收。随着故障切换间隔的缩短,发生这种情况的可能性增加。为了能够检测出故障的重复项,Diameter服务器在对标记为T标志的请求执行重复项检查时应使用向后和向前时间窗口。例如,为了让原始记录有时间退出网络并由记帐服务器记录,Diameter服务器可以延迟处理设置了T标志的记录,直到原始传输连接关闭后经过一个时间段time_WAIT+record_processing_time。在这段时间之后,它可以对照数据库检查带有T标志的记录,并相对保证原始记录(如果发送)已经收到和记录。

Appendix D. Internationalized Domain Names
附录D.国际化域名

To be compatible with the existing DNS infrastructure and simplify host and domain name comparison, Diameter identities (FQDNs) are represented in ASCII form. This allows the Diameter protocol to fall in-line with the DNS strategy of being transparent from the effects of Internationalized Domain Names (IDNs) by following the recommendations in [RFC4690] and [RFC5890]. Applications that provide support for IDNs outside of the Diameter protocol but interacting with it SHOULD use the representation and conversion framework described in [RFC5890], [RFC5891], and [RFC3492].

为了与现有DNS基础架构兼容并简化主机名和域名比较,Diameter标识(FQDN)以ASCII格式表示。这使得Diameter协议符合DNS策略,即遵循[RFC4690]和[RFC5890]中的建议,对国际化域名(IDN)的影响保持透明。为Diameter协议之外的IDN提供支持但与之交互的应用程序应使用[RFC5890]、[RFC5891]和[RFC3492]中描述的表示和转换框架。

Authors' Addresses

作者地址

Victor Fajardo (editor) Telcordia Technologies One Telcordia Drive, 1S-222 Piscataway, NJ 08854 USA

Victor Fajardo(编辑)Telcordia Technologies One Telcordia Drive,美国新泽西州皮斯卡塔韦市1S-222号,邮编:08854

   Phone: +1-908-421-1845
   EMail: vf0213@gmail.com
        
   Phone: +1-908-421-1845
   EMail: vf0213@gmail.com
        

Jari Arkko Ericsson Research 02420 Jorvas Finland

雅丽阿尔科爱立信研究公司02420 Jorvas芬兰

   Phone: +358 40 5079256
   EMail: jari.arkko@ericsson.com
        
   Phone: +358 40 5079256
   EMail: jari.arkko@ericsson.com
        

John Loughney Nokia Research Center 955 Page Mill Road Palo Alto, CA 94304 US

约翰·拉夫尼诺基亚研究中心美国加利福尼亚州帕洛阿尔托米尔路955号,邮编94304

   Phone: +1-650-283-8068
   EMail: john.loughney@nokia.com
        
   Phone: +1-650-283-8068
   EMail: john.loughney@nokia.com
        

Glen Zorn (editor) Network Zen 227/358 Thanon Sanphawut Bang Na, Bangkok 10260 Thailand

格伦·佐恩(编辑)网络禅227/358泰国曼谷Thnon Sanphawut Bang Na 10260

   Phone: +66 (0) 87-0404617
   EMail: glenzorn@gmail.com
        
   Phone: +66 (0) 87-0404617
   EMail: glenzorn@gmail.com