idnits 2.17.1 draft-ietf-sipcore-reinvite-01.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 (January 19, 2010) is 5183 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: July 23, 2010 ZTE 7 January 19, 2010 9 Re-INVITE and Target-refresh Request Handling in the Session Initiation 10 Protocol (SIP) 11 draft-ietf-sipcore-reinvite-01.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 July 23, 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 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 implentors 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 264 c=IN IP4 192.0.2.2 266 In the previous example, the UAS was configured to automatically 267 reject the addition of video streams. The example in Figure 3 268 assumes that the UAS requires its user's input in order to accept or 269 reject the addition of a video stream and uses reliable provisional 270 responses [RFC3262] (PRACK transactions are not shown for clarity). 272 UAC UAS 274 | | 275 |-------------(1) INVITE SDP1--------------->| 276 | | 277 |<------------(2) 200 OK SDP2----------------| 278 | | 279 |------------------(3) ACK------------------>| 280 | | 281 | | 282 |-------------(4) INVITE SDP3--------------->| 283 | | 284 |<----(5) 183 Session Progress SDP4----------| 285 | | 286 | | 287 |<------------(6) UPDATE SDP5----------------| 288 | | 289 |-------------(7) 200 OK SDP6--------------->| 290 | | 291 |<---------------(8) 200 OK------------------| 292 | | 293 |------------------(9) ACK------------------>| 294 | | 296 Figure 3: Rejection of a video stream by the user 298 Everything up to (4) is identical to the previous example. In (5), 299 the UAS accepts the change of the audio stream's remote IP address 300 but does not accept the video stream yet (it provides a null IP 301 address instead of setting the stream to 'inactive' because inactive 302 streams still need to exchange RTCP traffic). 304 SDP4: 305 m=audio 31000 RTP/AVP 0 306 c=IN IP4 192.0.2.5 307 m=video 31002 RTP/AVP 31 308 c=IN IP4 0.0.0.0 310 At a later point, the UAS's user rejects the addition of the video 311 stream. Consequently, the UAS sends an UPDATE request setting the 312 port of the video stream to zero in its SDP. 314 SDP5: 315 m=audio 31000 RTP/AVP 0 316 c=IN IP4 192.0.2.5 317 m=video 0 RTP/AVP 31 318 c=IN IP4 0.0.0.0 320 The UAS now returns a 200 (OK) response to the re-INVITE. 322 In all the previous examples, the UAC was the offerer in the re- 323 INVITE transaction. Examples with UACs acting as the answerers would 324 be similar. 326 3.2. Problems with Error Responses and Already-executed Changes 328 Section 3.1 contains examples on how a UAS rejects all the changes 329 requested in a re-INVITE without executing any of them by returning 330 an error response (Figure 1), and how a UAS executes some of the 331 changes requested in a re-INVITE and rejects some of them by 332 returning a 2xx response (Figure 2 and Figure 3). A UAS can accept 333 and reject different sets of changes simultaneously (Figure 2) or at 334 different times (Figure 3). 336 The scenario that created confusion among implementors consists of a 337 UAS that receives a re-INVITE, executes some of the changes requested 338 in it, and then wants to reject all those already-executed changes 339 and revert to the pre-re-INVITE state. Such a UAS may consider 340 returning an error response to the re-INVITE (the message flow would 341 be similar to the one in Figure 1), or using an UPDATE request to 342 revert to the pre-re-INVITE state and then returning a 2xx response 343 to the re-INVITE (the message flow would be similar to the one in 344 Figure 3). This section explains the problems associated with 345 returning an error response in these circumstances. In order to 346 avoid these problems, the UAS should use the latter option (UPDATE 347 request plus a 2xx response). Section 3.3 and Section 3.4 contain 348 the normative statements needed to avoid these problems. 350 The reason for not using an error response to undo already executed 351 changes is that an error response to a re-INVITE for which changes 352 have already been executed is effectively requesting a change in the 353 session or the dialog state. However, the UAC has no means to reject 354 those changes if it is unable to execute them. That is, if the UAC 355 is unable to revert to the pre-re-INVITE state, it will not be able 356 to communicate this fact to the UAS. 358 3.3. UAS Behavior 360 UASs should only return an error response to a re-INVITE if no 361 changes to the session or to the dialog state have been executed 362 since the re-INVITE was received. Such an error response indicates 363 that no changes have been executed as a result of the re-INVITE or 364 any other transaction within it. 366 If any of the changes requested in a re-INVITE or in any transaction 367 within it have already been executed (with the exception of target 368 refreshes), the UAS SHOULD return a 2xx response. 370 A change to the session state is considered to have been executed if 371 an offer/answer without preconditions [RFC4032] for the stream has 372 completed successfully or the UAs have exchanged media using the new 373 parameters. Connection establishment messages (e.g., TCP SYN), 374 connectivity checks (e.g., when using ICE [I-D.ietf-mmusic-ice]), and 375 any other messages used in the process of meeting the preconditions 376 for a stream are not considered media. 378 The successful completion of an offer/answer exchange without 379 preconditions indicates that the new parameters for the media stream 380 are already considered to be in use. The successful completion of an 381 offer/answer exchange with preconditions means something different. 382 The fact that all mandatory preconditions for the stream are met 383 indicates that the new parameters for the media stream are ready to 384 be used. However, they will not actually be used until the UAS 385 decides so. During a session establishment, the UAS can wait for 386 using the media parameters until the callee starts being alerted or 387 until the callee accepts the session. During a session modification, 388 the UAS can wait until its user accepts the changes to the session. 389 When dealing with streams where the UAS sends media more or less 390 continuously, the UAC notices that the new parameters are in use 391 because the UAC receives media that uses the new parameters. 392 However, this mechanism does not work with other types of streams. 393 Therefore, it is RECOMMENDED that when a UAS decides to start using 394 the new parameters for a stream for which all mandatory preconditions 395 have been met, the UAS either sends media using the new parameters or 396 sends a new offer where the precondition-related attributes for the 397 stream have been removed. As indicated above, the successful 398 completion of an offer/answer exchange without preconditions 399 indicates that the new parameters for the media stream are already 400 considered to be in use. 402 The point a change to the dialog state is considered to have been 403 executed depends on the particular dialog parameter being modified. 404 The specifications of different dialog parameters describe when the 405 new value of the parameter needs to be taken into use. 407 3.4. UAC Behavior 409 A UAC that receives an error response to a re-INVITE that undoes 410 already-executed changes within the re-INVITE may be facing a legacy 411 UAS that does not support this specification (i.e., a UAS that does 412 not follow the guidelines in Section 3.3). There are also certain 413 race condition situations that get both user agents out of 414 synchronization. In order to cope with these race condition 415 situations, a UAC that receives an error response to a re-INVITE for 416 which changes have been already executed SHOULD generate a new re- 417 INVITE or UPDATE request in order to make sure that both UAs have a 418 common view of the state of the dialog and the session (the UAC uses 419 the criteria in Section 3.3 in order to decide whether or not changes 420 have been executed for the stream). The purpose of this new offer/ 421 answer exchange is to synchronize both UAs, not to request changes 422 that the UAS may choose to reject. Therefore, the dialog parameters 423 and the session parameters in the offer/answer exchange SHOULD be as 424 close as those in the pre-re-INVITE state as possible. 426 3.5. Glare Situations 428 Section 4 of RFC 3264 [RFC3264] specifies rules to avoid and detect 429 glare situations (i.e., to avoid offer/answer collisions in race 430 conditions). Section 14.1 of RFC 3261 [RFC3261] specifies general 431 rules to handle glare situations in SIP. Section 5.1 of RFC 3311 432 [RFC3311] specifies when UPDATE requests can be sent. The specified 433 rules include, among other things, procedures to cope with situations 434 where both UAs generate an offer at the same time. However, there 435 are no rules to avoid a collision between an offer in an UPDATE 436 request and an error response to a re-INVITE. Since both the UPDATE 437 request and the error response could be requesting changes, it would 438 not be clear which changes would need to be executed first. The 439 following rules avoid types of glare conditions that were not covered 440 by previous specifications. 442 When checking for glare situations, UAs MUST treat the exchange of a 443 non-2xx final response to a re-INVITE and its corresponding ACK 444 request as an offer/answer exchange. Consequently, the rules 445 regarding glare situations applicable to offer/answer exchanges are 446 also applicable to those exchanges. These rules imply that if the 447 UAS of a re-INVITE transaction receives and UPDATE request with an 448 offer after having sent a non-2xx final response to the re-INVITE but 449 before having received the corresponding ACK request, the UA SHOULD 450 return a 491 (Request Pending) response to the UPDATE request. If 451 the UAC of a re-INVITE transaction sends an UPDATE request with an 452 offer, receives a non-2xx response to the re-INVITE, and then a 2xx 453 response to the UPDATE request, the UA SHOULD generate a new re- 454 INVITE or UPDATE request in order to make sure that both UAs have a 455 common view of the state of the session, as described in Section 3.4. 457 An UPDATE request without an offer can change dialog parameters. So 458 can a non-2xx final response to a re-INVITE request or a 2xx response 459 to an INVITE request (re-INVITE or initial INVITE). However, there 460 are no rules to avoid a collision between an offerless UPDATE request 461 and a final response to an INVITE request. The rules in Section 4.5, 462 which are given in the context of target refreshes, cover these types 463 of collisions as well. Therefore, there is no need to specify 464 further rules here. 466 3.6. Example of UAS Behavior 468 This section contains an example of a UAS that implements this 469 specification using an UPDATE request and a 2xx response to a re- 470 INVITE in order to revert to the pre-re-INVITE state. The example, 471 which is shown in Figure 4, assumes that the UAS requires its user's 472 input in order to accept or reject the addition of a video stream and 473 uses reliable provisional responses [RFC3262] (PRACK transactions are 474 not shown for clarity). 476 UAC UAS 478 | | 479 |-------------(1) INVITE SDP1--------------->| 480 | | 481 |<------------(2) 200 OK SDP2----------------| 482 | | 483 |------------------(3) ACK------------------>| 484 | | 485 | | 486 |-------------(4) INVITE SDP3--------------->| 487 | | 488 |<----(5) 183 Session Progress SDP4----------| 489 | | 490 |-------------(6) UPDATE SDP5--------------->| 491 | | 492 |<------------(7) 200 OK SDP6----------------| 493 | | 494 | | 495 |<------------(8) UPDATE SDP7----------------| 496 | | 497 |-------------(9) 200 OK SDP8--------------->| 498 | | 499 |<--------------(10) 200 OK------------------| 500 | | 501 |-----------------(11) ACK------------------>| 502 | | 504 Figure 4: Rejection of a video stream by the user 506 The UAs perform an offer/answer exchange to establish an audio only 507 session: 509 SDP1: 510 m=audio 30000 RTP/AVP 0 511 c=IN IP4 192.0.2.1 513 SDP2: 514 m=audio 31000 RTP/AVP 0 515 c=IN IP4 192.0.2.5 517 At a later point, the UAC sends a re-INVITE (4) in order to add a new 518 codec to the audio stream and to add a video stream to the session. 520 SDP3: 521 m=audio 30000 RTP/AVP 0 3 522 c=IN IP4 192.0.2.1 523 m=video 30002 RTP/AVP 31 524 c=IN IP4 192.0.2.1 526 In (5), the UAS accepts the addition of the audio codec but does not 527 accept the video stream yet (it provides a null IP address instead of 528 setting the stream to 'inactive' because inactive streams still need 529 to exchange RTCP traffic). 531 SDP4: 532 m=audio 31000 RTP/AVP 0 3 533 c=IN IP4 192.0.2.5 534 m=video 31002 RTP/AVP 31 535 c=IN IP4 0.0.0.0 537 At a later point, the UAC sends an UPDATE request (6) to remove the 538 original audio codec from the audio stream (the UAC could have also 539 used the PRACK to (5) to request this change). 541 SDP5: 542 m=audio 30000 RTP/AVP 3 543 c=IN IP4 192.0.2.1 544 m=video 30002 RTP/AVP 31 545 c=IN IP4 192.0.2.1 547 SDP6: 548 m=audio 31000 RTP/AVP 3 549 c=IN IP4 192.0.2.5 550 m=video 31002 RTP/AVP 31 551 c=IN IP4 0.0.0.0 553 Yet at a later point, the UAS's user rejects the addition of the 554 video stream. Additionally, the UAS decides to revert to the 555 original audio codec. Consequently, the UAS sends an UPDATE request 556 (8) setting the port of the video stream to zero and offering the 557 original audio codec in its SDP. 559 SDP7: 560 m=audio 31000 RTP/AVP 0 561 c=IN IP4 192.0.2.5 562 m=video 0 RTP/AVP 31 563 c=IN IP4 0.0.0.0 565 The UAC accepts the change in the audio codec in its 200 (OK) 566 response (9) to the UPDATE request. 568 SDP8: 569 m=audio 30000 RTP/AVP 0 570 c=IN IP4 192.0.2.1 571 m=video 0 RTP/AVP 31 572 c=IN IP4 192.0.2.1 574 The UAS now returns a 200 (OK) response (10) to the re-INVITE. Note 575 that the media state after this 200 (OK) response is the same as the 576 pre-re-INVITE media state. 578 3.7. Example of UAC Behavior 580 Figure 5 shows an example of a race condition situation in which the 581 UAs end up with different views of the state of the session. The UAs 582 in Figure 5 are involved in a session that, just before the message 583 flows in the figures starts, includes a sendrecv audio stream and an 584 inactive video stream. UA1 sends a re-INVITE (1) requesting to make 585 the video stream sendrecv. 587 SDP1: 588 m=audio 20000 RTP/AVP 0 589 a=sendrecv 590 m=video 20002 RTP/AVP 31 591 a=sendrecv 593 UA2 is configured to automatically accept incoming video streams but 594 to ask for user input before generating an outgoing video stream. 595 Therefore, UAS2 makes the video stream recvonly by returning a 183 596 (Session Progress) response (2). 598 SDP2: 599 m=audio 30000 RTP/AVP 0 600 a=sendrecv 601 m=video 30002 RTP/AVP 31 602 a=recvonly 604 When asked for input, UA2's user chooses not to have either incoming 605 or outgoing video. In order to make the video stream inactive, UA2 606 returns a 4xx error response (5) to the re-INVITE. The ACK request 607 (6) for this error response is generated by the proxy between both 608 user agents. Note that this error response undoes already-executed 609 changes. So, UA2 is a legacy UA that does not support this 610 specification. 612 The proxy relays the 4xx response (7) towards UA1. However, the 4xx 613 response (7) takes time to arrive to UA1 (e.g., the response may have 614 been sent over UDP and the first few retransmissions were lost). In 615 the meantime, UA2's user decides to put the audio stream on hold. 616 UA2 sends an UPDATE request (8) making the audio stream recvonly. 617 The video stream, which is inactive, is not modified and, thus, 618 continues being inactive. 620 SDP3: 621 m=audio 30000 RTP/AVP 0 622 a=recvonly 623 m=video 30002 RTP/AVP 31 624 a=inactive 626 The proxy relays the UPDATE request (9) to UA1. The UPDATE request 627 (9) arrives at UA1 before the 4xx response (7) that had been 628 previously sent. UA2 accepts the changes in the UPDATE request and 629 returns a 200 (OK) response (10) to it . 631 SDP4: m=audio 20000 RTP/AVP 0 a=sendonly m=video 30002 RTP/AVP 31 632 a=inactive 634 At a later point, the 4xx response (7) finally arrives at UA1. This 635 response makes the session return to its pre-re-INVITE state. 636 Therefore, for UA1, the audio stream is sendrecv and the video stream 637 is inactive. However, for UA2, the audio stream is recvonly (the 638 video stream is also inactive). 640 a:sendrecv a:sendrecv 641 v:inactive v:inactive 643 UA1 Proxy UA2 645 | | | 646 |----(1) INVITE SDP1-->| | 647 | |----(2) INVITE SDP1-->| 648 | | | 649 | |<----(3) 183 SDP2-----| a:sendrecv 650 a:sendrecv |<----(4) 183 SDP2-----| | v:recvonly 651 v:sendonly | | | 652 | |<------(5) 4xx -------| 653 | |-------(6) ACK ------>| a:sendrecv 654 | +-(7) 4xx -| | v:inactive 655 | | |<---(8) UPDATE SDP3---| 656 |<---(9) UPDATE SDP3---| | 657 | | | | 658 a:sendonly |---(10) 200 OK SDP4-->| | 659 v:inactive | | |---(11) 200 OK SDP4-->| a:recvonly 660 |<-(7) 4xx -+ | | v:inactive 661 a:sendrecv |------(12) ACK ------>| | 662 v:inactive | | | 664 a: status of the audio stream 665 v: status of the video stream 667 Figure 5: Message flow with race condition 669 After the message flow in Figure 5, following the recommendations in 670 this section, when UA1 received an error response (7) that undid 671 already-executed changes, UA1 would generate an UPDATE request with 672 an SDP reflecting the pre-re-INVITE state (i.e., sendrecv audio and 673 inactive video). UA2 could then return a 200 (OK) response to the 674 UPDATE request making the audio stream recvonly, which is the state 675 UA2's user had requested. Such an UPDATE transaction would get the 676 UAs back into synchronization. 678 3.8. Clarifications on Cancelling Re-INVITEs 680 Section 9.2 of RFC 3261 [RFC3261] specifies the behavior of a UAS 681 responding to a CANCEL request. Such a UAS responds to the INVITE 682 request with a 487 (Request Terminated) at the 'should' level. Per 683 the rules specified in Section 3.3, if the INVITE request was a re- 684 INVITE and some of its requested changes had already been executed, 685 the UAS would return a 2xx response instead. 687 4. Target-refresh Handling 689 The following sections discuss target-refresh request handling. 691 4.1. Background on Target-refresh Requests 693 A target-refresh request is defined as follows in Section 6 of RFC 694 3261 [RFC3261]: 696 "A target-refresh request sent within a dialog is defined as a 697 request that can modify the remote target of the dialog." 699 Additionally, 2xx responses to target-refresh requests can also 700 update the remote target of the dialog. As discussed in Section 12.2 701 of RFC 3261 [RFC3261], re-INVITEs are target-refresh requests. 703 RFC 3261 [RFC3261] specifies the behavior of UASs receiving target- 704 refresh requests and of UACs receiving a 2xx response for a target- 705 refresh request. 707 Section 12.2.2 of RFC 3261 [RFC3261] says: 709 "When a UAS receives a target-refresh request, it MUST replace the 710 dialog's remote target URI with the URI from the Contact header 711 field in that request, if present." 713 Section 12.2.1.2 of RFC 3261 [RFC3261] says: 715 "When a UAC receives a 2xx response to a target-refresh request, 716 it MUST replace the dialog's remote target URI with the URI from 717 the Contact header field in that response, if present." 719 The fact that re-INVITEs can be long-lived transactions and can have 720 other transactions within them makes it necessary to revise these 721 rules. Section 4.2 specifies new rules for the handing of target- 722 refresh requests. Note that the new rules apply to any target- 723 refresh request, not only to re-INVITEs. 725 4.2. Clarification on the Atomicity of Target-Refresh Requests 727 The remote target of a dialog is a special type of state information 728 because of its essential role in the exchange of SIP messages between 729 UAs in a dialog. A UA involved in a dialog receives the remote 730 target of the dialog from the remote UA. The UA uses the remote 731 target to send SIP requests to the remote UA. 733 The remote target is a piece of state information that is not meant 734 to be negotiated. When a UAC changes its address, the UAC simply 735 communicates its new address to the UAS in order to remain reachable 736 by the UAS. UAs need to follow the behavior specified in Section 4.3 737 and Section 4.4 of this specification instead of that specified in 738 RFC 3261 [RFC3261], which was discussed in Section 4.1. The new 739 behavior regarding target-refresh requests implies that a target- 740 refresh request can, in some cases, update the remote target even if 741 the request is responded with a final error response. This means 742 that target-refresh requests are not atomic. 744 4.3. UAC Behavior 746 Behavior of a UAC after having sent a target-refresh request updating 747 the remote target: 749 If the UAC receives an error response to the target-refresh request, 750 the UAS has not updated its remote target. 752 This allows UASs to authenticate target-refresh requests. 754 If the UAC receives a reliable provisional response or a 2xx response 755 to the target-refresh request, or the UAC receives a request on the 756 new target, the UAS has updated its remote target. The UAC can 757 consider the target refresh operation completed. 759 Even if the target request was a re-INVITE and the final response 760 to the re-INVITE was an error response, the UAS would not revert 761 to the pre-re-INVITE remote target. 763 If the UAC receives a reliable provisional response or a 2xx response 764 to the target-refresh request, the UAC MUST replace the dialog's 765 remote target URI with the URI from the Contact header field in that 766 response, if present. 768 When interacting with a UACs that does not support reliable 769 provisional responses or UPDATE requests, a UAC SHOULD NOT use the 770 same target refresh request to refresh the target and to make session 771 changes unless the session changes can be trivially accepted by the 772 UAS (e.g., an IP address change). Piggybacking a target refresh with 773 more complicated session changes in this situation would make it 774 unnecessarily complicated for the UAS to accept the target refresh 775 while rejecting the session changes. 777 4.4. UAS Behavior 779 Behavior of a UAS after having received a target-refresh request 780 updating the remote target: 782 If the UAS receives a target-refresh request that has been properly 783 authenticated, the UAS SHOULD generate a reliable provisional 784 response or a 2xx response to the target-refresh request. If 785 generating such responses is not possible (e.g., the UAS does not 786 support reliable provisional responses and needs user input before 787 generating a final response), the UAS SHOULD send a request to the 788 UAC using the new remote target (if the UAS does not need to send a 789 request for other reasons, the UAS can send an UPDATE request). On 790 sending a reliable provisional response or a 2xx response to the 791 target-refresh request, or a request to the new remote target, the 792 UAS MUST replace the dialog's remote target URI with the URI from the 793 Contact header field in the target-refresh request. 795 Reliable provisional responses in SIP are specified in RFC 3262 796 [RFC3262]. In this document, reliable provisional responses are 797 those that use the mechanism defined in RFC 3262 [RFC3262] on any 798 other SIP-based mechanism that may be specified in the future. 799 Other specifications may define ways to send provisional responses 800 reliably using non-SIP mechanisms (e.g., using media-level 801 messages to acknowledge the reception of the SIP response). For 802 the purposes of this document, provisional responses using those 803 non-SIP mechanisms are considered unreliable responses. 805 If instead sending a reliable provisional response or a 2xx response 806 to the target-refresh request, or a request to the new target, the 807 UAS generates an error response to the target-refresh request, the 808 UAS MUST NOT update its dialog's remote target. 810 4.5. Race Conditions and Target Refreshes 812 SIP provides request ordering by using the Cseq header field. That 813 is, a UAS that receives two requests at roughly the same time can 814 know which one is newer. However, SIP does not provide ordering 815 between responses and requests. For example, if a UA receives a 200 816 (OK) response to an UPDATE request and an UPDATE request at roughly 817 the same time, the UA cannot know which one was sent last. Since 818 both messages can refresh the remote target, the UA needs to know 819 which message was sent last in order to know which remote target 820 needs to be used. 822 Some of the procedures discussed in Section 3.5 could avoid these 823 types of situations. However, they are currently defined only for 824 SIP messages involved in offer/answer exchanges (e.g., the procedures 825 do not apply to an UPDATE request that does not carry an offer). The 826 following rules make those procedures applicable to the race 827 conditions described above so that UASs can cope with them. 829 When checking for glare situations, UAs MUST treat every UPDATE 830 request as if it contained an offer. Additionally, UAs MUST treat 831 the exchange of a 2xx response to an INVITE request and its 832 corresponding ACK request as an offer/answer exchange. Consequently, 833 the rules regarding glare situations applicable to offer/answer 834 exchanges are also applicable to those exchanges. 836 5. Re-INVITE Transaction Routing 838 The following sections discuss re-INVITE transaction routing. 840 5.1. Background on re-INVITE Transaction Routing 842 Re-INVITEs are routed using the dialog's route set, which contains 843 all the proxy servers that need to be traversed by requests send 844 within the dialog. Responses to the re-INVITE are routed using the 845 Via entries in the re-INVITE. 847 ACK requests for 2xx responses and for non-2xx final responses are 848 generated in different ways. As specified in Sections 14.1 and 849 13.2.1 of RFC 3261 [RFC3261], ACK requests for 2xx responses are 850 generated by the UAC core and are routed using the dialog's route 851 set. As specified in Section 17.1.1.2 of RFC 3261 [RFC3261], ACK 852 requests for non-2xx final responses are generated by the INVITE 853 client transaction (i.e., they are generated in a hop-by-hop fashion 854 by the proxy servers in the path) and are sent to the same transport 855 address as the re-INVITE. 857 5.2. Problems with UAs Losing their Contact 859 Refreshing the dialog's remote target during a re-INVITE transaction 860 (see Section 4.2) presents some issues because of the fact that Re- 861 INVITE transactions can be long lived. As described in Section 5.1, 862 the way responses to the re-INVITE and ACKs for non-2xx final 863 responses are routed is fixed once the re-INVITE is sent. The 864 routing of this messages does not depend on the dialog's route set 865 and, thus, target refreshes within an ongoing re-INVITE do not affect 866 their routing. A UA that changes its location (i.e., performs a 867 target refresh) but is still reachable at its old location will be 868 able to receive those messages (which will be sent to the old 869 location). However, a UA that cannot be reachable at its old 870 location any longer will not be able to receive them. 872 5.3. UAS Losing its Contact: UAC Behavior 874 When a UAS that moves to a new contact and loses its old contact 875 generates a non-2xx final response to the re-INVITE, it will not be 876 able to receive the ACK request. The entity receiving the response 877 and, thus, generating the ACK request will either get a transport 878 error or a timeout error, which, as described in Section 8.1.3.1 of 879 RFC 3261 [RFC3261], will be treated as a 503 (Service Unavailable) 880 response and as a 408 (Request Timeout) response, respectively. If 881 the sender of the ACK request is a proxy server, it will typically 882 ignore this error. If the sender of the ACK request is the UAC, 883 according to Section 12.2.1.2 of RFC 3261 [RFC3261], it is supposed 884 to (at the "should" level) terminate the dialog by sending a BYE 885 request. However, because of the special properties of ACK requests 886 for non-2xx final responses, most existing UACs do not terminate the 887 dialog when ACK request fails, which is fortunate. 889 A UAC that accepts a target refresh within a re-INVITE MUST ignore 890 transport and timeout errors when generating an ACK request for a 891 non-2xx final response if the UAC is communicating directly with the 892 UAS (i.e., there are no proxy servers in the dialog's route set). 894 5.4. UAC Losing its Contact: UAS Behavior 896 When a UAC moves to a new contact and loses its old contact, it will 897 not be able to receive responses to the re-INVITE. Consequently, it 898 will never generate an ACK request. 900 As described in Section 16.9 of RFC 3261 [RFC3261], a proxy server 901 that gets an error when forwarding a response does not take any 902 measurements. Consequently, proxy servers relaying responses will 903 effectively ignore the error. 905 If there are no proxy servers in the dialog's route set, the UAS will 906 get an error when sending a non-2xx final response. The UAS core 907 will be notified of the transaction failure, as described in Section 908 17.2.1 of RFC 3261 [RFC3261]. Most existing UASs do not terminate 909 the dialog on encountering this failure, which is fortunate. 911 A UAS that accepts a target refresh within a re-INVITE MUST ignore 912 transport and timeout errors when generating a non-2xx final response 913 to the re-INVITE if the UAS is communicating directly with the UAC 914 (i.e., there are no proxy servers in the dialog's route set). 916 Regardless of the presence or absence of proxy servers in the 917 dialog's route set, a UAS generating a 2xx response to the re-INVITE 918 will never receive an ACK request for it. According to Section 14.2 919 of RFC 3261 [RFC3261], such a UAS is supposed to (at the "should" 920 level) terminate the dialog by sending a BYE request. 922 A UAS that accepts a target refresh within a re-INVITE and never 923 receives an ACK request after having sent a 2xx response to the re- 924 INVITE SHOULD NOT terminate the dialog. If the UA has received a new 925 re-INVITE with a higher CSeq sequence number than the original one, 926 the UA SHOULD just ignore the error. If the UA has not received such 927 a re-INVITE, UA SHOULD generate a new re-INVITE in order to make sure 928 that both UAs have a common view of the state of the session. 930 Note that the UA generates a re-INVITE and not an UPDATE request 931 because UPDATE requests can be sent within a re-INVITE. By 932 accepting the incoming re-INVITE, the remote UA indicates that the 933 old re-INVITE transaction has already been terminated. 935 A 500 (Server Internal Error) response to the new re-INVITE would 936 mean that the remote UA was still processing the original re-INVITE. 937 This may be because the remote UA is a legacy UA that does not 938 support this specification. In this situation, the UA SHOULD follow 939 the original recommendation in RFC 3261 [RFC3261] and terminate the 940 dialog. 942 5.5. UAC Losing its Contact: UAC Behavior 944 When a UAC moves to a new contact and loses its old contact, it will 945 not be able to receive responses to the re-INVITE. Consequently, it 946 will never generate an ACK request. 948 Such a UAC SHOULD generate a CANCEL request to cancel the re-INVITE 949 and cause the INVITE client transaction corresponding to the re- 950 INVITE to enter the "Terminated" state. The UAC SHOULD also send a 951 new re-INVITE in order to make sure that both UAs have a common view 952 of the state of the session. 954 Per Section 14.2 of RFC 3261 [RFC3261], the UAS will accept new 955 incoming re-INVITEs as soon as it has generated a final response 956 to the previous INVITE request, which had a lower CSeq sequence 957 number. 959 6. Security Considerations 961 This document does not introduce any new security issue. It just 962 clarifies how certain transactions should be handled in SIP. 963 Security issues related to re-INVITEs and UPDATE requests are 964 discussed in RFC 3261 [RFC3261] and RFC 3311 [RFC3311]. 966 7. IANA Considerations 968 There are no IANA actions associated with this document. 970 8. Acknowledgements 972 Paul Kyzivat provided useful ideas on the topics discussed in this 973 document. 975 9. Normative References 977 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 978 Requirement Levels", BCP 14, RFC 2119, March 1997. 980 [RFC3261] Rosenberg, J., Schulzrinne, H., Camarillo, G., Johnston, 981 A., Peterson, J., Sparks, R., Handley, M., and E. 982 Schooler, "SIP: Session Initiation Protocol", RFC 3261, 983 June 2002. 985 [RFC3262] Rosenberg, J. and H. Schulzrinne, "Reliability of 986 Provisional Responses in Session Initiation Protocol 987 (SIP)", RFC 3262, June 2002. 989 [RFC3264] Rosenberg, J. and H. Schulzrinne, "An Offer/Answer Model 990 with Session Description Protocol (SDP)", RFC 3264, 991 June 2002. 993 [RFC3311] Rosenberg, J., "The Session Initiation Protocol (SIP) 994 UPDATE Method", RFC 3311, October 2002. 996 [RFC4032] Camarillo, G. and P. Kyzivat, "Update to the Session 997 Initiation Protocol (SIP) Preconditions Framework", 998 RFC 4032, March 2005. 1000 [I-D.ietf-mmusic-ice] 1001 Rosenberg, J., "Interactive Connectivity Establishment 1002 (ICE): A Protocol for Network Address Translator (NAT) 1003 Traversal for Offer/Answer Protocols", 1004 draft-ietf-mmusic-ice-19 (work in progress), October 2007. 1006 Authors' Addresses 1008 Gonzalo Camarillo (editor) 1009 Ericsson 1010 Hirsalantie 11 1011 Jorvas 02420 1012 Finland 1014 Email: Gonzalo.Camarillo@ericsson.com 1015 Christer Holmberg 1016 Ericsson 1017 Hirsalantie 11 1018 Jorvas 02420 1019 Finland 1021 Email: Christer.Holmberg@ericsson.com 1023 Yang Gao 1024 ZTE 1025 China 1027 Email: gao.yang2@zte.com.cn