idnits 2.17.1 draft-ietf-sipping-sip-offeranswer-12.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 : ---------------------------------------------------------------------------- No issues found here. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year -- The document seems to lack a disclaimer for pre-RFC5378 work, but may have content which was first submitted before 10 November 2008. If you have contacted all the original authors and they are all willing to grant the BCP78 rights to the IETF Trust, then this is fine, and you can ignore this comment. If not, you may need to add the pre-RFC5378 disclaimer. (See the Legal Provisions document at https://trustee.ietf.org/license-info for more information.) -- The document date (March 8, 2010) is 5162 days in the past. Is this intentional? Checking references for intended status: Informational ---------------------------------------------------------------------------- == Outdated reference: A later version (-18) exists of draft-ietf-sipping-config-framework-17 Summary: 1 error (**), 0 flaws (~~), 2 warnings (==), 2 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 Sipping P. Kyzivat 3 Internet-Draft Cisco Systems, Inc. 4 Intended status: Informational T. Sawada 5 Expires: September 9, 2010 KDDI Corporation 6 March 8, 2010 8 SIP (Session Initiation Protocol) Usage of the Offer/Answer Model 9 draft-ietf-sipping-sip-offeranswer-12 11 Abstract 13 The Session Initiation Protocol (SIP) utilizes the offer/answer model 14 to establish and update multimedia sessions using the Session 15 Description Protocol (SDP). The description of the offer/answer 16 model in SIP is dispersed across multiple RFCs. This document 17 summarizes all the current usages of the offer/answer model in SIP 18 communication. 20 Status of this Memo 22 This Internet-Draft is submitted to IETF in full conformance with the 23 provisions of BCP 78 and BCP 79. 25 Internet-Drafts are working documents of the Internet Engineering 26 Task Force (IETF), its areas, and its working groups. Note that 27 other groups may also distribute working documents as Internet- 28 Drafts. 30 Internet-Drafts are draft documents valid for a maximum of six months 31 and may be updated, replaced, or obsoleted by other documents at any 32 time. It is inappropriate to use Internet-Drafts as reference 33 material or to cite them other than as "work in progress." 35 The list of current Internet-Drafts can be accessed at 36 http://www.ietf.org/ietf/1id-abstracts.txt. 38 The list of Internet-Draft Shadow Directories can be accessed at 39 http://www.ietf.org/shadow.html. 41 This Internet-Draft will expire on September 9, 2010. 43 Copyright Notice 45 Copyright (c) 2010 IETF Trust and the persons identified as the 46 document authors. All rights reserved. 48 This document is subject to BCP 78 and the IETF Trust's Legal 49 Provisions Relating to IETF Documents 50 (http://trustee.ietf.org/license-info) in effect on the date of 51 publication of this document. Please review these documents 52 carefully, as they describe your rights and restrictions with respect 53 to this document. Code Components extracted from this document must 54 include Simplified BSD License text as described in Section 4.e of 55 the Trust Legal Provisions and are provided without warranty as 56 described in the BSD License. 58 Table of Contents 60 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 3 61 1.1. Terminology . . . . . . . . . . . . . . . . . . . . . . . 3 62 2. Summary of SIP usage of the Offer/Answer Model . . . . . . . . 3 63 2.1. Offer/Answer Exchange Pairs in SIP Messages . . . . . . . 4 64 2.2. Rejection of an Offer . . . . . . . . . . . . . . . . . . 5 65 2.3. Session Description which is not Offer nor Answer . . . . 6 66 3. Detailed Discussion of the Offer/Answer Model for SIP . . . . 7 67 3.1. Offer/Answer for the INVITE method with 100rel 68 extension . . . . . . . . . . . . . . . . . . . . . . . . 7 69 3.1.1. INVITE Request with SDP . . . . . . . . . . . . . . . 8 70 3.1.2. INVITE request without SDP . . . . . . . . . . . . . . 9 71 3.2. Offer/Answer Exchange in Early Dialog . . . . . . . . . . 10 72 3.3. Offer/Answer Exchange in an Established Dialog . . . . . . 11 73 3.4. Recovering From a Failed ReINVITE . . . . . . . . . . . . 11 74 4. Exceptional Case Handling . . . . . . . . . . . . . . . . . . 12 75 4.1. Message Crossing Case Handling . . . . . . . . . . . . . . 12 76 4.2. Glare Case Handling . . . . . . . . . . . . . . . . . . . 14 77 5. Content of Offers and Answers . . . . . . . . . . . . . . . . 15 78 5.1. General Principle for Constructing Offers and Answers . . 16 79 5.2. Choice of Media Types and Formats to Include and 80 Exclude . . . . . . . . . . . . . . . . . . . . . . . . . 16 81 5.2.1. Sending an Initial INVITE with Offer . . . . . . . . . 16 82 5.2.2. Responding with an Offer when the Initial INVITE 83 has no Offer . . . . . . . . . . . . . . . . . . . . . 17 84 5.2.3. Answering an Initial INVITE with Offer . . . . . . . . 17 85 5.2.4. Answering when the Initial INVITE had no Offer . . . . 18 86 5.2.5. Subsequent Offers and Answers . . . . . . . . . . . . 18 87 5.3. Hold and Resume of media . . . . . . . . . . . . . . . . . 19 88 5.4. Behavior on receiving SDP with c=0.0.0.0 . . . . . . . . . 20 89 6. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 20 90 7. Security Considerations . . . . . . . . . . . . . . . . . . . 21 91 8. Acknowledgement . . . . . . . . . . . . . . . . . . . . . . . 21 92 9. References . . . . . . . . . . . . . . . . . . . . . . . . . . 21 93 9.1. Normative References . . . . . . . . . . . . . . . . . . . 21 94 9.2. Informative References . . . . . . . . . . . . . . . . . . 22 95 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . . 22 97 1. Introduction 99 SIP utilizes the offer/answer model to establish and update sessions. 100 The rules to govern the offer/answer behaviors in SIP are described 101 in the several RFCs. ([RFC3261], [RFC3262], [RFC3264], [RFC3311], 102 and [I-D.camarillo-sipcore-reinvite].) 104 The primary purpose of this document is to describe all forms of SIP 105 usage of the offer/answer model in one document to help the readers 106 to fully understand it. Also, this document tries to incorporate the 107 results of the discussions on the controversial issues to avoid 108 repeating the same discussions later. 110 This document does not make normative changes. Rather, it recommends 111 how to use the existing standards to best effect. 113 1.1. Terminology 115 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 116 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 117 document are to be interpreted as described in RFC 2119 [RFC2119]. 118 This document only uses these key words when referencing normative 119 statements in existing RFCs. 121 2. Summary of SIP usage of the Offer/Answer Model 123 The offer/answer model itself is independent from the higher layer 124 application protocols which utilize it. SIP is one of the 125 applications using the offer/answer model. [RFC3264] defines the 126 offer/answer model, but does not specify which SIP messages should 127 convey an offer or an answer. This should be defined in the SIP core 128 and extensions RFCs. 130 In theory, any SIP message can include a session description in its 131 body. But a session description in a SIP message is not necessarily 132 an offer or an answer. Only certain session description usages that 133 conform to the rules described in standards-track RFCs can be 134 interpreted as an offer or an answer. The rules for how to handle 135 the offer/answer model are defined in several RFCs. 137 The offer/answer model defines a mechanism for update of sessions. 138 In SIP, a dialog is used to associate an offer/answer exchange with 139 the session which it is to update. In other words, only the offer/ 140 answer exchange in the SIP dialog can update the session which is 141 managed by that dialog. 143 2.1. Offer/Answer Exchange Pairs in SIP Messages 145 Currently, the rules on the offer/answer model are defined in 146 [RFC3261], [RFC3262], [RFC3264], [RFC3311] and 147 [I-D.camarillo-sipcore-reinvite]. In these RFCs, only the six 148 patterns shown in Table 1 are defined for exchanging an offer and an 149 answer with SIP messages. 151 Note that an offer/answer exchange initiated by an INVITE request 152 must follow exactly one of the patterns 1, 2, 3, 4. When an initial 153 INVITE causes multiple dialogs due to forking, an offer/answer 154 exchange is carried out independently in each distinct dialog. When 155 an INVITE request contains no offer, only pattern 2 or pattern 4 156 apply. 'The first reliable non-failure message' must have an offer 157 if there is no offer in the INVITE request. This means that UA which 158 receives the INVITE request without an offer must include an offer in 159 the first reliable response with 100rel extension. If no reliable 160 provisional response has been sent, the UAS must include an offer 161 when sending 2xx response. 163 In pattern 3, the first reliable provisional response may or may not 164 have an answer. When a reliable provisional response contains a 165 session description, and is the first to do so, then that session 166 description is the answer to the offer in the INVITE request. The 167 answer can not be updated, and a new offer can not be sent in a 168 subsequent reliable response for the same INVITE transaction. 170 In pattern 5, a PRACK request can contain an offer only if the 171 reliable response which it acknowledges contains an answer to the 172 previous offer/answer exchange. 174 NOTE: It is legal to have UPDATE/2xx exchanges without offer/ 175 answer exchanges (pattern 6). However when re-INVITEs are sent 176 for non-offer/answer purposes, an offer/answer exchange is 177 required. In that case the prior SDP will typically be repeated. 179 There may be ONLY ONE offer/answer negotiation in progress for a 180 single dialog at any point in time. Section 4 explains how to ensure 181 this. When an INVITE results in multiple dialogs each has a separate 182 offer/answer negotiation. 184 NOTE: This is when using a Content-Disposition of "session". 185 There may be a second offer/answer negotiation in progress using a 186 Content-Disposition of "early-session" [RFC3959]. That is not 187 addressed by this draft. 189 Offer Answer RFC Ini Est Early 190 ------------------------------------------------------------------- 191 1. INVITE Req. 2xx INVITE Resp. RFC 3261 Y Y N 192 2. 2xx INVITE Resp. ACK Req. RFC 3261 Y Y N 193 3. INVITE Req. 1xx-rel INVITE Resp. RFC 3262 Y Y N 194 4. 1xx-rel INVITE Resp. PRACK Req. RFC 3262 Y Y N 195 5. PRACK Req. 200 PRACK Resp. RFC 3262 N Y Y 196 6. UPDATE Req. 2xx UPDATE Resp. RFC 3311 N Y Y 198 Table 1. Summary of SIP Usage of the Offer/Answer Model 200 In Table 1, '1xx-rel' corresponds to the reliable provisional 201 response which contains the 100rel option defined in [RFC3262]. 203 The 'Ini' column shows the ability to exchange the offer/answer to 204 initiate the session. 'Y' indicates that the pattern can be used in 205 the initial offer/answer exchange, while 'N' indicates that it can 206 not. Only the initial INVITE transaction can be used to exchange the 207 offer/answer to establish a multimedia session. 209 The 'Est' column shows the ability to update the established session. 211 The 'Early' column indicates which patterns may be used to modify the 212 established session in an early dialog. There are two ways to 213 exchange a subsequent offer/answer in an early dialog. 215 2.2. Rejection of an Offer 217 It is not always clear how to reject an offer when it is 218 unacceptable, and some methods do not allow explicit rejection of an 219 offer. For each of the patterns in Table 1, Table 2 shows how to 220 reject an offer. 222 When a UA receives an INVITE request with an unacceptable offer, it 223 should respond with a 488 response, preferably with Warning header 224 field indicating the reason of the rejection, unless another response 225 code is more appropriate to reject it. (Pattern 1 and Pattern 3.) 227 If this is a reINVITE extra care must be taken, as detailed in 228 [I-D.camarillo-sipcore-reinvite]. Specifically, if the offer 229 contains any changes or additions to media stream properties, and 230 those have already been used to transmit/receive media before the 231 final response is sent, then a 2xx response should be sent, with a 232 syntactically correct response. This may optionally be followed by 233 an UPDATE request to rearrange the session parameters if both ends 234 support the UPDATE method. Alternatively the UA may terminate the 235 dialog and send an error response to the INVITE request. 237 When a UA receives an UPDATE request with an offer which it can not 238 accept, it should respond with a 488 response preferably with Warning 239 header field indicating the reason of the rejection, unless another 240 response code is more appropriate to reject it. (Pattern 6) 242 When a UA receives a PRACK request with an offer which it can not 243 accept, it may respond with a 200 response with a syntactically 244 correct session description. This may optionally be followed by an 245 UPDATE request to rearrange the session parameters if both ends 246 support the UPDATE method. Alternatively the UA may terminate the 247 dialog and send an error response to the INVITE request. (Pattern 5) 248 (While it may be tempting to respond with a 488 response in this 249 case, that is not recommended, because it does not acknowledge the 250 response.) 252 When a UA receives a response with an offer which it can not accept, 253 the UA does not have a way to reject it explicitly. Therefore, a UA 254 should respond to the offer with the correct session description and 255 rearrange the session parameters by initiating a new offer/answer 256 exchange, or alternatively terminate the session. (Pattern 2 and 257 Pattern 4) When initiating a new offer/answer, a UA should take care 258 not to cause an infinite offer/answer loop. 260 Offer Rejection 261 ----------------------------------------------------- 262 1. INVITE Req. (*) 488 INVITE Response 263 2. 2xx INVITE Resp. Answer in ACK Req. followed by new offer 264 OR termination of dialog 265 3. INVITE Req. 488 INVITE Response (same as Pattern 1.) 266 4. 1xx-rel INVITE Resp. Answer in PRACK Req. followed by new offer 267 5. PRACK Req. (**) 200 PRACK Resp. followed by new offer 268 OR termination of dialog 269 6. UPDATE Req. 488 UPDATE Response 271 (*) If this was a reINVITE, a failure response should not be sent if 272 media has already been exchanged using the new offer. 274 (**) A UA should only use PRACK to send an offer when it has strong 275 reasons to expect the receiver will accept the offer. 277 Table 2. Rejection of an Offer 279 2.3. Session Description which is not Offer nor Answer 281 As previously stated, a session description in a SIP message is not 282 necessarily an offer or an answer. For example, SIP can use a 283 session description to describe capabilities apart from offer/answer 284 exchange. Examples of this are 200 OK responses for OPTIONS and 488 285 responses for INVITE. 287 3. Detailed Discussion of the Offer/Answer Model for SIP 289 3.1. Offer/Answer for the INVITE method with 100rel extension 291 The INVITE method provides the basic procedure for offer/answer 292 exchange in SIP. Without the 100rel option, the rules are simple as 293 described in [RFC3261]. If an INVITE request includes a session 294 description, pattern 1 is applied and if an INVITE request does not 295 include a session description, pattern 2 is applied. 297 With 100rel, pattern 3 and pattern 4 are added and this complicates 298 the rules. An INVITE request may cause multiple responses. Note 299 that even if both UAs support the 100rel extension, not all the 300 provisional responses may be sent reliably. Note also that a 301 reliable provisional response is allowed without a session 302 description if the UAS does not wish to send the answer yet. An 303 unreliable provisional response may include a session description in 304 the body if the UAS has not sent a reliable response, but its session 305 description is neither an offer nor an answer. All the session 306 descriptions in the unreliable responses to the INVITE request must 307 be identical to the answer which is included in the reliable 308 response. A session description in an unreliable response that 309 precedes a reliable response can be considered a "preview" of the 310 answer that will be coming, and hence may be treated like an answer 311 until the actual one arrives. 313 NOTE: This "preview" session description rule applies to a single 314 offer/answer exchange. In parallel offer/answer exchanges (caused 315 by forking) a UA may obviously receive a different "preview" of an 316 answer in each dialog. UAs are expected to deal with this. 318 Although RFC 3261 says a UA should accept media once an INVITE with 319 an offer has been sent, in many cases, an answer (or, at least a 320 preview of it) is required in order for media to be accepted. Two 321 examples of why this might be required are: 323 o To avoid receiving media from undesired sources, some User Agents 324 assume symmetric RTP will be used, ignore all incoming media 325 packets until an address/port has been received from the other 326 end, and then use that address/port to filter incoming media 327 packets. 329 o In some networks, an intermediate node must authorize a media 330 stream before it can flow and requires a confirming answer to the 331 offer before doing so. 333 Therefore, a UAS should send an SDP answer reliably (if possible) 334 before it starts sending media. And, if neither the UAC nor the UAS 335 support 100rel, the UAS should send a preview of the answer before it 336 starts sending media. 338 3.1.1. INVITE Request with SDP 340 When a UAC includes an SDP body in the INVITE request as an offer, it 341 expects the answer to be received with one of the reliable responses. 342 Other than that, no offer/answer exchanges can occur in the messages 343 within the INVITE transaction. 345 UAC UAS 346 | F1 INVITE (SDP) | <- The offer in the offer/answer model 347 |-------------------->| 348 | F2 1xx (SDP) | <- The offer/answer exchange is not 349 |<--------------------| closed yet, but UAC acts as if it 350 | | ^ receives the answer. 351 | F3 1xx-rel (no SDP) | |<- a 1xx-rel may be sent without answer 352 |<--------------------| | SDP. 353 | F4 PRACK (no SDP) | | 354 |-------------------->| | UAC must not send a new offer. 355 | F5 2xx PRA (no SDP) | | 356 |<--------------------| v 357 | | 358 | F6 1xx-rel (SDP) | <- The answer in the offer/ answer model 359 |<--------------------| - 360 | F7 PRACK | | UAC can send a new offer in a PRACK 361 |-------------------->| | request to acknowledge F6. 362 | F8 2xx PRA | | After F7 UAC and UAS can send a new 363 |<--------------------| v offer in an UPDATE request. 364 | | 365 | F9 1xx-rel | <- SDP should not be included in the 366 |<--------------------| subsequent 1xx-rel once offer/answer 367 | F10 PRACK | has been completed. 368 |-------------------->| 369 | F11 2xx PRA | 370 |<--------------------| 371 | | 372 | F12 2xx INV | <- SDP should not be included in the 373 |<--------------------| final response once offer/answer has 374 | F13 ACK | been completed. 375 |-------------------->| 377 Figure 1 Example of Offer/Answer with 100rel Extension (1) 379 For example, in Figure 1, only the SDP in F6 is the answer. The SDP 380 in the non-reliable response (F2) is the preview of the answer and 381 must be the same as the answer in F6. Receiving F2, the UAC should 382 act as if it receives the answer. However, offer/answer exchange is 383 not completed yet and the UAC must not send a new offer until it 384 receives the same SDP in the first reliable response, which is the 385 real answer. After sending the SDP in F6, the UAS must prepare to 386 receive a new offer from the UAC with an UPDATE request or a PRACK 387 request. 389 The UAS does not include SDP in responses F9 and F12. However, the 390 UAC should prepare to receive SDP bodies in F9 and/or F12, and just 391 ignore them, to handle a peer that does not conform to the 392 recommended implementation. 394 3.1.2. INVITE request without SDP 396 When a UAC does not include an SDP body in the INVITE request, it 397 expects the offer to be received with the first reliable response. 398 The UAC will send the answer in the request to acknowledge the 399 response, i.e. PRACK or ACK request of the reliable response. Other 400 than that, no offer/answer exchanges can occur in the messages within 401 the INVITE transaction. 403 NOTE: The UAS should not include SDP in the responses F6 and F9. 404 However, the UAC should prepare to receive SDP bodies in F6 and/or 405 F9, and just ignore them to handle a peer that does not conform to 406 the recommended implementation. 408 UAC UAS 409 | F1 INVITE (no SDP) | 410 |-------------------->| 411 | F2 1xx | 412 |<--------------------| 413 | | 414 | F3 1xx-rel (SDP) | <- The first 1xx-rel must contain SDP 415 |<--------------------| as the offer. 416 | F4 PRACK (SDP) | <- A PRACK request to the first 1xx-rel 417 |-------------------->| must contain SDP as the answer. 418 | F5 2xx PRA (no SDP) | - 419 |<--------------------| | 420 | | | 421 | F6 1xx-rel (no SDP) | <- The subsequent 1xx-rel should not 422 |<--------------------| | contain SDP. 423 | F7 PRACK | | 424 |-------------------->| | UAC can send a new offer in an UPDATE 425 | F8 2xx PRA | | request after F4. 426 |<--------------------| v 427 | | 428 | F9 2xx INV (no SDP) | <- The final response should not 429 |<--------------------| contain SDP. 430 | F10 ACK | 431 |-------------------->| 433 Figure 2 Example of Offer/Answer with 100rel Extension (2) 435 Note that in the case that the UAC needs to prompt the user to accept 436 or reject the offer, the reliable provisional response with SDP as an 437 offer (pattern 4) can result in the retransmission until the PRACK 438 request can be sent. The UAC should take care to avoid this 439 situation when it sends the INVITE request without SDP. 441 3.2. Offer/Answer Exchange in Early Dialog 443 When both UAs support the 100rel extension, they can update the 444 session in the early dialog once the first offer/answer exchange has 445 been completed. 447 From a UA sending an INVITE request: 449 A UA can send an UPDATE request with a new offer if both ends support 450 the UPDATE method. Note that if the UAS needs to prompt the user to 451 accept or reject the offer, the delay can result in retransmission of 452 the UPDATE request. 454 A UA can send a PRACK request with a new offer only when 455 acknowledging the reliable provisional response carrying the answer 456 to an offer in the INVITE request. Compared to using the UPDATE 457 method, using PRACK can reduce the number of messages exchanged 458 between the UAs. However, to avoid problems or delays caused by 459 PRACK offer rejection, the UA is recommended to send a PRACK request 460 only when it has strong reasons to expect the receiver will accept 461 it. For example, the procedure used in precondition extension 462 [RFC3312] is a case where a PRACK request should be used for updating 463 the session status in an early dialog. Note also that if a UAS needs 464 to prompt the user to accept or reject the offer, the delay can 465 result in retransmission of the PRACK request. 467 From a UA receiving an INVITE request: 469 A UA can send an UPDATE request with a new offer if both ends support 470 the UPDATE method. A UAS can not send a new offer in the reliable 471 provisional response, so the UPDATE method is the only method for a 472 UAS to update an early session. 474 3.3. Offer/Answer Exchange in an Established Dialog 476 Both the re-INVITE and UPDATE methods can be used in an established 477 dialog to update the session. 479 The UPDATE method is simpler and can save at least one message 480 compared with the INVITE method. But both ends must support the 481 UPDATE method for it to be used. 483 The INVITE method needs at least three messages to complete but no 484 extensions are needed. Additionally, the INVITE method allows the 485 peer to take time to decide whether it will accept a session update 486 or not by sending provisional responses. That is, re-INVITE allows 487 the UAS to interact with the user at the peer, while UPDATE needs to 488 be answered automatically by the UAS. It is noted that re-INVITE 489 should be answered immediately unless such a user interaction is 490 needed. Otherwise, some 3pcc flows will break. 492 3.4. Recovering From a Failed ReINVITE 494 If a reINVITE fails, the session parameters in effect prior to the 495 reINVITE MUST remain unchanged, as if no re-INVITE had been issued. 496 ([RFC3261] section 14.1.) This remains the case even if multiple 497 offer/answer exchanges have occurred between the sending of the 498 reINVITE and its failure, and even if media has been exchanged using 499 the proposed changes in the session. Because this can be difficult 500 to achieve in practice, newer specifications call for the UAS to send 501 a 2xx response to a reINVITE in cases where rolling back changes 502 would be problematic. 504 Nevertheless, a UAC may receive a failure response to a reINVITE 505 after proposed changes that must be rolled back have already been 506 used. In such a case, the UAC should send an UPDATE offering the SDP 507 that has been reinstated. (See [I-D.camarillo-sipcore-reinvite] for 508 details.) 510 4. Exceptional Case Handling 512 In [RFC3264], the following restrictions are defined with regard to 513 sending a new offer. 515 "At any time, either agent MAY generate a new offer that updates 516 the session. However, it MUST NOT generate a new offer if it has 517 received an offer which it has not yet answered or rejected. It 518 MUST NOT generate a new offer if it has generated a prior offer 519 for which it has not yet received an answer or a rejection." 521 Assuming that the above rules are guaranteed, there seem to be two 522 possible 'exceptional' cases to be considered in SIP offer/answer 523 usage: the 'message crossing' case, and the 'glare' case. One of the 524 reasons why the usage of SIP methods to exchange offer/answer needs 525 to be carefully restricted in the RFCs is to ensure that the UA can 526 detect and handle appropriately the 'exceptional' cases to avoid 527 incompatible behavior. 529 4.1. Message Crossing Case Handling 531 When message packets cross in the transport network, an offer may be 532 received before the answer for the previous offer/answer exchange, as 533 shown in Figure 3. In such a case, UA A must detect that the session 534 description SDP-2 is not the answer to offer1. 536 A B 537 |SDP-1 (offer1)| 538 M1 |----------------->| 539 |SDP-2 (answer1)| 540 M2 |<------\ /-------| 541 | \/ | 542 |SDP-3 /\(offer2)| 543 M3 |<------/ \-------| 545 Figure 3 Message Crossing Case 547 Because of the restrictions on placement of offers and answers 548 (summarized in Table 1) there are a limited number of valid exchanges 549 of messages that may lead to this message crossing case. These are 550 enumerated in Table 3. (This table only shows messages containing 551 offers or answers. There could be other messages, without session 552 descriptions, which are not shown.) 554 There are variants, shown in Figures 4a and 4b, which are dependent 555 on an INVITE (Mx) that contains no offer. These are also included in 556 Table 3. 558 A B 559 | | 560 |SDP-1 offer1(UPD) | 561 M1 |==============================>| 562 |re-INV (no offer) | 563 Mx |------------------------------>| --+ 564 |SDP-2 answer1 (2xx-UPD)| | 565 M2 |<===========\ /===============| | first reliable 566 | \/ offer2| | response 567 |SDP-3 /\ (1xx-rel/2xx)| | 568 M3 |<===========/ \===============| <-+ 569 |SDP-4 answer2 (PRACK/ACK)| 570 My |------------------------------>| 571 | | 573 Figure 4a Avoidable message crossing cases 575 A B 576 | | 577 |re-INV (no offer) | 578 Mx |------------------------------>| --+ 579 |SDP-1 offer1(UPD) | | 580 M1 |==============================>| | 581 |SDP-2 answer1 (2xx-UPD)| | 582 M2 |<===========\ /===============| | first reliable 583 | \/ offer2| | response 584 |SDP-3 /\ (1xx-rel/2xx)| | 585 M3 |<===========/ \===============| <-+ 586 |SDP-4 answer2 (PRACK/ACK)| 587 My |------------------------------>| 588 | | 590 Figure 4b Avoidable message crossing cases 592 | M1 | M3 | M2 | Action 593 +--------+----------+---------+--------- 594 | UPDATE | 2xx-UPD | UPDATE | (1) 595 | | +---------|--------- 596 | | | INVITE | (1) 597 | | +---------+--------- 598 | | | 1xx-INV | (2) 599 | | +---------+--------- 600 | | | 2xx-INV | (2) 601 +--------+----------+---------+--------- 602 | PRACK | 2xx-PRA | UPDATE | (1) 603 +--------+----------+---------+--------- 604 | 2xx-INV| ACK | UPDATE | (1) 605 | | +---------+--------- 606 | | | INVITE | (1) 607 +--------+----------+---------+--------- 608 | INVITE | 1xx-rel | ??? | (3) 609 | |----------+---------+--------- 610 | | 2xx-INV | ??? | (3) 611 +--------+----------+---------+--------- 612 | 1xx-rel| PRACK | ??? | (3) 613 +--------+----------+---------+--------- 615 Table 3. Offer / Answer Crossing Message Sequences 617 (1) This is indistinguishable from true glare. UA A should respond 618 to M2 with a 491 response. 620 (2) This can only occur in situations depicted in figures 4a and 4b. 621 It is easier for UA A to avoid these situations than to recover 622 from them. The situation in Figure 4a can be avoided by 623 refraining from sending a re-INVITE without offer when an 624 unanswered offer is outstanding. The situation in Figure 4b can 625 be avoided by refraining from sending any message containing an 626 offer while an INVITE without offer is outstanding. 628 (3) There are no valid sequences that result in these cases. 630 Summarizing, a UA that has an outstanding unanswered offer should: 631 o refrain from sending a re-INVITE without an offer; 632 o reject (491) an INVITE or UPDATE containing an offer. 634 4.2. Glare Case Handling 636 When both ends in a dialog send a new offer at nearly the same time, 637 as described in Figure 5, a UA may receive a new offer before it 638 receives the answer to the offer it sent. This case is usually 639 called a 'glare' case. 641 A B 642 |offer1 offer2| 643 |-------\ /-------| 644 | \/ | 645 | /\ | 646 |<------/ \------>| 648 Figure 5 Glare Case 650 When offer2 is in an UPDATE request or (re-)INVITE request, it must 651 be rejected with a 491 response. 653 When offer2 is in a PRACK request (within the current rules, only 654 possible if offer1 is in an UPDATE request), UA A has a dilemma: all 655 PRACKs are supposed to be accepted with 200 response, yet there is no 656 way to indicate the problem with a 200 response. At best it could 657 proceed on the assumption that its INVITE will be rejected with a 658 491. To avoid this glare condition, UA A should not send an offer if 659 it has already sent a reliable provisional response containing an 660 answer to a previous offer and has not received the corresponding 661 PRACK request. 663 Glare can also occur when offer2 is in a 1xx or 2xx response. To 664 avoid this situation, when UA A has sent a (re)INVITE request without 665 session description, it should not send an offer until it has 666 received an offer in a reliable response to the (re)INVITE, and sent 667 an answer to that offer. 669 5. Content of Offers and Answers 671 While [RFC3264] and [RFC3312] give some guidance, questions remain 672 about exactly what should be included in an offer or answer. This is 673 especially a problem when the common "hold" feature has been 674 activated, and when there is the potential for a multimedia call. 676 Details of behavior depend on the capabilities and state of the User 677 Agent. The kinds of recommendations that can be made are limited by 678 the model of device capabilities and state that is presumed to exist. 680 This section focuses on a few key aspects of offers and answers that 681 have been identified as troublesome, and will consider other aspects 682 to be out of scope. This section considers: 683 o choice of supported media types and formats to include and exclude 684 o hold and resume of media 686 The following are out of scope for this document: 688 o NAT traversal and ICE 689 o specific codecs and their parameters 690 o the negotiation of secure media streams 691 o grouping of media streams 692 o preconditions 694 5.1. General Principle for Constructing Offers and Answers 696 A UA should send an offer that indicates what it, and its user, are 697 interested in using/doing at that time, without regard for what the 698 other party in the call may have indicated previously. This is the 699 case even when the offer is sent in response to an INVITE or re- 700 INVITE that contains no offer. (However in the case of re-INVITE the 701 constraints of RFCs 3261 and 3264 must be observed.) 703 A UA should send an answer that includes as close an approximation to 704 what the UA and its user are interested in doing at that time, while 705 remaining consistent with the offer/answer rules of [RFC3264] and 706 other RFCs. 708 NOTE: "at that time" is important. The device may permit the user 709 to configure which supported media are to be used by default. 711 In some cases a UA may not have direct knowledge of what it is 712 interested in doing at a particular time. If it is an intermediary 713 it may be able to delegate the decision. In the worst case it may 714 apply a default, such as assuming it wants to use all of its 715 capabilities. 717 5.2. Choice of Media Types and Formats to Include and Exclude 719 5.2.1. Sending an Initial INVITE with Offer 721 When a UAC sends an initial INVITE with an offer, it has complete 722 freedom to choose which media type(s) and media format(s) (payload 723 types in the case of RTP) it should include in the offer. 725 The media types may be all or a subset of the media the UAC is 726 capable of supporting, with the particular subset being determined by 727 the design and configuration (e.g., via 728 [I-D.ietf-sipping-config-framework]) of the UAC combined with input 729 from the user interface of the UAC. 731 The media formats may be all or a subset of the media formats the UAC 732 is capable of supporting for the corresponding media type, with the 733 particular subset being determined by the design and configuration of 734 the UAC combined with input from the user interface of the UAC. 736 Including all supported media formats will maximize the possibility 737 that the other party will have a supported format in common. But 738 including many can result in an unacceptably large SDP body. 740 5.2.2. Responding with an Offer when the Initial INVITE has no Offer 742 When a UAS has received an initial INVITE without an offer, it must 743 include an offer in the first reliable response to the INVITE. It 744 has largely the same options as when sending an initial INVITE with 745 an offer, but there are some differences. The choice may be governed 746 by both static (default) selections of media types as well as dynamic 747 selections made by a user via interaction with the device while it is 748 alerting. 750 NOTE: The offer may be sent in a provisional response, before the 751 user of the device has been alerted and had an opportunity to 752 select media options for the call. In this case the UAS cannot 753 include any call-specific options from the user of the device. If 754 there is a possibility that the user of the device will wish to 755 change what is offered before answering the call, then special 756 care should be taken. If PRACK and UPDATE are supported by caller 757 and callee then an initial offer can be sent reliably, and changed 758 with an UPDATE if the user desires a change. If PRACK and UPDATE 759 are not supported then the initial offer cannot be changed until 760 the call is fully established. In that case either the offer 761 should be delayed until the 200 is sent, or else the offer should 762 include the minimum set of media the user is able to select. 764 5.2.3. Answering an Initial INVITE with Offer 766 When a UAS receives an initial INVITE with an offer, what media lines 767 the answer may contain is constrained by [RFC3264]. The answer must 768 contain the same number of m-lines as the offer, and they must 769 contain the same media types. Each media line may be accepted, by 770 including a non-zero port number, or rejected by including a zero 771 port number in the answer. The media lines that are accepted should 772 typically be those that would have been offered had the INVITE not 773 contained an offer, excluding those not offered. 775 The media formats the answer may contain are constrained by 776 [RFC3264]. For each accepted m-line in the answer, there must be at 777 least one media format in common with the corresponding m-line of the 778 offer. The UAS may also include other media formats it is able to 779 support at this time. However there is little benefit to including 780 added types. 782 If the UAS does not wish to indicate support for any of the media 783 types in a particular media line of the offer it must reject the 784 corresponding media line, by setting the port number to zero. 786 5.2.4. Answering when the Initial INVITE had no Offer 788 When a UAC has sent an initial INVITE without an offer, and then 789 receives a response with the first offer, it should answer in the 790 same way as a UAS receiving an initial INVITE with an offer. 792 5.2.5. Subsequent Offers and Answers 794 The guidelines above (Section 5.1 and Section 5.2.1 through 795 Section 5.2.4) apply, but constraints in [RFC3264] must also be 796 followed. The following are of particular note because they have 797 proven troublesome: 798 o The number of m-lines may not be reduced in a subsequent offer. 799 Previously rejected media streams must remain, or be reused to 800 offer the same or a different stream. (Section 6 of [RFC3264].) 801 o In the o-line, only the version number may change, and if it 802 changes it must increment by one from the one previously sent as 803 an offer or answer. (Section 8 of [RFC3264].) If it doesn't 804 change then the entire SDP body must be identical to what was 805 previously sent as an offer or answer. Changing the o-line, 806 except version number value, during the session is an error case. 807 The behavior when receiving such a non-compliant offer/answer SDP 808 body is implementation dependent. If a UA needs to negotiate a 809 'new' SDP session, it should use the INVITE/Replaces method. 810 o In the case of RTP, the mapping from a particular dynamic payload 811 type number to a particular codec within that media stream 812 (m-line) must not change for the duration of the session. 813 (Section 8.3.2 of [RFC3264].) 815 NOTE: This may be impossible for a B2BUA to follow in some 816 cases (e.g. 3pcc transfer) if it does not terminate media. 818 When the new offer is sent in response to an offerless (re)INVITE, it 819 should be constructed according to the General Principle for 820 Constructing Offers and Answers (Section 5.1 ): all codecs the UA is 821 currently willing and able to use should be included, not just the 822 ones that were negotiated by previous offer/answer exchanges. The 823 same is true for media types - so if UA A initially offered audio and 824 video to UA B, and they end up with only audio, and UA B sends an 825 offerless (re)INVITE to UA A, A's resulting offer should most likely 826 re-attempt video, by reusing the zeroed m-line used previously. 828 NOTE: The behavior above is recommended, but it is not always 829 achievable - for example in some interworking scenarios. Or, the 830 offerer may simply not have enough resources to offer "everything" 831 at that point. Even if the UAS is not able to offer any other SDP 832 that the one currently being used, it should not reject the re- 833 INVITE. Instead, it should generate an offer with the currently 834 used SDP with o- line unchanged. 836 5.3. Hold and Resume of media 838 [RFC3264] specifies (using non-normative language) that "hold" should 839 be indicated in an established session by sending a new offer 840 containing "a=sendonly" for each media stream to be held. An 841 answerer is then to respond with "a=recvonly" to acknowledge that the 842 hold request has been understood. 844 Note that the use of sendonly/recvonly is not limited to hold. These 845 may be used for other reasons, such as devices that are only capable 846 of sending or receiving. So receiving an offer with "a=sendonly" 847 must not be treated as a certain indication that the offerer has 848 placed the media stream on hold. 850 This model is based on an assumption that the UA initiating the hold 851 will want to play Music on Hold, which is not always the case. A UA 852 may, if desired, initiate hold by offering "a=inactive" if it does 853 not intend to transmit any media while in hold status. 855 The rules of [RFC3264] constrain what may be in an answer when the 856 offer contains "sendonly", "recvonly", or "inactive" in an a= line. 857 But they do not constrain what must be in a subsequent offer. The 858 General Principle for Constructing Offers and Answers (Section 5.1) 859 is important here. The initiation of "hold" is a local action. It 860 should reflect the desired state of the UA. It then affects what the 861 UA includes in offers and answers until the local state is reset. 863 The receipt of an offer containing "a=sendonly" or "a=inactive" and 864 the sending of a compatible answer should not change the desired 865 state of the recipient. However, a UA that has been "placed on hold" 866 may itself desire to initiate its own hold status, based on local 867 input. 869 If UA2 has previously been "placed on hold" by UA1, via receipt of 870 "a=sendonly", then it may initiate its own hold by sending a new 871 offer containing "a=sendonly" to UA1. Upon receipt of that, UA1 will 872 answer with "a=inactive" because that is the only valid answer that 873 reflects its desire not to receive media. 875 NOTE: Section 8.4 of RFC3264 contains a conflicting recommendation 876 that the offer contain "a=inactive" in this case. We interpret 877 that recommendation to be non-normative. The use of "a=sendonly" 878 in this case will never produce a worse outcome, and can produce a 879 better outcome in useful cases. 881 Once in this state, to resume a two way exchange of media each side 882 must reset its local hold status. If UA1 is first to go off hold it 883 will then send an offer with "a=sendrecv". The UA2 will respond with 884 its desired state of "a=sendonly" because that is a permitted 885 response. When UA2 desires to also resume, it will send an offer 886 with "a=sendrecv". In this case, because UA1 has the same desire it 887 will respond with "a=sendrecv". In the same case, when UA2 receives 888 the offer with "a=sendrecv", if it has decided it wants to reset its 889 local hold but has not yet signaled the intent, it may send 890 "a=sendrecv" in the answer. 892 If UA2 has been "placed on hold" by UA1 via receipt of "a=inactive", 893 and subsequently wants to initiate its own hold, also using 894 "a=inactive", it need not send a new offer, since the only valid 895 response is "a=inactive" and that is already in effect. However, its 896 local desired state will now be either "inactive" or "a=sendonly". 897 This affects what it will send in future offers and answers. 899 If a UA has occasion to send another offer in the session, without 900 any desire to change the hold status (e.g. in response to a re- 901 INVITE without an offer, or when sending a re-INVITE to refresh the 902 session timer) it should follow the General Principle for 903 Constructing Offers and Answers (Section 5.1). If it previously 904 initiated a "hold" by sending "a=sendonly" or "a=inactive" then it 905 should offer that again. If it had not previously initiated "hold" 906 then it should offer "a=sendrecv", even if it had previously been 907 forced to answer something else. Without this behavior it is 908 possible to get "stuck on hold" in some cases, especially when a 909 third-party call controller is involved. 911 5.4. Behavior on receiving SDP with c=0.0.0.0 913 [RFC3264] specifies that an agent MUST be capable of receiving SDP 914 with a connection address of 0.0.0.0, in which case it means that 915 neither RTP nor RTCP should be sent to the peer. 917 If a UA generates an answer to the offer received with c=0.0.0.0, the 918 direction attribute of the accepted media stream in the answer must 919 be based on direction attribute of the offered stream and rules 920 specified in RFC 3264 to form the a-line in the answer. c=0.0.0.0 has 921 no special meaning for the direction attribute of the accepted stream 922 in the answer. 924 6. IANA Considerations 926 This document has no actions for IANA. 928 7. Security Considerations 930 There are not any security issues beyond the referenced RFCs. 932 8. Acknowledgement 934 The authors would like to thank Christer Holmberg, Rajeev Seth, 935 Nataraju A B, Byron Campen, Jonathan Rosenberg, Gonzalo Camarillo and 936 Shinji Okumura for their thorough reviews and comments. Many of 937 their suggestions and ideas have been incorporated in this document. 939 9. References 941 9.1. Normative References 943 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 944 Requirement Levels", BCP 14, RFC 2119, March 1997. 946 [RFC3261] Rosenberg, J., Schulzrinne, H., Camarillo, G., Johnston, 947 A., Peterson, J., Sparks, R., Handley, M., and E. 948 Schooler, "SIP: Session Initiation Protocol", RFC 3261, 949 June 2002. 951 [RFC3262] Rosenberg, J. and H. Schulzrinne, "Reliability of 952 Provisional Responses in Session Initiation Protocol 953 (SIP)", RFC 3262, June 2002. 955 [RFC3264] Rosenberg, J. and H. Schulzrinne, "An Offer/Answer Model 956 with Session Description Protocol (SDP)", RFC 3264, 957 June 2002. 959 [RFC3311] Rosenberg, J., "The Session Initiation Protocol (SIP) 960 UPDATE Method", RFC 3311, October 2002. 962 [RFC3312] Camarillo, G., Marshall, W., and J. Rosenberg, 963 "Integration of Resource Management and Session Initiation 964 Protocol (SIP)", RFC 3312, October 2002. 966 [I-D.camarillo-sipcore-reinvite] 967 Camarillo, G., Holmberg, C., and G. yang, "Re-INVITE and 968 Target-refresh Request Handling in the Session Initiation 969 Protocol (SIP)", draft-camarillo-sipcore-reinvite-01 (work 970 in progress), October 2009. 972 9.2. Informative References 974 [RFC3959] Camarillo, G., "The Early Session Disposition Type for the 975 Session Initiation Protocol (SIP)", RFC 3959, 976 December 2004. 978 [I-D.ietf-sipping-config-framework] 979 Channabasappa, S., "A Framework for Session Initiation 980 Protocol User Agent Profile Delivery", 981 draft-ietf-sipping-config-framework-17 (work in progress), 982 February 2010. 984 Authors' Addresses 986 Paul H. Kyzivat 987 Cisco Systems, Inc. 988 1414 Massachusetts Avenue 989 Boxborough, MA 01719 990 USA 992 Email: pkyzivat@cisco.com 994 Takuya Sawada 995 KDDI Corporation 996 3-10-10, Iidabashi, Chiyoda-ku 997 Tokyo 998 Japan 1000 Email: tu-sawada@kddi.com