idnits 2.17.1 draft-ietf-sipping-sip-offeranswer-11.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 (January 18, 2010) is 5213 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-16 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: July 22, 2010 KDDI Corporation 6 January 18, 2010 8 SIP (Session Initiation Protocol) Usage of the Offer/Answer Model 9 draft-ietf-sipping-sip-offeranswer-11 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 July 22, 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 is a variant, shown in Figure 4, which is dependent on an 555 INVITE (Mx) that contains no offer. This case should be extremely 556 rare - it is easily avoided by delaying Mx until answer1 is received. 557 It adds another possibility to Table 3. 559 A B 560 | | 561 |SDP-1 offer1(UPD) | 562 M1 |==============================>| 563 |re-INV (no offer) | 564 Mx |------------------------------>| --+ 565 |SDP-2 answer1 (2xx-UPD)| | 566 M2 |<===========\ /===============| | first reliable 567 | \/ offer2| | response 568 |SDP-3 /\ (1xx-rel/2xx)| | 569 M3 |<===========/ \===============| <-+ 570 |SDP-4 answer2 (PRACK/ACK)| 571 My |------------------------------>| Wait until answer1 572 | | 574 Figure 4 Reliable response as a message with offer2 in message 575 crossing case 577 | M1 | M3 | M2 | 578 |--------+----------+---------| 579 | INVITE | 1xx-rel | UPDATE | 580 |--------+----------+---------| 581 | PRACK | 200-PRA | UPDATE | 582 |--------+----------+---------| 583 | UPDATE | 200-UPD | UPDATE | 584 | | |---------| 585 | | | INVITE | (no INV in progress) 586 | | |---------| 587 | | | 2xx-INV | (INV in progress) 588 | | |---------| 589 | | | 1xx-rel | (from Figure 4) 590 |-----------------------------| 592 Table 3. Offer / Answer Crossing Message Sequences 594 Table 3 shows that there are only two ambiguous cases when an answer 595 is expected and an arriving message M2 containing SDP could be either 596 the expected answer or an offer. These are a reliable 1xx response 597 to an INVITE, or an UPDATE. 599 When message M2 is an UPDATE request or a (re)INVITE request, then 600 message M1 must also have been an UPDATE or INVITE. There may have 601 been message crossing, or not. If not then it is a glare case. 602 Either way, the remedy is for UA A to reject message M2 with a 491 603 response with Retry-After header field. 605 When M2 is a reliable provisional response or a successful final 606 response, and M1 was an UPDATE, then SDP-2 cannot be the expected 607 answer1. In this case, since UA A can not reject offer2 in reliable 608 response M2, it is recommended that it wait for answer1 before 609 sending a PRACK request with the answer to offer2. Note that this 610 case only occurs when UA A, while waiting for an answer, sends an 611 INVITE request without session description. 613 When M2 is a PRACK request Table 3 shows that it cannot be an offer 614 out of order, so UA A may infer SDP-2 is an answer. 616 Table 4 summarizes the discussions above. 618 SDP-2 | How to know it's not answer1 | Actions to take 619 -------+------------------------------+-------------------------- 620 INVITE | Never be an answer | 491 response 621 UPDATE | Glare case for UA A | with Retry-After 622 -------+------------------------------+-------------------------- 623 1xx-rel| If M1 was UPDATE then SDP-2 | Delay ACK/PRACK 624 2xx-INV| is not answer1 | until answer1 is received 625 -------+------------------------------+-------------------------- 626 PRACK | This case never happens | Not a message cross case 627 | under the current rules. | Treat SDP-2 as answer2 628 -------+------------------------------+-------------------------- 630 Table 4. Message Crossing Resolution 632 4.2. Glare Case Handling 634 When both ends in a dialog send a new offer at nearly the same time, 635 as described in Figure 5, a UA may receive a new offer before it 636 receives the answer to the offer it sent. This case is usually 637 called a 'glare' case. 639 A B 640 |offer1 offer2| 641 |-------\ /-------| 642 | \/ | 643 | /\ | 644 |<------/ \------>| 646 Figure 5 Glare Case 648 When offer2 is in an UPDATE request or (re-)INVITE request, it must 649 be rejected with a 491 response. 651 When offer2 is in a PRACK request (within the current rules, only 652 possible if offer1 is in an UPDATE request), the PRACK may be 653 accepted with 200 or may be rejected with a 491 response. A 491 654 response is valid to satisfy the offer/answer model but it may delay 655 the completion of the reliable response transfer mechanism or, in 656 worst case, may result in the failure to complete the SIP transaction 657 because there is no clear retry rule when a PRACK request is rejected 658 with a 491 response. To avoid this glare condition, UA A should not 659 send an offer if it has already sent a reliable provisional response 660 containing an answer to a previous offer and has not received the 661 corresponding PRACK request. 663 To avoid a glare condition involving an offer in a response, when UA 664 A has sent a (re)INVITE request without session description, it 665 should not send an offer until it has received an offer in a reliable 666 response to the (re)INVITE, and sent an answer to that offer. 668 5. Content of Offers and Answers 670 While [RFC3264] and [RFC3312] give some guidance, questions remain 671 about exactly what should be included in an offer or answer. This is 672 especially a problem when the common "hold" feature has been 673 activated, and when there is the potential for a multimedia call. 675 Details of behavior depend on the capabilities and state of the User 676 Agent. The kinds of recommendations that can be made are limited by 677 the model of device capabilities and state that is presumed to exist. 679 This section focuses on a few key aspects of offers and answers that 680 have been identified as troublesome, and will consider other aspects 681 to be out of scope. This section considers: 682 o choice of supported media types and formats to include and exclude 683 o hold and resume of media 685 The following are out of scope for this document: 686 o NAT traversal and ICE 687 o specific codecs and their parameters 688 o the negotiation of secure media streams 689 o grouping of media streams 690 o preconditions 692 5.1. General Principle for Constructing Offers and Answers 694 A UA should send an offer that indicates what it, and its user, are 695 interested in using/doing at that time, without regard for what the 696 other party in the call may have indicated previously. This is the 697 case even when the offer is sent in response to an INVITE or re- 698 INVITE that contains no offer. (However in the case of re-INVITE the 699 constraints of RFCs 3261 and 3264 must be observed.) 701 A UA should send an answer that includes as close an approximation to 702 what the UA and its user are interested in doing at that time, while 703 remaining consistent with the offer/answer rules of [RFC3264] and 704 other RFCs. 706 NOTE: "at that time" is important. The device may permit the user 707 to configure which supported media are to be used by default. 709 In some cases a UA may not have direct knowledge of what it is 710 interested in doing at a particular time. If it is an intermediary 711 it may be able to delegate the decision. In the worst case it may 712 apply a default, such as assuming it wants to use all of its 713 capabilities. 715 5.2. Choice of Media Types and Formats to Include and Exclude 717 5.2.1. Sending an Initial INVITE with Offer 719 When a UAC sends an initial INVITE with an offer, it has complete 720 freedom to choose which media type(s) and media format(s) (payload 721 types in the case of RTP) it should include in the offer. 723 The media types may be all or a subset of the media the UAC is 724 capable of supporting, with the particular subset being determined by 725 the design and configuration (e.g., via 726 [I-D.ietf-sipping-config-framework]) of the UAC combined with input 727 from the user interface of the UAC. 729 The media formats may be all or a subset of the media formats the UAC 730 is capable of supporting for the corresponding media type, with the 731 particular subset being determined by the design and configuration of 732 the UAC combined with input from the user interface of the UAC. 734 Including all supported media formats will maximize the possibility 735 that the other party will have a supported format in common. But 736 including many can result in an unacceptably large SDP body. 738 5.2.2. Responding with an Offer when the Initial INVITE has no Offer 740 When a UAS has received an initial INVITE without an offer, it must 741 include an offer in the first reliable response to the INVITE. It 742 has largely the same options as when sending an initial INVITE with 743 an offer, but there are some differences. The choice may be governed 744 by both static (default) selections of media types as well as dynamic 745 selections made by a user via interaction with the device while it is 746 alerting. 748 NOTE: The offer may be sent in a provisional response, before the 749 user of the device has been alerted and had an opportunity to 750 select media options for the call. In this case the UAS cannot 751 include any call-specific options from the user of the device. If 752 there is a possibility that the user of the device will wish to 753 change what is offered before answering the call, then special 754 care should be taken. If PRACK and UPDATE are supported by caller 755 and callee then an initial offer can be sent reliably, and changed 756 with an UPDATE if the user desires a change. If PRACK and UPDATE 757 are not supported then the initial offer cannot be changed until 758 the call is fully established. In that case either the offer 759 should be delayed until the 200 is sent, or else the offer should 760 include the minimum set of media the user is able to select. 762 5.2.3. Answering an Initial INVITE with Offer 764 When a UAS receives an initial INVITE with an offer, what media lines 765 the answer may contain is constrained by [RFC3264]. The answer must 766 contain the same number of m-lines as the offer, and they must 767 contain the same media types. Each media line may be accepted, by 768 including a non-zero port number, or rejected by including a zero 769 port number in the answer. The media lines that are accepted should 770 typically be those that would have been offered had the INVITE not 771 contained an offer, excluding those not offered. 773 The media formats the answer may contain are constrained by 774 [RFC3264]. For each accepted m-line in the answer, there must be at 775 least one media format in common with the corresponding m-line of the 776 offer. The UAS may also include other media formats it is able to 777 support at this time. However there is little benefit to including 778 added types. 780 If the UAS does not wish to indicate support for any of the media 781 types in a particular media line of the offer it must reject the 782 corresponding media line, by setting the port number to zero. 784 5.2.4. Answering when the Initial INVITE had no Offer 786 When a UAC has sent an initial INVITE without an offer, and then 787 receives a response with the first offer, it should answer in the 788 same way as a UAS receiving an initial INVITE with an offer. 790 5.2.5. Subsequent Offers and Answers 792 The guidelines above (Section 5.1 and Section 5.2.1 through 793 Section 5.2.4) apply, but constraints in [RFC3264] must also be 794 followed. The following are of particular note because they have 795 proven troublesome: 796 o The number of m-lines may not be reduced in a subsequent offer. 797 Previously rejected media streams must remain, or be reused to 798 offer the same or a different stream. (Section 6 of [RFC3264].) 799 o In the o-line, only the version number may change, and if it 800 changes it must increment by one from the one previously sent as 801 an offer or answer. (Section 8 of [RFC3264].) If it doesn't 802 change then the entire SDP body must be identical to what was 803 previously sent as an offer or answer. Changing the o-line, 804 except version number value, during the session is an error case. 805 The behavior when receiving such a non-compliant offer/answer SDP 806 body is implementation dependent. If a UA needs to negotiate a 807 'new' SDP session, it should use the INVITE/Replaces method. 808 o In the case of RTP, the mapping from a particular dynamic payload 809 type number to a particular codec within that media stream 810 (m-line) must not change for the duration of the session. 811 (Section 8.3.2 of [RFC3264].) 813 NOTE: This may be impossible for a B2BUA to follow in some 814 cases (e.g. 3pcc transfer) if it does not terminate media. 816 When the new offer is sent in response to an offerless (re)INVITE, 817 all codecs supported by the UA are to be included, not just the ones 818 that were negotiated by previous offer/answer exchanges. The same is 819 true for media types - so if UA A initially offered audio and video 820 to UA B, and they end up with only audio, and UA B sends an offerless 821 (re)INVITE to UA A, A's resulting offer should re- attempt video, by 822 reusing the zeroed m-line used previously. 824 NOTE: The behavior above is recommended, but it is not always 825 achievable - for example in some interworking scenarios. Or, the 826 offerer may simply not have enough resources to offer "everything" 827 at that point. Even if the UAS is not able to offer any other SDP 828 that the one currently being used, it should not reject the re- 829 INVITE. Instead, it should generate an offer with the currently 830 used SDP with o- line unchanged. 832 5.3. Hold and Resume of media 834 [RFC3264] specifies (using non-normative language) that "hold" should 835 be indicated in an established session by sending a new offer 836 containing "a=sendonly" for each media stream to be held. An 837 answerer is then to respond with "a=recvonly" to acknowledge that the 838 hold request has been understood. 840 Note that the use of sendonly/recvonly is not limited to hold. These 841 may be used for other reasons, such as devices that are only capable 842 of sending or receiving. So receiving an offer with "a=sendonly" 843 must not be treated as a certain indication that the offerer has 844 placed the media stream on hold. 846 This model is based on an assumption that the UA initiating the hold 847 will want to play Music on Hold, which is not always the case. A UA 848 may, if desired, initiate hold by offering "a=inactive" if it does 849 not intend to transmit any media while in hold status. 851 The rules of [RFC3264] constrain what may be in an answer when the 852 offer contains "sendonly", "recvonly", or "inactive" in an a= line. 853 But they do not constrain what must be in a subsequent offer. The 854 General Principle for Constructing Offers and Answers (Section 5.1) 855 is important here. The initiation of "hold" is a local action. It 856 should reflect the desired state of the UA. It then affects what the 857 UA includes in offers and answers until the local state is reset. 859 The receipt of an offer containing "a=sendonly" or "a=inactive" and 860 the sending of a compatible answer should not change the desired 861 state of the recipient. However, a UA that has been "placed on hold" 862 may itself desire to initiate its own hold status, based on local 863 input. 865 If UA2 has previously been "placed on hold" by UA1, via receipt of 866 "a=sendonly", then it may initiate its own hold by sending a new 867 offer containing "a=sendonly" to UA1. Upon receipt of that, UA1 will 868 answer with "a=inactive" because that is the only valid answer that 869 reflects its desire not to receive media. 871 NOTE: Section 8.4 of RFC3264 contains a conflicting recommendation 872 that the offer contain "a=inactive" in this case. We interpret 873 that recommendation to be non-normative. The use of "a=sendonly" 874 in this case will never produce a worse outcome, and can produce a 875 better outcome in useful cases. 877 Once in this state, to resume a two way exchange of media each side 878 must reset its local hold status. If UA1 is first to go off hold it 879 will then send an offer with "a=sendrecv". The UA2 will respond with 880 its desired state of "a=sendonly" because that is a permitted 881 response. When UA2 desires to also resume, it will send an offer 882 with "a=sendrecv". In this case, because UA1 has the same desire it 883 will respond with "a=sendrecv". In the same case, when UA2 receives 884 the offer with "a=sendrecv", if it has decided it wants to reset its 885 local hold but has not yet signaled the intent, it may send 886 "a=sendrecv" in the answer. 888 If UA2 has been "placed on hold" by UA1 via receipt of "a=inactive", 889 and subsequently wants to initiate its own hold, also using 890 "a=inactive", it need not send a new offer, since the only valid 891 response is "a=inactive" and that is already in effect. However, its 892 local desired state will now be either "inactive" or "a=sendonly". 893 This affects what it will send in future offers and answers. 895 If a UA has occasion to send another offer in the session, without 896 any desire to change the hold status (e.g. in response to a re- 897 INVITE without an offer, or when sending a re-INVITE to refresh the 898 session timer) it should follow the General Principle for 899 Constructing Offers and Answers (Section 5.1). If it previously 900 initiated a "hold" by sending "a=sendonly" or "a=inactive" then it 901 should offer that again. If it had not previously initiated "hold" 902 then it should offer "a=sendrecv", even if it had previously been 903 forced to answer something else. Without this behavior it is 904 possible to get "stuck on hold" in some cases, especially when a 905 third-party call controller is involved. 907 5.4. Behavior on receiving SDP with c=0.0.0.0 909 [RFC3264] specifies that an agent MUST be capable of receiving SDP 910 with a connection address of 0.0.0.0, in which case it means that 911 neither RTP nor RTCP should be sent to the peer. 913 If a UA generates an answer to the offer received with c=0.0.0.0, the 914 direction attribute of the accepted media stream in the answer must 915 be based on direction attribute of the offered stream and rules 916 specified in RFC 3264 to form the a-line in the answer. c=0.0.0.0 has 917 no special meaning for the direction attribute of the accepted stream 918 in the answer. 920 6. IANA Considerations 922 This document has no actions for IANA. 924 7. Security Considerations 926 There are not any security issues beyond the referenced RFCs. 928 8. Acknowledgement 930 The authors would like to thank Christer Holmberg, Rajeev Seth, 931 Nataraju A B, Byron Campen, Jonathan Rosenberg, Gonzalo Camarillo and 932 Shinji Okumura for their thorough reviews and comments. Many of 933 their suggestions and ideas have been incorporated in this document. 935 9. References 937 9.1. Normative References 939 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 940 Requirement Levels", BCP 14, RFC 2119, March 1997. 942 [RFC3261] Rosenberg, J., Schulzrinne, H., Camarillo, G., Johnston, 943 A., Peterson, J., Sparks, R., Handley, M., and E. 944 Schooler, "SIP: Session Initiation Protocol", RFC 3261, 945 June 2002. 947 [RFC3262] Rosenberg, J. and H. Schulzrinne, "Reliability of 948 Provisional Responses in Session Initiation Protocol 949 (SIP)", RFC 3262, June 2002. 951 [RFC3264] Rosenberg, J. and H. Schulzrinne, "An Offer/Answer Model 952 with Session Description Protocol (SDP)", RFC 3264, 953 June 2002. 955 [RFC3311] Rosenberg, J., "The Session Initiation Protocol (SIP) 956 UPDATE Method", RFC 3311, October 2002. 958 [RFC3312] Camarillo, G., Marshall, W., and J. Rosenberg, 959 "Integration of Resource Management and Session Initiation 960 Protocol (SIP)", RFC 3312, October 2002. 962 [I-D.camarillo-sipcore-reinvite] 963 Camarillo, G., Holmberg, C., and G. yang, "Re-INVITE and 964 Target-refresh Request Handling in the Session Initiation 965 Protocol (SIP)", draft-camarillo-sipcore-reinvite-01 (work 966 in progress), October 2009. 968 9.2. Informative References 970 [RFC3959] Camarillo, G., "The Early Session Disposition Type for the 971 Session Initiation Protocol (SIP)", RFC 3959, 972 December 2004. 974 [I-D.ietf-sipping-config-framework] 975 Channabasappa, S., "A Framework for Session Initiation 976 Protocol User Agent Profile Delivery", 977 draft-ietf-sipping-config-framework-16 (work in progress), 978 September 2009. 980 Authors' Addresses 982 Paul H. Kyzivat 983 Cisco Systems, Inc. 984 1414 Massachusetts Avenue 985 Boxborough, MA 01719 986 USA 988 Email: pkyzivat@cisco.com 990 Takuya Sawada 991 KDDI Corporation 992 3-10-10, Iidabashi, Chiyoda-ku 993 Tokyo 994 Japan 996 Email: tu-sawada@kddi.com