idnits 2.17.00 (12 Aug 2021) /tmp/idnits45509/draft-ietf-dime-app-design-guide-19.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 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 (June 26, 2013) is 3250 days in the past. Is this intentional? Checking references for intended status: Informational ---------------------------------------------------------------------------- == Unused Reference: 'RFC2407' is defined on line 965, but no explicit reference was found in the text -- 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 3588 (Obsoleted by RFC 6733) -- Obsolete informational reference (is this intentional?): RFC 4005 (Obsoleted by RFC 7155) -- Obsolete informational reference (is this intentional?): RFC 5226 (Obsoleted by RFC 8126) -- Obsolete informational reference (is this intentional?): RFC 5996 (Obsoleted by RFC 7296) Summary: 0 errors (**), 0 flaws (~~), 2 warnings (==), 8 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 Diameter Maintenance and Extensions (DIME) L. Morand, Ed. 3 Internet-Draft Orange Labs 4 Intended status: Informational V. Fajardo 5 Expires: December 28, 2013 6 H. Tschofenig 7 Nokia Siemens Networks 8 June 26, 2013 10 Diameter Applications Design Guidelines 11 draft-ietf-dime-app-design-guide-19 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 Diameter. It is meant as a guidelines document and 20 therefore as informative in nature. 22 Status of This Memo 24 This Internet-Draft is submitted in full conformance with the 25 provisions of BCP 78 and BCP 79. 27 Internet-Drafts are working documents of the Internet Engineering 28 Task Force (IETF). Note that other groups may also distribute 29 working documents as Internet-Drafts. The list of current Internet- 30 Drafts is at http://datatracker.ietf.org/drafts/current/. 32 Internet-Drafts are draft documents valid for a maximum of six months 33 and may be updated, replaced, or obsoleted by other documents at any 34 time. It is inappropriate to use Internet-Drafts as reference 35 material or to cite them other than as "work in progress." 37 This Internet-Draft will expire on December 28, 2013. 39 Copyright Notice 41 Copyright (c) 2013 IETF Trust and the persons identified as the 42 document authors. All rights reserved. 44 This document is subject to BCP 78 and the IETF Trust's Legal 45 Provisions Relating to IETF Documents 46 (http://trustee.ietf.org/license-info) in effect on the date of 47 publication of this document. Please review these documents 48 carefully, as they describe your rights and restrictions with respect 49 to this document. Code Components extracted from this document must 50 include Simplified BSD License text as described in Section 4.e of 51 the Trust Legal Provisions and are provided without warranty as 52 described in the Simplified BSD License. 54 Table of Contents 56 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2 57 2. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 3 58 3. Overview . . . . . . . . . . . . . . . . . . . . . . . . . . 3 59 4. Reusing Existing Diameter Applications . . . . . . . . . . . 5 60 4.1. Adding a New Command . . . . . . . . . . . . . . . . . . 5 61 4.2. Deleting an Existing Command . . . . . . . . . . . . . . 6 62 4.3. Reusing Existing Commands . . . . . . . . . . . . . . . . 6 63 4.3.1. Adding AVPs to a Command . . . . . . . . . . . . . . 6 64 4.3.2. Deleting AVPs from a Command . . . . . . . . . . . . 8 65 4.4. Reusing Existing AVPs . . . . . . . . . . . . . . . . . . 9 66 4.4.1. Setting of the AVP Flags . . . . . . . . . . . . . . 9 67 4.4.2. Reuse of AVP of Type Enumerated . . . . . . . . . . . 9 68 5. Defining New Diameter Applications . . . . . . . . . . . . . 9 69 5.1. Introduction . . . . . . . . . . . . . . . . . . . . . . 9 70 5.2. Defining New Commands . . . . . . . . . . . . . . . . . . 10 71 5.3. Use of Application-Id in a Message . . . . . . . . . . . 10 72 5.4. Application-Specific Session State Machines . . . . . . . 11 73 5.5. Session-Id AVP and Session Management . . . . . . . . . . 11 74 5.6. Use of Enumerated Type AVPs . . . . . . . . . . . . . . . 12 75 5.7. Application-Specific Message Routing . . . . . . . . . . 12 76 5.8. Translation Agents . . . . . . . . . . . . . . . . . . . 13 77 5.9. End-to-End Application Capabilities Exchange . . . . . . 14 78 5.10. Diameter Accounting Support . . . . . . . . . . . . . . . 14 79 5.11. Diameter Security Mechanisms . . . . . . . . . . . . . . 16 80 6. Defining Generic Diameter Extensions . . . . . . . . . . . . 16 81 7. Guidelines for Registrations of Diameter Values . . . . . . . 17 82 8. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 19 83 9. Security Considerations . . . . . . . . . . . . . . . . . . . 19 84 10. Contributors . . . . . . . . . . . . . . . . . . . . . . . . 20 85 11. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . 20 86 12. Informative References . . . . . . . . . . . . . . . . . . . 20 87 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 22 89 1. Introduction 91 The Diameter base protocol provides facilities to extend Diameter 92 (see Section 1.3 of [RFC6733]) to support new functionality. In the 93 context of this document, extending Diameter means one of the 94 following: 96 1. Addition of new functionality to an existing Diameter application 97 without defining a new application. 99 2. Addition of new functionality to an existing Diameter application 100 that requires the definition of a new application. 102 3. The definition of an entirely new Diameter application to offer 103 functionality not supported by existing applications. 105 4. The definition of a new generic functionality that can be reused 106 across different applications. 108 All of these choices are design decisions that can be done by any 109 combination of reusing existing or defining new commands, AVPs or AVP 110 values. However, application designers do not have complete freedom 111 when making their design. A number of rules have been defined in 112 [RFC6733] that place constraints on when an extension requires the 113 allocation of a new Diameter application identifier or a new command 114 code value. The objective of this document is the following: 116 o Clarify the Diameter extensibility rules as defined in the 117 Diameter base protocol. 119 o Discuss design choices and provide guidelines when defining new 120 applications. 122 o Present trade-off choices. 124 2. Terminology 126 This document reuses the terminology defined in [RFC6733]. 128 3. Overview 130 As designed, the Diameter base protocol [RFC6733] can be seen as a 131 two-layer protocol. The lower layer is mainly responsible for 132 managing connections between neighboring peers and for message 133 routing. The upper layer is where the Diameter applications reside. 134 This model is in line with a Diameter node having an application 135 layer and a peer-to-peer delivery layer. The Diameter base protocol 136 document defines the architecture and behavior of the message 137 delivery layer and then provides the framework for designing Diameter 138 applications on the application layer. This framework includes 139 definitions of application sessions and accounting support (see 140 Section 8 and Section 9 of [RFC6733]). Accordingly, a Diameter node 141 is seen in this document as a single instance of a Diameter message 142 delivery layer and one or more Diameter applications using it. 144 The Diameter base protocol is designed to be extensible and the 145 principles are described in the Section 1.3 of [RFC6733]. As a 146 summary, Diameter can be extended by: 148 1. Defining new AVP values 150 2. Creating new AVPs 152 3. Creating new commands 154 4. Creating new applications 156 As a main guiding principle, the recommendation is: "try to re-use as 157 much as possible!". It will reduce the time to finalize 158 specification writing, and it will lead to a smaller implementation 159 effort as well as reduce the need for testing. In general, it is 160 clever to avoid duplicate effort when possible. 162 However, re-use is not appropriate when the existing functionality 163 does not fit the new requirement and/or the re-use leads to 164 ambiguity. 166 The impact on extending existing applications can be categorized into 167 two groups: 169 Minor Extension: Enhancing the functional scope of an existing 170 application by the addition of optional features to support. Such 171 enhancement has no backward compatibility issue with the existing 172 application. 174 A typical example would be the definition of a new optional AVP 175 for use in an existing command. Diameter implementations 176 supporting the existing application but not the new AVP will 177 simply ignore it, without consequences for the Diameter message 178 handling. The standardization effort will be fairly small. 180 Major Extension: Enhancing an application that requires the 181 definition of a new Diameter application. 183 Typical examples would be the creation of a new command for 184 providing functionality not supported by existing applications or 185 the definition of a new AVP with the M-bit set to be carried in an 186 existing command. For such extension, a significant specification 187 effort is required and a careful approach is recommended. 189 We would also like to remind that the definition of a new Diameter 190 application and the definition of a new command should be something 191 to avoid as much as possible. In the past, there has been some 192 reluctance to define new commands and new applications. With the 193 modified extensibility rules provided by [RFC6733], registering new 194 commands and new applications does not lead to additional overhead 195 for the specification author in terms of standardization process. 196 Registering new functionality (new commands, new AVPs, new 197 applications, etc.) with IANA remains important to avoid namespace 198 collisions, which will likely lead to deployment problems. 200 4. Reusing Existing Diameter Applications 202 An existing application may need to be enhanced to fulfill new 203 requirements and these modifications can be at the command level and/ 204 or at the AVP level. The following sections describe the possible 205 modifications that can be performed on existing applications and 206 their related impact. 208 4.1. Adding a New Command 210 Adding a new command is considered as a major extension and requires 211 a new Diameter application to be defined. Adding a new command to an 212 application means either defining a completely new command or 213 importing the command's Command Code Format (CCF) syntax from another 214 application whereby the new application inherits some or all of the 215 functionality of the application where the command came from. In the 216 former case, the decision to create a new application is 217 straightforward since this is typically a result of adding a new 218 functionality that does not exist yet. For the latter, the decision 219 to create a new application will depend on whether importing the 220 command in a new application is more suitable than simply using the 221 existing application as it is in conjunction with any other 222 application. Therefore, a case by case study of each application 223 requirement should be applied. 225 An example considers the Diameter EAP application [RFC4072] and the 226 Diameter NASREQ application [RFC4005]. When network access 227 authentication using EAP is required, the Diameter EAP commands 228 (Diameter-EAP-Request/Diameter-EAP-Answer) are used; otherwise the 229 NASREQ application will be used. When the Diameter EAP application 230 is used, the accounting exchanges defined in Diameter NASREQ may be 231 used. 233 However, in general, it is difficult to come to a hard guideline, and 234 so a case-by-case study of each application requirement should be 235 applied. Before adding or importing a command, application designers 236 should consider the following: 238 o Can the new functionality be fulfilled by creating a new command 239 independent from any existing command? In this case, the 240 resulting new application and the existing application can work 241 independent of, but cooperating with each other. 243 o Can the existing command be reused without major extensions and 244 therefore without the need for the definition of a new 245 application, e.g., new functionality introduced by the creation of 246 new optional AVPs. 248 Note: Importing commands too liberally could result in a monolithic 249 and hard to manage application supporting too many different 250 features. 252 4.2. Deleting an Existing Command 254 Although this process is not typical, removing a command from an 255 application requires a new Diameter application to be defined. This 256 is due to the fact that the reception of the deleted command would 257 systematically result in a protocol error (i.e., 258 DIAMETER_COMMAND_UNSUPPORTED). 260 It is unusual to delete an existing command from an application for 261 the sake of deleting it or the functionality it represents. This 262 normally indicates of a flawed design. An exception might be if the 263 intent of the deletion is to create a newer version of the same 264 application that is somehow simpler than the previous version. 266 4.3. Reusing Existing Commands 268 This section discusses rules in adding and/or deleting AVPs from an 269 existing command of an existing application. The cases described in 270 this section may not necessarily result in the creation of new 271 applications. 273 From a historical point of view, it is worth to note that there was a 274 strong recommendation to re-use existing commands in the [RFC3588] to 275 prevent rapid depletion of code values available for vendor-specific 276 commands. However, [RFC6733] has relaxed the allocation policy and 277 enlarged the range of available code values for vendor-specific 278 applications. Although reuse of existing commands is still 279 recommended, protocol designers can consider defining a new command 280 when it provides a solution more suitable than the twisting of an 281 existing command's use and applications. 283 4.3.1. Adding AVPs to a Command 284 Based on the rules in [RFC6733], AVPs that are added to an existing 285 command can be categorized into: 287 o Mandatory (to understand) AVPs. As defined in [RFC6733], these 288 are AVPs with the M-bit flag set, which means that a Diameter node 289 receiving them is required to understand not only their values but 290 also their semantics. Failure to do so will cause an message 291 handling error. This is regardless of whether these AVPs are 292 required or optional as specified by the command's Command Code 293 Format (CCF) syntax . 295 o Optional (to understand) AVPs. As defined in [RFC6733], these are 296 AVPs with the M-bit flag cleared. A Diameter node receiving these 297 AVPs can simply ignore them if it does not support them. 299 The rules are strict in the case where the AVPs to be added are 300 mandatory to understand, i.e., they have the M-bit set. A mandatory 301 AVP cannot be added to an existing command without defining a new 302 Diameter application, as stated in [RFC6733]. This falls into the 303 "Major Extensions" category. Despite the clarity of the rule, 304 ambiguity still arises when evaluating whether a new AVP being added 305 should be mandatory to begin with. Application designers should 306 consider the following questions when deciding about the M-bit for a 307 new AVP: 309 o Would it be required for the receiving side to be able to process 310 and understand the AVP and its content? 312 o Would the new AVPs change the state machine of the application? 314 o Would the presence of the new AVP lead to a different number of 315 round-trips, effectively changing the state machine of the 316 application? 318 o Would the new AVP be used to differentiate between old and new 319 versions of the same application whereby the two versions are not 320 backward compatible? 322 o Would the new AVP have duality in meaning, i.e., be used to carry 323 application-related information as well as to indicate that the 324 message is for a new application? 326 If the answer to at least one of the questions is "yes" then the 327 M-bit has to be set for the new AVP. This list of questions is non- 328 exhaustive and other criteria can be taken into account in the 329 decision process. 331 If application designers are instead contemplating the use of 332 optional AVPs, i.e., with the M-bit cleared, then the following are 333 some of the pitfalls that should be avoided: 335 o Use of optional AVPs with intersecting meaning. One AVP has 336 partially the same usage and meaning as another AVP. The presence 337 of both can lead to confusion. 339 o An optional AVPs with dual purpose, i.e., to carry application 340 data as well as to indicate support for one or more features. 341 This has a tendency to introduce interpretation issues. 343 o Adding one or more optional AVPs and indicating (usually within 344 descriptive text for the command) that at least one of them has to 345 be present in the command. This essentially circumventing the 346 ABNF and is equivalent to adding a mandatory AVP to the command. 348 These practices generally result in interoperability issues and 349 should be avoided as much as possible. 351 4.3.2. Deleting AVPs from a Command 353 The impacts of deleting an AVP from a command depends on its command 354 code format specification and M-bit setting: 356 o Deleting an AVP that is indicated as { AVP } in the command's CCF 357 syntax specification (regardless of the M-bit setting). 359 In this case, a new command code and subsequently a new Diameter 360 application have to be specified. 362 o Deleting an AVP, which has the M-bit set, and is indicated as [ 363 AVP ] in the command's CCF syntax specification. 365 No new command code has to be specified but the definition of a 366 new Diameter application is required. 368 o Deleting an AVP, which has the M-bit cleared, and is indicated as 369 [ AVP ] in the command's CCF syntax specification. 371 In this case, the AVP can be deleted without consequences. 373 If possible, application designers should attempt the reuse the 374 command's CCF syntax specification without modification and simply 375 ignore (but not delete) any optional AVP that will not be used. This 376 is to maintain compatibility with existing applications that will not 377 know about the new functionality as well as maintain the integrity of 378 existing dictionaries. 380 4.4. Reusing Existing AVPs 382 This section discusses rules in reusing existing AVP when reusing an 383 existing command or defining a new command in a new application. 385 4.4.1. Setting of the AVP Flags 387 When reusing AVPs in a new application, the AVP flag setting, such as 388 the mandatory flag ('M'-bit), has to be re-evaluated for a new 389 Diameter application and, if necessary, even for every command within 390 the application. In general, for AVPs defined outside of the 391 Diameter base protocol, the characteristics of an AVP are tied to its 392 role within an application and the commands. 394 All other AVP flags shall remain unchanged. 396 4.4.2. Reuse of AVP of Type Enumerated 398 When modifying the set of values supported by an AVP of type 399 Enumerated, this means defining a new AVP. Modifying the set of 400 Enumerated values includes adding a value or deprecating the use of a 401 value defined initially for the AVP. Defining a new AVP will avoid 402 interoperability issues. 404 5. Defining New Diameter Applications 406 5.1. Introduction 408 This section discusses the case where new applications have 409 requirements that cannot be fulfilled by existing applications and 410 would require definition of completely new commands, AVPs and/or AVP 411 values. Typically, there is little ambiguity about the decision to 412 create these types of applications. Some examples are the interfaces 413 defined for the IP Multimedia Subsystem of 3GPP, e.g., Cx/Dx 414 ([TS29.228] and [TS29.229]), Sh ([TS29.328] and [TS29.329]) etc. 416 Application designers should try to import existing AVPs and AVP 417 values for any newly defined commands. In certain cases where 418 accounting will be used, the models described in Section 5.10 should 419 also be considered. 421 Additional considerations are described in the following sections. 423 5.2. Defining New Commands 425 As a general recommendation, commands should not be defined from 426 scratch. It is instead recommend to re-use an existing command 427 offering similar functionality and use it as a starting point. 429 Moreover, the new command's CCF syntax specification should be 430 carefully defined when considering applicability and extensibility of 431 the application. If most of the AVPs contained in the command are 432 indicated as fixed or required, it might be difficult to reuse the 433 same command and therefore the same application in a slighly changed 434 environment. Defining a command with most of the AVPs indicated as 435 optional must not be seen as a sub-optimal design introducing too 436 much flexibility in the protocol. The protocol designers are only 437 advised to clearly state the condition of presence of these AVPs and 438 properly define the corresponding behaviour of the Diameter nodes 439 when these AVPs are absent from the command. 441 Note: As a hint for protocol designers, it is not sufficient to just 442 look at the command's CCF syntax specification. It is also necessary 443 to carefully read through the accompanying text in the specification. 445 In the same way, the CCF syntax specification should be defined such 446 that it will be possible to add any arbitrary optional AVPs with the 447 M-bit cleared (including vendor-specific AVPs) without modifying the 448 application. For this purpose, it is strongly recommended to add "* 449 [AVP]" in the command's CCF, which allows the addition of any 450 arbitrary AVP as described in [RFC6733]. 452 5.3. Use of Application-Id in a Message 454 When designing new applications, designers should specify that the 455 Application Id carried in all session-level messages must be the 456 Application Id of the application using those messages. This 457 includes the session-level messages defined in Diameter base 458 protocol, i.e., RAR/RAA, STR/STA, ASR/ASA and possibly ACR/ACA in the 459 coupled accounting model, see Section 5.10. Some existing 460 specifications do not adhere to this rule for historical reasons. 461 However, this guidance should be followed to avoid routing problems. 463 In general, when a new application has been allocated with a new 464 Application Id and it also reuses existing commands with or without 465 modifications, it must use the newly allocated Application Id in the 466 header and in all relevant Application Id AVPs (Auth-Application-Id 467 or Acct-Application-Id) present in the commands message body. 469 Additionally, application designs using Vendor-Specific-Application- 470 Id AVP should not use the Vendor-Id AVP to further dissect or 471 differentiate the vendor-specification Application Id. Diameter 472 routing is not based on the Vendor-Id. As such, the Vendor-Id should 473 not be used as an additional input for routing or delivery of 474 messages. The Vendor-Id AVP is an informational AVP only and kept 475 for backward compatibility reasons. 477 5.4. Application-Specific Session State Machines 479 Section 8 of [RFC6733] provides session state machines for 480 authentication, authorization and accounting (AAA) services and these 481 session state machines are not intended to cover behavior outside of 482 AAA. If a new application cannot clearly be categorized into any of 483 these AAA services, it is recommended that the application defines 484 its own session state machine. Support for server-initiated request 485 is a clear example where an application-specific session state 486 machine would be needed, for example, the Rw interface for ITU-T push 487 model (cf.[Q.3303.3]). 489 5.5. Session-Id AVP and Session Management 491 Diameter applications are usually designed with the aim of managing 492 user sessions (e.g., Diameter network access session (NASREQ) 493 application [RFC4005]) or specific service access session (e.g., 494 Diameter SIP application [RFC4740]). In the Diameter base protocol, 495 session state is referenced using the Session-Id AVP. All Diameter 496 messages that use the same Session-Id will be bound to the same 497 session. Diameter-based session management also implies that both 498 Diameter client and server (and potentially proxy agents along the 499 path) maintain session state information. 501 However, some applications may not need to rely on the Session-Id to 502 identify and manage sessions because other information can be used 503 instead to correlate Diameter messages. Indeed, the User-Name AVP or 504 any other specific AVP can be present in every Diameter message and 505 used therefore for message correlation. Some applications might not 506 require the notion of Diameter session concept at all. For such 507 applications, the Auth-Session-State AVP is usually set to 508 NO_STATE_MAINTAINED in all Diameter messages and these applications 509 are therefore designed as a set of stand-alone transactions. Even if 510 an explicit access session termination is required, application- 511 specific commands are defined and used instead of the Session- 512 Termination-Request/Answer (STR/STA) or Abort-Session-Request/Answer 513 (ASR/ASA) defined in the Diameter base protocol. In such a case, the 514 Session-Id is not significant. 516 Based on these considerations, protocol designers should carefully 517 appraise whether the application currently defined relies on it's own 518 session management concept or whether the Session-Id defined in the 519 Diameter base protocol would be used for correlation of messages 520 related to the same session. If not, the protocol designers could 521 decide to define application commands without the Session-Id AVP. If 522 any session management concept is supported by the application, the 523 application documentation must clearly specify how the session is 524 handled between client and server (as possibly Diameter agents in the 525 path). 527 5.6. Use of Enumerated Type AVPs 529 The type Enumerated was initially defined to provide a list of valid 530 values for an AVP with their respective interpretation described in 531 the specification. For instance, AVPs of type Enumerated can be used 532 to provide further information on the reason for the termination of a 533 session or a specific action to perform upon the reception of the 534 request. 536 However, AVPs of type Enumerated are too often used as a simple 537 Boolean flag, indicating for instance a specific permission or 538 capability, and therefore only two values are defined, e.g., TRUE/ 539 FALSE, AUTORIZED/UNAUTHORIZED or SUPPORTED/UNSUPPORTED. This is a 540 sub-optimal design since it limits the extensibility of the 541 application: any new capability/permission would have to be supported 542 by a new AVP or new Enumerated value of the already defined AVP, 543 causing backwards compatibility issues with existing implementations. 545 Instead of using an Enumerated AVP for a Boolean flag, protocol 546 designers are encouraged to use Unsigned32 or Unsigned64 AVP type as 547 bit mask whose bit settings are described in the relevant Diameter 548 application specification. Such AVPs can be reused and extended 549 without major impact on the Diameter application. The bit mask 550 should leave room for future additions. Examples of AVPs that use 551 bit masks are the Session-Binding AVP defined in [RFC6733] and the 552 MIP6-Feature-Vector AVP defined in [RFC5447]. 554 5.7. Application-Specific Message Routing 556 Diameter request message routing usually relies on the Destination- 557 Realm AVP and the Application Id present in the request message 558 header. However, some applications may need to rely on the User-Name 559 AVP or any other application-specific AVP present in the request to 560 determine the final destination of a request, e.g., to find the 561 target AAA server hosting the authorization information for a given 562 user when multiple AAA servers are addressable in the realm. 564 In such a context, basic routing mechanisms described in [RFC6733] 565 are not fully suitable, and additional application-level routing 566 mechanisms have to be described in the application documentation to 567 provide such specific AVP-based routing. Such functionality will be 568 basically hosted by an application-specific proxy agent that will be 569 responsible for routing decisions based on the received specific 570 AVPs. 572 Examples of such application-specific routing functions can be found 573 in the Cx/Dx applications ([TS29.228] and [TS29.229]) of the 3GPP IP 574 Multimedia Subsystem, in which the proxy agent (Subscriber Location 575 Function aka SLF) uses specific application-level identities found in 576 the request to determine the final destination of the message. 578 Whatever the criteria used to establish the routing path of the 579 request, the routing of the answer has to follow the reverse path of 580 the request, as described in [RFC6733], with the answer being sent to 581 the source of the received request, using transaction states and hop- 582 by-hop identifier matching. In particular, this ensures that the 583 Diameter Relay or Proxy agents in the request routing path will be 584 able to release the transaction state upon receipt of the 585 corresponding answer, avoiding unnecessary failover. Application 586 designers are strongly dissuaded from modifying the answer-routing 587 principles described in [RFC6733] when defining a new application. 589 5.8. Translation Agents 591 As defined in [RFC6733], a translation agent is a device that 592 provides interworking between Diameter and another protocol (e.g., 593 RADIUS). 595 In the case of RADIUS, it was initially thought that defining the 596 translation function would be straightforward by adopting few basic 597 principles, e.g., by the use of a shared range of code values for 598 RADIUS attributes and Diameter AVPs. Guidelines for implementing a 599 RADIUS-Diameter translation agent were put into RFC 4005 ([RFC4005]). 601 However, it was acknowledged that such translation mechanism was not 602 so obvious and deeper protocol analysis was required to ensure 603 efficient interworking between RADIUS and Diameter. Moreover, the 604 interworking requirements depend on the functionalities provided by 605 the Diameter application under specification, and a case-by-case 606 analysis will be required. 608 Therefore, protocol designers cannot assume the availability of a 609 "standard" Diameter-to-RADIUS gateways agent when planning to 610 interoperate with the RADIUS infrastructure. They should specify the 611 required translation mechanism along with the Diameter application, 612 if needed. This recommendation applies for any kind of translation. 614 5.9. End-to-End Application Capabilities Exchange 616 New Diameter applications can rely on optional AVPs to exchange 617 application-specific capabilities and features. These AVPs can be 618 exchanged on an end-to-end basis at the application layer. Examples 619 of this can be found with the MIP6-Feature-Vector AVP in [RFC5447] 620 and the QoS-Capability AVP in [RFC5777]. 622 The end-to-end capabilities AVPs formalize the addition of new 623 optional functionality to existing applications by announcing support 624 for it. Applications that do not understand these AVPs can discard 625 them upon receipt. Receivers of these AVPs can discover the 626 additional functionality supported by the end-point originating the 627 request and behave accordingly when processing the request. Senders 628 of these AVPs can safely assume the receiving end-point does not 629 support any functionality carried by the AVP if it is not present in 630 corresponding response. This is useful in cases where deployment 631 choices are offered, and the generic design can be made available for 632 a number of applications. 634 When used in a new application, protocol designers should clearly 635 specify this end-to-end capabilities exchange and the corresponding 636 behaviour of the Diameter nodes supporting the application. 638 It is also important to note that this end-to-end capabilities 639 exchange relies on the use of optional AVPs is not meant as a generic 640 mechanism to support extensibility of Diameter applications with 641 arbitrary functionality. When the added features drastically change 642 the Diameter application or when Diameter agents have to be upgraded 643 to support the new features, a new application should be defined. 645 5.10. Diameter Accounting Support 647 Accounting can be treated as an auxiliary application that is used in 648 support of other applications. In most cases, accounting support is 649 required when defining new applications. This document provides two 650 possible models for using accounting: 652 Split Accounting Model: 654 In this model, the accounting messages will use the Diameter base 655 accounting Application Id (value of 3). The design implication 656 for this is that the accounting is treated as an independent 657 application, especially for Diameter routing. This means that 658 accounting commands emanating from an application may be routed 659 separately from the rest of the other application messages. This 660 may also imply that the messages end up in a central accounting 661 server. A split accounting model is a good design choice when: 663 * The application itself does not define its own accounting 664 commands. 666 * The overall system architecture permits the use of centralized 667 accounting for one or more Diameter applications. 669 Centralizing accounting may have advantages but there are also 670 drawbacks. The model assumes that the accounting server can 671 differentiate received accounting messages. Since the received 672 accounting messages can be for any application and/or service, the 673 accounting server has to have a method to match accounting 674 messages with applications and/or services being accounted for. 675 This may mean defining new AVPs, checking the presence, absence or 676 contents of existing AVPs, or checking the contents of the 677 accounting record itself. But in general, there is no clean and 678 generic scheme for sorting these messages. Therefore, the use of 679 this model is recommended only when all received accounting 680 messages can be clearly identified and sorted. For most cases, 681 the use of Coupled Accounting Model is recommended. 683 Coupled Accounting Model: 685 In this model, the accounting messages will use the Application Id 686 of the application using the accounting service. The design 687 implication for this is that the accounting messages are tightly 688 coupled with the application itself; meaning that accounting 689 messages will be routed like the other application messages. It 690 would then be the responsibility of the application server 691 (application entity receiving the ACR message) to send the 692 accounting records carried by the accounting messages to the 693 proper accounting server. The application server is also 694 responsible for formulating a proper response (ACA). A coupled 695 accounting model is a good design choice when: 697 * The system architecture or deployment does not provide an 698 accounting server that supports Diameter. Consequently, the 699 application server has to be provisioned to use a different 700 protocol to access the accounting server, e.g., via LDAP, SOAP 701 etc. This case includes the support of older accounting 702 systems that are not Diameter aware. 704 * The system architecture or deployment requires that the 705 accounting service for the specific application should be 706 handled by the application itself. 708 In all cases above, there will generally be no direct Diameter 709 access to the accounting server. 711 These models provide a basis for using accounting messages. 712 Application designers may obviously deviate from these models 713 provided that the factors being addressed here have also been taken 714 into account. Although it is not recommended, an application may 715 define a new set of commands to carry application-specific accounting 716 records. 718 5.11. Diameter Security Mechanisms 720 As specified in [RFC6733], the Diameter message exchange should be 721 secured between neighboring Diameter peers using TLS/TCP or DTLS/ 722 SCTP. However, IPsec can also be deployed to secure communication 723 between Diameter peers. When IPsec is used instead of TLS or DTLS, 724 the following recommendations apply. 726 IPsec ESP [RFC4301] in transport mode with non-null encryption and 727 authentication algorithms is used to provide per-packet 728 authentication, integrity protection and confidentiality, and support 729 the replay protection mechanisms of IPsec. IKEv2 [RFC5996] is 730 recommended for performing mutual authentication and for establishing 731 and maintaining security associations (SAs). 733 IKEv1 [RFC2409] was used with RFC 3588 [RFC3588] and for easier 734 migration from IKEv1 based implementations both RSA digital 735 signatures and pre-shared keys should be supported in IKEv2. 736 However, if IKEv1 is used, implementers should follow the guidelines 737 given in Section 13.1 of RFC 3588 [RFC3588]. 739 6. Defining Generic Diameter Extensions 741 Generic Diameter extensions are AVPs, commands or applications that 742 are designed to support other Diameter applications. They are 743 auxiliary applications meant to improve or enhance the Diameter 744 protocol itself or Diameter applications/functionality. Some 745 examples include the extensions to support auditing and redundancy 746 (see [I-D.calhoun-diameter-res-mgmt]), improvements in duplicate 747 detection scheme (see [I-D.asveren-dime-dupcons]), and the support 748 for QoS AVPs (see [RFC5777]). 750 Since generic extensions may cover many aspects of Diameter and 751 Diameter applications, it is not possible to enumerate all scenarios. 752 However, some of the most common considerations are as follows: 754 Backward Compatibility: 756 With the design of generic extensions an protocol designer has to 757 consider with potential concerns about how existing applications 758 deal with the new extension they do not understand. Designers 759 also have to make sure that new extensions do not break expected 760 message delivery layer behavior. 762 Forward Compatibility: 764 Protocol designers need to make sure that their design will not 765 introduce undue restrictions for future applications. 767 Trade-off in Signaling: 769 Designers may have to choose between the use of optional AVPs 770 piggybacked onto existing commands versus defining new commands 771 and applications. Optional AVPs are simpler to implement and may 772 not need changes to existing applications. However, this ties the 773 sending of extension data to the application's transmission of a 774 message. This has consequences if the application and the 775 extensions have different timing requirements. The use of 776 commands and applications solves this issue, but the trade-off is 777 the additional complexity of defining and deploying a new 778 application. It is left up to the designer to find a good balance 779 among these trade-offs based on the requirements of the extension. 781 In practice, generic extensions often use optional AVPs because they 782 are simple and non-intrusive to the application that would carry 783 them. Peers that do not support the generic extensions need not 784 understand nor recognize these optional AVPs. However, it is 785 recommended that the authors of the extension specify the context or 786 usage of the optional AVPs. As an example, in the case that the AVP 787 can be used only by a specific set of applications then the 788 specification must enumerate these applications and the scenarios 789 when the optional AVPs will be used. In the case where the optional 790 AVPs can be carried by any application, it is should be sufficient to 791 specify such a use case and perhaps provide specific examples of 792 applications using them. 794 In most cases, these optional AVPs piggybacked by applications would 795 be defined as a Grouped AVP and it would encapsulate all the 796 functionality of the generic extension. In practice, it is not 797 uncommon that the Grouped AVP will encapsulate an existing AVP that 798 has previously been defined as mandatory ('M'-bit set) e.g., 3GPP IMS 799 Cx/Dx interfaces ([TS29.228] and [TS29.229]). 801 7. Guidelines for Registrations of Diameter Values 803 As summarized in the Section 3 of this document and further described 804 in the Section 1.3 of [RFC6733], there are four main ways to extend 805 Diameter. The process for defining new functionality slightly varies 806 based on the different extensions. This section provides protocol 807 designers with some guidance regarding the definition of values for 808 possible Diameter extensions and the necessary interaction with IANA 809 to register the new functionality. 811 a. Defining new AVP values 813 The specifications defining AVPs and AVP values provide guidance 814 for defining new values and the corresponding policy for adding 815 these values. For example, the RFC 5777 [RFC5777] defines the 816 Treatment-Action AVP which contains a list of valid values 817 corresponding to pre-defined actions (drop, shape, mark, permit). 818 This set of values can be extended following the Specification 819 Required policy defined in [RFC5226]. As a second example, the 820 Diameter base specification [RFC6733] defines the Result-Code AVP 821 that contains a 32-bit address space used to identity possible 822 errors. According to the Section 11.3.2 of [RFC6733], new values 823 can be assigned by IANA via an IETF Review process [RFC5226]. 825 b. Creating new AVPs 827 Two different types of AVP Codes namespaces can be used to create 828 a new AVPs: 830 * IETF AVP Codes namespace; 832 * Vendor-specific AVP Codes namespace. 834 In the latter case, a vendor needs to be first assigned by IANA 835 with a private enterprise number, which can be used within the 836 Vendor-Id field of the vendor-specific AVP. This enterprise 837 number delimits a private namespace in which the vendor is 838 responsible for vendor-specific AVP code value assignment. The 839 absence of a Vendor-Id or a Vendor-Id value of zero (0) in the AVP 840 header identifies standard AVPs from the IETF AVP Codes namespace 841 managed by IANA. The allocation of code values from the IANA- 842 managed namespace is conditioned by an Expert Review of the 843 specification defining the AVPs or an IETF review if a block of 844 AVPs needs to be assigned. Moreover, the remaining bits of the 845 AVP Flags field of the AVP header can be also assigned via 846 Standard Action if the creation of new AVP Flags is desired. 848 c. Creating new commands 850 Unlike the AVP Code namespace, the Command Code namespace is flat 851 but the range of values is subdivided into three chunks with 852 distinct IANA registration policies: 854 * A range of standard Command Code values that can be allocated 855 via IETF review; 857 * A range of vendor-specific Command Code values that can be 858 allocated on a First-Come/First-Served basis; 860 * A range of values reserved only for experimental and testing 861 purposes. 863 As for AVP Flags, the remaining bits of the Command Flags field of 864 the Diameter header can also be assigned via a Standards Action to 865 create new Command Flags if required. 867 d. Creating new applications 869 Similarly to the Command Code namespace, the Application-Id 870 namespace is flat but divided into two distinct ranges: 872 * A range of values reserved for standard Application-Ids 873 allocated after Expert Review of the specification defining the 874 standard application; 876 * A range for values for vendor specific applications, allocated 877 by IANA on a First-Come/First-Serve basis. 879 The IANA AAA parameters page can be found at http://www.iana.org/ 880 assignments/aaa-parameters/aaa-parameters.xml and the enterprise 881 number IANA page is available at http://www.iana.org/assignments/ 882 enterprise-numbers. More details on the policies followed by IANA 883 for namespace management (e.g. First-Come/First-Served, Expert 884 Review, IETF Review, etc.) can be found in [RFC5226]. 886 NOTE: 887 When the same functionality/extension is used by more than one 888 vendor, it is recommended to define a standard extension. 889 Moreover, the registration of vendor-specific extension is 890 encouraged to avoid interoperability issues in the same network. 891 With this aim, the registration policy of vendor-specific 892 extension has been simplified with the publication of [RFC6733] 893 and the namespace reserved for vendor-specific extensions is large 894 enough to avoid exhaustion. 896 8. IANA Considerations 898 This document does not require actions by IANA. 900 9. Security Considerations 901 This document provides guidelines and considerations for extending 902 Diameter and Diameter applications. Although such an extension may 903 related to a security functionality, the document does not explicitly 904 give guidance on enhancing Diameter with respect to security. 906 10. Contributors 908 The content of this document was influenced by a design team created 909 to revisit the Diameter extensibility rules. The team consisting of 910 the members listed below was formed in February 2008 and finished its 911 work in June 2008. 913 o Avi Lior 915 o Glen Zorn 917 o Jari Arkko 919 o Lionel Morand 921 o Mark Jones 923 o Victor Fajardo 925 o Tolga Asveren 927 o Jouni Korhonen 929 o Glenn McGregor 931 o Hannes Tschofenig 933 o Dave Frascone 935 We would like to thank Tolga Asveren, Glenn McGregor, and John 936 Loughney for their contributions as co-authors to earlier versions of 937 this document. 939 11. Acknowledgments 941 We greatly appreciate the insight provided by Diameter implementers 942 who have highlighted the issues and concerns being addressed by this 943 document. The authors would also like to thank Jean Mahoney and Ben 944 Campbell for their invaluable detailed review and comments on this 945 document. 947 12. Informative References 949 [I-D.asveren-dime-dupcons] 950 Asveren, T., "Diameter Duplicate Detection Cons.", draft- 951 asveren-dime-dupcons-00 (work in progress), August 2006. 953 [I-D.calhoun-diameter-res-mgmt] 954 Calhoun, P., "Diameter Resource Management Extensions", 955 draft-calhoun-diameter-res-mgmt-08.txt (work in progress), 956 March 2001. 958 [Q.3303.3] 959 3rd Generation Partnership Project, "ITU-T Recommendation 960 Q.3303.3, "Resource control protocol no. 3 (rcp3): 961 Protocol at the Rw interface between the Policy Decision 962 Physical Entity (PD-PE) and the Policy Enforcement 963 Physical Entity (PE-PE): Diameter"", 2008. 965 [RFC2407] Piper, D., "The Internet IP Security Domain of 966 Interpretation for ISAKMP", RFC 2407, November 1998. 968 [RFC2409] Harkins, D. and D. Carrel, "The Internet Key Exchange 969 (IKE)", RFC 2409, November 1998. 971 [RFC3588] Calhoun, P., Loughney, J., Guttman, E., Zorn, G., and J. 972 Arkko, "Diameter Base Protocol", RFC 3588, September 2003. 974 [RFC4005] Calhoun, P., Zorn, G., Spence, D., and D. Mitton, 975 "Diameter Network Access Server Application", RFC 4005, 976 August 2005. 978 [RFC4072] Eronen, P., Hiller, T., and G. Zorn, "Diameter Extensible 979 Authentication Protocol (EAP) Application", RFC 4072, 980 August 2005. 982 [RFC4301] Kent, S. and K. Seo, "Security Architecture for the 983 Internet Protocol", RFC 4301, December 2005. 985 [RFC4740] Garcia-Martin, M., Belinchon, M., Pallares-Lopez, M., 986 Canales-Valenzuela, C., and K. Tammi, "Diameter Session 987 Initiation Protocol (SIP) Application", RFC 4740, November 988 2006. 990 [RFC5226] Narten, T. and H. Alvestrand, "Guidelines for Writing an 991 IANA Considerations Section in RFCs", BCP 26, RFC 5226, 992 May 2008. 994 [RFC5447] Korhonen, J., Bournelle, J., Tschofenig, H., Perkins, C., 995 and K. Chowdhury, "Diameter Mobile IPv6: Support for 996 Network Access Server to Diameter Server Interaction", RFC 997 5447, February 2009. 999 [RFC5777] Korhonen, J., Tschofenig, H., Arumaithurai, M., Jones, M., 1000 and A. Lior, "Traffic Classification and Quality of 1001 Service (QoS) Attributes for Diameter", RFC 5777, February 1002 2010. 1004 [RFC5996] Kaufman, C., Hoffman, P., Nir, Y., and P. Eronen, 1005 "Internet Key Exchange Protocol Version 2 (IKEv2)", RFC 1006 5996, September 2010. 1008 [RFC6733] Fajardo, V., Arkko, J., Loughney, J., and G. Zorn, 1009 "Diameter Base Protocol", RFC 6733, October 2012. 1011 [TS29.228] 1012 3rd Generation Partnership Project, "3GPP TS 29.228; 1013 Technical Specification Group Core Network and Terminals; 1014 IP Multimedia (IM) Subsystem Cx and Dx Interfaces; 1015 Signalling flows and message contents", , 1016 . 1018 [TS29.229] 1019 3rd Generation Partnership Project, "3GPP TS 29.229; 1020 Technical Specification Group Core Network and Terminals; 1021 Cx and Dx interfaces based on the Diameter protocol; 1022 Protocol details", , 1023 . 1025 [TS29.328] 1026 3rd Generation Partnership Project, "3GPP TS 29.328; 1027 Technical Specification Group Core Network and Terminals; 1028 IP Multimedia (IM) Subsystem Sh interface; signalling 1029 flows and message content", , 1030 . 1032 [TS29.329] 1033 3rd Generation Partnership Project, "3GPP TS 29.329; 1034 Technical Specification Group Core Network and Terminals; 1035 Sh Interface based on the Diameter protocol; Protocol 1036 details", , 1037 . 1039 Authors' Addresses 1040 Lionel Morand (editor) 1041 Orange Labs 1042 38/40 rue du General Leclerc 1043 Issy-Les-Moulineaux Cedex 9 92794 1044 France 1046 Phone: +33145296257 1047 Email: lionel.morand@orange.com 1049 Victor Fajardo 1051 Email: vf0213@gmail.com 1053 Hannes Tschofenig 1054 Nokia Siemens Networks 1055 Linnoitustie 6 1056 Espoo 02600 1057 Finland 1059 Phone: +358 (50) 4871445 1060 Email: Hannes.Tschofenig@gmx.net 1061 URI: http://www.tschofenig.priv.at