idnits 2.17.00 (12 Aug 2021) /tmp/idnits43724/draft-ietf-dime-app-design-guide-16.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- No issues found here. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year == The document doesn't use any RFC 2119 keywords, yet seems to have RFC 2119 boilerplate text. -- The document seems to lack a disclaimer for pre-RFC5378 work, but may have content which was first submitted before 10 November 2008. If you have contacted all the original authors and they are all willing to grant the BCP78 rights to the IETF Trust, then this is fine, and you can ignore this comment. If not, you may need to add the pre-RFC5378 disclaimer. (See the Legal Provisions document at https://trustee.ietf.org/license-info for more information.) -- The document date (October 22, 2012) is 3497 days in the past. Is this intentional? Checking references for intended status: Informational ---------------------------------------------------------------------------- == Outdated reference: draft-ietf-dime-rfc3588bis has been published as RFC 6733 ** Obsolete normative reference: RFC 3588 (Obsoleted by RFC 6733) -- Obsolete informational reference (is this intentional?): RFC 2407 (Obsoleted by RFC 4306) -- Obsolete informational reference (is this intentional?): RFC 2409 (Obsoleted by RFC 4306) -- Obsolete informational reference (is this intentional?): RFC 4005 (Obsoleted by RFC 7155) Summary: 1 error (**), 0 flaws (~~), 3 warnings (==), 5 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 Diameter Maintenance and Extensions L. Morand, Ed. 3 (DIME) Orange Labs 4 Internet-Draft V. Fajardo 5 Intended status: Informational 6 Expires: April 25, 2013 H. Tschofenig 7 Nokia Siemens Networks 8 October 22, 2012 10 Diameter Applications Design Guidelines 11 draft-ietf-dime-app-design-guide-16 13 Abstract 15 The Diameter Base protocol provides facilities for protocol 16 extensibility enabling to define new Diameter applications or modify 17 existing applications. This document is a companion document to the 18 Diameter base protocol that further explains and clarifies the rules 19 to extend the Diameter base protocol. It is meant as a guidelines 20 document and therefore it does not add, remove or change existing 21 rules. 23 Requirements Language 25 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 26 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 27 document are to be interpreted as described in [RFC2119]. 29 Status of this Memo 31 This Internet-Draft is submitted in full conformance with the 32 provisions of BCP 78 and BCP 79. 34 Internet-Drafts are working documents of the Internet Engineering 35 Task Force (IETF). Note that other groups may also distribute 36 working documents as Internet-Drafts. The list of current Internet- 37 Drafts is at http://datatracker.ietf.org/drafts/current/. 39 Internet-Drafts are draft documents valid for a maximum of six months 40 and may be updated, replaced, or obsoleted by other documents at any 41 time. It is inappropriate to use Internet-Drafts as reference 42 material or to cite them other than as "work in progress." 44 This Internet-Draft will expire on April 25, 2013. 46 Copyright Notice 48 Copyright (c) 2012 IETF Trust and the persons identified as the 49 document authors. All rights reserved. 51 This document is subject to BCP 78 and the IETF Trust's Legal 52 Provisions Relating to IETF Documents 53 (http://trustee.ietf.org/license-info) in effect on the date of 54 publication of this document. Please review these documents 55 carefully, as they describe your rights and restrictions with respect 56 to this document. Code Components extracted from this document must 57 include Simplified BSD License text as described in Section 4.e of 58 the Trust Legal Provisions and are provided without warranty as 59 described in the Simplified BSD License. 61 Table of Contents 63 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 4 64 2. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 5 65 3. Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 66 4. Reusing Existing Diameter Applications . . . . . . . . . . . . 8 67 4.1. Adding a New Command . . . . . . . . . . . . . . . . . . . 8 68 4.2. Deleting an Existing Command . . . . . . . . . . . . . . . 9 69 4.3. Reusing Existing Commands . . . . . . . . . . . . . . . . 9 70 4.3.1. Adding AVPs to a Command . . . . . . . . . . . . . . . 9 71 4.3.2. Deleting AVPs from a Command . . . . . . . . . . . . . 11 72 4.4. Reusing Existing AVPs . . . . . . . . . . . . . . . . . . 12 73 4.4.1. Setting of the AVP Flags . . . . . . . . . . . . . . . 12 74 4.4.2. Reuse of AVP of Type Enumerated . . . . . . . . . . . 12 75 5. Defining New Diameter Applications . . . . . . . . . . . . . . 13 76 5.1. Introduction . . . . . . . . . . . . . . . . . . . . . . . 13 77 5.2. Defining New Commands . . . . . . . . . . . . . . . . . . 13 78 5.3. Use of Application-Id in a Message . . . . . . . . . . . . 14 79 5.4. Application-Specific Session State Machines . . . . . . . 14 80 5.5. Session-Id AVP and Session Management . . . . . . . . . . 15 81 5.6. AVPs Defined as Boolean Flag . . . . . . . . . . . . . . . 15 82 5.7. Application-Specific Message Routing . . . . . . . . . . . 16 83 5.8. About Translation Agent . . . . . . . . . . . . . . . . . 17 84 5.9. End-to-End Application Capabilities Exchange . . . . . . . 17 85 5.10. Diameter Accounting Support . . . . . . . . . . . . . . . 18 86 5.11. Diameter Security Mechanisms . . . . . . . . . . . . . . . 20 87 6. Defining Generic Diameter Extensions . . . . . . . . . . . . . 22 88 7. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 24 89 8. Security Considerations . . . . . . . . . . . . . . . . . . . 25 90 9. Contributors . . . . . . . . . . . . . . . . . . . . . . . . . 26 91 10. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . 27 92 11. References . . . . . . . . . . . . . . . . . . . . . . . . . . 28 93 11.1. Normative References . . . . . . . . . . . . . . . . . . . 28 94 11.2. Informative References . . . . . . . . . . . . . . . . . . 28 95 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . . 30 97 1. Introduction 99 The Diameter base protocol provides facilities to extend the Diameter 100 base protocol (see Section 1.3 of [I-D.ietf-dime-rfc3588bis]) for 101 supporting new functionalities. In the context of this document, 102 extending Diameter means one of the following: 104 1. Addition of a new functionality to an existing Diameter 105 application without defining a new application. 107 2. Addition of a new functionality to an existing Diameter 108 application that requires the definition of a new application. 110 3. The definition of a new Diameter application to provide a set of 111 functionalities not supported by existing applications. 113 4. The definition of a new generic functionality that can be reused 114 across different applications. 116 All of these choices are design decisions that can be done by any 117 combination of reusing existing or defining new commands, AVPs or AVP 118 values. However, application designers do not have total freedom 119 when making their design. A number of rules have been defined in 120 [I-D.ietf-dime-rfc3588bis] and place constraints on when an extension 121 requires the allocation of a new Diameter application identifier or a 122 new command code value. The objective of this document is the 123 following: 125 o Clarify updated Diameter extensibility rules in the Diameter base 126 protocol. 128 o Clarify usage of certain Diameter functionalities that are not 129 explicitly described in the Diameter Base specification. 131 o Discuss design choices and provide guidelines when defining new 132 applications. 134 o Present trade-off of design choices. 136 2. Terminology 138 This document reuses the terminology used in 139 [I-D.ietf-dime-rfc3588bis]. 141 3. Overview 143 As designed, the Diameter base protocol [I-D.ietf-dime-rfc3588bis] 144 can be seen as a two-layer protocol. The lower layer is mainly 145 responsible for managing connections between neighboring peers and 146 for message routing. The upper layer is where the Diameter 147 applications reside. This model is in line with a Diameter node 148 having an application layer and a peer-to-peer delivery layer. The 149 Diameter base protocol document defines the architecture and behavior 150 of the message delivery layer and then provides the framework for 151 designing Diameter applications on the application layer. This 152 framework includes definitions of application sessions and accounting 153 support (see Section 8 and 9 of [I-D.ietf-dime-rfc3588bis]). 154 Accordingly, a Diameter node is seen in this document as a single 155 instance of a Diameter message delivery layer and one or more 156 Diameter applications using it. 158 The Diameter base protocol is designed to be extensible and the 159 principles are described in the section 1.3 of 160 [I-D.ietf-dime-rfc3588bis]. Extending Diameter can mean either the 161 definition of a completely new Diameter application or the reuse of 162 commands, AVPs and AVP values in any combination for the purpose of 163 inheriting the features of an existing Diameter application. The 164 recommendation for re-using as much as possible existing 165 implementations is meaningful as most of the requirements defined for 166 a new application are likely already fulfilled by existing 167 applications. 169 However, when reusing existing applications, there is a greater 170 likelihood of ambiguity on how much of the existing application can 171 be enhanced without being distorted too much and therefore requiring 172 the definition of a new application. 174 The impacts of extending existing applications can be categorized as 175 follow: 177 Minor Extension: Enhancing the functional scope of an existing 178 application by the addition of optional features to support. Such 179 enhancement has no backward compatibility issue with the existing 180 application. A typical example would be the definition of a new 181 optional AVP to use in an existing command. Diameter 182 implementations supporting the existing application but not the 183 new AVP will simply ignore it, without major consequences on the 184 Diameter message handling. In general, this includes everything 185 that is not covered by the next category. The standardization 186 effort will be fairly small. 188 Major Extension: Enhancing the functional scope of an existing 189 application in such a way that this implies backward compatible 190 change to the existing application and then requires the 191 definition of a new Diameter application. Typical examples would 192 be the creation of a new command for providing functionality not 193 supported by existing applications or the definition of a new AVP 194 with M-bit set to carry in an existing command. For such 195 extension, a significant specification effort is required and a 196 careful approach is recommended. 198 The rules outlined in the section 1.3 of [I-D.ietf-dime-rfc3588bis] 199 indicate when an extension requires a new command code to be 200 registered and when new Diameter applications have to be defined. 201 The subsequent sections further explain and clarify the rules to 202 extend the Diameter base protocol. It is meant as a guidelines 203 document and therefore it does not add, remove or change existing 204 rules. 206 4. Reusing Existing Diameter Applications 208 When selecting the Diameter base protocol to support new 209 functionalities, protocol designers are advised to reuse as much as 210 possible existing Diameter applications in order to simplify 211 standardization, implementation and avoid potential interoperability 212 issues. However, existing application needs to be adapted to support 213 new requirements and these modifications can be at the command level 214 and/or at the AVP level. The following sections describe the 215 possible modifications that can be performed on existing applications 216 and their related impacts. 218 4.1. Adding a New Command 220 Adding a new command is considered as a major extension and requires 221 a new Diameter application to be defined. Adding a new command to an 222 application means either defining a completely new command or 223 importing the command's CCF syntax specification from another 224 application whereby the new application inherits some or all of the 225 functionality of the application where the command came from. In the 226 former case, the decision to create a new application is 227 straightforward since this is typically a result of adding a new 228 functionality that does not exist yet. For the latter, the decision 229 to create a new application will depend on whether importing the 230 command in a new application is more suitable than simply using the 231 existing application as it is in conjunction with any other 232 application. Therefore, a case by case study of each application 233 requirement should be applied. 235 An illustrative example is the command pair defined in Diameter EAP 236 application [RFC4072] that can be re-used conjointly with any other 237 application (e.g. the Diameter NASREQ application [RFC4005]) as soon 238 as standard EAP-based authentication procedures need to be supported 239 by the implementation. It may therefore not be required to import 240 the command pair in the new defined application. 242 However, in general, it is difficult to come to a hard guideline, and 243 so a case-by-case study of each application requirement should be 244 applied. Before adding or importing a command, application designers 245 should consider the following: 247 o Can the new functionality be fulfilled by creating a new command 248 independent from any existing command? In this case, the 249 resulting new application and the existing application can work 250 independent of, but cooperating with each other. 252 o Can the existing command be reused without major extensions and 253 therefore without the need for the definition of a new 254 application, e.g. new functionality introduced by the creation of 255 new optional AVPs. 257 o Care should be taken to avoid a liberal method of importing an 258 existing command's CCF syntax specification. This would result in 259 a monolithic and hard to manage application supporting too many 260 different functionalities and can cause interoperability issues 261 between the different applications. 263 4.2. Deleting an Existing Command 265 Although this process is not typical, removing a command from an 266 application requires a new Diameter application to be defined. This 267 is due to the fact that the reception of the deleted command would 268 systematically result in a protocol error 269 (DIAMETER_COMMAND_UNSUPPORTED). 271 It is unusual to delete an existing command from an application for 272 the sake of deleting it or the functionality it represents. This 273 normally indicates of a flawed design. An exception might be if the 274 intent of the deletion is to create a newer version of the same 275 application that is somehow simpler than the previous version. 277 4.3. Reusing Existing Commands 279 This section discusses rules in adding and/or deleting AVPs from an 280 existing command of an existing application. The cases described in 281 this section may not necessarily result in the creation of new 282 applications. 284 It is worth to note that the strong recommendation to re-use existing 285 commands in the [RFC3588] was to prevent rapid scarcity of code 286 values available for vendor-specific commands. 287 [I-D.ietf-dime-rfc3588bis] relaxes the policy with respect to the 288 allocation of command codes for vendor-specific uses and enlarges the 289 range of available code values for vendor-specific applications. 290 Although reuse of existing commands is still recommended, protocol 291 designers can consider defining a new command when it provides a 292 solution more suitable than the twisting of an existing command's use 293 and applications. 295 4.3.1. Adding AVPs to a Command 297 Based on the rules in [I-D.ietf-dime-rfc3588bis], AVPs that are added 298 to an existing command can be categorized into: 300 o Mandatory (to understand) AVPs. As defined in 301 [I-D.ietf-dime-rfc3588bis], these are AVPs with the M-bit flag 302 set, which means that a Diameter node receiving them is required 303 to understand not only their values but their semantics. Failure 304 to do so will cause an message handling error. This is regardless 305 of whether these AVPs are required or optional as specified by the 306 command's CCF syntax specification. 308 o Optional (to understand) AVPs. As defined in 309 [I-D.ietf-dime-rfc3588bis], these are AVPs with the M-bit flag 310 cleared, which mean that a Diameter node receiving these AVPs can 311 simply ignore them if not supported in the process of the received 312 command. 314 The rules are strict in the case where the AVPs to be added are 315 mandatory to understand i.e. with the M-bit set. A mandatory AVP 316 cannot be added to an existing command without defining a new 317 Diameter application, as stated in [I-D.ietf-dime-rfc3588bis]. This 318 falls into the "Major Extensions" category. Despite the clarity of 319 the rule, ambiguity still arises when evaluating whether a new AVP 320 being added should be mandatory to begin with. Application designers 321 should consider the following questions when deciding to set the 322 M-bit for a new AVP: 324 o Would it be required for the receiving side to be able to process 325 and understand the AVP and its content? 327 o Would the new AVPs change the state machine of the application? 329 o Would the presence of the new AVP lead to a different number of 330 round-trips, effectively changing the state machine of the 331 application? 333 o Would the new AVP be used to differentiate between old and new 334 versions of the same application whereby the two versions are not 335 backward compatible? 337 o Would the new AVP have duality in meaning i.e. be used to carry 338 application-related information as well as be used to indicate 339 that the message is for a new application? 341 When one of the above questions can be answered in the affirmative 342 then the M-bit has to be set for the new AVP. This list of questions 343 is non-exhaustive and other criteria can be taken into account in the 344 decision process. 346 If application designers are instead contemplating the use of 347 optional AVPs i.e. with the M-bit cleared, then the following are 348 some of the pitfalls that should be avoided: 350 o Use of optional AVPs with intersecting meaning. One AVP has 351 partially the same usage and meaning as another AVP. The presence 352 of both can lead to confusion. 354 o An optional AVPs with dual purpose, i.e. to carry application data 355 as well as to indicate support for one or more features. This has 356 a tendency to introduce interpretation issues. 358 o Adding one or more optional AVPs and indicating (usually within 359 descriptive text for the command) that at least one of them has to 360 be present in the command. This essentially circumventing the 361 ABNF and is equivalent to adding a mandatory AVP to the command. 363 These practices generally result in interoperability issues and 364 should be avoided as much as possible. 366 4.3.2. Deleting AVPs from a Command 368 The impacts of deleting an AVP from a command depend on its command 369 code format specification and M-bit setting: 371 o Deleting an AVP that is indicated as { AVP } in the command's CCF 372 syntax specification, whatever the setting of the M-bit set. This 373 means the definition of a new command. In this case, a new 374 command code and subsequently a new Diameter application have to 375 be specified. 377 o Deleting an AVP with M-bit set that is indicated as [ AVP ] in the 378 command's CCF syntax specification. No new command code has to be 379 specified but the definition of a new Diameter application is 380 required. 382 o Deleting an AVP with the M-bit cleared that is indicated as [ AVP 383 ] in the command's CCF syntax specification. In this case, the 384 AVP can be deleted without consequences. 386 If possible application designers should attempt the reuse the 387 command's CCF syntax specification without modification and simply 388 ignore (but not delete) any optional AVP that will not be used. This 389 is to maintain compatibility with existing applications that will not 390 know about the new functionality as well as maintain the integrity of 391 existing dictionaries. 393 4.4. Reusing Existing AVPs 395 This section discusses rules in reusing existing AVP when reusing an 396 existing command or defining a new command in a new application. 398 4.4.1. Setting of the AVP Flags 400 When reusing AVPs in a new application, the AVP flag setting, such as 401 the mandatory flag ('M'-bit), has to be re-evaluated for a new 402 Diameter application and, if necessary, even for every command within 403 the application. In general, for AVPs defined outside of the 404 Diameter base protocol, its mandatory characteristics are tied to its 405 role within an application and command. 407 All other AVP flags shall remain unchanged. 409 4.4.2. Reuse of AVP of Type Enumerated 411 When modifying the set of values supported by an AVP of type 412 Enumerated, this means defining a new AVP. Modifying the set of 413 Enumerated values includes adding a value or deprecating the use of a 414 value defined initially for the AVP. Defining a new AVP will avoid 415 interoperability issues. 417 5. Defining New Diameter Applications 419 5.1. Introduction 421 The general recommendation for Diameter extensibility is to reuse 422 commands, AVPs and AVP values as much as possible. However, some of 423 the extensibility rules described in the previous sections also apply 424 to scenarios where a designer is trying to define a completely new 425 Diameter application. 427 This section discusses the case where new applications have 428 requirements that cannot be filled by existing applications and would 429 require definition of completely new commands, AVPs and/or AVP 430 values. Typically, there is little ambiguity about the decision to 431 create these types of applications. Some examples are the interfaces 432 defined for the IP Multimedia Subsystem of 3GPP, i.e. Cx/Dx 433 ([TS29.228] and [TS29.229]), Sh ([TS29.328] and [TS29.329]) etc. 435 Application designers should also follow the theme of Diameter 436 extensibility, which in this case means to import existing AVPs and 437 AVP values for any newly defined commands. In certain cases where 438 accounting will be used, the models described in Section 5.10 should 439 also be considered. Though some decisions may be clear, designers 440 should also consider certain aspects of defining a new application. 441 Some of these aspects are described in following sections. 443 5.2. Defining New Commands 445 As a general recommendation, reusing as much as possible of existing 446 material is encouraged when defining new commands. Protocol 447 designers can thus usefully benefit from the experience gained with 448 the implementation of existing commands. This includes good 449 practices to reuse but also known mistakes not to repeat. Therefore 450 it is advisable to avoid the definition of a command from scratch and 451 rather take as an example an existing command that would be 452 functionally close to command under definition. 454 Moreover, the new command's CCF should be carefully defined when 455 considering applicability and extensibility of the application. If 456 most of the AVPs contained in the command are indicated as fixed or 457 required, it might be difficult to reuse the same command and 458 therefore the same application if the context has slightly changed 459 and some AVPs become obsolete. Defining a command with most of the 460 AVPs indicated as optional must not be seen as a sub-optimal design 461 introducing too much flexibility in the protocol. The protocol 462 designers are only advised to clearly state the condition of presence 463 of these AVPs and properly define the corresponding behaviour of the 464 Diameter nodes when these AVPs are absent from the command. 466 In the same way, the CCF should be defined in a way that it will be 467 possible to add any arbitrary optional AVPs with the M-bit cleared 468 (including vendor-specific AVPs) without modifying the application. 469 For this purpose, it is strongly recommended to add "* [AVP]" in the 470 command's CCF that will allow the addition of any arbitrary AVP as 471 described in [I-D.ietf-dime-rfc3588bis]. 473 5.3. Use of Application-Id in a Message 475 When designing new applications, designers should specify that the 476 application ID carried in all session-level messages must be the 477 application ID of the application using those messages. This 478 includes the session-level messages defined in Diameter base 479 protocol, i.e., RAR/RAA, STR/STA, ASR/ASA and possibly ACR/ACA in the 480 coupled accounting model, see Section 5.10. Existing specifications 481 may not adhere to this rule for historical or other reasons. 482 However, this scheme should be followed to avoid possible routing 483 problems for these messages. 485 In general, when a new application has been allocated with a new 486 application id and it also reuses existing commands with or without 487 modifications (Sec 4.1), it must use the newly allocated application 488 id in the header and in all relevant application id AVPs (Auth- 489 Application-Id or Acct-Application-Id) present in the commands 490 message body. 492 Additionally, application designs using 493 Vendor-Specific-Application-Id AVP should not use the Vendor-Id AVP 494 to further dissect or differentiate the vendor-specification 495 application id. Diameter routing is not based on the Vendor-Id. As 496 such, the Vendor-ID should not be used as an additional input for 497 routing or delivery of messages. In general, the Vendor-Id AVP is an 498 informational AVP only and kept for backward compatibility reasons. 500 5.4. Application-Specific Session State Machines 502 Section 8 of [I-D.ietf-dime-rfc3588bis] provides session state 503 machines for authentication, authorization and accounting (AAA) 504 services and these session state machines are not intended to cover 505 behavior outside of AAA. If a new application cannot clearly be 506 categorized into any of these AAA services, it is recommended that 507 the application define its own session state machine. Support for 508 server-initiated request is a clear example where an application- 509 specific session state machine would be needed, for example, the Rw 510 interface for ITU-T push model (cf.[Q.3303.3]). 512 5.5. Session-Id AVP and Session Management 514 Diameter applications are usually designed with the aim of managing 515 user sessions, e.g. network access session (NASREQ application 516 [RFC4005]) or specific service access session (Diameter SIP 517 application [RFC4740]). In the Diameter base protocol, the session 518 management is based on the Session-Id AVP that it used to identify a 519 given session and all the Diameter messages including the same 520 Session-Id will be bound to the same session. Diameter-based session 521 management also implies that both Diameter client and server (and 522 potentially proxy agents in the diameter path) are maintaining 523 session state information associated with the Session-Id contained in 524 the Diameter messages. 526 However, some applications may not need to rely on the Session-Id to 527 identify and manage user sessions because other information can be 528 used instead to correlate Diameter messages. Indeed, the User-Name 529 AVP or any other specific AVP can be present in every Diameter 530 message and used therefore for message correlation. There might even 531 be applications for which the notion of Diameter session management 532 would not be required at all. For such applications, the Auth- 533 Session-State AVP is usually set to NO_STATE_MAINTAINED in all the 534 Diameter messages and these applications are therefore designed as a 535 set of stand-alone transactions. Even if an explicit access session 536 termination is required, application-specific commands are defined 537 and used instead of the Session-Termination-Request/Answer (STR/STA) 538 or Abort-Session-Request/Answer (ASR/ASA) defined in the Diameter 539 base protocol. In such a case, the Session-Id is not significant. 541 Based on these considerations, protocol designers should carefully 542 appraise whether the application currently defined relies on the 543 concept of session management and whether the Session-Id defined in 544 the Diameter base protocol would be used for correlation of messages 545 related to the same session. If not, the protocol designers could 546 decide to define application commands without the Session-Id AVP. If 547 any session management concept is supported by the application, the 548 application documentation must clearly specify how the session is 549 handled between client and server (as possibly Diameter agents in the 550 path). 552 5.6. AVPs Defined as Boolean Flag 554 The type Enumerated was initially defined to provide a list of valid 555 values for an AVP with their respective interpretation described in 556 the specification. For instance, AVPs of type Enumerated can be used 557 to provide further information on the reason for the termination of a 558 session or a specific action to perform upon the reception of the 559 request. 561 However, AVPs of type Enumerated are too often used as a simple 562 Boolean flag, indicating for instance a specific permission or 563 capability, and therefore only two values are defined e.g. TRUE/ 564 FALSE, AUTORIZED/UNAUTHORIZED or SUPPORTED/UNSUPPORTED. This is a 565 sub-optimal design since it limits the extensibility of the 566 application: any new capability/permission would have to be supported 567 by a new AVP or new Enumerated value of the already defined AVP, 568 causing backwards compatibility issues with existing implementations. 570 Instead of using an Enumerated AVP for a Boolean flag, protocol 571 designers are encouraged to use Unsigned32 or Unsigned64 AVP type as 572 bit mask whose bit settings are described in the relevant Diameter 573 application specification. Such AVPs can be reused and extended 574 without major impact on the Diameter application. The bit mask 575 should leave room for future additions. Examples of bit mask AVP are 576 the Session-Binding AVP defined in [I-D.ietf-dime-rfc3588bis] and the 577 MIP6-Feature-Vector AVP defined in [RFC5447] 579 5.7. Application-Specific Message Routing 581 Diameter request message routing usually relies on the Destination- 582 Realm AVP and the Application Id present in the request message 583 header. However, some applications may need to rely on the User-Name 584 AVP or any other application-specific AVP present in the request to 585 determine the final destination of a request e.g. find the target AAA 586 server hosting the authorization information for a given user when 587 multiple AAA servers are addressable in the realm. 589 In such a context, basic routing mechanisms described in 590 [I-D.ietf-dime-rfc3588bis] are not fully suitable, and additional 591 application-level routing mechanisms have to be described in the 592 application documentation to provide such specific AVP-based routing. 593 Such functionality will be basically hosted by an application- 594 specific Proxy agent that will be responsible for routing decisions 595 based on the received specific AVPs. 597 Example of such application-specific routing functions can be found 598 in the Cx/Dx applications ([TS29.228] and [TS29.229]) of the 3GPP IP 599 Multimedia Subsystem, in which the proxy agent (Subscriber Location 600 Function aka SLF) uses specific application-level identities found in 601 the request to determine the final destination of the message. 603 Whatever the criteria used to establish the routing path of the 604 request, the routing of the answer should follow the reverse path of 605 the request, as described in [I-D.ietf-dime-rfc3588bis], with the 606 answer being sent to the source of the received request, using 607 transaction states and hop-by-hop identifier matching. In 608 particular, this ensures that the Diameter Relay or Proxy agents in 609 the request routing path will be able to release the transaction 610 state upon receipt of the corresponding answer, avoiding unnecessary 611 failover. Application designers are strongly dissuaded from 612 modifying the answer-routing principles described in 613 [I-D.ietf-dime-rfc3588bis] when defining a new application. 615 5.8. About Translation Agent 617 As defined in [I-D.ietf-dime-rfc3588bis], a translation agent is a 618 device that provides interworking between Diameter and another 619 protocol (e.g. RADIUS, TACACS+). 621 In the case of RADIUS, it was initially thought that defining the 622 translation function would be straightforward by adopting few basic 623 principles e.g. use of a shared range of code values for RADIUS 624 attributes and Diameter AVPs. Guidelines for implementing a RADIUS- 625 Diameter translation agent were put into RFC 4005 ([RFC4005]). 627 However, it was acknowledged that such translation mechanism was not 628 so obvious and deeper protocol analysis was required to ensure 629 efficient interworking between RADIUS and Diameter. Moreover, the 630 interworking requirements depend on the functionalities provided by 631 the Diameter application under specification, and a case-by-case 632 analysis will be required. 634 Therefore, protocol designers cannot assume the availability of a 635 "standard" Diameter-to-RADIUS gateways agent when planning to 636 interoperate with the RADIUS infrastructure. They should specify the 637 required translation mechanism along with the Diameter application. 638 This recommendation applies for any kind of translation (e.g. 639 Diameter/MAP). 641 5.9. End-to-End Application Capabilities Exchange 643 New Diameter applications can rely on optional AVPs to exchange 644 application-specific capabilities and features. These AVPs can be 645 exchanged on an end-to-end basis at the application layer. Examples 646 of this can be found in [RFC5447] and [RFC5777]. 648 The end-to-end capabilities AVPs formalize the addition of new 649 optional functionality to existing applications by announcing support 650 for it. Applications that do not understand these AVPs can discard 651 them upon receipt. Recevers of these AVPs can discover the addional 652 functionalities supported the end-point orignating the request and 653 behave accordingly when processing the request. Senders of these 654 AVPs can safely assume the receiving end-point does not support any 655 functionality carried by the AVP if it is not present in 656 corresponding response. This is useful in cases where deployment 657 choices are offered, and the generic design can be made available for 658 a number of applications. 660 When used in a new application, protocol designers should clearly 661 specify this end-to-end capabilities exchange and the corresponding 662 behaviour of the Diameter nodes supporting the application. 664 It is also important to note that this end-to-end capabilities 665 exchange relying on the use of optional AVPs is not meant as a 666 generic mechanism to support extensibility of Diameter applications 667 with arbitrary functionalities. When the added features drastically 668 change the Diameter application or when Diameter agents have to be 669 upgraded to support the new features, a new application should be 670 defined. 672 5.10. Diameter Accounting Support 674 Accounting can be treated as an auxiliary application that is used in 675 support of other applications. In most cases, accounting support is 676 required when defining new applications. This document provides 677 two(2) possible models for using accounting: 679 Split Accounting Model 681 In this model, the accounting messages will use the Diameter base 682 accounting application ID (value of 3). The design implication 683 for this is that the accounting is treated as an independent 684 application, especially during Diameter routing. This means that 685 accounting commands emanating from an application may be routed 686 separately from the rest of the other application messages. This 687 may also imply that the messages end up in a central accounting 688 server. A split accounting model is a good design choice when: 690 * The application itself will not define its own unique 691 accounting commands. 693 * The overall system architecture permits the use of centralized 694 accounting for one or more Diameter applications. 696 Centralizing accounting may have advantages but there are also 697 drawbacks. The model assumes that the accounting server can 698 differentiate received accounting messages. Since the received 699 accounting messages can be for any application and/or service, the 700 accounting server has to have a method to match accounting 701 messages with applications and/or services being accounted for. 702 This may mean defining new AVPs, checking the presence, absence or 703 contents of existing AVPs, or checking the contents of the 704 accounting record itself. But in general, there is no clean and 705 generic scheme for sorting these messages. Therefore, the use of 706 this model is recommended only when all received accounting 707 messages can be clearly identified and sorted. For most cases, 708 the use of Coupled Accounting Model is recommended. 710 Coupled Accounting Model 712 In this model, the accounting messages will use the application ID 713 of the application using the accounting service. The design 714 implication for this is that the accounting messages are tightly 715 coupled with the application itself; meaning that accounting 716 messages will be routed like any other application messages. It 717 would then be the responsibility of the application server 718 (application entity receiving the ACR message) to send the 719 accounting records carried by the accounting messages to the 720 proper accounting server. The application server is also 721 responsible for formulating a proper response (ACA). A coupled 722 accounting model is a good design choice when: 724 * The system architecture or deployment will not provide an 725 accounting server that supports Diameter. 727 * The system architecture or deployment requires that the 728 accounting service for the specific application should be 729 handled by the application itself. 731 * The application server is provisioned to use a different 732 protocol to access the accounting server; e.g., via LDAP, SOAP 733 etc. This includes attempting to support older accounting 734 systems that are not Diameter aware. 736 In all cases above, there will generally be no direct Diameter 737 access to the accounting server. 739 These models provide a basis for using accounting messages. 740 Application designers may obviously deviate from these models 741 provided that the factors being addressed here have also been taken 742 into account. Though it is not recommended, examples of other 743 methods might be defining a new set of commands to carry application- 744 specific accounting records. 746 5.11. Diameter Security Mechanisms 748 As specified in [I-D.ietf-dime-rfc3588bis], the Diameter message 749 exchange should be secured by using TLS/TCP or DTLS/SCTP. However, 750 IPsec can also be deployed to secure connections between Diameter 751 peers. When IPsec is used instead of TLS or DTLS, the following 752 recommendations apply. 754 IPsec ESP 5.3 [RFC4301] in transport mode with non-null encryption 755 and authentication algorithms is used to provide per-packet 756 authentication, integrity protection and confidentiality, and support 757 the replay protection mechanisms of IPsec. IKE is used for peer 758 authentication, negotiation of security associations, and key 759 management, using the IPsec DOI [RFC2407]. Peer authentication can 760 be achieved by using a pre-shared key, or certificate-based peer 761 authentication using digital signatures can be used as alternative. 762 Peer authentication using the public key encryption methods outlined 763 in IKE's Sections 5.2 and 5.3 [RFC2409] should not be used. 765 Diameter implementations using IPsec as the security mechanism must 766 support both IKE Main Mode and Aggressive Mode. When pre-shared keys 767 are used for authentication, IKE Aggressive Mode should be used 768 instead of IKE Main Mode. When digital signatures are used for 769 authentication, either IKE Main Mode or IKE Aggressive Mode can be 770 used. 772 When digital signatures are used to achieve authentication, an IKE 773 negotiator should use IKE Certificate Request Payload(s) to specify 774 the certificate authority (or authorities) that are trusted in 775 accordance with its local policy. IKE negotiators should use 776 pertinent certificate revocation checks before accepting a PKI 777 certificate for use in IKE's authentication procedures. 779 The Phase 2 Quick Mode exchanges used to negotiate protection for 780 Diameter connections must explicitly carry the Identity Payload 781 fields (IDci and IDcr). The DOI provides for several types of 782 identification data. However, when used in conformant 783 implementations, each ID Payload must carry a single IP address and a 784 single non-zero port number, and must not use the IP Subnet or IP 785 Address Range formats. This allows the Phase 2 security association 786 to correspond to specific TCP and SCTP connections. 788 Since IPsec acceleration hardware may only be able to handle a 789 limited number of active IKE Phase 2 SAs, Phase 2 delete messages may 790 be sent for idle SAs, as a means of keeping the number of active 791 Phase 2 SAs to a minimum. The receipt of an IKE Phase 2 delete 792 message should not be interpreted as a reason for tearing down a 793 Diameter connection. Rather, it is preferable to leave the 794 connection up, and if additional traffic is sent on it, to bring up 795 another IKE Phase 2 SA to protect it. This avoids the potential for 796 continually bringing connections up and down. 798 6. Defining Generic Diameter Extensions 800 Generic Diameter extensions are AVPs, commands or applications that 801 are designed to support other Diameter applications. They are 802 auxiliary applications meant to improve or enhance the Diameter 803 protocol itself or Diameter applications/functionality. Some 804 examples include the extensions to support auditing and redundancy 805 (see [I-D.calhoun-diameter-res-mgmt]), improvements in duplicate 806 detection scheme (see [I-D.asveren-dime-dupcons]), and piggybacking 807 of QoS attributes (see [RFC5777]). 809 Since generic extensions can cover many aspects of Diameter and 810 Diameter applications, it is not possible to enumerate all the 811 probable scenarios in this document. However, some of the most 812 common considerations are as follows: 814 o Backward compatibility: Dealing with existing applications that do 815 not understand the new extension. Designers also have to make 816 sure that new extensions do not break expected message delivery 817 layer behavior. 819 o Forward compatibility: Making sure that the design will not 820 introduce undue restrictions for future applications. Future 821 applications attempting to support this feature should not have to 822 go through great lengths to implement any new extensions. 824 o Trade-off in signaling: Designers may have to choose between the 825 use of optional AVPs piggybacked onto existing commands versus 826 defining new commands and applications. Optional AVPs are simpler 827 to implement and may not need changes to existing applications. 828 However, this ties the sending of extension data to the 829 application's transmission of a message. This has consequences if 830 the application and the extensions have different timing 831 requirements. The use of commands and applications solves this 832 issue, but the trade-off is the additional complexity of defining 833 and deploying a new application. It is left up to the designer to 834 find a good balance among these trade-offs based on the 835 requirements of the extension. 837 In practice, generic extensions often use optional AVPs because they 838 are simple and non-intrusive to the application that would carry 839 them. Peers that do not support the generic extensions need not 840 understand nor recognize these optional AVPs. However, it is 841 recommended that the authors of the extension specify the context or 842 usage of the optional AVPs. As an example, in the case that the AVP 843 can be used only by a specific set of applications then the 844 specification must enumerate these applications and the scenarios 845 when the optional AVPs will be used. In the case where the optional 846 AVPs can be carried by any application, it is should be sufficient to 847 specify such a use case and perhaps provide specific examples of 848 applications using them. 850 In most cases, these optional AVPs piggybacked by applications would 851 be defined as a Grouped AVP and it would encapsulate all the 852 functionality of the generic extension. In practice, it is not 853 uncommon that the Grouped AVP will encapsulate an existing AVP that 854 has previously been defined as mandatory ('M'-bit set) e.g., 3GPP IMS 855 Cx/Dx interfaces ([TS29.228] and [TS29.229]). 857 7. IANA Considerations 859 This document does not require actions by IANA. 861 8. Security Considerations 863 This document provides guidelines and considerations for extending 864 Diameter and Diameter applications. It does not define nor address 865 security-related protocols or schemes. 867 9. Contributors 869 The content of this document was influenced by a design team created 870 to revisit the Diameter extensibility rules. The team consisting of 871 the members listed below was formed in February 2008 and finished its 872 work in June 2008. 874 o Avi Lior 876 o Glen Zorn 878 o Jari Arkko 880 o Lionel Morand 882 o Mark Jones 884 o Victor Fajardo 886 o Tolga Asveren 888 o Jouni Korhonen 890 o Glenn McGregor 892 o Hannes Tschofenig 894 o Dave Frascone 896 We would like to thank Tolga Asveren, Glenn McGregor, and John 897 Loughney for their contributions as co-authors to earlier versions of 898 this document. 900 10. Acknowledgments 902 We greatly appreciate the insight provided by Diameter implementers 903 who have highlighted the issues and concerns being addressed by this 904 document. The authors would also like to thank A. Jean Mahoney and 905 Ben Campbell for their invaluable detailed review and comments on 906 this document. 908 11. References 910 11.1. Normative References 912 [I-D.ietf-dime-rfc3588bis] 913 Fajardo, V., Arkko, J., Loughney, J., and G. Zorn, 914 "Diameter Base Protocol", draft-ietf-dime-rfc3588bis-34 915 (work in progress), June 2012. 917 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 918 Requirement Levels", BCP 14, RFC 2119, March 1997. 920 [RFC3588] Calhoun, P., Loughney, J., Guttman, E., Zorn, G., and J. 921 Arkko, "Diameter Base Protocol", RFC 3588, September 2003. 923 11.2. Informative References 925 [I-D.asveren-dime-dupcons] 926 Asveren, T., "Diameter Duplicate Detection Cons.", 927 draft-asveren-dime-dupcons-00 (work in progress), 928 August 2006. 930 [I-D.calhoun-diameter-res-mgmt] 931 Calhoun, P., "Diameter Resource Management Extensions", 932 draft-calhoun-diameter-res-mgmt-08.txt (work in progress), 933 March 2001. 935 [Q.3303.3] 936 3rd Generation Partnership Project, "ITU-T Recommendation 937 Q.3303.3, "Resource control protocol no. 3 (rcp3): 938 Protocol at the Rw interface between the Policy Decision 939 Physical Entity (PD-PE) and the Policy Enforcement 940 Physical Entity (PE-PE): Diameter"", 2008. 942 [RFC2407] D. Piper, "The Internet IP Security Domain of 943 Interpretation for ISAKMP", 1998. 945 [RFC2409] D. Harkins and D. Carrel, "The Internet Key Exchange 946 (IKE)", 1998. 948 [RFC4005] P. Calhoun et al., "Diameter Network Access Server 949 Application", August 2005, 950 . 952 [RFC4072] P. Eronen et al., "Diameter Extensible Authentication 953 Protocol (EAP) Application", August 2005, 954 . 956 [RFC4301] S. Kent and K. Seo, "Security Architecture for the 957 Internet Protocol", 2005. 959 [RFC4740] M. Garcia-Martin et al., "Diameter Session Initiation 960 Protocol (SIP) Application", November 2006, 961 . 963 [RFC5447] J. Korhonen et al., "Diameter Mobile IPv6: Support for 964 Network Access Server to Diameter Server Interaction", 965 February 2009, 966 . 968 [RFC5777] J. Korhonen et al., "Traffic Classification and Quality of 969 Service (QoS) Attributes for Diameter", 2010. 971 [TS29.228] 972 3rd Generation Partnership Project, "3GPP TS 29.228; 973 Technical Specification Group Core Network and Terminals; 974 IP Multimedia (IM) Subsystem Cx and Dx Interfaces; 975 Signalling flows and message contents", 976 . 978 [TS29.229] 979 3rd Generation Partnership Project, "3GPP TS 29.229; 980 Technical Specification Group Core Network and Terminals; 981 Cx and Dx interfaces based on the Diameter protocol; 982 Protocol details", 983 . 985 [TS29.328] 986 3rd Generation Partnership Project, "3GPP TS 29.328; 987 Technical Specification Group Core Network and Terminals; 988 IP Multimedia (IM) Subsystem Sh interface; signalling 989 flows and message content", 990 . 992 [TS29.329] 993 3rd Generation Partnership Project, "3GPP TS 29.329; 994 Technical Specification Group Core Network and Terminals; 995 Sh Interface based on the Diameter protocol; Protocol 996 details", 997 . 999 Authors' Addresses 1001 Lionel Morand (editor) 1002 Orange Labs 1004 Email: lionel.morand@orange.com 1006 Victor Fajardo 1008 Email: vf0213@gmail.com 1010 Hannes Tschofenig 1011 Nokia Siemens Networks 1012 Linnoitustie 6 1013 Espoo 02600 1014 Finland 1016 Phone: +358 (50) 4871445 1017 Email: Hannes.Tschofenig@gmx.net 1018 URI: http://www.tschofenig.priv.at