idnits 2.17.1 draft-ietf-sipcore-reinvite-02.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- ** You're using the IETF Trust Provisions' Section 6.b License Notice from 12 Sep 2009 rather than the newer Notice from 28 Dec 2009. (See https://trustee.ietf.org/license-info/) 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 : ---------------------------------------------------------------------------- -- The document has examples using IPv4 documentation addresses according to RFC6890, but does not use any IPv6 documentation addresses. Maybe there should be IPv6 examples, too? -- The draft header indicates that this document updates RFC3261, but the abstract doesn't seem to mention this, which it should. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year (Using the creation date from RFC3261, updated by this document, for RFC5378 checks: 2000-07-17) -- 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 (March 4, 2010) is 5138 days in the past. Is this intentional? Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) No issues found here. Summary: 1 error (**), 0 flaws (~~), 1 warning (==), 4 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 SIPCORE G. Camarillo, Ed. 3 Internet-Draft C. Holmberg 4 Updates: 3261 (if approved) Ericsson 5 Intended status: Standards Track Y. Gao 6 Expires: September 5, 2010 ZTE 7 March 4, 2010 9 Re-INVITE and Target-refresh Request Handling in the Session Initiation 10 Protocol (SIP) 11 draft-ietf-sipcore-reinvite-02.txt 13 Abstract 15 In this document, we clarify the handling of re-INVITEs in SIP. We 16 clarify in which situations a UAS (User Agent Server) should generate 17 a success response and in which situations a UAS should generate an 18 error response to a re-INVITE. Additionally, we clarify issues 19 related to target-refresh requests. 21 Status of this Memo 23 This Internet-Draft is submitted to IETF in full conformance with the 24 provisions of BCP 78 and BCP 79. 26 Internet-Drafts are working documents of the Internet Engineering 27 Task Force (IETF), its areas, and its working groups. Note that 28 other groups may also distribute working documents as Internet- 29 Drafts. 31 Internet-Drafts are draft documents valid for a maximum of six months 32 and may be updated, replaced, or obsoleted by other documents at any 33 time. It is inappropriate to use Internet-Drafts as reference 34 material or to cite them other than as "work in progress." 36 The list of current Internet-Drafts can be accessed at 37 http://www.ietf.org/ietf/1id-abstracts.txt. 39 The list of Internet-Draft Shadow Directories can be accessed at 40 http://www.ietf.org/shadow.html. 42 This Internet-Draft will expire on September 5, 2010. 44 Copyright Notice 46 Copyright (c) 2010 IETF Trust and the persons identified as the 47 document authors. All rights reserved. 49 This document is subject to BCP 78 and the IETF Trust's Legal 50 Provisions Relating to IETF Documents 51 (http://trustee.ietf.org/license-info) in effect on the date of 52 publication of this document. Please review these documents 53 carefully, as they describe your rights and restrictions with respect 54 to this document. Code Components extracted from this document must 55 include Simplified BSD License text as described in Section 4.e of 56 the Trust Legal Provisions and are provided without warranty as 57 described in the BSD License. 59 Table of Contents 61 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 3 62 2. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 3 63 3. Re-INVITE Handling . . . . . . . . . . . . . . . . . . . . . . 4 64 3.1. Background on Re-INVITE Handling by UASs . . . . . . . . . 4 65 3.2. Problems with Error Responses and Already-executed 66 Changes . . . . . . . . . . . . . . . . . . . . . . . . . 8 67 3.3. UAS Behavior . . . . . . . . . . . . . . . . . . . . . . . 9 68 3.4. UAC Behavior . . . . . . . . . . . . . . . . . . . . . . . 10 69 3.5. Glare Situations . . . . . . . . . . . . . . . . . . . . . 10 70 3.6. Example of UAS Behavior . . . . . . . . . . . . . . . . . 11 71 3.7. Example of UAC Behavior . . . . . . . . . . . . . . . . . 14 72 3.8. Clarifications on Cancelling Re-INVITEs . . . . . . . . . 16 73 4. Target-refresh Handling . . . . . . . . . . . . . . . . . . . 17 74 4.1. Background on Target-refresh Requests . . . . . . . . . . 17 75 4.2. Clarification on the Atomicity of Target-Refresh 76 Requests . . . . . . . . . . . . . . . . . . . . . . . . . 17 77 4.3. UAC Behavior . . . . . . . . . . . . . . . . . . . . . . . 18 78 4.4. UAS Behavior . . . . . . . . . . . . . . . . . . . . . . . 18 79 4.5. Race Conditions and Target Refreshes . . . . . . . . . . . 19 80 5. Re-INVITE Transaction Routing . . . . . . . . . . . . . . . . 20 81 5.1. Background on re-INVITE Transaction Routing . . . . . . . 20 82 5.2. Problems with UAs Losing their Contact . . . . . . . . . . 20 83 5.3. UAS Losing its Contact: UAC Behavior . . . . . . . . . . . 20 84 5.4. UAC Losing its Contact: UAS Behavior . . . . . . . . . . . 21 85 5.5. UAC Losing its Contact: UAC Behavior . . . . . . . . . . . 22 86 6. Security Considerations . . . . . . . . . . . . . . . . . . . 22 87 7. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 22 88 8. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . 23 89 9. Normative References . . . . . . . . . . . . . . . . . . . . . 23 90 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . . 23 92 1. Introduction 94 As discussed in Section 14 of RFC 3261 [RFC3261], an INVITE request 95 sent within an existing dialog is known as a re-INVITE. A re-INVITE 96 is used to modify session parameters, dialog parameters, or both. 97 That is, a single re-INVITE can change both the parameters of its 98 associated session (e.g., changing the IP address where a media 99 stream is received) and the parameters of its associated dialog 100 (e.g., changing the remote target of the dialog). A re-INVITE can 101 change the remote target of a dialog because it is a target refresh 102 request, as defined in Section 6 of RFC 3261 [RFC3261]. 104 A re-INVITE transaction has an offer/answer [RFC3264] exchange 105 associated to it. The UAC (User Agent Client) generating a given re- 106 INVITE can act as the offerer or as the answerer. A UAC willing to 107 act as the offerer includes an offer in the re-INVITE. The UAS then 108 provides an answer in a response to the re-INVITE. A UAC willing to 109 act as answerer does not include an offer in the re-INVITE. The UAS 110 then provides an offer in a response to the re-INVITE becoming, thus, 111 the offerer. 113 Certain transactions within a re-INVITE (e.g., UPDATE [RFC3311] 114 transactions) can also have offer/answer exchanges associated to 115 them. A UA (User Agent) can act as the offerer or the answerer in 116 any of these transactions regardless of whether the UA was the 117 offerer or the answerer in the umbrella re-INVITE transaction. 119 There has been some confusion among implementors regarding how a UAS 120 (User Agent Server) should handle re-INVITEs. In particular, 121 implementors requested clarification on which type of response a UAS 122 should generate in different situations. In this document, we 123 clarify these issues. 125 Additionally, there has also been some confusion among implementors 126 regarding target refresh requests, which include but are not limited 127 to re-INVITEs. In this document, we also clarify the process by 128 which remote targets are refreshed. 130 2. Terminology 132 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 133 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 134 document are to be interpreted as described in RFC 2119 [RFC2119]. 136 UA: User Agent. 138 UAC: User Agent Client. 140 UAS: User Agent Server. 142 3. Re-INVITE Handling 144 The following sections discuss re-INVITE handling. 146 3.1. Background on Re-INVITE Handling by UASs 148 A UAS receiving a re-INVITE will need to, eventually, generate a 149 response to it. Some re-INVITEs can be responded to immediately 150 because their handling does not require user interaction (e.g., 151 changing the IP address where a media stream is received). The 152 handling of other re-INVITEs requires user interaction (e.g., adding 153 a video stream to an audio-only session). Therefore, these re- 154 INVITEs cannot be responded to immediately. 156 An error response to a re-INVITE has the following semantics. As 157 specified in Section 12.2.2 of RFC 3261 [RFC3261], if a re-INVITE is 158 rejected, no state changes are performed. These state changes 159 include state changes associated to the re-INVITE transaction and all 160 other transactions within the re-INVITE (target refreshes, which are 161 discussed in Section 4.1, are an exception to this rule because in 162 certain cases they are performed even if the re-INVITE is rejected). 163 That is, the session and dialog states are the same as before the re- 164 INVITE was received. The example in Figure 1 illustrates this point. 166 UAC UAS 168 | | 169 |-------------(1) INVITE SDP1--------------->| 170 | | 171 |<------------(2) 200 OK SDP2----------------| 172 | | 173 |------------------(3) ACK------------------>| 174 | | 175 | | 176 |-------------(4) INVITE SDP3--------------->| 177 | | 178 |<-----------------(5) 4xx-------------------| 179 | | 180 |------------------(6) ACK------------------>| 181 | | 182 Figure 1: Rejection of a re-INVITE 184 The UAs perform an offer/answer exchange to establish an audio-only 185 session: 187 SDP1: 188 m=audio 30000 RTP/AVP 0 190 SDP2: 191 m=audio 31000 RTP/AVP 0 193 At a later point, the UAC sends a re-INVITE (4) in order to add a 194 video stream to the session. 196 SDP3: 197 m=audio 30000 RTP/AVP 0 198 m=video 30002 RTP/AVP 31 200 The UAS is automatically configured to reject video streams. 201 Consequently, the UAS returns an error response (5). At that point, 202 the session parameters in use are still those resulting from the 203 initial offer/answer exchange, which are described by SDP1 and SDP2. 204 That is, the session and dialog states are the same as before the re- 205 INVITE was received. 207 In the previous example, the UAS rejected all the changes requested 208 in the re-INVITE by returning an error response. However, there are 209 situations where a UAS wants to accept some but not all the changes 210 requested in a re-INVITE. In these cases, the UAS generates a 200 211 (OK) response with an SDP indicating which changes were accepted and 212 which were not. The example in Figure 2 illustrates this point. 214 UAC UAS 216 | | 217 |-------------(1) INVITE SDP1--------------->| 218 | | 219 |<------------(2) 200 OK SDP2----------------| 220 | | 221 |------------------(3) ACK------------------>| 222 | | 223 | | 224 |-------------(4) INVITE SDP3--------------->| 225 | | 226 |<------------(5) 200 OK SDP4----------------| 227 | | 228 |------------------(6) ACK------------------>| 229 | | 231 Figure 2: Automatic rejection of a video stream 233 The UAs perform an offer/answer exchange to establish an audio only 234 session: 236 SDP1: 237 m=audio 30000 RTP/AVP 0 238 c=IN IP4 192.0.2.1 240 SDP2: 241 m=audio 31000 RTP/AVP 0 242 c=IN IP4 192.0.2.5 244 At a later point, the UAC moves to an access that provides a higher- 245 bandwidth. Therefore, the UAC sends a re-INVITE (4) in order to 246 change the IP address where it receives the audio stream to its new 247 IP address and add a video stream to the session. 249 SDP3: 250 m=audio 30000 RTP/AVP 0 251 c=IN IP4 192.0.2.2 252 m=video 30002 RTP/AVP 31 253 c=IN IP4 192.0.2.2 255 The UAS is automatically configured to reject video streams. 256 However, the UAS needs to accept the change of the audio stream's 257 remote IP address. Consequently, the UAS returns a 200 (OK) response 258 and sets the port of the video stream to zero in its SDP. 260 SDP4: 261 m=audio 31000 RTP/AVP 0 262 c=IN IP4 192.0.2.5 263 m=video 0 RTP/AVP 31 265 In the previous example, the UAS was configured to automatically 266 reject the addition of video streams. The example in Figure 3 267 assumes that the UAS requires its user's input in order to accept or 268 reject the addition of a video stream and uses reliable provisional 269 responses [RFC3262] (PRACK transactions are not shown for clarity). 271 UAC UAS 273 | | 274 |-------------(1) INVITE SDP1--------------->| 275 | | 276 |<------------(2) 200 OK SDP2----------------| 277 | | 278 |------------------(3) ACK------------------>| 279 | | 280 | | 281 |-------------(4) INVITE SDP3--------------->| 282 | | 283 |<----(5) 183 Session Progress SDP4----------| 284 | | 285 | | 286 |<------------(6) UPDATE SDP5----------------| 287 | | 288 |-------------(7) 200 OK SDP6--------------->| 289 | | 290 |<---------------(8) 200 OK------------------| 291 | | 292 |------------------(9) ACK------------------>| 293 | | 295 Figure 3: Rejection of a video stream by the user 297 Everything up to (4) is identical to the previous example. In (5), 298 the UAS accepts the change of the audio stream's remote IP address 299 but does not accept the video stream yet (it provides a null IP 300 address instead of setting the stream to 'inactive' because inactive 301 streams still need to exchange RTCP traffic). 303 SDP4: 304 m=audio 31000 RTP/AVP 0 305 c=IN IP4 192.0.2.5 306 m=video 31002 RTP/AVP 31 307 c=IN IP4 0.0.0.0 309 At a later point, the UAS's user rejects the addition of the video 310 stream. Consequently, the UAS sends an UPDATE request (6) setting 311 the port of the video stream to zero in its offer. 313 SDP5: 314 m=audio 31000 RTP/AVP 0 315 c=IN IP4 192.0.2.5 316 m=video 0 RTP/AVP 31 317 c=IN IP4 0.0.0.0 319 The UAC returns a 200 (OK) response (7) to the UPDATE with the 320 following answer: 322 SDP6: 323 m=audio 30000 RTP/AVP 0 324 c=IN IP4 192.0.2.2 325 m=video 0 RTP/AVP 31 327 The UAS now returns a 200 (OK) response (8) to the re-INVITE. 329 In all the previous examples, the UAC of the re-INVITE transaction 330 was the offerer. Examples with UACs acting as the answerers would be 331 similar. 333 3.2. Problems with Error Responses and Already-executed Changes 335 Section 3.1 contains examples on how a UAS rejects all the changes 336 requested in a re-INVITE without executing any of them by returning 337 an error response (Figure 1), and how a UAS executes some of the 338 changes requested in a re-INVITE and rejects some of them by 339 returning a 2xx response (Figure 2 and Figure 3). A UAS can accept 340 and reject different sets of changes simultaneously (Figure 2) or at 341 different times (Figure 3). 343 The scenario that created confusion among implementors consists of a 344 UAS that receives a re-INVITE, executes some of the changes requested 345 in it, and then wants to reject all those already-executed changes 346 and revert to the pre-re-INVITE state. Such a UAS may consider 347 returning an error response to the re-INVITE (the message flow would 348 be similar to the one in Figure 1), or using an UPDATE request to 349 revert to the pre-re-INVITE state and then returning a 2xx response 350 to the re-INVITE (the message flow would be similar to the one in 351 Figure 3). This section explains the problems associated with 352 returning an error response in these circumstances. In order to 353 avoid these problems, the UAS should use the latter option (UPDATE 354 request plus a 2xx response). Section 3.3 and Section 3.4 contain 355 the normative statements needed to avoid these problems. 357 The reason for not using an error response to undo already executed 358 changes is that an error response to a re-INVITE for which changes 359 have already been executed is effectively requesting a change in the 360 session or the dialog state. However, the UAC has no means to reject 361 those changes if it is unable to execute them. That is, if the UAC 362 is unable to revert to the pre-re-INVITE state, it will not be able 363 to communicate this fact to the UAS. 365 3.3. UAS Behavior 367 UASs should only return an error response to a re-INVITE if no 368 changes to the session or to the dialog state have been executed 369 since the re-INVITE was received. Such an error response indicates 370 that no changes have been executed as a result of the re-INVITE or 371 any other transaction within it. 373 If any of the changes requested in a re-INVITE or in any transaction 374 within it have already been executed (with the exception of target 375 refreshes), the UAS SHOULD return a 2xx response. 377 A change to the session state is considered to have been executed if 378 an offer/answer without preconditions [RFC4032] for the stream has 379 completed successfully or the UAs have exchanged media using the new 380 parameters. Connection establishment messages (e.g., TCP SYN), 381 connectivity checks (e.g., when using ICE [I-D.ietf-mmusic-ice]), and 382 any other messages used in the process of meeting the preconditions 383 for a stream are not considered media. 385 Normally, a UA receiving media can easily detect when the new 386 parameters for the media stream are used (e.g,. media is received 387 on a new port). However, in some scenarios the UA will have to 388 process incoming media packets in order to detect whether they use 389 the old or the new parameters. 391 The successful completion of an offer/answer exchange without 392 preconditions indicates that the new parameters for the media stream 393 are already considered to be in use. The successful completion of an 394 offer/answer exchange with preconditions means something different. 395 The fact that all mandatory preconditions for the stream are met 396 indicates that the new parameters for the media stream are ready to 397 be used. However, they will not actually be used until the UAS 398 decides so. During a session establishment, the UAS can wait before 399 using the media parameters until the callee starts being alerted or 400 until the callee accepts the session. During a session modification, 401 the UAS can wait until its user accepts the changes to the session. 402 When dealing with streams where the UAS sends media more or less 403 continuously, the UAC notices that the new parameters are in use 404 because the UAC receives media that uses the new parameters. 405 However, this mechanism does not work with other types of streams. 406 Therefore, it is RECOMMENDED that when a UAS decides to start using 407 the new parameters for a stream for which all mandatory preconditions 408 have been met, the UAS either sends media using the new parameters or 409 sends a new offer where the precondition-related attributes for the 410 stream have been removed. As indicated above, the successful 411 completion of an offer/answer exchange without preconditions 412 indicates that the new parameters for the media stream are already 413 considered to be in use. 415 The point a change to the dialog state is considered to have been 416 executed depends on the particular dialog parameter being modified. 417 The specifications of different dialog parameters describe when the 418 new value of the parameter needs to be taken into use. 420 3.4. UAC Behavior 422 A UAC that receives an error response to a re-INVITE that undoes 423 already-executed changes within the re-INVITE may be facing a legacy 424 UAS that does not support this specification (i.e., a UAS that does 425 not follow the guidelines in Section 3.3). There are also certain 426 race condition situations that get both user agents out of 427 synchronization. In order to cope with these race condition 428 situations, a UAC that receives an error response to a re-INVITE for 429 which changes have been already executed SHOULD generate a new re- 430 INVITE or UPDATE request in order to make sure that both UAs have a 431 common view of the state of the dialog and the session (the UAC uses 432 the criteria in Section 3.3 in order to decide whether or not changes 433 have been executed for the stream). The purpose of this new offer/ 434 answer exchange is to synchronize both UAs, not to request changes 435 that the UAS may choose to reject. Therefore, the dialog parameters 436 and the session parameters in the offer/answer exchange SHOULD be as 437 close as those in the pre-re-INVITE state as possible. 439 3.5. Glare Situations 441 Section 4 of RFC 3264 [RFC3264] specifies rules to avoid and detect 442 glare situations (i.e., to avoid offer/answer collisions in race 443 conditions). Section 14.1 of RFC 3261 [RFC3261] specifies general 444 rules to handle glare situations in SIP. Section 5.1 of RFC 3311 446 [RFC3311] specifies when UPDATE requests can be sent. The specified 447 rules include, among other things, procedures to cope with situations 448 where both UAs generate an offer at the same time. However, there 449 are no rules to avoid a collision between an offer in an UPDATE 450 request and an error response to a re-INVITE. Since both the UPDATE 451 request and the error response could be requesting changes, it would 452 not be clear which changes would need to be executed first. The 453 following rules avoid types of glare conditions that were not covered 454 by previous specifications. 456 When checking for glare situations, UAs MUST treat the exchange of a 457 non-2xx final response to a re-INVITE and its corresponding ACK 458 request as an offer/answer exchange. Consequently, the rules 459 regarding glare situations applicable to offer/answer exchanges are 460 also applicable to those exchanges. These rules imply that if the 461 UAS of a re-INVITE transaction receives and UPDATE request with an 462 offer after having sent a non-2xx final response to the re-INVITE but 463 before having received the corresponding ACK request, the UA SHOULD 464 return a 491 (Request Pending) response to the UPDATE request. If 465 the UAC of a re-INVITE transaction sends an UPDATE request with an 466 offer, receives a non-2xx response to the re-INVITE, and then a 2xx 467 response to the UPDATE request, the UA SHOULD generate a new re- 468 INVITE or UPDATE request in order to make sure that both UAs have a 469 common view of the state of the session, as described in Section 3.4. 471 An UPDATE request without an offer can change dialog parameters. So 472 can a non-2xx final response to a re-INVITE request or a 2xx response 473 to an INVITE request (re-INVITE or initial INVITE). However, there 474 are no rules to avoid a collision between an offerless UPDATE request 475 and a final response to an INVITE request. The rules in Section 4.5, 476 which are given in the context of target refreshes, cover these types 477 of collisions as well. Therefore, there is no need to specify 478 further rules here. 480 3.6. Example of UAS Behavior 482 This section contains an example of a UAS that implements this 483 specification using an UPDATE request and a 2xx response to a re- 484 INVITE in order to revert to the pre-re-INVITE state. The example, 485 which is shown in Figure 4, assumes that the UAS requires its user's 486 input in order to accept or reject the addition of a video stream and 487 uses reliable provisional responses [RFC3262] (PRACK transactions are 488 not shown for clarity). 490 UAC UAS 492 | | 493 |-------------(1) INVITE SDP1--------------->| 494 | | 495 |<------------(2) 200 OK SDP2----------------| 496 | | 497 |------------------(3) ACK------------------>| 498 | | 499 | | 500 |-------------(4) INVITE SDP3--------------->| 501 | | 502 |<----(5) 183 Session Progress SDP4----------| 503 | | 504 |-------------(6) UPDATE SDP5--------------->| 505 | | 506 |<------------(7) 200 OK SDP6----------------| 507 | | 508 | | 509 |<------------(8) UPDATE SDP7----------------| 510 | | 511 |-------------(9) 200 OK SDP8--------------->| 512 | | 513 |<--------------(10) 200 OK------------------| 514 | | 515 |-----------------(11) ACK------------------>| 516 | | 518 Figure 4: Rejection of a video stream by the user 520 The UAs perform an offer/answer exchange to establish an audio only 521 session: 523 SDP1: 524 m=audio 30000 RTP/AVP 0 525 c=IN IP4 192.0.2.1 527 SDP2: 528 m=audio 31000 RTP/AVP 0 529 c=IN IP4 192.0.2.5 531 At a later point, the UAC sends a re-INVITE (4) in order to add a new 532 codec to the audio stream and to add a video stream to the session. 534 SDP3: 535 m=audio 30000 RTP/AVP 0 3 536 c=IN IP4 192.0.2.1 537 m=video 30002 RTP/AVP 31 538 c=IN IP4 192.0.2.1 540 In (5), the UAS accepts the addition of the audio codec but does not 541 accept the video stream yet (it provides a null IP address instead of 542 setting the stream to 'inactive' because inactive streams still need 543 to exchange RTCP traffic). 545 SDP4: 546 m=audio 31000 RTP/AVP 0 3 547 c=IN IP4 192.0.2.5 548 m=video 31002 RTP/AVP 31 549 c=IN IP4 0.0.0.0 551 At a later point, the UAC sends an UPDATE request (6) to remove the 552 original audio codec from the audio stream (the UAC could have also 553 used the PRACK to (5) to request this change). 555 SDP5: 556 m=audio 30000 RTP/AVP 3 557 c=IN IP4 192.0.2.1 558 m=video 30002 RTP/AVP 31 559 c=IN IP4 192.0.2.1 561 SDP6: 562 m=audio 31000 RTP/AVP 3 563 c=IN IP4 192.0.2.5 564 m=video 31002 RTP/AVP 31 565 c=IN IP4 0.0.0.0 567 Yet at a later point, the UAS's user rejects the addition of the 568 video stream. Additionally, the UAS decides to revert to the 569 original audio codec. Consequently, the UAS sends an UPDATE request 570 (8) setting the port of the video stream to zero and offering the 571 original audio codec in its SDP. 573 SDP7: 574 m=audio 31000 RTP/AVP 0 575 c=IN IP4 192.0.2.5 576 m=video 0 RTP/AVP 31 577 c=IN IP4 0.0.0.0 579 The UAC accepts the change in the audio codec in its 200 (OK) 580 response (9) to the UPDATE request. 582 SDP8: 583 m=audio 30000 RTP/AVP 0 584 c=IN IP4 192.0.2.1 585 m=video 0 RTP/AVP 31 586 c=IN IP4 192.0.2.1 588 The UAS now returns a 200 (OK) response (10) to the re-INVITE. Note 589 that the media state after this 200 (OK) response is the same as the 590 pre-re-INVITE media state. 592 3.7. Example of UAC Behavior 594 Figure 5 shows an example of a race condition situation in which the 595 UAs end up with different views of the state of the session. The UAs 596 in Figure 5 are involved in a session that, just before the message 597 flows in the figures starts, includes a sendrecv audio stream and an 598 inactive video stream. UA1 sends a re-INVITE (1) requesting to make 599 the video stream sendrecv. 601 SDP1: 602 m=audio 20000 RTP/AVP 0 603 a=sendrecv 604 m=video 20002 RTP/AVP 31 605 a=sendrecv 607 UA2 is configured to automatically accept incoming video streams but 608 to ask for user input before generating an outgoing video stream. 609 Therefore, UAS2 makes the video stream recvonly by returning a 183 610 (Session Progress) response (2). 612 SDP2: 613 m=audio 30000 RTP/AVP 0 614 a=sendrecv 615 m=video 30002 RTP/AVP 31 616 a=recvonly 618 When asked for input, UA2's user chooses not to have either incoming 619 or outgoing video. In order to make the video stream inactive, UA2 620 returns a 4xx error response (5) to the re-INVITE. The ACK request 621 (6) for this error response is generated by the proxy between both 622 user agents. Note that this error response undoes already-executed 623 changes. So, UA2 is a legacy UA that does not support this 624 specification. 626 The proxy relays the 4xx response (7) towards UA1. However, the 4xx 627 response (7) takes time to arrive to UA1 (e.g., the response may have 628 been sent over UDP and the first few retransmissions were lost). In 629 the meantime, UA2's user decides to put the audio stream on hold. 630 UA2 sends an UPDATE request (8) making the audio stream recvonly. 631 The video stream, which is inactive, is not modified and, thus, 632 continues being inactive. 634 SDP3: 635 m=audio 30000 RTP/AVP 0 636 a=recvonly 637 m=video 30002 RTP/AVP 31 638 a=inactive 640 The proxy relays the UPDATE request (9) to UA1. The UPDATE request 641 (9) arrives at UA1 before the 4xx response (7) that had been 642 previously sent. UA1 accepts the changes in the UPDATE request and 643 returns a 200 (OK) response (10) to it. 645 SDP4: 646 m=audio 20000 RTP/AVP 0 647 a=sendonly 648 m=video 30002 RTP/AVP 31 649 a=inactive 651 At a later point, the 4xx response (7) finally arrives at UA1. This 652 response makes the session return to its pre-re-INVITE state. 653 Therefore, for UA1, the audio stream is sendrecv and the video stream 654 is inactive. However, for UA2, the audio stream is recvonly (the 655 video stream is also inactive). 657 a:sendrecv a:sendrecv 658 v:inactive v:inactive 660 UA1 Proxy UA2 662 | | | 663 |----(1) INVITE SDP1-->| | 664 | |----(2) INVITE SDP1-->| 665 | | | 666 | |<----(3) 183 SDP2-----| a:sendrecv 667 a:sendrecv |<----(4) 183 SDP2-----| | v:recvonly 668 v:sendonly | | | 669 | |<------(5) 4xx -------| 670 | |-------(6) ACK ------>| a:sendrecv 671 | +-(7) 4xx -| | v:inactive 672 | | |<---(8) UPDATE SDP3---| 673 |<---(9) UPDATE SDP3---| | 674 | | | | 675 a:sendonly |---(10) 200 OK SDP4-->| | 676 v:inactive | | |---(11) 200 OK SDP4-->| a:recvonly 677 |<-(7) 4xx -+ | | v:inactive 678 a:sendrecv |------(12) ACK ------>| | 679 v:inactive | | | 681 a: status of the audio stream 682 v: status of the video stream 684 Figure 5: Message flow with race condition 686 After the message flow in Figure 5, following the recommendations in 687 this section, when UA1 received an error response (7) that undid 688 already-executed changes, UA1 would generate an UPDATE request with 689 an SDP reflecting the pre-re-INVITE state (i.e., sendrecv audio and 690 inactive video). UA2 could then return a 200 (OK) response to the 691 UPDATE request making the audio stream recvonly, which is the state 692 UA2's user had requested. Such an UPDATE transaction would get the 693 UAs back into synchronization. 695 3.8. Clarifications on Cancelling Re-INVITEs 697 Section 9.2 of RFC 3261 [RFC3261] specifies the behavior of a UAS 698 responding to a CANCEL request. Such a UAS responds to the INVITE 699 request with a 487 (Request Terminated) at the 'should' level. Per 700 the rules specified in Section 3.3, if the INVITE request was a re- 701 INVITE and some of its requested changes had already been executed, 702 the UAS would return a 2xx response instead. 704 4. Target-refresh Handling 706 The following sections discuss target-refresh request handling. 708 4.1. Background on Target-refresh Requests 710 A target-refresh request is defined as follows in Section 6 of RFC 711 3261 [RFC3261]: 713 "A target-refresh request sent within a dialog is defined as a 714 request that can modify the remote target of the dialog." 716 Additionally, 2xx responses to target-refresh requests can also 717 update the remote target of the dialog. As discussed in Section 12.2 718 of RFC 3261 [RFC3261], re-INVITEs are target-refresh requests. 720 RFC 3261 [RFC3261] specifies the behavior of UASs receiving target- 721 refresh requests and of UACs receiving a 2xx response for a target- 722 refresh request. 724 Section 12.2.2 of RFC 3261 [RFC3261] says: 726 "When a UAS receives a target-refresh request, it MUST replace the 727 dialog's remote target URI with the URI from the Contact header 728 field in that request, if present." 730 Section 12.2.1.2 of RFC 3261 [RFC3261] says: 732 "When a UAC receives a 2xx response to a target-refresh request, 733 it MUST replace the dialog's remote target URI with the URI from 734 the Contact header field in that response, if present." 736 The fact that re-INVITEs can be long-lived transactions and can have 737 other transactions within them makes it necessary to revise these 738 rules. Section 4.2 specifies new rules for the handing of target- 739 refresh requests. Note that the new rules apply to any target- 740 refresh request, not only to re-INVITEs. 742 4.2. Clarification on the Atomicity of Target-Refresh Requests 744 The remote target of a dialog is a special type of state information 745 because of its essential role in the exchange of SIP messages between 746 UAs in a dialog. A UA involved in a dialog receives the remote 747 target of the dialog from the remote UA. The UA uses the remote 748 target to send SIP requests to the remote UA. 750 The remote target is a piece of state information that is not meant 751 to be negotiated. When a UAC changes its address, the UAC simply 752 communicates its new address to the UAS in order to remain reachable 753 by the UAS. UAs need to follow the behavior specified in Section 4.3 754 and Section 4.4 of this specification instead of that specified in 755 RFC 3261 [RFC3261], which was discussed in Section 4.1. The new 756 behavior regarding target-refresh requests implies that a target- 757 refresh request can, in some cases, update the remote target even if 758 the request is responded with a final error response. This means 759 that target-refresh requests are not atomic. 761 4.3. UAC Behavior 763 Behavior of a UAC after having sent a target-refresh request updating 764 the remote target: 766 If the UAC receives an error response to the target-refresh request, 767 the UAS has not updated its remote target. 769 This allows UASs to authenticate target-refresh requests. 771 If the UAC receives a reliable provisional response or a 2xx response 772 to the target-refresh request, or the UAC receives a request on the 773 new target, the UAS has updated its remote target. The UAC can 774 consider the target refresh operation completed. 776 Even if the target request was a re-INVITE and the final response 777 to the re-INVITE was an error response, the UAS would not revert 778 to the pre-re-INVITE remote target. 780 If the UAC receives a reliable provisional response or a 2xx response 781 to the target-refresh request, the UAC MUST replace the dialog's 782 remote target URI with the URI from the Contact header field in that 783 response, if present. 785 When interacting with a UACs that does not support reliable 786 provisional responses or UPDATE requests, a UAC SHOULD NOT use the 787 same target refresh request to refresh the target and to make session 788 changes unless the session changes can be trivially accepted by the 789 UAS (e.g., an IP address change). Piggybacking a target refresh with 790 more complicated session changes in this situation would make it 791 unnecessarily complicated for the UAS to accept the target refresh 792 while rejecting the session changes. 794 4.4. UAS Behavior 796 Behavior of a UAS after having received a target-refresh request 797 updating the remote target: 799 If the UAS receives a target-refresh request that has been properly 800 authenticated, the UAS SHOULD generate a reliable provisional 801 response or a 2xx response to the target-refresh request. If 802 generating such responses is not possible (e.g., the UAS does not 803 support reliable provisional responses and needs user input before 804 generating a final response), the UAS SHOULD send a request to the 805 UAC using the new remote target (if the UAS does not need to send a 806 request for other reasons, the UAS can send an UPDATE request). On 807 sending a reliable provisional response or a 2xx response to the 808 target-refresh request, or a request to the new remote target, the 809 UAS MUST replace the dialog's remote target URI with the URI from the 810 Contact header field in the target-refresh request. 812 Reliable provisional responses in SIP are specified in RFC 3262 813 [RFC3262]. In this document, reliable provisional responses are 814 those that use the mechanism defined in RFC 3262 [RFC3262] or any 815 other SIP-based mechanism that may be specified in the future. 816 Other specifications may define ways to send provisional responses 817 reliably using non-SIP mechanisms (e.g., using media-level 818 messages to acknowledge the reception of the SIP response). For 819 the purposes of this document, provisional responses using those 820 non-SIP mechanisms are considered unreliable responses. 822 If instead of sending a reliable provisional response or a 2xx 823 response to the target-refresh request, or a request to the new 824 target, the UAS generates an error response to the target-refresh 825 request, the UAS MUST NOT update its dialog's remote target. 827 4.5. Race Conditions and Target Refreshes 829 SIP provides request ordering by using the Cseq header field. That 830 is, a UAS that receives two requests at roughly the same time can 831 know which one is newer. However, SIP does not provide ordering 832 between responses and requests. For example, if a UA receives a 200 833 (OK) response to an UPDATE request and an UPDATE request at roughly 834 the same time, the UA cannot know which one was sent last. Since 835 both messages can refresh the remote target, the UA needs to know 836 which message was sent last in order to know which remote target 837 needs to be used. 839 Some of the procedures discussed in Section 3.5 could avoid these 840 types of situations. However, they are currently defined only for 841 SIP messages involved in offer/answer exchanges (e.g., the procedures 842 do not apply to an UPDATE request that does not carry an offer). The 843 following rules make those procedures applicable to the race 844 conditions described above so that UASs can cope with them. 846 When checking for glare situations, UAs MUST treat every UPDATE 847 request as if it contained an offer. Additionally, UAs MUST treat 848 the exchange of a 2xx response to an INVITE request and its 849 corresponding ACK request as an offer/answer exchange. Consequently, 850 the rules regarding glare situations applicable to offer/answer 851 exchanges are also applicable to those exchanges. 853 5. Re-INVITE Transaction Routing 855 The following sections discuss re-INVITE transaction routing. 857 5.1. Background on re-INVITE Transaction Routing 859 Re-INVITEs are routed using the dialog's route set, which contains 860 all the proxy servers that need to be traversed by requests send 861 within the dialog. Responses to the re-INVITE are routed using the 862 Via entries in the re-INVITE. 864 ACK requests for 2xx responses and for non-2xx final responses are 865 generated in different ways. As specified in Sections 14.1 and 866 13.2.1 of RFC 3261 [RFC3261], ACK requests for 2xx responses are 867 generated by the UAC core and are routed using the dialog's route 868 set. As specified in Section 17.1.1.2 of RFC 3261 [RFC3261], ACK 869 requests for non-2xx final responses are generated by the INVITE 870 client transaction (i.e., they are generated in a hop-by-hop fashion 871 by the proxy servers in the path) and are sent to the same transport 872 address as the re-INVITE. 874 5.2. Problems with UAs Losing their Contact 876 Refreshing the dialog's remote target during a re-INVITE transaction 877 (see Section 4.2) presents some issues because of the fact that Re- 878 INVITE transactions can be long lived. As described in Section 5.1, 879 the way responses to the re-INVITE and ACKs for non-2xx final 880 responses are routed is fixed once the re-INVITE is sent. The 881 routing of this messages does not depend on the dialog's route set 882 and, thus, target refreshes within an ongoing re-INVITE do not affect 883 their routing. A UA that changes its location (i.e., performs a 884 target refresh) but is still reachable at its old location will be 885 able to receive those messages (which will be sent to the old 886 location). However, a UA that cannot be reachable at its old 887 location any longer will not be able to receive them. 889 5.3. UAS Losing its Contact: UAC Behavior 891 When a UAS that moves to a new contact and loses its old contact 892 generates a non-2xx final response to the re-INVITE, it will not be 893 able to receive the ACK request. The entity receiving the response 894 and, thus, generating the ACK request will either get a transport 895 error or a timeout error, which, as described in Section 8.1.3.1 of 896 RFC 3261 [RFC3261], will be treated as a 503 (Service Unavailable) 897 response and as a 408 (Request Timeout) response, respectively. If 898 the sender of the ACK request is a proxy server, it will typically 899 ignore this error. If the sender of the ACK request is the UAC, 900 according to Section 12.2.1.2 of RFC 3261 [RFC3261], it is supposed 901 to (at the "should" level) terminate the dialog by sending a BYE 902 request. However, because of the special properties of ACK requests 903 for non-2xx final responses, most existing UACs do not terminate the 904 dialog when ACK request fails, which is fortunate. 906 A UAC that accepts a target refresh within a re-INVITE MUST ignore 907 transport and timeout errors when generating an ACK request for a 908 non-2xx final response if the UAC is communicating directly with the 909 UAS (i.e., there are no proxy servers in the dialog's route set). 911 5.4. UAC Losing its Contact: UAS Behavior 913 When a UAC moves to a new contact and loses its old contact, it will 914 not be able to receive responses to the re-INVITE. Consequently, it 915 will never generate an ACK request. 917 As described in Section 16.9 of RFC 3261 [RFC3261], a proxy server 918 that gets an error when forwarding a response does not take any 919 measurements. Consequently, proxy servers relaying responses will 920 effectively ignore the error. 922 If there are no proxy servers in the dialog's route set, the UAS will 923 get an error when sending a non-2xx final response. The UAS core 924 will be notified of the transaction failure, as described in Section 925 17.2.1 of RFC 3261 [RFC3261]. Most existing UASs do not terminate 926 the dialog on encountering this failure, which is fortunate. 928 A UAS that accepts a target refresh within a re-INVITE MUST ignore 929 transport and timeout errors when generating a non-2xx final response 930 to the re-INVITE if the UAS is communicating directly with the UAC 931 (i.e., there are no proxy servers in the dialog's route set). 933 Regardless of the presence or absence of proxy servers in the 934 dialog's route set, a UAS generating a 2xx response to the re-INVITE 935 will never receive an ACK request for it. According to Section 14.2 936 of RFC 3261 [RFC3261], such a UAS is supposed to (at the "should" 937 level) terminate the dialog by sending a BYE request. 939 A UAS that accepts a target refresh within a re-INVITE and never 940 receives an ACK request after having sent a 2xx response to the re- 941 INVITE SHOULD NOT terminate the dialog. If the UA has received a new 942 re-INVITE with a higher CSeq sequence number than the original one, 943 the UA SHOULD just ignore the error. If the UA has not received such 944 a re-INVITE, UA SHOULD generate a new re-INVITE in order to make sure 945 that both UAs have a common view of the state of the session. 947 Note that the UA generates a re-INVITE and not an UPDATE request 948 because UPDATE requests can be sent within a re-INVITE. By 949 accepting the incoming re-INVITE, the remote UA indicates that the 950 old re-INVITE transaction has already been terminated. 952 A 500 (Server Internal Error) response to the new re-INVITE would 953 mean that the remote UA was still processing the original re-INVITE. 954 This may be because the remote UA is a legacy UA that does not 955 support this specification. In this situation, the UA SHOULD follow 956 the original recommendation in RFC 3261 [RFC3261] and terminate the 957 dialog. 959 5.5. UAC Losing its Contact: UAC Behavior 961 When a UAC moves to a new contact and loses its old contact, it will 962 not be able to receive responses to the re-INVITE. Consequently, it 963 will never generate an ACK request. 965 Such a UAC SHOULD generate a CANCEL request to cancel the re-INVITE 966 and cause the INVITE client transaction corresponding to the re- 967 INVITE to enter the "Terminated" state. The UAC SHOULD also send a 968 new re-INVITE in order to make sure that both UAs have a common view 969 of the state of the session. 971 Per Section 14.2 of RFC 3261 [RFC3261], the UAS will accept new 972 incoming re-INVITEs as soon as it has generated a final response 973 to the previous INVITE request, which had a lower CSeq sequence 974 number. 976 6. Security Considerations 978 This document does not introduce any new security issue. It just 979 clarifies how certain transactions should be handled in SIP. 980 Security issues related to re-INVITEs and UPDATE requests are 981 discussed in RFC 3261 [RFC3261] and RFC 3311 [RFC3311]. 983 7. IANA Considerations 985 There are no IANA actions associated with this document. 987 8. Acknowledgements 989 Paul Kyzivat provided useful ideas on the topics discussed in this 990 document. 992 9. Normative References 994 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 995 Requirement Levels", BCP 14, RFC 2119, March 1997. 997 [RFC3261] Rosenberg, J., Schulzrinne, H., Camarillo, G., Johnston, 998 A., Peterson, J., Sparks, R., Handley, M., and E. 999 Schooler, "SIP: Session Initiation Protocol", RFC 3261, 1000 June 2002. 1002 [RFC3262] Rosenberg, J. and H. Schulzrinne, "Reliability of 1003 Provisional Responses in Session Initiation Protocol 1004 (SIP)", RFC 3262, June 2002. 1006 [RFC3264] Rosenberg, J. and H. Schulzrinne, "An Offer/Answer Model 1007 with Session Description Protocol (SDP)", RFC 3264, 1008 June 2002. 1010 [RFC3311] Rosenberg, J., "The Session Initiation Protocol (SIP) 1011 UPDATE Method", RFC 3311, October 2002. 1013 [RFC4032] Camarillo, G. and P. Kyzivat, "Update to the Session 1014 Initiation Protocol (SIP) Preconditions Framework", 1015 RFC 4032, March 2005. 1017 [I-D.ietf-mmusic-ice] 1018 Rosenberg, J., "Interactive Connectivity Establishment 1019 (ICE): A Protocol for Network Address Translator (NAT) 1020 Traversal for Offer/Answer Protocols", 1021 draft-ietf-mmusic-ice-19 (work in progress), October 2007. 1023 Authors' Addresses 1025 Gonzalo Camarillo (editor) 1026 Ericsson 1027 Hirsalantie 11 1028 Jorvas 02420 1029 Finland 1031 Email: Gonzalo.Camarillo@ericsson.com 1032 Christer Holmberg 1033 Ericsson 1034 Hirsalantie 11 1035 Jorvas 02420 1036 Finland 1038 Email: Christer.Holmberg@ericsson.com 1040 Yang Gao 1041 ZTE 1042 China 1044 Email: gao.yang2@zte.com.cn