SIMPLE WG M. Lonnfors Internet-Draft J. Costa-Requena Expires: November 25, 2005 E. Leppanen Nokia H. Khartabil Telio May 24, 2005 Session Initiation Protocol (SIP) extension for Partial Notification of Presence Information draft-ietf-simple-partial-notify-05 Status of this Memo By submitting this Internet-Draft, each author represents that any applicable patent or other IPR claims of which he or she is aware have been or will be disclosed, and any of which he or she becomes aware will be disclosed, in accordance with Section 6 of BCP 79. Internet-Drafts are working documents of the Internet Engineering Task Force (IETF), its areas, and its working groups. Note that other groups may also distribute working documents as Internet- Drafts. Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress." The list of current Internet-Drafts can be accessed at http://www.ietf.org/ietf/1id-abstracts.txt. The list of Internet-Draft Shadow Directories can be accessed at http://www.ietf.org/shadow.html. This Internet-Draft will expire on November 25, 2005. Copyright Notice Copyright (C) The Internet Society (2005). Abstract By default, presence delivered using the Presence Event Package for the Session Initiation Protocol is represented in the Presence Information Data Format (PIDF). A PIDF document contains a set of elements, each representing a different aspect of the presence being Lonnfors, et al. Expires November 25, 2005 [Page 1] Internet-Draft Partial notification May 2005 reported. When any subset of the elements change, even a just a single element, a new document containing the full set of elements is delivered. This memo defines an extension allowing delivery of presence data that has actually changed. Table of Contents 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 3 2. Conventions . . . . . . . . . . . . . . . . . . . . . . . . . 3 3. Introduction to the partial notification mechanism . . . . . . 3 3.1 Basic presence agent operation . . . . . . . . . . . . . . 4 3.2 Operation with partial notification . . . . . . . . . . . 4 4. Client and server operations . . . . . . . . . . . . . . . . . 4 4.1 Content-type for partial notifications . . . . . . . . . . 5 4.2 Watcher generation of SUBSCRIBE requests . . . . . . . . . 5 4.3 Presence agent processing of SUBSCRIBE requests . . . . . 5 4.4 Presence agent generation of partial notifications . . . . 5 4.5 Watcher processing of NOTIFY requests . . . . . . . . . . 6 5. Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 6. Security Considerations . . . . . . . . . . . . . . . . . . . 12 7. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . 13 8. References . . . . . . . . . . . . . . . . . . . . . . . . . . 13 8.1 Normative references . . . . . . . . . . . . . . . . . . . 13 8.2 Informative references . . . . . . . . . . . . . . . . . . 14 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . 14 Intellectual Property and Copyright Statements . . . . . . . . 15 Lonnfors, et al. Expires November 25, 2005 [Page 2] Internet-Draft Partial notification May 2005 1. Introduction A presence event package for Session Initiation Protocol (SIP) [4] allow users ('watchers') to subscribe to other users' ('presentities') presence information. The presence information is composed of multiple pieces of data that are delivered to the watcher. The size of the presence information document can be large (i.e. the presence document can contain an arbitrary number of elements called presence tuples that convey data). As specified in RFC2778 [3] and presence event package for SIP [4], a Presence Agent (PA) always delivers in presence notifications all the presence data that has been authorized for a certain watcher. This is done regardless of what presence data has changed compared to last notification. It may not be reasonable to send the complete presence information over low bandwidth and high latency links when only part of the presence information has actually changed. This may end up degrading the presence service and causing bad perception at the watcher side. This document defines a partial notification approach where the presence server delivers to the watchers only those parts of the presence information that have changed compared to the presence information sent in the previous notifications. This reduces the amount of data that needs be transported over the network. This mechanism utilizes the presence event package for SIP [4] and a new MIME type for carrying partial Presence Information Data Format documents [2] 2. Conventions In this document, the key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" are to be interpreted as described in RFC 2119 [1] and indicate requirement levels for compliant implementations. This document makes use of the vocabulary defined in RFC2778 [3], RFC3265 [7], the presence event package for SIP [4], and the PIDF extension for Partial Presence [2]. 3. Introduction to the partial notification mechanism This chapter briefly introduces the regular functionality of the presence service, and gives an overview of the partial notification solution. This section is informational in nature. It does not contain any normative statements. Lonnfors, et al. Expires November 25, 2005 [Page 3] Internet-Draft Partial notification May 2005 3.1 Basic presence agent operation The presence service normally operates so that a watcher sends a SIP SUBSCRIBE request targeted to the presentity. The request is routed to the presence agent where the presentity's presence information is stored. The SUBSCRIBE request can include an Accept header field that indicates the supported content types. The presence agent receives the SUBSCRIBE request and if there is no Accept header indicating the supported content types or the Accept header contains the default PIDF content type, the PA will generate presence notifications using the default PIDF format [6]. The PIDF document can contain one or multiple XML elements. The PIDF document include a set of elements defined in RFC2778 [3] and its extensions for representing the presence information. This PIDF document will be carried in the body of a NOTIFY request constructed as per RFC3265 [7]. During basic operation, the presence document always contains the full state corresponding to the presence status of the presentity, as determined by the PA local policy and authorization rules. 3.2 Operation with partial notification The partial notification mechanism allows a watcher to request that, whenever possible, notifications contain only presence information that has actually changed. A watcher that wants to receive partial notifications according to this document, creates a SIP SUBSCRIBE request similar to that of a regular presence subscription. However, the SIP SUBSCRIBE request contains an Accept header field whose value contains the "application/pidf-diff+xml" tag. When the presence agent receives the subscription, it examines the Accept header field value and if "application/pidf-diff+xml" value is present, it can decide to use the partial notifications mechanism specified in this memo. The presence agent builds NOTIFY requests that contain the Content-Type header field set to "application/ pidf-diff+xml". The first NOTIFY request that contains presence information will contain a full presence document. Subsequent NOTIFY requests can contain partial notifications. This behavior is described in detail in Section 4. 4. Client and server operations Unless otherwise specified in this document, the regular watcher and presence agent behavior is applied as defined in the SIP presence event package [4]. Lonnfors, et al. Expires November 25, 2005 [Page 4] Internet-Draft Partial notification May 2005 4.1 Content-type for partial notifications Entities supporting the partial notification extension described in this document MUST support the 'application/pidf-diff+xml' content- type specified in the PIDF extension for partial presence [2]. 4.2 Watcher generation of SUBSCRIBE requests A SUBSCRIBE request can be used to negotiate the preferred content type to be used in the notifications. The Accept header field is used for this purpose as specified in RFC2161 [5]. When a watcher wants to allow the presence agent to send partial notifications the watcher MUST include an Accept header field in its SUBSCRIBE request. The value of the Accept header file MUST contain 'application/ pidf-diff+xml' (in addition to 'application/pidf+xml' required by the SIP presence event package [4]). The watcher MAY include a "q" parameter with each Accept value to indicate the relative preference of that value. 4.3 Presence agent processing of SUBSCRIBE requests The presence agent receives subscriptions from watchers and generates notifications according to the SIP presence event package [4]. If the watcher has indicated the supported content types in the Accept header field of the SUBSCRIBE request, the presence agent compares the values included in the Accept header field with the supported ones, and decides which one to use. If the watcher has indicated preferred accept values by means of "q" parameters, the presence agent SHOULD base the decision on those preferences, unless otherwise indicated by the presence agent local policy. 4.4 Presence agent generation of partial notifications Once a subscription is accepted and installed, the PA MUST deliver the full state of the presence information in the first notification that contains a presence document. If the presence agent decides to send notifications according to this specification that include a presence document, the presence agent MUST build a presence document according to the PIDF extension for Partial Presence [2] and MUST set the Content-Type header field to the value 'application/ pidf-diff+xml'. When using the 'application/pidf-diff+xml' MIME type the PA MUST include a "version" attribute and for the first notification (within a given subscription) the PA MUST initialize version to value one (1). This version counter is scoped to the subscription. Version is only reset when the given subscription is terminated. It is not reset when the subscription is refreshed. Lonnfors, et al. Expires November 25, 2005 [Page 5] Internet-Draft Partial notification May 2005 When the PA the generates partial notifications, the PA SHOULD include only that presence information that have changed compared to the previous notification. It is up to the PA's local policy to determine what is considered as a change to the previous state. The PA MUST construct the partial presence document according to the following logic: o The PA MUST construct the presence information according to the PIDF extension for Partial Presence format [2]. All the information that has been added to the presence document is listed inside elements. All information that has been removed from the presence document is listed inside elements and all information that has been changed is listed under elements. o The PA MUST include a "version" attribute in the presence document. The PA MUST increment the version number by one compared to the earlier successfully send presence document to the watcher associated with a certain subscription. The PA MUST NOT send a new NOTIFY request that contains a partial presence document (not a re-transmission) for the same Request-URI, until it has received a final response from the watcher for the previous one or the previous NOTIFY request has timed out. The PA always ends a sequence of partial notifications when it receives any SUBSCRIBE request (refresh or termination) within the associated subscription. The PA sends a NOTIFY request containing the full presence document to this SUBSCRIBE request. 4.5 Watcher processing of NOTIFY requests Watcher processes all NOTIFY requests that contain 'application/ pidf+xml' content type as specified in RFC3856 [4]. When the watcher receives the first notification containing 'application/pidf-diff+xml' MIME body the watcher MUST initialize an internal version counter, related to this subscription, to the value of the "version" included in the presence document. This version counter is scoped to the subscription. When the watcher receives a subsequent 'application/pidf-diff+xml' encoded presence document the watcher MUST compare the received "version" attribute with the local version counter. If the version number is incremented by one, the watcher MUST modify its local presence document according to the following logic: Lonnfors, et al. Expires November 25, 2005 [Page 6] Internet-Draft Partial notification May 2005 o If the root element of the presence document is the watcher must replace its local copy of the presence document with the presence document received in the 'application/pidf-diff+xml' body. o If the root element of the presence document is the watcher MUST apply the changes to its local copy of the full presence document indicated in the received 'application/ pidf-diff+xml' document as specified in PIDF extension for Partial Presence [2]. o The watcher MUST increment local version counter by one. If the watcher receives an 'application/pidf-diff+xml' encoded partial presence document whose "version" attribute value higher by more than one with the locally stored value the watcher assumes that one or more NOTIFYs were lost. The watcher SHOULD either refresh the subscription in order to receive a full presence document or terminate the subscription. If the watcher receives a presence document with the "version" attribute value equal or lower than the locally stored version number, it is considered a PA failure and the watcher SHOULD discard the document without further processing. If the PA changes the content type used in notifications within the existing subscription the watcher MUST discard all the previously received presence information (except local version counter) from that particular presentity and process the new content as specified for that content type. Local version counter MUST NOT be discarded because if PA changes back to 'application/pidf-diff+xml' MIME type version counter will continue to increase from last version value. 5. Examples The following message flow shows an example applying the partial notifications mechanism. A watcher sends a SUBSCRIBE request declaring support for the default presence format ('application/pidf+xml) and the for the partial notification ('application/pidf-diff+xml') in the Accept header field value. The watcher uses the "q" parameter to set the preference for receiving partial notifications. The PA accepts the subscription and, based on the "q" parameter value, selects to send partial notifications in NOTIFY requests. The first NOTIFY request includes the full state of presence information represented in the 'application/pidf+xml' content type. The following notifications only include the delta of the presence information from the previous NOTIFY request. Lonnfors, et al. Expires November 25, 2005 [Page 7] Internet-Draft Partial notification May 2005 Watcher Presence Agent PUA | F1 SUBSCRIBE | | |-------------------------->| | | F2 200 OK | | |<--------------------------| | | F3 NOTIFY | | |<--------------------------| | | F4 200 OK | | |-------------------------->| | | | | | | Update presence | | |<----------------------- | | | | | F5 NOTIFY | | |<--------------------------| | | F6 200 OK | | |-------------------------->| | Message Details F1 SUBSCRIBE watcher->example.com server SUBSCRIBE sip:resource@example.com SIP/2.0 Via: SIP/2.0/TCP watcherhost.example.com; branch=z9hG4bKnashds7 To: From: ;tag=xfg9 Call-ID: 2010@watcherhost.example.com CSeq: 17766 SUBSCRIBE Max-Forwards: 70 Event: presence Accept: application/pidf+xml;q=0.3, application/pidf-diff+xml;q=1 Contact: Expires: 3600 Content-Length: 0 The PA accepts the subscription and generates a 200 OK response to the SUBSCRIBE request F2 200 OK example.com server->watcher SIP/2.0 200 OK Via: SIP/2.0/TCP watcherhost.example.com; branch=z9hG4bKnashds7 ;received=192.0.2.1 To: ;tag=ffd2 Lonnfors, et al. Expires November 25, 2005 [Page 8] Internet-Draft Partial notification May 2005 From: ;tag=xfg9 Call-ID: 2010@watcherhost.example.com CSeq: 17766 SUBSCRIBE Event: presence Expires: 3600 Contact: Content-Length: 0 The PA, based on the "q" parameter value in the Accept header of the SUBSCRIBE request (F1), decides to use partial notifications. The PA creates a first NOTIFY request that includes the full presence state. F3 NOTIFY example.com server-> watcher NOTIFY sip:user@watcherhost.example.com SIP/2.0 Via: SIP/2.0/TCP server.example.com; branch=z9hG4bKna998sk To: ;tag=xfg9 From: ;tag=ffd2 Call-ID: 2010@watcherhost.example.com Event: presence Subscription-State: active;expires=3599 Max-Forwards: 70 CSeq: 8775 NOTIFY Contact: Content-Type: application/pidf-diff+xml Content-Length: [replace with real content length] open assistant true false true tel:09012345678 Lonnfors, et al. Expires November 25, 2005 [Page 9] Internet-Draft Partial notification May 2005 open im:pep@example.com closed meeting http://example.com/~pep/ http://example.com/~pep/icon.gif http://example.com/~pep/card.vcd sip:pep@example.com Full state presence document F4 200 OK watcher-> example.com server Lonnfors, et al. Expires November 25, 2005 [Page 10] Internet-Draft Partial notification May 2005 SIP/2.0 200 OK Via: SIP/2.0/TCP server.example.com; branch=z9hG4bKna998sk ;received=192.0.2.2 To: ;tag=xfg9 From: ;tag=ffd2 Call-ID: 2010@watcherhost.example.com CSeq: 8775 NOTIFY Content-Length: 0 At a later time, the presentity's presence information changes. The PA generates a NOTIFY request that includes the changed information. F5 NOTIFY example.com server -> watcher NOTIFY sip:user@watcherhost.example.com SIP/2.0 Via: SIP/2.0/TCP server.example.com; branch=z9hG4bKna998sl To: ;tag=xfg9 From: ;tag=ffd2 Call-ID: 2010@watcherhost.example.com CSeq: 8776 NOTIFY Event: presence Subscription-State: active;expires=3543 Max-Forwards: 70 Contact: Content-Type: application/pidf-diff+xml Content-Length: [replace with real content length] open mailto:pep@example.com This is a new tuple inserted between the last tuple and note element Lonnfors, et al. Expires November 25, 2005 [Page 11] Internet-Draft Partial notification May 2005 open 0.7 F6 200 OK watcher-> example.com server SIP/2.0 200 OK Via: SIP/2.0/TCP server.example.com; branch=z9hG4bKna998sl ;received=192.0.2.2 To: ;tag=xfg9 From: ;tag=ffd2 Call-ID: 2010@watcherhost.example.com CSeq: 8776 NOTIFY Content-Length: 0 6. Security Considerations This specification relies on the presence event package for SIP [4]. Partial notifications can reveal information about what has changed compared to the previous notification. This can make it easier for eavesdropper to know what kind of changes are happening in the presentity's presence information. However, the same information can be found if the presence event package is used with baseline PIDF [6]. A third party can inject a NOTIFY request with partial state that will cause the watcher to think it has missed a partial document and to request a new full state document. This is no worse than what we have without this extension since a party that could perform such action could also send a NOTIFY with Subscription-State: terminated and achieve the same effect without knowing about the extension. Partial Notification does not make the situation any worse, and the protection mechanisms from the existing system apply to preventing this attack against the partial notification mechanism. Presence related security considerations are extensively discussed in the presence event package for SIP [4] and all those identified security considerations apply to this document as well. Issues described in the presence event package for SIP [4], including Lonnfors, et al. Expires November 25, 2005 [Page 12] Internet-Draft Partial notification May 2005 confidentiality, message integrity and authenticity, outbound authentication, replay prevention, DoS attacks against thirst parties and DoS attacks against servers all apply here without any change It is RECOMMENDED that TLS [8] be used between elements to provide hop by hop confidentially protection. Furthermore, SMIME MAY be used for integrity and authenticity of SUBSCRIBE and NOTIFY requests. This is described in Section 23 of RFC 3261. 7. Acknowledgments The authors would like to thank Jyrki Aarnos, Jonathan Rosenberg, Dean Willis, Kriztian Kiss, Juha Kalliokulju, Miguel Garcia, Anders Kristensen, Yannis Pavlidis, Ben Cambell, Robert Sparks, and Tim Moran for their valuable comments. 8. References 8.1 Normative references [1] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, March 1997. [2] Lonnfors, M., Khartabil, H., Leppanen, E., and J. Urpalainen, "Presence Information Data Format (PIDF) Extension for Partial Presence", draft-ietf-simple-partial-pidf-format-04 (work in progress), January 2004. [3] Day, M., Rosenberg, J., and H. Sugano, "A Model for Presence and Instant Messaging", RFC 2778, February 2000. [4] Rosenberg, J., "A Presence Event Package for the Session Initiation Protocol (SIP)", RFC 3856, August 2004. [5] Rosenberg, J., Schulzrinne, H., Camarillo, G., Johnston, A., Peterson, J., Sparks, R., Handley, M., and E. Schooler, "SIP: Session Initiation Protocol", RFC 3261, June 2002. [6] Sugano, H., Fujimoto, S., Klyne, G., Bateman, A., Carr, W., and J. Peterson, "Presence Information Data Format (PIDF)", RFC 3863, August 2004. [7] Roach, A., "SIP-Specific Event Notification", RFC 3265, June 2002. [8] Dierks, T. and C. Allen, "The TLS Protocol Version 1.0", RFC 2246, January 1999. Lonnfors, et al. Expires November 25, 2005 [Page 13] Internet-Draft Partial notification May 2005 8.2 Informative references [9] Rosenberg, J., "A Watcher Information Event Template-Package for the Session Initiation Protocol (SIP)", RFC 3857, August 2004. Authors' Addresses Mikko Lonnfors Nokia Itamerenkatu 11-13 00180 Helsinki Finland Phone: +358 71 8008000 Email: mikko.lonnfors@nokia.com Jose Costa-Requena Nokia Valimotie 9 00380 Helsinki Finland Phone: +358 71 8008000 Email: jose.costa-requena@nokia.com Eva Leppanen Nokia P.O BOX 785 Tampere Finland Phone: +358 7180 77066 Email: eva-maria.leppanen@nokia.com Hisham Khartabil Telio P.O. Box 1203 Oslo Norway Phone: +47 2167 3544 Email: hisham.khartabil@telio.no Lonnfors, et al. Expires November 25, 2005 [Page 14] Internet-Draft Partial notification May 2005 Intellectual Property Statement The IETF takes no position regarding the validity or scope of any Intellectual Property Rights or other rights that might be claimed to pertain to the implementation or use of the technology described in this document or the extent to which any license under such rights might or might not be available; nor does it represent that it has made any independent effort to identify any such rights. Information on the procedures with respect to rights in RFC documents can be found in BCP 78 and BCP 79. Copies of IPR disclosures made to the IETF Secretariat and any assurances of licenses to be made available, or the result of an attempt made to obtain a general license or permission for the use of such proprietary rights by implementers or users of this specification can be obtained from the IETF on-line IPR repository at http://www.ietf.org/ipr. The IETF invites any interested party to bring to its attention any copyrights, patents or patent applications, or other proprietary rights that may cover technology that may be required to implement this standard. Please address the information to the IETF at ietf-ipr@ietf.org. Disclaimer of Validity This document and the information contained herein are provided on an "AS IS" basis and THE CONTRIBUTOR, THE ORGANIZATION HE/SHE REPRESENTS OR IS SPONSORED BY (IF ANY), THE INTERNET SOCIETY AND THE INTERNET ENGINEERING TASK FORCE DISCLAIM ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Copyright Statement Copyright (C) The Internet Society (2005). This document is subject to the rights, licenses and restrictions contained in BCP 78, and except as set forth therein, the authors retain all their rights. Acknowledgment Funding for the RFC Editor function is currently provided by the Internet Society. Lonnfors, et al. Expires November 25, 2005 [Page 15]