Internet Engineering Task ForceIMPPSIMPLE WG Internet DraftJonathanRosenbergDean Willis Robert Sparks Ben Campbell dynamicsoft Henning Schulzrinne Jonathan Lennox Columbia U. Bernard Aboba Christian Huitema David Gurle Microsoft Dave Oran Cisco draft-rosenberg-impp-presence-00.txt June 15, 2000et al. draft-rosenberg-impp-presence-01.txt Various Places March 2, 2001 Expires:December, 2000September 2001 SIP Extensions for Presence STATUS OF THIS MEMO This document is an Internet-Draft and is in full conformance with all provisions of Section 10 of RFC2026. 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. Abstract This document proposes an extension to SIP for subscriptions and notifications of user presence.Traditional SIP clients already make use ofUser presence is defined as theREGISTER methodwillingness and ability of a user touploadcommunicate with other users on the network. Historically, presencestate to network servers, in order to enable call establishment. This extension allows that data to be publishedhas been limited tosubscribers. This is accomplished by defining two new SIP methods - SUBSCRIBE"on-line" andNOTIFY,"off-line" indicators; the notion of presence here is broader. Subscriptions and notifications of user presence are supported by defininga new logical entity,an event package within thepresence agent (PA), which handles subscriptionsgeneral SIP event notification framework. This protocol is also compliant with the Common Presence andnotifications.Instant Messaging (CPIM) framework. 1 Introduction Presence is (indirectly) defined in RFC2778 [1] as subscription to and notification of changes in the communications state of a user. This communications state consists of the set of communications means, communications address, and status of that user. A presence protocol is a protocol for providing such a service over the Internet or any IP network. This document proposes an extension to the Session Initiation Protocol (SIP) [2] for presence.Baseline SIP is used primarily for initiation of interactive sessions, such as voice, video, and games. The process of session initiation requires a system which uses the communications means, communications addresses, and communications status of a user in order to determine the host where initiation requests can be delivered. A presence system is one where this information is pushed to subscribers through notification requests, as opposed to being pulled by proxy and redirect servers when session establishment is desired. In a sense, this makes presence and session initiation "duals" - one is synchronous (presence systems push data the instant it changes) and the other is asynchronous (servers access presence data for a user at the point where a call is initiated to that user). The similarities between presence and communications establishment is one reason why we chose to base the presence protocol on SIP. Section 2 explains this in greater detail. The extension defined here has, as its objectives, scalability, security, flexibility, and extensibility. To provide scale, our protocol (1) pushes intelligence to the periphery wherever possible, as we believe this to be the primary tool for achieving this goal, (2) allows the global namespace to be divided into a hierarchy, and (3) allows presence state to be distributed along this hierarchy. Many of the capabilities of this extension for providing scale are simply inherited from SIP, which was engineered to handle highly scalable communications establishment.This extensionalso makes communications between differing administrative domains possible. The scale objectives and mechanisms for achieving it are outlined in detail in section 9. Presence deals with highly sensitive data regarding people, and we can envision future applications which deal with information like the physical location of individuals, which is even more sensitive. To handle this, privacy of the information distributed, and authentication of relevant parties in the system is provided by the system. Finally, flexibilityisimportant. It is likely thataprotocol for subscription and notificationconcrete instantiation ofevents related to communications will be applied to other applications. Even withinthe generalarea of communications, subscription andevent notificationservices are needed for features like auto callback and message waiting indication. While these are not directly addressed by this extension, we have engineered in sufficient flexibility to enable them in a systematic fashion. This is accomplished by separating the protocol operation from the underlying transport (UDP, TCP, or anything else can be used), and by separating the transfer of subscriptions and notifications from their content. The extension is also flexible in that it can support client to client subscriptions and notifications with no server at all (serverless operation), support a single server for intra-domain operation, multiple serversframework defined forintra-domain operation, and inter-domain operation with a server in one domain, the other, or both. 2 Why useSIP [3], and asa base protocol for presence? We have chosensuch, makes use of theSession Initiation Protocol (SIP) as a starting point for developing aSUBSCRIBE and NOTIFY methods defined there. User presenceprotocol. Thisis particularly well suited formany reasons. Overall, our aim is to reuse infrastructure and components which help solve the problem. We have found thatSIP. SIPsolves a very similar problem, with the result that minimal work is required to extend it to solve the problem at hand. SIPs primary function is to initiate interactive multiparty communications sessions. The challenge in doing this is to allow a caller to take a location independent identifier, such as joe@example.com,registrars anduse it to discover the location of the user (wherelocationin this context refers to a host on the Internet where theservices already hold usercan be reached), so that the invitation to join a session can be delivered. The problempresence information; it ischallenging because users move around, have dynamically assigned IP addresses, may be reachable at numerous locations and via multiple devices, and may have varying capabilities at those locations. SIP operates by allowing users to send communications reachability stateuploaded tothe network,these devices through REGISTER messages, andthis information isusedby the network to "rendezvous" the caller with the called party. Within baseline SIP, this communications reachability state consists primarily of communications addresses. However, an extension, caller preferences and callee capabilities [3], extends this statetoinclude status and capabilities. This enables a much more powerful form of rendezvous. For example, a caller can dial a generic number for the called party, specify in the call establishment request that communications is desired with a mobile phone, and the call will be preferentially routedroute calls tothe users cell phone. We observed that the information used by network elements withinthose users. Furthermore, SIPto rendezvous callers with called users is the *same* information distributed by a presence protocol. The only difference is in the application of this information. In SIP, this information is not distributed to interested parties when it changes, but rather usednetworks already route INVITE messages from any user ondemand to set up a call. In essence, SIP makes use of this state (uploaded tothe networkin REGISTER requests) for asynchronously initiated queries for communications, while presence distributes it synchronously when it changes. Effectively, session initiation and presence are "duals" of each other, relying on the same information. Because of this, extension of SIPtosatisfy the needs of a presence protocol seems very sensible - a re-use of "information". There is also significant reuse of protocol machinery, and more importantly, reuse of deployed components, infrastructure, and data. Conceptually, using the same infrastructure for initiation of communications, and for distribution of communications state, seems natural. It means that the same system provides both components of interactive communications services, working seamlessly and efficiently. Reuse ofthesame infrastructure means a big reduction in management and infrastructure costs for providers. Perhaps most importantly, using the same underlying protocols and infrastructures makes it easy to provide new services which integrate voice/video and presence. Furthermore, we anticipateproxy thatmany systems will offer both communications establishment and presence on the same device, such as a wireless handset. Therefore, usingholds thesame underlying protocol componentsregistration state forboth isasubstantial practical advantage in terms of code reuse and memory footprint reduction, both of which are very important for wireless handsets. Real SIP implementations exist with memory footprints well under 100k.user. Asonly a subset of SIPthis state isneeded foruser presence,this number will be even lower for presence-only systems. The abstract arguments made in the previous paragraph manifest themselves through a common set of requirements for both presence and session initiation. As a result, there are many capabilities already present in SIP which are directly applicable to presence. In particular: Scale: SIP must scale to support initiation of communications sessions among the global Internet populace. This presents demanding scale requirements. To meet them,those SIPallows for the global namespace of users to be divided up hierarchically, with dynamic communications state stored only in the leaves of the hierarchy. Network elements (called proxies) within the hierarchynetworks canbe stateless, handling routing of requests downward in the hierarchy, and responses upwards, without storing any information. This simulaneously provides both scale and fault tolerance. Rendezvous: SIP mustalso allowa caller to have an initiation request routed to the server which has authoritative information about the location and communications capabilities of the called user. For presence, a mechanism is needed to route subscriptionSUBSCRIBE requests tothe server which has authoritative information about the location and communications capabilities of the subscribed-to user. Clearly, these are the same exact problem, and SIPs existing rendezvous and routing capabilities are directly applicable for presence. Identity of Participants: In SIP, it is critical tobeable to identify the initiator of the request, and the target of the communications. In presence, messages needrouted toidentify the initiator of the subscription, and its target. These arethe sameparties. The SIP mechanisms for identification of entities are therefore directly usable for presence. Authentication of Initiator: In SIP, it is essential that the called party be able to verify the identity of the caller, in order to prevent calls from unwanted parties. In presence, it is essentialproxy. This means thatthe presentity be able to verify the identity of the subscriber, in order to prevent subscriptions from unwanted parties. Both are the same problem, and readily accomplished with end to end authentication mechanisms. SIP currently provides three such mechanisms, one of which is public key based (PGP), and the other two of which are based on a shared secret (http basic and digest). The protocol is extensible to support additional mechanisms. Furthermore,SIPprovides proxy-signed requests, so that the presentity can verify the domain of the originator. End-to-end privacy of Data: In SIP, the bodies, and several of the headers of the request and response messagesnetworks can beencrypted, using PGP. This allows for privacy of sessions users are being invited to. For presence, there is a need for endreused toend privacy of the presence state users convey, which is also encapsulated in bodies. Thus, the SIP encryption mechanisms can provide privacyestablish global connectivity forpresence. Hop-by-Hop Encryption: End to end encryption is important, but requires deployment of a PKI with end user keys. As none really exists, a secondary level of privacy can be provided when a transitive trust relationship exists between userspresence subscriptions andnetwork elements of multiple administrative domains.notifications. This extension isthrough hop by hop encryption between users and proxies and proxies and proxies. SIP allows hop by hop encryptionbased onany number of mechanisms, and thisthe conceptcan be reused for privacyof a presenceas well. Content: SIP uses MIME to carry content in its messages. Normally, this content is the Session Description Protocol (SDP) [4]agent, whichdefines sessions, but other contentisallowed. Subscription requests need to carry documentsa new logical entity thatdescribe detailsis capable ofthe subscription,accepting subscriptions, storing subscription state, andnotification requests carry documents that describe the state of the presentity. We propose that MIME is also used for this purpose. This provides important extensibility capabilities. As these capabilitiesgenerating notifications when there arealready provided by SIP, no additional work is needed to support themchanges in user presence.Transport Independence: SIP is used to establish communications sessions. A widely varying set of devicesThe entity islikely to make use of such services, including PCs, wireless PDAs (in fact, the 3GPP wireless standards body has already chosen SIPdefined asthe signaling platform for third generation wireless devices), standalone phones, cell phones, laptops, and even Internet appliances. In recognition of the diverse connectivity these devices have, SIPa logical one, since it istransport neutral, and can run over any protocol, including TCPgenerally co-resident with another entity, andUDP. Itcanalso be run over the newer SCTP [5], and a process for doing so is defined in a companion document [6]. Soft State: In SIP, the communications state pushed intoeven move around during thenetwork must be periodically refreshed in order for it to remain present. This soft state mechanism provides robustness against system crashes. The periodlifetime ofrefresh can be negotiated throughasimple two phase mechanism. In presence, this mechanismsubscription. This extension isnot only needed for communications state, butalsofor subscriptions, which represent a new piece of state incompliant with thesystem. SIPs existing refresh mechanisms can be reused for this purpose. These similarities meanCommon Presence and Instant Messaging (CPIM) framework thatthe majority of SIPs mechanisms are directly applicable for presence.has been defined in [4]. This allows SIPproxies can routefor presencerequeststo easily interwork withno change. Section 12 details those components of SIP which are, and are not, needed for presence. 3other presence systems compliant to CPIM. 2 Definitions This document uses the terms as defined in [1]. Additionally, the following terms are defined and/or additionally clarified:User Agent (UA): A SIP User Agent. A UA is capable of sending and receiving SIP requests. User Agent Server (UAS): A UAS is the component of a UA which receives requests, and responds to them. User Agent Client (UAC): A UAC is the component of a UA which sends requests, and receives responses. Registrar: A registrar is a SIP server which can receive and process REGISTER requests. These requests are used to construct address bindings. Proxy: A proxy is a SIP proxy. A SIP proxy receives a SIP request, modifies some of the headers, and forwards the request to a next-hop server, which can be another proxy, or possibly a user agent.Presence User Agent (PUA): A Presence User Agent manipulates presence information for a presentity. In SIP terms, this means that a PUA generates REGISTER requests, conveying some kind of information about the presentity. We explicitly allow multiple PUAs per presentity. This means that a user can have many devices (such as a cell phone and PDA), each of which is independently generating a component of the overall presence information for a presentity. PUAs push data into the presence system, but are outside of it, in that they do not receive SUBSCRIBE messages, or send NOTIFY. Presence Agent (PA): A presence agent is a SIP user agent which is capable of receiving SUBSCRIBE requests, responding to them, and generating notifications of changes in presence state. A presence agent must have complete knowledge of the presence state of a presentity. Typically, this is accomplished by co-locating the PA with the proxy/registrar, or the presence user agent of the presentity. A PA is always addressable with a SIP URL. Presence Server: A presence server is a logical entity that can act as either a presence agentthat is colocated withor as aproxy/registrar. Itproxy server for SUBSCRIBE requests. When acting as a PA, it is aware of the presence information of the presentity through some protocol means. This protocol means can be SIP REGISTER requests, but other mechanisms are allowed. When acting as a proxy, the SUBSCRIBE requests are proxied to another entity that may act as a PA. Presence Client: A presence client is a presence agent that is colocated with a PUA. It is aware of the presence information of the presentity because it is co-located with the entity that manipulates this presence information.43 Overview of Operation In this section, we present an overview of the operation of this extension.It defines two new methods, SUBSCRIBE (for subscribingWhen an entity, the subscriber, wishes tochanges in state), and NOTIFY (for notifying subscribers of changes in state). 4.1 Architecture We define a new type of SIP user agent, called a Presence Agent, or PA. A PA islearn about presence information from some user, it creates alogical function, and is usually co-located withSUBSCRIBE request. This request identifies the desired presentity in the request URI, using either aproxy/registrar,presence URL or aPUA. A PASIP URL. The subscription iscapable of storing subscriptions and generating notifications. Sincecarried along SIP proxies as any other INVITE would be. It eventually arrives at aPApresence server, which canreside either ineithera proxy/registrar or within the PUA, the system allows both "network" and "client" generated notifications and management of subscriptions. In fact,terminate therole of PA is defined on a subscription bysubscriptionbasis, and can change during the lifetime of the subscription. This allows for(in which case it acts as thePA function to migrate from PUA topresenceserver and back, depending on the connectivity of the PUA. PAs generate notifications. These notifications can be delivered directly toagent for thesubscriber,presentity), orproxiesproxy it onthe subscription path can electtoreceivea presence client. If thenotifications as well. Such flexibility allows each administrative domain to make its own decision regardingpresence client handles thetradeoffs between security, scalability, and provision of services. This flexibility is inherited from SIP. The architecturesubscription, it isdepicted in Figure 1. 4.2 Message Flow A subscriber,effectively acting asa User Agent Client (in SIP, an end system which sends requeststhe presence agent for the presentity. The decision about whether to proxy or terminate the SUBSCRIBE iscalledaUser Agent Client, or UAC) wishing to subscribelocal matter; however, we describe one way tosome presentity constructseffect such aSIP SUBSCRIBE request message.configuration, using REGISTER. Therequest URIpresence agent (whether in the presence server or presence client) first authenticates the subscription, then authorizes it. The means for authorization are outside the scope of thisrequest isprotocol, and we expect that many mechanisms will be used. Once authorized, the presence agent sends anormal SIP URL identifying202 Accepted response. It also sends an immediate NOTIFY message containing theaddressstate of the presentity.This request URI is rewritten by SIP proxies (which are very similar to HTTP proxies) asAs therequest travels towardsstate of therecipient. For example, a requestpresentity changes, the PA generates NOTIFYs forsip:joe@example.com will arrive atall subscribers. The SUBSCRIBE message effectively establishes a session with theexample.com server, which looks up Joe in some corporate database, and then determines that Joepresence agent. As a result, the SUBSCRIBE can bereached internally at sip:joe@engineering.example.com. This new addressrecord-routed, and rules for tag handling and Contact processing mirror those for INVITE. Similarly, the NOTIFY message isplacedhandled in much therequestsame way a re-INVITE within a call leg is handled. 4 Naming A presentity is identified in the most general way through a presence URI [4], which is of theoutgoing request, and +-------+ | | /\| Proxy |\ / | | \ SUB SUB / +-------+ \ / \ / \/ +-------+ +-------+ | | | | | Proxy | | Proxy | | | | | +-------+ +-------+ / \ / \ / \ SUB / \ \ / \ <---- \/ / Sub- \ -------- +----------+ / scriber\ -------- | | /-----------\ NOTIFY ----- |Proxy/ | |Registrar/| |PA | | | +----------+ / SUB // /\ ^ NOTIFY / / | // / |REGISTER / / | // / | / \ / / \ / \ /PA+\ / \ / \ / PUA \ / PUA \ / PUA \ ------- ------- ------- Figure 1: Architectureform pres:user@domain. These URIs are protocol independent. Through a variety ofPresence System sentmeans, these URIs can be resolved tothe server for engineering.example.com. Since the request URI is rewritten by proxies, some means is neededdetermine a specific protocol that can be used toconvey the identity of the original desired recipient. Thus,access thesender also placespresentity. Once such a resolution has taken place, the presentity can be addressed with a sip URLfor the desired recipient in the mandatory To field. The From field identifies the originatorofthe message.nearly identical form: sip:user@domain. Themessage must also containprotocol independent form (the pres: URL) can be thought of as an abstract name, akin to aCall-ID. In SIP, the Call-IDURN, which is used toassociateidentify elements in agroup of requests withpresence system. These are resolved to concrete URLs that can be used to directly locate those entities on thesame session. Here,network. When subscribing to a presentity, theusage issubscription can be addressed using the protocol independent form or thesame;sip URL form. In thesession in this caseSIP context, "addressed" refers to the request URI. It isinitiated by a SUBSCRIBE. All SUBSCRIBE messagesRECOMMENDED thatrefreshif thesubscription, and all NOTIFY messages generated for that subscription, are partentity sending a SUBSCRIBE is capable of resolving thesame session, and thus shareprotocol independent form to thesame Call-ID value. Call-ID has no meaning beyond being a common identifier. Each SUBSCRIBE also carries a CSeq, whichSIP form, this resolution isa sequence number plusdone before sending thename ofrequest. However, if themethodentity is incapable of doing this translation, therequest (the method nameprotocol independent form isthere to support SIP features not required for presence). The CSeq uniquely identifies each SUBSCRIBE and NOTIFYused in thesession, and increases for each subsequentrequestinURI. Performing thesame direction. Eachtranslation as early as possible means that these requests can be routed by SIPrequest also carries a Via header. Via headers contain a traceproxies that are not aware of theIP addresses or FQDNspresence namespace. The result ofthe systemsthis naming scheme is thatthe request traversed. Asa SUBSCRIBE requesttravels from proxy to proxy towards the recipient, each adds its address, "pushing" them into a header, much like the operation of a stack. The stack of addressesisreflected in the response, and each proxy "pops" the top address off, and uses that to determine whereaddressed tosenda user theresponse.exact same way an INVITE request would be addressed. Thisallows proxies to forward UDP requests statelessly, someans thatthey need not even remember wheretherequest came from to forwardSIP network will route these messages along theresponse. Finally, clients using this extension MUST insert a Contact header intosame path an INVITE would travel. One of these entities along therequest (Contact is usedpath may act as a PA forrouting of requests inthereverse direction, fromsubscription. Typically, this will either be thetarget ofpresence server (which is theoriginal message toproxy/registrar where that user is registered), or theinitiatorpresence client (which is one of theoriginal message). Theuser agents associated with that presentity). SUBSCRIBErequest MAYmessages also containa body. The body contains additional informationlogical identifiers thatdescribesdefine thesubscription. SIP usesoriginator and recipient of thestandard MIME headers (Content-Type, Content-Length,subscription (the To andContent- Encoding)From header fields). Since these identifiers are logical ones, it is RECOMMENDED that these use the protocol independent format whenever possible. This also makes it easier to interwork with other systems which recognize these forms. The Contact, Record-Route and Route fields do not identify logical entities, but rather concrete ones used for SIP messaging. As such, they MUST use thecontent. An example subscription request looks like: SUBSCRIBE sip:jdrosen@dynamicsoft.com SIP/2.0 Via: SIP/2.0/UDP userpc.example.com To: sip:jdrosen@dynamicsoft.com From: sip:user@example.com Contact: sip:user@userpc.example.com Call-ID: knsd08alas9dy@3.4.5.6 CSeq: 1 SUBSCRIBE Content-Length: 0 The request MAY be sent using UDP or TCP (SIP supportsSIP URL forms in bothUDP and TCP (and even SCTP [6] transport; reliability is guaranteed over UDPSUBSCRIBE andcongestion control is provided through a simple retransmission scheme with exponential backoff).NOTIFY. 5 Presence Event Package Therequest MAY be sent to a local outbound proxy (a local outbound proxy is a device similar toSIP event framework [3] defines anhttp proxy; it receives requests which are not destinedabstract SIP extension foritself,subscribing to, andthen forwards them towardsreceiving notifications of, events. It leaves thefinal destination), or MAY be sent directlydefinition of many additional aspects of these events tothe serverconcrete extensions, also known as event packages. This extension qualifies as an event package. This section fills in thedomain specified ininformation required by [3]. 5.1 Package Name The name of this package is "presence". This name MUST appear within the Event header in SUBSCRIBE requestURI.and NOTIFY request. Thisis identical to baseline SIP. Local outbound proxies are RECOMMENDED in order to provide domain-based third party signatures (i.e., resignsection also serves as therequest with a keyIANA registration for theentire domain). These proxies SHOULD perform proxy authentication, verifying the identityevent package "presence". TODO: Define IANA template in sub-notify and fill it in here. Example: Event: presence 5.2 SUBSCRIBE bodies The body of a SUBSCRIBE request MAY contain a body. The purpose of theoriginator, before resigning. Proxies forwardbody depends on its type. In general, subscriptions will normally not contain bodies. The request URI, which identifies themessage according to configured routing logicpresentity, combined withDNS SRV record procedures. Pre-established security associations MAY be used, or SAs MAY be established on demand. The SAs themselves SHOULD be based on IPSec ESP in transport mode [7] to provide privacy services for instant messages. Keysthe event package name, are sufficient forESP MAYuser presence. We anticipate that document formats could beestablished administratively. If administrative keys are not available, IKE is useddefined to act as filters forkey exchange [8]. If a proxy receives a requestsubscriptions. These filters would indicate certain user presence events thatdoes not arrive over a SA, it MAY reject the request. This decision is based onwould generate notifies, or restrict thelocal security policyset of data returned in NOTIFY requests. For example, a presence filter might specify that theproxy. Each proxy adds its address tonotifications should only be generated when theVia header as it forwardsstatus of therequest. Proxies MAYusers instant message inbox changes. It might alsorecord route; this meanssay thatthey can request to receive all subsequent messages forthesame Call-ID. By not record-routing, proxies will seecontent of these notifications should only contain theinitial request they forward; all subsequent requests in the same session will bypass the proxy, and goIM related information. 5.3 Expiration User presence changes as a result of events that include: o Turning on and off of amore direct path betweencell phone o Modifying theend systems. Record- routing is done by insertingregistration from aheader intosoftphone o Changing theforwarded request (called Record-Route) which containsstatus on an instant messaging tool These events are usually triggered by human intervention, and occur with a frequency on theaddressorder of minutes or hours. As such, it is subscriptions should have an expiration in theproxy. Like the Via headers, Record-Route has a "stack" property, since proxies "push" values intomiddle of this range, which is roughly one hour. Therefore, themessage. The entire Record-Route stackdefault expiration time for subscriptions within this package isreflected in3600 seconds. As per [3], theresponse tosubscriber MAY include an alternate expiration time. Whatever theSUBCRIBE, but unlike Via, no addresses are "popped" inindicated expiration time, theresponse. In this fashion, both sender and recipientserver MAY reduce it but MUST NOT increase it. 5.4 NOTIFY Bodies The body of theSUBSCRIBE havenotification contains alistpresence document. This document describes the user presence of themessage path for subsequent requests. This path list is built into a Route header bypresentity that was subscribed to. All subscribers MUST support theend systems,presence data format described in [fill in with IMPP document TBD], andplacedMUST list its MIME type, [fill insubsequent requests. The Routewith MIME type] in an Accept headeris like a loose source routepresent inIP, and specifies the path thattherequest should take. Record-routing gives each proxy the capability to independently decideSUBSCRIBE request. Other presence data formats might be defined in theright trade off of scale (achieved by not record routing) and services (generally achieved by record routing). Proxies which are awarefuture. In thatthey are behind a firewall,case, the subscriptions MAY indicate support forexample, can record-route, ensuring that messages from inside to outsideother presence formats. However, they MUST alwayscome from the proxy. Eventually, the SUBSCRIBE request is forwarded to a proxy which is co-locatedsupport and list [fill in witha registrar. A registrar isMIME type of IMPP presence document] as anentity in SIP that has dynamic application layer routing information. When a client starts up, they sendallowed format. Of course, theregistrar a REGISTER request that binds an address innotifications generated by thedomainpresence agent MUST be in one of theregistrar toformats specified in theaddress ofAccept header in themachine they are residing on. Continuing withSUBSCRIBE request. 5.5 Processing Requirements at theexample above,PA User presence is highly sensitive information. Because theproxy for engineering.example.com receivesimplications of divulging presence information can be severe, strong requirements are imposed on therequest for Joe. Joe had formerly registered a binding from sip:joe@engineering.example.comPA regarding subscription processing, especially related tosip:joe@mypc.engineering.example.com, which contains the FQDNauthentication and authorization. A presence agent MUST authenticate all subscription requests. This authentication can be done using any of thehost Joemechanisms defined for SIP. It isusing. In fact,not considered sufficient for thebinding established by a REGISTER can be oneauthentication tomany, sobe transitive; thata user can indicateis, theability toauthentication SHOULD use an end-to-end mechanism. The SIP basic authentication mechanism MUST NOT becontacted at multiple hosts (laptop, PDA, cell phone). This informationused. It isfundamentally presence. ForRECOMMENDED that any subscriptions thatreason,are not authenticated do not cause state to be established in theproxy/registrarPA. This canelect to act asbe accomplished by generating aPA401 in response to the SUBSCRIBE, and then discarding all state forthis subscription. A proxy/registrar which can act asthat transaction. Retransmissions of the SUBSCRIBE generate the same response, guaranteeing reliability even over UDP. Furthermore, a PAis known asMUST NOT accept apresence server. Before accepting the subscription, the presence server will generally need to obtainsubscription unless authorizationfrom the principal. This extension does not specify howhas been provided by thepresence server would obtainpresentity. The means by which authorizationfromare provided are outside theprincipal.scope of this document. Authorizationcan bemay have been provided ahead of time through access lists, perhaps specified in a webconfiguration, for example. Another approachpage. Authorization may have been provided by means of uploading of some kind of standardized access control list document. Back end authorization servers, such as a DIAMETER [5], RADIUS [6], or COPS [7], can also be used. It is also useful toobtainbe able to query the user for authorizationatfollowing thetimereceipt ofthe subscription. One approacha subscription request forsuchwhich no authorizationis defined ininformation was present. Appendix A provides aseparate document [9]. Ifpossible solution for such a scenario. The result of the authorization decision by the server will be reject, accept, or pending. Pending occurs when the server cannot obtain authorization at this time, and may beobtainedable to do so at a later time, when thetime of subscription,presentity becomes available. Unfortunately, if thepresenceservercan return a 202 (Accepted) response, which indicatesinforms the subscriber that the subscriptionmight have been accepted. When authorization is finally obtained (because the principal becomes online andisqueried once again for authorization), the presence server can then enablepending, this will divulge information about thesubscriptionpresentity - namely, that they have not granted authorization andbegin generation of notifications for it. Instead of acting asare not available to give it at this time. Therefore, aPA,PA SHOULD generate thepresence server can act as a proxysame response fora subscription,both pending andforward it toaccepted subscriptions. This response SHOULD be apresence client. A presence client makes itself known to202 Accepted response. If thepresenceserverby registering (using SIP REGISTER) a Contact addressinforms the subscriber thatincludesthemethods tag of "SUBSCRIBE". The tagsubscription isdefined inrejected, this also divulges information about thecaller preferences specification [3]. This specification allows, among other things, for clients to indicate in a REGISTERpresentity - namely, that theywould prefer to receive messages with specific methods. Proxies receiving requests with a particular method forward it to the contact address which has indicated it can handle that method. This allows for a user with a single SIP address to use separate user agents for presence and for other communications. Alternatively, users can usehave explicitly blocked thesame user agents for both. An example registration usingsubscription previously, or are available at thistag looks like: REGISTER sip:dynamicsoft.com SIP/2.0 Via: SIP/2.0/UDP mypc.dynamicsoft.com To: sip:jdrosen@dynamicsoft.com From: sip:jdrosen@dynamicsoft.com Call-ID: asidhasd@1.2.3.4 CSeq: 39 REGISTER Contact: sip:jdrosen@pua-pc.dynamicsoft.com;methods="SUBSCRIBE" Contact: http://www.cs.columbia.edu/~jdrosen Content-Length: 0 One oftime and chose to decline theContact headers containssubscription. If theSUBSCRIBE value inpolicy of themethods tag. The presenceservercan therefore forward the requestis not tothat address. If there are no registrationsdivulge this information, the PA MAY respond with a 202 Accepted response even though themethods tagsubscription is rejected. Alternatively, if the policy of"SUBSCRIBE", there are no presence clients, andthepresence server SHOULD assumepresentity or therole of PA. In fact, itPA ispossiblethattwo different presence clients register forit is acceptable to inform thesame presentity. In this case,subscriber of thepresence server, acting asrejection, aproxy, may fork the SUBSCRIBE, which means it sends multiple copies of603 Decline SHOULD be used. Note that since therequest, oneresponse toeach presence client. Each client will presumably query its principala subscription does not contain any useful information aboutwhetherthesubscriptionpresentity, privacy and integrity of SUBSCRIBE responses isacceptable. In the common case wherenot deemed important. 5.6 Generation of Notifications Upon acceptance of aprincipal has left their presence tool running at work, and then gone home and startedsubscription, thetool there,PA SHOULD generate an immediate NOTIFY with theprincipal will acceptcurrent presence state of thesubscription at home. This causespresentity. If asuccess response to be generated,subscription is received, andforwarded to the presence server (whichisactingmarked asa proxy), and then back to the subscriber. The presence tool at home then assumes responsibility for that subsription. The tool at work can continue to support subscriptions it received previously. Independently of whetherpending or was rejected, the PAresides in the presence server or presence client, if a SUBSCRIBE request arrives and is acceptable,SHOULD generate an immediate NOTIFY. This NOTIFY should contain a200 OK response is generated, and the PA storesvalid state for thesubscription. The 200 OK response contains a copy of the current presence state ofpresentity, yet be one which provides no useful information about the presentity.The 200 OK responseAn example of this is tothe SUBSCRIBE listed above might look like: SIP/2.0 200 OK Via: SIP/2.0/UDP presenceserver.dynamicsoft.com Via: SIP/2.0/UDP userpc.example.com To: sip:jdrosen@dynamicsoft.com From: sip:user@example.com Contact: sip:user@userpc.example.com Record-Route: sip:jdrosen@example.com;maddr=presenceserver.dynamicsoft.com Expires: 3600 Call-ID: knsd08alas9dy@3.4.5.6 CSeq: 1 SUBSCRIBE Content-Type: application/xpidf+xml Content-Length: 287 <?xml version="1.0"?> <!DOCTYPE presence PUBLIC "-//IETF//DTD RFCxxxx XPIDF 1.0//EN" "xpidf.dtd"> <presence> <presentity uri="sip:jdrosen@dynamicsoft.com;method="SUBSCRIBE"> <atom id="779js0a98"> <address uri="sip:jdrosen@dynamicsoft.com;method=INVITE"> <status status="open"/> </address> </atom> </presentity> </presence> Noticeprovide an IM URL that is theresponse has mirrored many fields from the request, includingsame form as theTo, From, Call-ID, CSeq,presence URL, andVia headers. The PA has also added a Contact header, providing anmark that IM addresswhere it can be reached.as "not available". Theresponse also contains a Record-Route header. This header was presumably inserted by the proxy (the address in the maddr headerreason for this process of "lying" is thatof a presence server acting aswithout it, aproxy), and is reflected insubscriber could tell the200 OK response. The response also containsdifference between apresence document for the presentity,pending subscription anda Contact header. The Contact headers in a response to SUBSCRIBE list all the current addresses which have been subscribed. Aan accepted subscriptionis uniquely defined by the combination ofbased on theCall-ID, To,existence andFrom header fields in the SUBSCRIBE. Subscriptions are soft- state; they must be refreshed periodically by the subscriber in order to remain active. The Expires header in the 200 OK response is used to indicate the lifetimecontent ofthe subscription; the subscriber must resend the subscription before then, or it is deleted from the PA. Whenan immediate NOTIFY. The approach defined here ensures that the presenceinformation for the presentity changes, the PA generatesdelivered in a NOTIFYrequest for each subscriber. Recall thatgenerated by aPApending or rejected subscription isassumed to know about all changes in the presence information foralso apresentity; it will know this either because it is co-located with the PUA, otherwise it is co-located with the registrar, and will learn about changes in presence information from REGISTER requests. The NOTIFY request is routed using the Record-Route and Contact headers obtained from the subscription, as is donevalid one that could have been delivered inbaseline SIP. For example, the PA will generatea NOTIFYthat looks like this: NOTIFY sip:user@userpc.example.com Via: SIP/2.0/UDP pua-pc.dynamicsoft.com To: sip:user@example.com From: sip:jdrosen@dynamicsoft.com Contact: sip:jdrosen@pua-pc.dynamicsoft.com Route: sip:user@userpc.example.com;maddr=userpc.example.com Call-ID: knsd08alas9dy@3.4.5.6 CSeq: 1 NOTIFY Content-Type: application/xpidf+xml Content-Length: 290 <?xml version="1.0"?> <!DOCTYPE presence PUBLIC "-//IETF//DTD RFCxxxx XPIDF 1.0//EN" "xpidf.dtd"> <presence> <presentity uri="sip:jdrosen@dynamicsoft.com;method="SUBSCRIBE"> <atom id="779js0a98"> <address uri="sip:jdrosen@dynamicsoft.com;method=INVITE"> <status status="closed"/> </address> </atom> </presentity> </presence> This NOTIFY is sent togenerated by an accepted subscription. If thepresence server (presenceserver.dynamicsoft.com) becausepolicy of themaddr parameter in the Record-Route. Thepresence serverreceives this, and sees the Route header. It removes the Route header, places the URI sip:user@userpc.example.com intoor theRequest URI, and sendspresentity is that it is acceptable to divulge information about whether theIP address corresponding to the maddr parameter, in this case, also userpc.example.com. In this way,subscription succeeded or not, the immediate NOTIFYtakes the same path as the SUBSCRIBE took. As an optimization, notifications do notneedtonot be sentif the subscriber is not actually online. This improves scalability. When a client wishes to fetch the current communications state of a user, it generates a SUBSCRIBE request, with an Expires header with time 0 (that is,for pending or rejected subscriptions. Of course, once a subscriptionwhich immediately expires). Once it hits the PA, a 200 OK responseisgenerated (assuming authorization exists) containingaccepted, thecurrent presence state. The subscription is then immediately expired. The result is a fetch of presence information without generation ofPA SHOULD generate asubscription. Note that since fetch is accomplished using SUBSCRIBE, the same security mechanisms and authorization requirements are usedNOTIFY forboth. 5 Subscriptions This section defines detailed syntax and semantics associated with subscriptions. 5.1 Generating subscriptions Subscription is accomplished using the new SUBSCRIBE method, defined below. Subscribe = "SUBSCRIBE" Like all SIP method names,theSUBSCRIBE method name is case sensitive. SUBSCRIBE is usedsubscription whena subscriber wishes to receive asynchronous notifications about events generated by some object. These events can be changes init determines that the presence state of theobject, or any other type of event. The address of the object is placed by the subscriber in the To header and alsopresentity has changed. Section 6 describes how therequest URI. The bodyPA makes this determination. For reasons ofthe SUBSCRIBE method MAY contain informationprivacy, it will frequently be necessary tolimitencrypt thesetcontents ofevents for which notifications are sent, or otherwise provide modifiers tothesubscription. If no body is present, all events generated by the object causenotifications.In its application to presence of people, the object is actually a presentity, and its address is the SIP URL for the presentity. Tables 1 and 2 extend tables 4 and 5 of SIP with two additional columns, defining the headers thatThis can beused inaccomplished using theSUBSCRIBE and NOTIFY requests and responses. Subscriptions are soft-state, and must be periodically refreshed.standard SIP encryption mechanisms. Therefresh interval is suggested by the client in the SUBSCRIBE request (usingencryption should be performed using theExpires header) andkey of theactual value returnedsubscriber as identified in theSUBSCRIBE response inFrom field of theExpires header; see Section 6.20SUBSCRIBE. Similarly, integrity ofSIP. If no value is present,thedefaultnotifications isone hour. The responseimportant to subscribers. As such, thesubscription MUST contain an Expires header indicating the actual expirationcontents of thesubscription. This time will never be later than the time offered in the request, if it is offered. The subscriptionnotifications SHOULD berefreshed before this expiration of the client still desires the subscription to be valid. A SUBSCRIBE request MUST contain a To header, identifying the logical identityauthenticated using one of theuser or object who is being subcribed to (i.e.,standardized SIP mechanisms. Since thewhere enc. e-e SUBSCRIBENOTIFY___________________________________________________ Accept R e o o Accept 415 e o o Accept-Encoding R e o o Accept-Encoding 415 e o o Accept-Language R e o o Accept-Language 415 e o o Allow 200 e o o Allow 405 e m m Authorization R e o o Authorization r e o o Call-ID gc n e m m Contact R e m o Contact 2xx e m o Contact 3xx e o o Contact 485 e o o Content-Encoding e e o o Content-Length e e m m Content-Type e e * * CSeq gc n e m m Date g e o o Encryption g n e o o Expires g e o o From gc n e m m Hide R n h o o Max-Forwards R n e o o Organization g c h o o Table 1: Summary of header fields, A--O address of the presentity). A SUBSCRIBE request, of course, MUST contain a Request-URI. For requestsare generated bya UAC, this SHOULD be identical to the To field. As the SUBSCRIBE request traverses proxy servers,theRequest-URI is rewrittenpresence server, which may not have access to theaddress of the subscribed-to entity as known in the next-hop server. A SUBSCRIBE request MUST contain a Call-ID header (simply an opaque identifier) and a From header. The From header contains logical identitykey of the userrequestingrepresented by thesubscription. Generally, this is a SIP URL, although it need not be. Note that as a logical identifier,presentity, it willgenerally not contain a complete hostname, such as sip:user@pc10.engineering.example.com, but rather contain a logical name, such as sip:user@example.com. where enc. e-e SUB NOTIFY __________________________________________________________ Priority R c e - - Proxy-Authenticate 407 n h o o Proxy-Authorization R n h o o Proxy-Require R n h o o Record-Route R h o o Record-Route 2xx,401,484 h o o Require R e o o Retry-After R c e - - Retry-After 404,413,480,486 c e o o 500,503 c e o o 600,603 c e o o Response-Key R c e o o Route R h o o Server r c e o o Subject R c e - - Timestamp g e o o To gc(1) n e m m Unsupported 420 e o o User-Agent g c e o o Via gc(2) n e m m Warning r e o o WWW-Authenticate R c e o o WWW-Authenticate 401 c e o o Table 2: Summary of header fields, P--Z; (1): copied with possible addition of tag; (2): UAS removes first Via header field A subscription is uniquely identified by the combination of the To, Call-ID and the From field in the SUBSCRIBE request. Refreshes of subscriptions SHOULD reuse the same Call-ID if possible, since subscriptions are uniquely identified at presence servers using the Call-ID. Two subscriptions fromfrequently be thesame user, forcase that thesame user, but with different Call-IDs,NOTIFY areconsidered different subscriptions. We anticipatesigned by a third party. It is RECOMMENDED thatreuse ofthesame Call-ID will notsignature bepossible through reboot cycles. This is acceptable, however. The soft-state natureby an authority over domain ofsubscriptions will causetheold one to expire. Note this is exactly the same as usage of Call-ID in registrations. A SUBSCRIBE request MUST contain a CSeq header. As specified in [2], The CSeq header MUST increment for each subsequent requestpresentity. In other words, forthe same To, From, and Call-ID field (thus, the CSeq in each refresh MUST increase). The CSeq header uniquely identifies and orders each refresh ofaparticular subscription. A SUBSCRIBE request MUST contain a Via header, formatted as defined in RFC 2543 [2]. Via headers are used to properly forward the response to the SUBSCRIBE. A SUBSCRIBE request MUST contain a Contact header. This indicatesuser pres:user@example.com, theaddress(es) (as a SIP URL) to whichsignator of theclient would like to receive notifications. This MUST beNOTIFY SHOULD beone or more SIP addresses, containingthefully qualified domain namesauthority forthe host generating the subscription, or the IP addressexample.com. 5.7 Rate Limitations on NOTIFY For reasons ofthe host generating the subscription. Other addresses are possible, supporting third party subscriptions. Ifcongestion control, itcontains multiple addresses, notifications will be sent to each address. If no Contact headerispresent, noimportant that the rate of notificationswill be sent. The SUBSCRIBE request MAY containnot become excessive. As abody, and when present,result, it is RECOMMENDED that theContent-Length, Content-Type, and Content-Encoding are used as specified in [2]. There are many applicationsPA not generate notifications forbodies withinaSUBSCRIBE request - for example, providing more detailed information about what the subscription is for. Derivation of semantics of the purpose of the body is based on the Content-Type and Content- Disposition headers. A SUBSCRIBE request MAY contain an Accept header, indicating the allowed presence description formats which may be returned insingle presentity at anotification. When not present, the server assumes only the lightweight presence format [10] is supported. This extension does NOT neccessitate the use of either Require or Proxy-Require. These headers SHOULD NOT be present unless some other extensions are needed beyond this one. Usage of the other headers specified as optional in Tables 1 and 2 is defined in [2]. 5.2 Sending subscriptions Therate faster than once every 5 seconds. 5.8 Refresh Behavior Since SUBSCRIBErequest MAY be sent directly to the server identified in the Request URI. Alternatively, it can be sent to a local outbound proxy server. Usage of local outbound proxiesisRECOMMENDED with presence in order to provide security features. An example subscription message looks like: SUBSCRIBE sip:user@example.com SIP/2.0 Via: SIP/2.0/UDP myhost.example.com From: Professor Smith <sip:professor@university.edu> To: Joe User <sip:user@example.com> Contact: sip:professor@mypc.university.edu Call-ID: 986sdo909y66555@12.33.4.5 CSeq: 4937872 SUBSCRIBE Accept: text/uri-list, text/xml-presence 5.3 Proxying subscriptions Proxies forward SUBSCRIBE requestsrouted by proxies asthey wouldany otherrequest. The resultmethod, it is possible thatthe SUBSCRIBE eventually arrives ataserver where the user is registered. Section 5.4 outlines processing in these servers. 5.4 Presence server processing of SUBSCRIBE This section outlines the processing of a newsubscriptionrequest for a presentity served by a presence server. When a SUBSCRIBE request arrives, the presence server SHOULD send a 100 Trying response.might fork. Thenext job of the presence serverresult isto determine ifthat itwillmight arrive at multiple devices which are configured to act as aproxyPA forthis subscription, or as a PA. Once this determination is made, processing follows Section 5.3 inthecasesame presentity. Each of these will respond with aproxy, and Section 5.5 in202 response to thecase of a PA. IfSUBSCRIBE. Based on thepresentity identifiedforking rules inthe request URI has at least one registered Contact that indicates support of the SUBSCRIBE method, the presence server MAY proxy the request, or MAY act as a PA. If no Contacts are registered for the presentity, or if there are Contacts, but none indicate support for the SUBSCRIBE method, the presence server SHOULD assume the role of PA. If there was more than one Contact which indicated support of the SUBSCRIBE method, the proxy MAY fork the request (that is, send the subscription to more thanSIP, only onePA). Standard SIP processing, as defined in Section 12.4ofRFC2543 [2],these responses isusedpassed tocollect responses and send a single response upstream, towardsthe subscriber.Basically,However, thealgorithm specifiedsubscriber willresult in a 200 OK being forwarded upstream if any of the presence clients responded with a 200 OK. If more than one presence client responded with a 200 OK, only one of them is forwarded upstream. Note that this may cause multiple PAs to generatereceive notificationsfor the same presentity. This is acceptable;from each of those PAis generatingwhich accepted thesame information.subscriptions. Theredundant information is discarded at the subscriber [11]. If the presence server was formerly acting as a PA for a subscription (in other words, the presence server was a PA for a subscription with the same Call-ID, To, and From field, but different CSeq), but is now a proxy,SIP event framework allows each package to define thepresence server MUST cease acting as PAhandling for thissubscription if the proxied request generates a final response, unless that final response is 405 (Method not Allowed) (which means the presence client isn't actually a presence client, since it doesn't support SUBSCRIBE). Itcase. The processing in this case ispossible for the role of PA to migrate from presence serveridentical topresence client dynamically. Consider firstthecase of a presence server acting as a PA, because there were no presence clients available. At some point, the presence client comes online (knownway INVITE would be handled. The 202 Accepted to thepresence server through a registration). When the subscription is next refreshed,SUBSCRIBE will result in thepresence server can act as a proxy insteadinstallation ofa PA, and forward thesubscriptionto the presence client. This terminatesstate in the subscriber. The subscriptiononis associated with theserver,To andallows it to become active on the presence client. By transferring subscriptions on refreshes, handling of subscriptions to gradually transitionFrom (both with tags) and Call-ID froma presence server to a presence client. The role of presence server migrates back in muchthesame way.202. When notifications arrive, those from thepresence client goes offline (by unregisteringPA's whose 202's were discarded in theContact address withforking proxy will not match themethods="SUBSCRIBE" tag),subscriptionrefreshes will now terminateID stored at thepresence server, causing the presence serversubscriber (the From tags will differ). These SHOULD be responded toact aswith aPA for those subscriptions.481. This willcause the subscriptions to gradually become active at the presence server. As an optimization, the presence server can cachedisable theactivesubscriptionsat the client. This is done by observing the SUBSCRIBE requests, and the 200 OK responses, which pass by the presence server (which is acting as a proxy). When the presence client goes offline,from those PA. Furthermore, when refreshing thepresence server can simply instantiatesubscription, thecached subscriptions immediately. Note that cachingrefresh SHOULD make use ofsubscriptions imposes a security risk unlessthepresence server can authenticate and verifytags from theintegrity of SUBSCRIBE requests202 andtheir responses. 5.5 Presence agent processingmake use ofSUBSCRIBE The presence agent MAY authenticate the request (using a 401 response, NOT 407, since the PA is a user agent in SIP terminology). Once authenticated, the PA determines if this is a subscription refresh,any Contact ora new subscription. IfRecord-Route headers in order to deliver theCall-ID, To, and From field match that of an existing subscription,SUBSCRIBE back to thesubscription is a refresh. Otherwise, it is a new subscription. 5.5.1 Refreshes Asame PAMAY reject a refresh if it determinesthat sent thesubscription is no longer acceptable (for example, if the subscription was permitted on a timed basis). In202. The result of thiscase, the subscription is removed from the system, and a 6xx class responseissent. Notethat a4xx or 5xx error response MUST NOT cause the subscription topresentity can have multiple PAs active, but these should beremoved from the system. The remainder of the discussion on refreshes assumeshomogeneous, so thatthe subscription is still acceptable. Each notification address (as indicated in the Contact header), is independently refreshed. This allows different expiration times for different notification addresses. Differing expiration timeseach canbe indicated usinggenerate theexpires parametersame set ofthe Contact header, just as is donenotifications forregistrations [2]. When a presence agent receives a subscription refresh, it updatestheexpiration time ofpresentity. Supporting heterogeneous PAs, eachnotification address in the subscription. As with the initial subscription, the server MAY lower the amount of time until expiration, but MUST NOT increase it. The final expiration time is placed in the Expires header in the response, or into the expires parametersofthe Contact headers in the response. The 200 OK response SHOULD also contain a copy of the current presence state of the presentity, in a format listed in the Accept header of the SUBSCRIBE, else the Light Presence Information Data Format (LPIDF) [10] if no Accept header is present. If the Accept header was present but empty, no presence information is placed in the response. If no refreshwhich generated notifications for anotification address is received before its expiration time, that address is removed from the listsubset ofaddresses. If all notification addresses are removed,theentire subscription is deleted. 5.5.2 New subscriptions Thepresenceserver first determines if the subscriber is authorized. How such authorization is determineddata, isoutside the scope of this document. Authorizations may have been pre-granted by the presentity or the system administrator. Alternatively, when the subscription arrives, the PA may query the usercomplex and difficult todetermine if authorization is permitted. Such querying is straightforward in the case of a PA co- resident with a PUA (in which casemanage. If such ascreen pop or something elsefeature is needed, it can beused). In the case of a PA co-residentaccomplished with aproxy/registrar,B2BUA rather than through aremote authorization protocol, such as [9], or even the Common Open Policy Service (COPS) [12] can be used. If authorization was refused, the request SHOULD be rejected withforking proxy. 6 Publication The user presence for a600 class response. If authorization could notpresentity can be obtained(for example, because the principal was offline or not available), the PA SHOULD generatefrom any number of different ways. Baseline SIP defines a202 response. This response tells the subscribermethod thatthe subscriptionispending. The PA may reattempt authorization at a later time, possibly when the principal comes back online. See [9], which describes a SIP extension that can beusedfor authorization of users. The subscriber SHOULD refresh the subscription as per a 200 response. The subscriber knowsby all SIP clients - thesubscription is accepted when either (1) a NOTIFY for that subscription appears, or (2) a refresh generatesREGISTER method. This method allows a200 response. If authorization has been granted, the PA MUST respondUA toSUBSCRIBE withinform a200 OK response. The response MUST contain an indication of expiration time for each notification address in the SUBSCRIBE. The 200 OK response SHOULD also contain a copySIP network oftheits currentpresence state of the presentity, in a format listed in the Accept header of the SUBSCRIBE, else the Light Presence Information data Format (LPIDF) [10] if no Accept header is present. If the Accept header was present but empty, no presence information is placed in the response. The PA MAY sign the 200 OK response. The PA also instantiates a subscriptioncommunications addresses (ie., Contact addresses) . Furthermore, multiple UA can independently register Contact addresses for thesubscriber. The subscription is indexed by the Call-ID in the SUBSCRIBE and the URI in the From field (including the tag). The PA generates Route headers (using thesame SIP URL. These Contactand Record-Route headers from the request) toaddresses can beused for sending notifications. These Route headers are constructed exactly as ifSIP URLs, or they can be any other valid URL. Using theSUBSCRIBE request were an INVITE. The Route headers are storedregister information foruse in subsequent notifications. 5.6 Subscriber processing of SUBSCRIBE response The subscriber will receive a single final response to the SUBSCRIBE request. If this response is a 600 class response, the subscription request has been denied. If the responsepresence isa 200 class response, the subscription has been accepted.straightforward. Theresponse may contain the current presence stateaddress of record in the REGISTER (the To field) identifies the presentity. The200 OK response will contain expiration information (either in an Expires header, and/or in the expires parameter ofContact headersin the 200 OK response) indicating when the subscription expires. The subscriber MUST refreshdefine communications addresses that describe thesubscription before an expiration time if it wishes to continue to receive notifications tostate of theaddress with that expiration.presentity. TheSUBSCRIBE response will also contain Record-Route headers; these are used to build a Route header set forusein subsequent subscription refreshes. The constructionof theRoute headers follows thoseSIP caller preferences extension [8] is RECOMMENDED fora 200 OK response to INVITE as documented in RFC2543 [2], exceptuse with UAs thatContact headersarenot included in the processing. SUBSCRIBE is like REGISTER,interested inthat the Contact headers don't refer to signaling addresses, but rather notification addresses. Unlike REGISTER, a Route needs to be built for SUBSCRIBE, and this Route should not includepresence. It provides additional information about the Contactheaders. To refresh the subscription, the subscriber contructs a new SUBSCRIBE request. The Call-ID, To, and From in this request MUST match those of the previous SUBSCRIBE request. The CSeq header MUST be higher thanaddresses thatof the previous SUBSCRIBE request. The Via header is constructed as described in 5.2. The request MUST contain the Route header constructed from the responsecan be used tothe initial SUBSCRIBE. The request MAY contain Accept, Content-Length, Content-Type, and Content-Encoding headers as described in Section 5.2. The request URI is constructed from the Route headers, as defined in RFC2543 [2].construct a richer presence document. Therequest is then sent to the server in the request URI. As long as the subscription remains active, the subscriber will receive notifications"description" attribute ofpresence state fromthePA. 5.7 Unsubscribing A subscriber may unsubscribe by sending a SUBSCRIBE request with an Expires header of 0. TheContact headerindicates the particular address thatisbeing unsubscribed. This MAY be a *, indicating that all Contacts for that particular subscription (as identified by the Call-ID, To, and From) areexplicitly defined here to beremoved. If all Contacts are removed, the PA deletes the subscription. 5.8 Fetching Fetching is similar to a subscribing, in that it returns the current presence state. However, no notifications are sent for future changes in the presence state. Rather than inventing a new method for this, it is readily accomplished withused as aSUBSCRIBE along with an Expires: 0 header and no Contact header. The absence of any Contact header is what distinguishes it from the similar operation of unsubscribing. The advantage of using SUBSCRIBE isfree-form field thatthe server can simply process the request independently of whether itsallows afetch or longer lived subscription; the authorization and processing steps are identical. The only difference is whether an actual subscription is instantiated for theuseror not. This parallels how fetching of registrations is done in SIP. Note that fetching has no effect on existing subscriptions. 6 Publication Publication is the process by which presence information is uploaded from the presence user agentstothe presence agent. The information uploaded through publications is the content used to formulate presence documents distributed through notifications. Publication can be done using any number of means, including proprietary protocols. There are many cases where this is both necessary and desirable. However, wedefinea standard mechanism for publication of presence information from a PUA to a presence server. This mechanism is entirely based on the existing SIP registration and caller preferences specifications [3]. Simply put, the Contact headers placed in registrations are the presence information published bythepresence user agents. The caller preferences extension provides a large set of parameters which can be used to provide additional information, beyond location, which provided by SIP REGISTER. Usagestatus ofREGISTER to publish presence information has several important features: o It supports communications means represented by any URL scheme, including HTTP and SMTP. o It supports distributed presence information, whereby multiple PUAs can independently update state for different communications addresses for the same presentity. o It supports third party updates, so that one entity can update presence state for another. o Caller preferences allows for relative weights to be assigned to the addresses. o Caller preferences allows for arbitrary characteristics to be assigned totheaddresses. o Caller preferences allows for descriptions to contain arbitrary textpresentity at thatcan be used for notes.communications address. We also allow REGISTER requests to contain presence documents, so that the PUAs can publish more complex information. Note that we do not provide for locking mechanisms, which would allow a client to lock presence state, fetch it, and update it atomically. We believe that this is not neeeded for the majority of use cases, and introduces substantial complexity. Most presence operations do not require get-before-set, since the SIP register mechanism works in such a way that data can be updated without a get. The application of registered contacts to presence increases the requirements for authenticity. Therefore, REGISTER requests used by presence user agents SHOULD be authenticated using either SIP authentication mechanisms, or a hop by hop mechanism.7 Notification Notification isTo indicate presence for instant messaging, theprocessUA MAY either register contact addresses that are SIP URLs with the "methods" parameter set to indicate the method MESSAGE, or it MAY register an IM URL. TODO: This section needs work. Need to define a concrete example oftransmitting presence statemapping a register tosubscribers.a presence document, once IMPP generates the document format. 6.1 Migrating the PA Function It isdone by a PA. 7.1 Whenimportant tosend Notifications are sent whenrealize that thestate ofPA function can be colocated with several elements: o It can be co-located with thepresentity changes, and that state change is oneproxy server handling registrations forwhich a notification is desired. Notifications SHOULDthe presentity. In this way, the PA knows the presence of the user through registrations. o It can besent inco-located with atimely fashion afterPUA for that presentity. In thestate has changed. Descriptioncase of a single PUA per presentity, thecases in which state changes should trigger notifications is handled by subscription documents transmitted in SUBSCRIBE requests. If no such document was present,PUA knows thePA SHOULD assume that allstatechanges are reported. Similarly, the subscription document describes the subscribers preferences forof thedetailed content presentpresentity by sheer nature of its co-location. o It can be co-located in any proxy along thenotification. The actual data sent would be computed throughcall setup path. That proxy can learn theintersection requested content, andpresence state of thecontent authorizedpresentity bythe subscribed partygenerating its own SUBSCRIBE intheir access controls.order to determine it. In this case, theabsense ofPA is effectively asubscription document,B2BUA. Because of the soft-state nature of the subscriptions, itis assumed thatbecomes possible for thesubscriber wants all data. As an important optimization, aPAMAY elect not to send a notifyfunction toa subscriber if it knows thatmigrate during thesubscriberlifetime of a subscription. The most workable scenario isnot available to receive notifications. This can be known by havingfor the PAsubscribefunction to migrate from thesubscriber. In particular, the ability to receive notifications represents another piece ofpresencestate which can be uploaded in a REGISTER,server to the PUA, anddiscovered throughback. Consider aSUBSCRIBE. For example, if userA subscribes to userB, userA would include,subscription that is installed inits registrations, an addressa presence server. Assume for the moment thatindicates its ability to receive NOTIFY requests: REGISTER sip:example.com SIP/2.0 Via: SIP/2.0/UDP userApc.example.com To: sip:userA@example.com From: sip:userA@example.com Call-ID: 8ynllz9a6ajsda009@9.8.7.6 CSeq: 1 REGISTER Contact: sip:userA@userApc.example.com;methods=NOTIFY Content-Length: 0 If userB also subscribes to userA, userB would be awarethe presence server can determine that a downstream UA is capable ofthis communications addressacting as a PA fornotifications. It could then match it against the notification addresses inthe presentity. When a subscriptionfrom userA,refresh arrives, the PA destroys its subscription, anddetermine whetherthen acts as anotification address was currently active. We anticipate that most subscriptions will be symmetric, that is, A subscribes to B and B subscribes to A. In this case, no extra subscriptions are requiredproxy forthis optimization. Note that this optimization is likely to work only when notifications are sent by clients. This is because presence servers are not likely to be privy to presence state ofthesubscribers. 7.2 Formatting of NOTIFYsubscription. Thegeneration of notificationssubscription isrelatively straightforward.then routed to the UA, where it can be accepted. Thepresence dataresult isconstructed based on rules outside ofthat thescope ofsubscription becomes installed in the PUA. For thisdocument. Note thatmigration to work, theentity generating a notificationPUA MUSTuse a presence format listed among thosebe prepared to accept SUBSCRIBE requests which already contain tags in theAccept header inTo field. Furthermore, theSUBSCRIBE request. If not present,PUA MUST insert a Contact header into theLightweight Presence Information Data Format (LPIDF) [10] type is assumed. The NOTIFY202, and this header MUSTcontainbe used by thesame Call-ID assubscriber to update theSUBSCRIBEcontact address forwhich it is acting as a notification. The From field MUST matchtheTo fieldsubscription. TODO: Does this work? What about getting a Record-Route in place at theSUBSCRIBE, andPUA. This might only be possible for refreshes that don't use Route or tags. The presence server determines that a PUA is capable of supporting a PA function through theTo field MUST matchREGISTER message. Specifically, if a PUA wishes to indicate support for theFrom fieldPA function, it SHOULD include a contact address intheits registration with a caller preferences "methods" parameter listing SUBSCRIBE.The From field MUST contain7 Mapping to CPIM This section defines how atag, which allowsSIP fornotifications frompresenceserver and PUAmessages are converted tobe distinguished, as far as SIP transaction processingCPIM, and how a CPIM messages areconcerned. Forconverted to SIPexperts - this represents a slightly different operation thanforINVITE. Whenpresence. SIP to CPIM conversion occurs when auserSIP system sendsan INVITE, they will receive a 200 OK withatag. Requests in the reverse direction then containSUBSCRIBE request thattag, andcontains a pres URL or SIP URL thattag only, in the From field. Here, the responsecorresponds toSUBSCRIBE may containataguser inthe To field, andaNOTIFY will containdomain that runs atag in the From field. However,different presence protocol. CPIM to SIP involves theUA may receive NOTIFY requests with tagscase where a user inthe From fielda different protocol domain generates a subscription thatdo not match the tagis destined for a user in a SIP domain. Note that the200 OK received toprocess defined below requires that theinitial SUBSCRIBE.gateway store subscription state. This unfortunate result isbecause only a single 200 OK is returned to a SUBSCRIBE request, as opposeddue tomultiple 200 OK for INVITE. Thus,theUA MUST be preparedneed toreceive NOTIFYs with many different tags, eachremember the Call-ID, CSeq, and Route headers for subscriptions froma different PUA. The CSeq MUST be formatted as described inthe SIP[2]. In particular, noteside, so that they can be inserted into theCSeq spaceSIP NOTIFY generated when a CPIM notification arrives. 7.1 SIP to CPIM SIP for presnce isdifferentconverted to CPIM through a SIP to CPIM abstract gateway service, depicted inthe direction of notifierFigure 1. +-------------+ | | | SIP tosubscriber and subscriberCPIM| | Conversion | | | SIP | | CPIM ---------------> | | ----------------> | | | | | | | | | | | | +-------------+ Figure 1: SIP tonotifier, andCPIM Conversion The first step isfrom a different space for presence clients and presence servers. NOTIFY SHOULD NOT containthat aContact header. If theSUBSCRIBE requestcontained Record-Route and/or Contact headers, the Route header for NOTIFYiscomputed as per [2], as if the SUBSCRIBE were an INVITE, and the NOTIFY werereceived at aBYE.gateway. Therequest-URI is also computedgateway generates a CPIM subscription request, with its parameters filled in asper [2]. NOTIFY requests SHOULD be authenticated, using any of the end to end SIP authentication mechanisms. Note that the shared secret mechanisms are likely to only work for presence client generated notifications, since shared secrets will exist only between end users, not between servers and end users. When presence servers are generating the notifications, public key based authentication is RECOMMENDED. 7.3 Responding to NOTIFY The subscriber SHOULD be prepared to receive notifications from different sources for the same presentity.follows: o Themechanisms for combining these notifications towatcher identity in theoverall presentity stateCPIM message isoutsidecopied from thescopeFrom field ofthis document, but is described in [11].the SUBSCRIBE. If the From field contains aNOTIFYSIP URL, it isreceivedconverted to an equivalent pres URL bya UA for a subscription which doesdropping all SIP URL parameters, and changing the scheme to pres. This conversion may notexist,work - what if theUA SHOULD respond withSIP URL has no user name. Plus, converting from a481 (Unknown Call Leg). It is RECOMMENDED that the UA also sendURL back to aSUBSCRIBE method, withURN in this fashion may not do it correctly. o The target identity in theTo fieldCPIM message is copied from theFromRequest-URI field of theNOTIFY,SUBSCRIBE. This may need to be converted to a pres URL as well. o The duration parameter in theFromCPIM message is copied from theTo ofExpires header in the SUBSCRIBE. If theNOTIFY,Expiresequalheader specifies an absolute time, it is converted tozero, and Contact wildcarded (*). This will request that the subscription which generateda delta-time by theunwanted notification be removed.gateway. If no Expires header is present, one hour is assumed. o The transID parameter in theNOTIFYCPIM message isproperly formed and desired,constructed by appending theUA MUST respond with a 200 OK. Notification responses will not normally contain bodies. They MAY ifCall-ID, therequest contained an Accept header listing acceptable bodiesURI in theresponse. IfTo field, thenotification generates no final response at all, and times out, or ifURI in thenotification generates a 481 response,From field, theentity generatingCSeq and thenotification should invalidate that notification addresstag in thesubscription. If invalidationFrom field, and the request URI, and computing a hash of theaddress results in no notification addresses remaining inresulting string. This hash is used as thesubscription,transID. Note that theentire subscriptionrequest URI isdeleted.included in the hash. Thisprevents notifications from being generatedis tousersdifferentiate forked requests within the SIP network thathave gone offline, or to those users who were mistakenly subscribed but have no presence clientmay arrive atall. The soft state nature of subscriptions will ensure that valid subscriptions will be refreshed if accidentally deleted. 8 Access controls Access controls are mechanisms which allowtheuser controlling a presentity to define rules about who is allowed to subscribe, what data they see, and when. Access controls aresame gateway. The CPIM service then responds with either acritical componentsuccess or failure. In the case ofa presence solution, but are ideally separated fromsuccess, theunderlying presence protocol. This is because access controls are fundamentally a mechanism for influencing policy decisions made by presence servers; policy can be controlled in numerous ways, and for maximum flexibility and modularity, should be kept separate. Some possibilities for access controls include: Web Based: A user can goSIP to CPIM gateway service generates asecure web page, enter in access controls, and have the data pushed202 response to thepresence server through proprietary means (the presence server itself may runSUBSCRIBE. It adds aweb server). This providestag to theopportunity for substantial differentiationTo field inaccess control services, without interoperability issues. However, it is not suitable for automated control over access controls. CPL Based: The call processing language (CPL) [13]the response, which isused to define call processing rules (i.e., policy) for call setup requests. We observe thatthe samepolicies will likely make sense for subscriptionsaswell. Therefore, CPL, possibly with some extensions, can be used for access controls for presence. These access controls can be uploadedthe transID field ina SIP REGISTER request [14]. COPS:the success response. TheCommon Open Policy Service (COPS) [12] protocol allows for general purpose outsourced policy decisions.202 response also contains a Contact header, which is the value of the target from the SUBSCRIBE request. Itcould easilyis important that the Contact header beused by presence serversset todefine processing of subscriptions. Some ofthethings access controls can be used for are: o Pre-authorizing subscribers, sotarget, since thattheir subscriptions are automatically accepted. o Blocking subscribers, somakes sure thattheirsubscriptionrequests are automatically rejected o Specifying that only subsets of presence information are reported to selected subscribers o Specifying that false presence information can be given to selected subscribers 9 Providing scalability This section briefly overviews the mechanisms in this extension which provide scalability, a critical goal for any presence protocol. Werefreshes haveobserved that scalability is limited by the messaging and processing load at presence servers. Astheprocessing load is proportional to the message load, we can consider justsame value in themessage load to determinerequest URI as thescale bottlenecks at a presence server. This load is equal to: load = (presentities * subscribers per presentity * notifications per presentity) + (presentities * subscribers per presentity)original subscription. Thefirst term represents the notification load, and the second,duration value from thesubscription load. The dominant factorCPIM success response is placed into thenotification load. We address this load by providing three mechanisms - one for the reduction of each of these terms. 9.1 PartitioningExpires header of thenamespace202. Theload on an individual server can be reduced by partitioninggateway stores thenamespace, so thatCall-ID and Route header set for this subscription. If the CPIM service responds with asingle presence server handles onlyfailure, the SIP to CPIM gateway generates asmall number of presentities. This is accomplished through proxy servers, which can receive603 response. It adds asubscription, determine the subdomain which ownstag to thepresence for that user, and forwardTo field in thesubscription to that subdomain. The subdomain itself may have proxiesresponse, whichdo this. The resultisthatthepresence namespace can be divided hierarchically, with proxies providing routing towardssame as theleafs, which handletransID field in theactual presence servers. As an example,failure response. When the CPIM system generates asubscription requestnotification request, the SIP tosip:joe@example.com reachesCPIM gateway creates a SIP NOTIFY request. The request is constructed using themain proxy serverstandard RFC2543 [2] procedures forexample.com. This server does nothing but look up users inconstructing adirectory server, mapping them to subdomains.request within a call leg. Thisparticular user iswill result inengineering, sotheproxy mapsTo field containing therequest URI to sip:joe@engineering.example.com,watcher field from CPIM, andforwards it totheengineering.example.com server. A different user may have been forwarded toFrom field containing themarketing.example.com server. These servers,target field from the CPIM notification. The tag inturn, can rely on databases or other configuration to map these addresses into further subdomains. For example,theengineering server might map sip:joe@engineering.example.com to sip:joe@electrical.engineering.example.com. As these proxies are generally stateless, they can be easily clustered, with load balancing provided through DNS SRV records. Use of SRV records also provides for fault tolerance amongFrom field will contain thecluster. SIP proxy servers can be stateless; assisting only intransID. The presence information is copied into theroutingbody ofrequests,the notification. The Call-ID andnot maintaining anyRoute headers are constructed from the subscription stateat all. Furthermore, through SIPs Record-Routing mechanisms, proxies can assiststored inroutingthefirstgateway. If no notification has yet been generated for this subscription, an initial CSeq value is selected and stored. SUBSCRIBErequest;refreshescan bypassare handled identically to initial subscriptions as above. If a subscription is received with an Expires of zero, theproxiesSIP toimprove scale. 9.2 Client notificationsCPIM gateway generates an unsubscribe message into the the CPIM system. Theload can also be reduced by completely eliminating notificationswatcher parameter is copied from thepresence server. ThisFrom field of the SUBSCRIBE. The target parameter isaccomplished throughcopied from themechanisms describedRequest URI field of the SUBSCRIBE. The transID is copied from the tag inthis extension that allow, by default, a presence clientthe To field of the SUBSCRIBE request. The response togenerate notificationsan unsubscribe is either success or failure. In the case of success, a 202 response is constructed in the same fashion as above for a success response to a CPIM subscriber.This followsAll subscription state is removed. In thewell known Internet scalability principlecase ofpushing intelligence tofailure, a 603 response is constructed in theperiphery. 9.3 Distributedsame fashion as above, and then subscription stateAll the subscriptions from one domainis removed, if present. 7.2 CPIM toanother can be aggregated by co-locating a PA withSIP CPIM to SIP conversion occurs when alocal outbound proxy.CPIM subscription request arrives on the CPIM side of the gateway. This scenario is shown in Figure 2.InThe CPIM subscription request is converted into a SIP SUBSCRIBE request. To do that, thefigure, domain X has two subscribersfirst step is to determine if the subscribe is fora single presentity in domain Y. Both subscribers use a local outbound proxy, so thatan existing subscription. That is done by taking theSUBSCRIBE messages pass through a single proxy. Whentarget in theproxy sees aCPIM subscription request, and matching it against targets fora user in an outside domain,existing subscriptions. If there are none, itacts asis aPA, and accepts the subscription itself. Sincenew subscription, otherwise, its aPA must be aware ofrefresh. If its a new subscription, thecomplete presence state ofgateway generates a SIP SUBSCRIBE request in thepresentity,following manner: o The From field in thepresence server itself subscribesrequest is set to thepresentitywatcher field in thefirst time it gets aCPIM subscriptionfor that presentity. Subsequent subscriptions from inside domain X forrequest o The To field in thesame presentity do not needrequest is set totrigger additional subscriptions outside. A singlethe target field in the CPIM subscriptionfrom domain Xrequest o The Expires header in the SUBSCRIBE request isused. So,set to the duration field in the CPIM subscription request o The tag in thefigure,From field is set to thefirsttransID in the CPIM subscriptionrequest, SUBSCRIBE 1, might look like: SUBSCRIBE sip:presentity@domainy.com SIP/2.0 Via: SIP/2.0/UDP subscriberA-pc.domainx.com From: sip:subscriberA@domainx.com To: sip:presentity@domainy.com Call-ID: uobhasd97@7.3.4.2 CSeq: 1 SUBSCRIBE Contact: sip:subscriberA@subscriberA-pc.domainX.com Content-Length: 0 ++++++++++ ++++++++ +++++ +++ +++ ++ ++++++++++++ + ++ + ++ +---------+ + + +---------+ | +----+ | +SUBSCRIBE 3 | | | |request. +-------------+ ||------------------->| | CPIM to SIP | |PAConversion | |++ +|ProxySIP SUBSCRIBE | |+----+CPIM subscription request <--------------> |+++++ +| <---------------> | |Outbound| ++ +| | |Proxy|+ +| |+---------+ ++ + +---------+ SUBSCRIBE ^ ^ + ++ \ 1 / \ + ++ \ / \ SUBSCRIBE + ++++ \ SUBSCRIBE 3 //-----\\ \ 2 ++ ++++++ \ // \\ \ ++ ++ \ | Subscriber | \ ++ +++ > \\ A // \ ++ ++ +---------+ \\-----// \ + ++ | | //------\\ ++ + | Presence| |/ \| + +|Server| |Subscriber|+ ++ | | |\ B /| + + | | \\------// + + +---------+ + ++ + + ++ + DOMAIN X + + /\ + + / \ ++++ + /PUA \ +++++ ++ /------\ ++++++ + ++ DOMAIN Y ++ ++ ++ ++++++++++++++++++++-------------+ Figure 2:Distributing Subscription State When thisCPIM to SIP Conversion This SUBSCRIBE message isreceived at the outbound proxy/PA for domain X,then sent. If thePA itself generates asubscriptionfor presentity, SUBSCRIBE 3: Via: SIP/2.0/UDP outboundproxy.domainx.com From: sip:domainx.com To: sip:presentity@domainy.com Call-ID: gghhjjoo@0.1.2.3 CSeq: 77is a refresh, a SUBSCRIBEContact: sip:outboundproxy.domainX.com Content-Length: 0 Note that this subscription listsrequest is generated in theoutbound proxy/PA assame way. However, there will also be a tag in theoriginating host (inTo field, copied from theVia and Contact fields),subscription state in the gateway, andsip:domainx.com asa Route header, obtained from theidentity ofsubscription state in thesubscriber. This subcriptiongateway. When a response to the SUBSCRIBE isforwardedreceived, a response is sent to thePA for presentityCPIM system. The duration parameter indomain Y. If itthis response iswillingcopied from the Expires header in the SUBSCRIBE response (a conversion from an absolute time toaccept a domain wide subscription (after authenticatingdelta time may be needed). The transID in therequest, of course, as comingresponse is copied from theownertag in the From field of thedomain), aresponse. If the response was 202, the status is set to indeterminate. If the response was any other 200OKclass response, the status isgenerated. Once this arrives atset to sucess. For any other final response, theoutbound proxy, it can acceptstatus is set to failure. If the response was a 200 class response, subscription state is established. This state contains the tag fromsubscriber 1. When subscriber 2 subscribes, using SUBSCRIBE 2: SUBSCRIBE sip:presentity@domainy.com SIP/2.0 Via: SIP/2.0/UDP subscriberB-pc.domainx.com From: sip:subscriberB@domainx.com To: sip:presentity@domainy.com Call-ID: qwertyuiop@11.22.33.44 CSeq: 12the To field in the SUBSCRIBEContact: sip:subscriberB@subscriberB-pc.domainX.com Content-Length: 0 thisresponse, and the Route header set computed from the Record-Routes and Contact headers in the 200 class response. The subscription isacceptedindexed by theoutbound proxy/PA. No subscriptions arepresentity identification (the To field of the SUBSCRIBE that was generated). If an unsubscribe request is received from the CPIM side, the gateway checks if the subscription exists. If it does, a SUBSCRIBE is generatedor forwardedas described above. However, the Expires header is set todomain Y. This process results inzero. If the subscriptionstate being distributed throughoutdoes not exist, thenetwork, with each domain holdinggateway generates a failure response and sends it to thesubscriptions from users within its own domain. In fact,CPIM system. When theprocess can take place recursively, resulting in distribution of presence state over a tree of domains. That achieves scale; a presentity that might get millions of subscribers would be readily served by such an architecture. The important conceptresponse tonote here is that this aggregation processthe SUBSCRIBE request arrives, it is converted to amatter of local optimization in domain X; as farCPIM response asdomain Ydescribed above for the initial SUBSCRIBE response. In all cases, any subscription state in the gateway isconcerned, theredestroyed. When a NOTIFY is received from the SIP system, asingle subscription, and processing that subscriptionCPIM notification request isno different than processing any other subscription.sent. This notification ispossible because we have defined presence operationsconstructed as follows: o The CPIM watcher is set tobe invoked on logical entities, PAs, which can dynamically be instantiated on a subscription by subscription basisthe URI inany device which can somehow determinethecompleteTo field of the NOTIFY. o The CPIM target is set to the URI in the From field of the NOTIFY. o The transID is computed using the same mechanism as for the SUBSCRIBE in Section 7.1 o The presencestatecomponent of the notification is extracted from the body of the SIP NOTIFY request. The gateway generates apresentity. In200 response to thecase here,SIP NOTIFY and sends it as well. TODO: some call flow diagrams with theoutbound proxyparameters 8 Firewall and NAT Traversal It isinstantiatinganticipated that presence services will be used by clients and presentities that are connected to proxy servers on thePA,other side of firewalls and NATs. Fortunately, since the SIP presence messages do not establish independent media streams, as INVITE does, firewall and NAT traversal is much simpler than described in [9] and [10]. Generally, data traverses NATs and firewalls when it isallowingsent over TCP or TLS connections established by devices inside thePAfirewall/NAT toknow the presence statedevices outside of it. As apresentity through another subscription. The drawback of this optimizationresult, it is RECOMMENDED that SIP for presence entities maintain persistent TCP or TLS connections to their next hop peers. This includes connections opened to send a SUBSCRIBE, NOTIFY, and most importantly, REGISTER. By keeping the latter connection open, itintroduces security issues. The subscription from domainX is now domain wide;can be used by thepresentity cannot authenticateSIP proxy to send messages from outside theidentity of every subscriber withinfirewall/NAT back to thedomain.client. It isforced into a trust relationship with that domain, suchalso recommended thatdomain Y truststhe client include a Contact cookie as described in [10] in their registration, so thatdomain X is authenticating each subscriber. Furthermore,theability ofproxy can map the presentity URI toauthorize some subscribers from domain X, but not others, is lost, unless there is some means to convey access control across domains. Asthat connection. Furthermore, entities on either side of aresult, the decision about whether to accept such domain wide subscriptions is upfirewall or NAT should record-route in order to ensure that thesecurity policy ofinitial connection established for thepresence server. Clearly, such subscriptions might be acceptedsubscription is used forcertain presentities (ones with many subscribers), but not others. 10the notifications as well. 9 Security considerations There are numerous security considerations for presence. Many are outlined above; this section considers them issue by issue.10.19.1 Privacy Privacy encompasses many aspects of a presence system: o Subscribers may not want to reveal the fact that they have subscribed to certain users o Users may not want to reveal that they have accepted subscriptions from certain users o Notifications (and fetch results) may contain sensitive data which should not be revealed to anyone but the subscriber Privacy is provided through a combination of hop by hop encryption and end to end encryption. The hop by hop mechanisms provide scalable privacy services, disable attacks involving traffic analysis, and hide all aspects of presence messages. However, they operate based on transitivity of trust, and they cause message content to be revealed to proxies. Theend to endend-to-end mechanisms do not require transitivity of trust, and reveal information only to the desired recipient. However,end to endend-to-end encryption cannot hide all information, and is susceptible to traffic analysis. Strong end to end authentication and encryption also requires that both participants have public keys, which is not generally the case. Thus, both mechanisms combined are needed for complete privacy services. SIP allows any hop by hop encryption scheme. It is RECOMMENDED that between network servers (proxies to proxies, proxies to redirect servers), transport mode ESP[7][11] is used to encrypt the entire message. Between a UAC and its local proxy, TLS[15][12] is RECOMMENDED. Similarly, TLS SHOULD be used between a presence server and the PUA. The presence server can determine whether TLS is supported by the receiving client based on the transport parameter in the Contact header of its registration. If that registration contains the token "tls" as transport, it implies that the PUA supports TLS. Furthermore, we allow for the Contact header in the SUBSCRIBE request to contain TLS as a transport. The Contact header is used to route subsequent messages between a pair of entities. It defines the address and transport used to communicate with the user agent. Even though TLS might be used between the subscriber and its local proxy, placing this parameter in the Contact header means that TLS can also be used end to end for generation of notifications after the initial SUBSCRIBE message has been successfully routed. This would provide end to end privacy and authentication services with low proxy overheads. SIP encryption MAY be used end to end for the transmission of both SUBSCRIBE and NOTIFY requests. SIP supports PGP based encryption, which does not require the establishment of a session key for encryption of messages within a given subscription (basically, a new session key is established for each message as part of the PGP encryption). Work has recently begun on the application of S/MIME[16][13] for SIP.Tunneling of TLS over SIP, for the purposes of establishment of an end to end private key for encryption, is also under investigation. 10.29.2 Message integrity and authenticity It is important for the message recipient to ensure that the message contents are actually what was sent by the originator, and that the recipient of the message be able to determine who the originator really is. This applies to both requests and responses of SUBSCRIBE and NOTIFY. This is supported in SIP through end to end authentication and message integrity. SIP provides PGP based authentication and integrity (both challenge-response and public key signatures), and http basic and digest authentication.10.3HTTP Basic is NOT RECOMMENDED. 9.3 Outbound authentication When local proxies are used for transmission of outbound messages, proxy authentication is RECOMMENDED. This is useful to verify the identity of the originator, and prevent spoofing and spamming at the originating network.10.49.4 Replay prevention To prevent the replay of old subscriptions and notifications, all signed SUBSCRIBE and NOTIFY requests and responses MUST contain a Date header covered by the message signature. Any message with a date older than several minutes in the past, or more than several minutes into the future, SHOULD be discarded. Furthermore, all signed SUBSCRIBE and NOTIFY requests MUST contain a Call-ID and CSeq header covered by the message signature. A user agent or presence server MAY store a list of Call-ID values, and for each, the higest CSeq seen within that Call-ID. Any message that arrives for a Call-ID that exists, whose CSeq is lower than the highest seen so far, is discarded. Finally, challenge-response authentication (httpbasic, digest, ofdigest or PGP) MAY be used to prevent replay attacks.10.59.5 Denial of service attacks Denial of service attacks are a critical problem for an open, inter- domain, presence protocol. Here, we discuss several possible attacks, and the steps we have taken to prevent them.10.5.19.5.1 Smurf attacks through false contacts Unfortunately, presence is a good candidate for smurfing attacks because of its amplification properties. A single SUBSCRIBE message could generate a nearly unending stream of notifications, so long as a suitably dynamic source of presence data can be found. Thus, a simple way to launch an attack is to send subscriptions to a large number of users, and in the Contact header (which is where notifications are sent), place the address of the target. The only reliable way to prevent these attacks is through authentication and authorization. End users will hopefully not accept subscriptions from random unrecognized users. Also, the presence client software could be programmed to warn the user when the Contact header in a SUBSCRIBE is from a domain which does not match that of the From field (which identifies the subscriber). Also, note that as described inSection 7.3,[3], if anotifyNOTIFY is not acknowledged or was not wanted, the subscription that generated it is removed. This eliminatessome ofthe amplification properties of providing false Contact addresses.10.5.2 Annoyance subscriptions A user can attempt to "annoy" another by subscribing, and on rejection, subscribe again. If subscriptions cause screen pops, this can result in a DoS attack whereby screen pops are constantly pushed onto the subscribed parties machine. To avoid this attack, PUAs SHOULD cache rejected subscriptions and automatically reject subsequent ones (of course, the UA will want a way for the subscriber to remove the negative cached entries if they change their mind). In addition, the PUA SHOULD use access control mechanisms to block those subscriptions at the presence server as well. 10.6 Firewall traversal The extension defined here is firewall and NAT friendly, in that it can be configured in such a way as to traverse any device which allows outgoing TCP connections to an external server. Consider the configuration in Figure 3: The key to enabling traversal of the firewall is to ensure that all SUBSCRIBE requests, their responses, and subsequent notifications and their responses, all traverse a long lived connection opened from the proxy inside the firewall (on the left) out towards the proxy or presence server in the remote domain. SIP supports long lived connections, but what is needed here is a means for the proxy inside the firewall to request to the presence entity on the far side that (1) the connection be kept open, and (2) the presence entity record-route, so that notifications pass over the same connection. These are accomplished with a simple extension [17]. In this environment, the proxy would need to be aware it is behind a firewall, so that it can request the persistent connection, and use TCP in the first place. Note that a subscriber could also do this, allowing for firewall traversal even in the absence of a proxy inside the firewall. Since usage of these persistent connections is not mandatory, it can be used when needed, but for non-firewalled networks, end to end notifications can be used instead, increasing scalability. 11 Addressing Transport SIP, and this protocol based on it, is very flexible in its usage of | | | | INSIDE | OUTSIDE | | | | +--------+ | +--------+ | | | | | | | | |Presence| | Proxy | --------------+--------- | Entity | | | | | | | | | | | +--------+ | +--------+ | | | | | | | | | | | | | | /------\ | // \\ | | Subscriber | | | | | \\ // \------/ Firewall Figure 3: Architecture of Presence System transport protocols. Both TCP and UDP operation are defined; SIP is reliable over any transport and provides its own application layer congestion control, reliability and sequencing. New transports can be used, such as the Stream Control Transmission Protocol (SCTP) [5], which may prove useful for presence messages [6], or TLS. SIPs ability to run over UDP may provide useful for an eventual application of multicast to presence information. Notifications, in particular, might be very amenable to multicast distribution. This flexibility is needed because, simply put, one size does not fit all. UDP is beneficial in that it can be used in stateless proxy servers, improving scale and performance. It is also faster, as no explicit connection setup is required. It may also be appropriate for small devices, such as wireless handsets, which may not readily support persistent connections. However, TCP is advantageous in many cases for liveness determination, congestion control, and its superior segmentation and reassembly capabilities. 12 Required SIP features SIP contains many components and capabilities, only some of which are needed to support presence. It is a common misconception to believe that SIP is only good for initiating phone calls. Since SIP separates the definition of a session to other protocols, such as the Session Description Protocol (SDP) [4], SIP is best viewed as a real-time rendezvous system, which allows content to be delivered from one user, to the current location(s) where another user, the desired target, is located. This rendezvous system can be used to deliver invitations to sessions, as is accomplished with the INVITE method, but other data, such as subscriptions and notifications, can be delivered. As such, most of the generic components of SIP as they relate to message routing are useful and needed for this extension, and most of those related specifically to INVITE, BYE, ACK, and CANCEL processing are not needed. This section outlines those components needed, and those not needed, for presence. 12.1 Needed components The following are the SIP components needed in a PA, PUA, or subscriber (all three are classified as user agents in SIP terminology) to support this extension: o Basic SIP parser, capable of generating To, From, Call-ID, CSeq, To, Via, Route, Accept, Allow, Require, Record-Route, Expires, Contact, Content-Length, and Content-Type headers, in addition to the request and response line. o UDP transmission mechanisms for non-INVITE requests, which is nothing more than a periodic retransmit of a request with exponential backoff. o Implementation of the client and server state machine for non-INVITE requests (used for reliable transport), documented in Section 10.4.1 of SIP [2]. o The ability to send SIP REGISTER requests, and process responses, and refresh those registrations. o Construction and usage of Route headers. o Support the Require mechanism for protocol extension, as defined in Section 6.30 of RFC 2543. o Reject requests with unknown methods, returning an Allow header in the response. o Reject requests with unknown bodies, returning an Accept header in the response. o Send and process SIP responses based solely on the 100s digit. o Send responses based on the Via header processing rules of Section 6.40 If a UA wishes to implement security, it needs to support the security mechanisms defined in RFC 2543. A presence server must additionally act as a proxy, and therefore must additionally be able to: o Parse and generate SIP messages, understanding the To, From, Call-ID, CSeq, Via, Route, Record-Route, and Proxy-Require headers, in addition to the request and response line. o If co-located with a registrar, process SIP REGISTER requests and generate responses o Perform the proxying functions described in Section 12 of RFC 2543; these rules mainly concern connection management, Via processing, loop detection, and transport. 12.2 Components not needed User agents supporting presence do not need to support the following SIP capabilities: o Processing of INVITE, ACK, CANCEL, BYE requests o Support for the INVITE reliability mechanisms and state machines o multiple 200 OK responses o SDP processing o re-INVITEs Elimination of INVITE processing alone results in a substantial reduction in required features. 1310 Example message flowsTHeThe following subsections exhibit example message flows, to further clarify behavior of the protocol.13.110.1 Client to Client Subscription with Presentity State Changes This call flow illustrates subscriptions and notifications that do not involve a presence server. The watcher subscribes to thepresentitypresentity, and thepresentity includes its current statesubscription is accepted, resulting inthe 200 OK response message.a 202 Accepted response. The presentity subsequently changes state (is on the phone), resulting in a new notification. The flow finishes with the watcher canceling the subscription. Watcher Presentity ------- ----------- | F1 SUBSCRIBE | | ----------------------------->| | F2200 OK202 Accepted | |<------------------------------| | F3 NOTIFY | |<------------------------------| | F4 200 OK | |------------------------------>| | F5 NOTIFY | |<------------------------------| | F6 200 OK | |------------------------------>| | F7 SUBSCRIBE (unsub) | |------------------------------>| | F8200 OK202 Accepted | |<------------------------------| Message Details F1 SUBSCRIBE watcher -> presentity SUBSCRIBE sip:presentity@pres.example.com SIP/2.0 Via: SIP/2.0/UDP watcherhost.example.com:5060 From: User<sip:user@watcherhost.example.com><pres:user@example.com> To: Resource<sip:presentity@pres.example.com><pres:presentity@example.com> Call-ID: 3248543@watcherhost.example.com CSeq : 1 SUBSCRIBE Expires: 600 Accept:application/xpidf+xml, text/lpidfapplication/xpidf+xml Event: presence Contact: sip:user@watcherhost.example.com F2200 OK202 Accepted presentity->watcher SIP/2.0200 OK202 Accepted Via: SIP/2.0/UDP watcherhost.example.com:5060 From: User<sip:user@watcherhost.example.com><pres:user@example.com> To: Resource<sip:presentity@pres.example.com><pres:presentity@example.com>;tag=88a7s Call-ID: 3248543@watcherhost.example.com Cseq: 1 SUBSCRIBE Event: presence Expires: 600Content-Type: application/xpidf+xml Content-Length: 351 <?xml version="1.0"?> <!DOCTYPE presence PUBLIC "-//IETF//DTD RFCxxxx XPIDF 1.0//EN" "xpidf.dtd"> <presence> <presentity uri="sip:presentity@pres.example.com;method=SUBSCRIBE"/> <atom id="779js0a98"> <address uri="sip:presentity@pres.example.com;method=INVITE"> <status status="open"/> </address> </atom> </presence>Contact: sip:presentity@pres.example.com F3 NOTIFY Presentity->watcher NOTIFY sip:user@watcherhost.example.com SIP/2.0 Via: SIP/2.0/UDP pres.example.com:5060 From: Resource<sip:presentity@pres.example.com><pres:presentity@example.com>;tag=88a7s To: User<sip:user@watcherhost.example.com><pres:user@example.com> Call-ID: 3248543@watcherhost.example.com CSeq: 1 NOTIFY Event: presence Content-Type: application/xpidf+xml Content-Length:352120 <?xml version="1.0"?><!DOCTYPE presence PUBLIC "-//IETF//DTD RFCxxxx XPIDF 1.0//EN" "xpidf.dtd"> <presence> <presentity uri="sip:presentity@pres.example.com;method=SUBSCRIBE"/> <atom id="779js0a98"> <address uri="sip:presentity@pres.example.com;method=INVITE"> <status status="inuse"/> </address> </atom><presence entityInfo="pres:presentity@example.com"> <tuple destination="sip:presentity@example.com" status="open"/> </presence> F4 200 OK watcher->presentity SIP/2.0 200 OK Via: SIP/2.0/UDP pres.example.com:5060 From: Resource<sip:presentity@pres.example.com><pres:presentity@example.com> To: User<sip:user@watcherhost.example.com><pres:user@example.com> Call-ID: 3248543@watcherhost.example.com CSeq: 1 NOTIFY F5 NOTIFY Presentity->watcher NOTIFY sip:user@watcherhost.example.com SIP/2.0 Via: SIP/2.0/UDP pres.example.com:5060 From: Resource<sip:presentity@pres.example.com><pres:presentity@example.com> To: User<sip:user@watcherhost.example.com><pres:user@example.com> Call-ID: 3248543@watcherhost.example.com CSeq: 2 NOTIFY Event: presence Content-Type: application/xpidf+xml Content-Length:351120 <?xml version="1.0"?><!DOCTYPE presence PUBLIC "-//IETF//DTD RFCxxxx XPIDF 1.0//EN" "xpidf.dtd"> <presence> <presentity uri="sip:presentity@pres.example.com;method=SUBSCRIBE"/> <atom id="779js0a98"> <address uri="sip:presentity@pres.example.com;method=INVITE"> <status status="open"/> </address> </atom><presence entityInfo="pres:presentity@example.com"> <tuple destination="sip:presentity@example.com" status="closed"/> </presence> F6 200 OK watcher->presentity SIP/2.0 200 OK Via: SIP/2.0/UDP pres.example.com:5060 From: Resource<sip:presentity@pres.example.com><pres:presentity@example.com> To: User<sip:user@watcherhost.example.com><pres:user@example.com> Call-ID: 3248543@watcherhost.example.com CSeq: 2 NOTIFY F7 SUBSCRIBE watcher -> presentity SUBSCRIBE sip:presentity@pres.example.com SIP/2.0 Via: SIP/2.0/UDP watcherhost.example.com:5060 From: User<sip:user@watcherhost.example.com><pres:user@example.com> To: Resource<sip:presentity@pres.example.com><pres:presentity@example.com> Call-ID: 3248543@watcherhost.example.com Event: presence CSeq : 2 SUBSCRIBE Expires: 0 Accept:application/xpidf+xml, text/lpidfapplication/xpidf+xml Contact: sip:user@watcherhost.example.com F8200 OK202 Accepted presentity->watcher SIP/2.0200 OK202 Accepted Via: SIP/2.0/UDP watcherhost.example.com:5060 From: User<sip:user@watcherhost.example.com><pres:user@example.com> To: Resource<sip:presentity@pres.example.com><pres:presentity@example.com> Call-ID: 3248543@watcherhost.example.com Event: presence Cseq: 2 SUBSCRIBE Expires:0Content-Type: text/lpidf Content-Length: 113 To: sip:presentity@pres.example.com Contact: sip:presentity@pres.example.com;method=INVITE; description="open" 13.210.2 Presence Server with Client Notifications This call flow shows the involvement of a presence server in the handling of subscriptions. In this scenario, the client has indicated that it will handle subscriptions and thus notifications. The message flow shows a change of presence state by the client and a cancellation of the subscription by the watcher. Presence Watcher Server PUA | | F1 REGISTER | | |<---------------------| | | F2 200 OK | | |--------------------->| | F3 SUBSCRIBE | | |--------------------->| | | | F4 SUBSCRIBE | | |--------------------->| | | F5200 OK202 | | |<---------------------| | F6200 OK202 | | |<---------------------| | ||F7REGISTER |NOTIFY ||<---------------------|| |<--------------------------------------------+ | F8 200 OK | ||--------------------->||-------------------------------------------->| | | F9NOTIFYREGISTER | ||<--------------------------------------------+|<---------------------| | | F10 200 OK | ||-------------------------------------------->||--------------------->| | F11SUBSCRIBE | | |--------------------->|NOTIFY | | |<--------------------------------------------+ | F12SUBSCRIBE | | |--------------------->| | | F13 200 OK | | |<---------------------| | F14200 OK | ||<---------------------| ||-------------------------------------------->| Message Details F1 REGISTER PUA->server REGISTER sip:example.com SIP/2.0 Via: SIP/2.0/UDP pua.example.com:5060 To: <sip:resource@example.com> From: <sip:resource@example.com> Call-ID: 2818@pua.example.com CSeq: 1 REGISTER Contact:<sip:id@pua.example.com;method=MESSAGE><sip:id@pua.example.com>;methods="MESSAGE" ;description="open" Contact:<sip:id@pua.example.com;method=SUBSCRIBE><sip:id@pua.example.com>;methods="SUBSCRIBE" Expires: 600 F2 200 OK server->PUA SIP/2.0 200 OK Via: SIP/2.0/UDP pua.example.com:5060 To: <sip:resource@example.com> From: <sip:resource@example.com> Call-ID: 2818@pua.example.com CSeq: 1 REGISTER Contact:<sip:id@pua.example.com;method=MESSAGE><sip:id@pua.example.com>;methods="MESSAGE" ;description="open" Contact:<sip:id@pua.example.com;method=SUBSCRIBE><sip:id@pua.example.com>;methods="SUBSCRIBE" Expires: 600 F3 SUBSCRIBE watcher->server SUBSCRIBE sip:resource@example.com SIP/2.0 Via: SIP/2.0/UDP watcherhost.example.com:5060 From: User<sip:user@example.com><pres:user@example.com> To: Resource<sip:resource@example.com><pres:resource@example.com> Call-ID: 32485@watcherhost.example.com CSeq : 1 SUBSCRIBE Expires: 600 Event: presence Accept: application/xpidf+xml Contact: sip:user@watcherhost.example.com F4 SUBSCRIBE server->PUA SUBSCRIBE sip:id@pua.example.com SIP/2.0 Via: SIP/2.0/UDP server.example.com:5060 Via: SIP/2.0/UDP watcherhost.example.com:5060 From: User<sip:user@example.com><pres:user@example.com> To: Resource<sip:resource@example.com><pres:resource@example.com> Call-ID: 32485@watcherhost.example.com CSeq : 1 SUBSCRIBE Event: presence Expires: 600 Accept: application/xpidf+xml Contact: sip:user@watcherhost.example.com F5200 OK202 Accepted PUA->server SIP/2.0200 OK202 Accepted Via: SIP/2.0/UDP server.example.com:5060 Via: SIP/2.0/UDP watcherhost.example.com:5060 From: User<sip:user@example.com><pres:user@example.com> To: Resource<sip:resource@example.com><pres:resource@example.com>;tag=ffd2 Call-ID: 32485@watcherhost.example.com CSeq : 1 SUBSCRIBE Event: presence Expires: 600Content-Type: text/lpidf Content-Length: 115 To: sip:resource@example.com Contact: <sip:id@pua.example.com;method=MESSAGE> ;description="open"F6 200 OK server->watcher SIP/2.0200 OK202 Accepted Via: SIP/2.0/UDP watcherhost.example.com:5060 From: User<sip:user@example.com><pres:user@example.com> To: Resource<sip:resource@example.com><pres:resource@example.com>;tag=ffd2 Call-ID: 32485@watcherhost.example.com CSeq : 1 SUBSCRIBE Event: presence Expires: 600Content-Type: text/lpidf Content-Length: 115 To: sip:resource@example.com Contact: <sip:id@pua.example.com;method=MESSAGE> ;description="open"F7REGISTER PUA->server REGISTER sip:example.com SIP/2.0 Via: SIP/2.0/UDP pua.example.com:5060 To: <sip:resource@example.com> From: <sip:resource@example.com> Call-ID: 2818@pua.example.com CSeq: 2 REGISTER Contact: <sip:id@pua.example.com;method=MESSAGE> ;description="inuse" Expires: 600 F8 200 OK server->PUA SIP/2.0 200 OK Via: SIP/2.0/UDP pua.example.com:5060 To: <sip:resource@example.com> From: <sip:resource@example.com> Call-ID: 2818@pua.example.com CSeq: 2 REGISTER Contact: <sip:id@pua.example.com;method=MESSAGE> ;description="inuse"; expires=600 Contact: <sip:id@pua.example.com;method=SUBSCRIBE> ; expires=210 F9NOTIFY PUA->watcher NOTIFY sip:user@watcherhost.example.com SIP/2.0 Via: SIP/2.0/UDP pua.example.com:5060 To: User<sip:user@example.com><pres:user@example.com> From: Resource<sip:resource@example.com><pres:resource@example.com>;tag=ffd2 Call-ID: 32485@watcherhost.example.com CSeq : 1 NOTIFY Event: presence Content-Type:text/lpidfapplication/xpidf+xml Content-Length:116 To: sip:resource@example.com Contact: <sip:id@pua.example.com;method=MESSAGE> ;description="inuse" F10120 <?xml version="1.0"?> <presence entityInfo="pres:resource@example.com"> <tuple destination="im:resource@example.com" status="open"/> </presence> F8 200 OK watcher->PUA SIP/2.0 200 OK Via: SIP/2.0/UDP pua.example.com:5060 To: User<sip:user@example.com><pres:user@example.com> From: Resource<sip:resource@example.com><pres:resource@example.com>;tag=ffd2 Call-ID: 32485@watcherhost.example.com CSeq : 1 NOTIFYF11 SUBSCRIBE watcher->server SUBSCRIBE sip:resource@example.comF9 REGISTER PUA->server REGISTER sip:example.com SIP/2.0 Via: SIP/2.0/UDPwatcherhost.example.com:5060 From: User <sip:user@example.com>pua.example.com:5060 To:Resource<sip:resource@example.com> From: <sip:resource@example.com> Call-ID:32485@watcherhost.example.com CSeq :2818@pua.example.com CSeq: 2SUBSCRIBE Expires: 0REGISTER Contact:sip:user@watcherhost.example.com F12 SUBSCRIBE<sip:id@pua.example.com>;methods="MESSAGE" ;description="busy" Contact: <sip:id@pua.example.com>;methods="SUBSCRIBE" Expires: 600 F10 200 OK server->PUASUBSCRIBE sip:resource@example.comSIP/2.0 200 OK Via: SIP/2.0/UDPserver.example.com:5060 Via: SIP/2.0/UDP watcherhost.example.com:5060 From: User <sip:user@example.com>pua.example.com:5060 To:Resource<sip:resource@example.com> From: <sip:resource@example.com> Call-ID:32485@watcherhost.example.com CSeq :2818@pua.example.com CSeq: 2SUBSCRIBE Expires: 0REGISTER Contact: <sip:id@pua.example.com>;methods="MESSAGE" ;description="busy" Contact: <sip:id@pua.example.com>;methods="SUBSCRIBE" Expires: 600 F11 NOTIFY PUA->watcher NOTIFY sip:user@watcherhost.example.comF13 200 OK PUA->serverSIP/2.0200 OK Via: SIP/2.0/UDP server.example.com:5060Via: SIP/2.0/UDPwatcherhost.example.com:5060 From: User <sip:user@example.com>pua.example.com:5060 To: User <pres:user@example.com> From: Resource<sip:resource@example.com><pres:resource@example.com>;tag=ffd2 Call-ID: 32485@watcherhost.example.com CSeq : 2SUBSCRIBENOTIFY Event: presence Content-Type:text/lpidfapplication/xpidf+xml Content-Length:115 To: sip:resource@example.com Contact: <sip:id@pua.example.com;method=MESSAGE> ; description="open" F14120 <?xml version="1.0"?> <presence entityInfo="pres:resource@example.com"> <tuple destination="im:resource@example.com" status="busy"/> </presence> F12 200 OKserver->watcherwatcher->PUA SIP/2.0 200 OK Via: SIP/2.0/UDPwatcherhost.example.com:5060 From: User <sip:user@example.com>pua.example.com:5060 To: User <pres:user@example.com> From: Resource<sip:resource@example.com><pres:resource@example.com>;tag=ffd2 Call-ID: 32485@watcherhost.example.com CSeq : 2SUBSCRIBE Content-Type: text/lpidf Content-Length: 115 To: sip:resource@example.com Contact: <sip:id@pua.example.com;method=MESSAGE> ; description="open" 13.3NOTIFY 10.3 Presence Server Notifications This message flow illustrates how the presence server can be the responsible for sending notifications for a presentity. The presence server will do this if the presentity has not sent a registration indicating an interest in handling subscriptions. This flow assumes that the watcher has previously been authorized to subscribe to this resource at the server. Watcher Server PUA | F1 SUBSCRIBE | | |------------------>| | | F2200 OK202 Accepted | | |<------------------| | ||F3REGISTER | | |<-------------------| | | F4 200 OK | | |------------------->| | F5NOTIFY | | |<------------------| | |F6F4 200 OK | | |------------------>| | | |F7F5 REGISTER | | |<-------------------| | |F8F6 200 OK | | |------------------->| |F9F7 NOTIFY | | |<------------------| | |F10F8 200 OK | | |------------------>| | Message Details F1 SUBSCRIBE watcher->server SUBSCRIBE sip:resource@example.com SIP/2.0 Via: SIP/2.0/UDP watcherhost.example.com:5060 To:<sip:resource@example.com><pres:resource@example.com> From:<sip:user@example.com><pres:user@example.com> Call-ID: 2010@watcherhost.example.com CSeq: 1 SUBSCRIBE Event: presence Accept: application/xpidf+xml Contact: <sip:user@watcherhost.example.com> Expires: 600 F2200202 OK server->watcher SIP/2.0200 OK202 Accepted Via: SIP/2.0/UDP watcherhost.example.com:5060 To:<sip:resource@example.com><pres:resource@example.com>;tag=ffd2 From:<sip:user@example.com><pres:user@example.com> Call-ID: 2010@watcherhost.example.com CSeq: 1 SUBSCRIBE Event: presence Expires: 600Content-Type: text/lpidf Content-Length: 114 To: sip:resource@example.comContact:<sip:resource@example.com;method=MESSAGE> ;description="closed" F3 REGISTER PUA->server REGISTERsip:example.comSIP/2.0 Via: SIP/2.0/UDP pua.example.com:5060 To: <sip:resource@example.com> From: <sip:resource@example.com> Call-ID: 110@pua.example.com CSeq: 1 REGISTER Contact: <sip:id@pua.example.com;method=MESSAGE> ;description="open" Expires: 600 F4 200 OK server->PUA SIP/2.0 200 OK Via: SIP/2.0/UDP pua.example.com:5060 To: <sip:resource@example.com> From: <sip:resource@example.com> Call-ID: 110@pua.example.com CSeq: 1 REGISTER Contact: <sip:id@pua.example.com;method=MESSAGE> ; description="open"; expires=600 F5F3 NOTIFY server-> watcher NOTIFY sip:user@watcherhost.example.com SIP/2.0 Via: SIP/2.0/UDP server.example.com:5060 From:<sip:resource@example.com><pres:resource@example.com>;tag=ffd2 To:<sip:user@example.com><pres:user@example.com> Call-ID: 2010@watcherhost.example.com Event: presence CSeq: 1 NOTIFY Content-Type:text/lpidfapplication/xpidf+xml Content-Length:111 To: sip:resource@example.com Contact: <sip:id@pua.example.com;method=MESSAGE> ; description="open" F6120 <?xml version="1.0"?> <presence entityInfo="pres:resource@example.com"> <tuple destination="im:resource@example.com" status="open"/> </presence> F4 200 OK SIP/2.0 200 OK Via: SIP/2.0/UDP server.example.com:5060 From:<sip:resource@example.com><pres:resource@example.com>;tag=ffd2 To:<sip:user@example.com><pres:user@example.com> Call-ID: 2010@watcherhost.example.com CSeq: 1 NOTIFYF7F5 REGISTER REGISTER sip:example.com SIP/2.0 Via: SIP/2.0/UDP pua.example.com:5060 To: <sip:resource@example.com> From: <sip:resource@example.com> Call-ID: 110@pua.example.com CSeq: 2 REGISTER Contact:<sip:id@pua.example.com;methods=MESSAGE><sip:id@pua.example.com>;methods="MESSAGE" ;description="Away from keyboard" Expires: 600F8F6 200 OK Via: SIP/2.0/UDP pua.example.com:5060 To: <sip:resource@example.com> From: <sip:resource@example.com> Call-ID: 110@pua.example.com CSeq: 2 REGISTER Contact:<sip:id@pua.example.com;methods=MESSAGE><sip:id@pua.example.com>;methods="MESSAGE" ; description="Away from keyboard" ; expires=600F9F7 NOTIFY NOTIFY sip:user@watcherhost.example.com SIP/2.0 Via: SIP/2.0/UDP server.example.com:5060 From:<sip:resource@example.com><pres:resource@example.com>;tag=ffd2 To:<sip:user@example.com><pres:user@example.com> Call-ID: 2010@watcherhost.example.com CSeq: 2 NOTIFY Event: presence Content-Type:text/lpidfapplication/xpidf+xml Content-Length:125 To: sip:resource@example.com Contact: <sip:id@pua.example.com;method=MESSAGE> ; description="Away from keyboard" F10 200 OK SIP/2.0 200 OK Via: SIP/2.0/UDP server.example.com:5060 From: <sip:resource@example.com> To: <sip:user@example.com> Call-ID: 2010@watcherhost.example.com CSeq: 2 NOTIFY 13.4 Presence Server Notifications with Client Authorization of Subscription This call flow expands on the call flow in 13.3 by showing how the Presence Server gets authorization for a new subscription120 <?xml version="1.0"?> <presence entityInfo="pres:resource@example.com"> <tuple destination="im:resource@example.com" status="Away fromthe client. The authorization is done using the QAUTH method defined in [9]. Presence Watcher Server PUA | | F1 REGISTER | | |<---------------------| | | F2 200 OK | | |--------------------->| | F3 SUBSCRIBE | | |--------------------->| | | F4 202 Accepted | | |<---------------------| | | | F5 QAUTH | | |--------------------->| | | F6 200 OK | | |<---------------------| | F7 NOTIFY | | |<---------------------| | | F8 200 OK | | |--------------------->| | | | F9 REGISTER | | |<---------------------| | | F10 200 OK | | |--------------------->| | F11 NOTIFY | | |<---------------------| | | F12 200 OK | | |--------------------->| | | F13 SUBSCRIBE | | |--------------------->| | | F14 200 OK | | |<---------------------| | Message Details: F1 REGISTER PUA->server REGISTER sip:example.com SIP/2.0 Via: SIP/2.0/UDP pua.example.com:5060 To: <sip:resource@example.com> From: <sip:resource@example.com> Call-ID: 12@pua.example.com CSeq: 1 REGISTER Contact: <sip:id@pua.example.com;methods=MESSAGE> ;description="open" Contact: <sip:id@pua.example.com;methods=QAUTH> Expires: 600 F2 200 OK server->PUA SIP/2.0 200 OK Via: SIP/2.0/UDP pua.example.com:5060 To: <sip:resource@example.com> From: <sip:resource@example.com> Call-ID: 12@pua.example.com CSeq: 1 REGISTER Contact: <sip:id@pua.example.com;methods=MESSAGE> ;description="open" Contact: <sip:id@pua.example.com;methods=QAUTH> Expires: 600 F3 SUBSCRIBE watcher->server SUBSCRIBE sip:resource@example.com SIP/2.0 Via: SIP/2.0/UDP watcherhost.example.com:5060 From: User <sip:user@example.com> To: Resource <sip:resource@example.com> Call-ID: 3248546@watcherhost.example.com CSeq: 1 SUBSCRIBE Expires: 600 Contact: sip:user@watcherhost.example.com F4 202 Accepted server->watcher SIP/2.0 202 Accepted Via: SIP/2.0/UDP watcherhost.example.com:5060 From: User <sip:user@example.com> To: Resource <sip:resource@example.com> Call-ID: 3248546@watcherhost.example.com CSeq: 1 SUBSCRIBE Expires: 600 F5 QAUTH server->PUA QAUTH sip:id@pua.example.com SIP/2.0 Via: SIP/2.0/UDP server.example.com:5060 From: User <sip:user@example.com> To: Resource <sip:resource@example.com> Call-ID: 2874@server.example.com CSeq: 1 QAUTH Expires: Sun, 14 Jun 2036 00:00:00 GMT Contact: sip:server.example.com F6 200 OK PUA->server SIP/2.0 200 OK Via: SIP/2.0/UDP server.example.com:5060 From: User <sip:user@example.com> To: Resource <sip:resource@example.com> Call-ID: 2874@server.example.com CSeq: 1 QAUTH Expires: Sun, 14 Jun 2036 00:00:00 GMT F7 NOTIFY server->watcher NOTIFY sip:user@watcherhost.example.com SIP/2.0 Via: SIP/2.0/UDP server.example.com:5060 From: <sip:resource@example.com> To: <sip:user@example.com> Call-ID: 3248546@watcherhost.example.com CSeq: 1 NOTIFY Content-Type: text/lpidf Content-Length: 111 To: sip:resource@example.com Contact: <sip:resource@example.com;method=MESSAGE> ; description="open"keyboard"/> </presence> F8 200 OK SIP/2.0 200 OK Via: SIP/2.0/UDP server.example.com:5060 From:<sip:resource@example.com> To: <sip:user@example.com> Call-ID: 3248546@watcherhost.example.com CSeq: 1 NOTIFY F9 REGISTER PUA->server REGISTER sip:example.com SIP/2.0 Via: SIP/2.0/UDP pua.example.com:5060 To: <sip:resource@example.com> From: <sip:resource@example.com> Call-ID: 12@pua.example.com CSeq: 2 REGISTER Contact: <sip:id@pua.example.com;methods=MESSAGE> ;description="hiding in storm shelter" Contact: <sip:id@pua.example.com;methods=QAUTH> Expires: 600 F10 200 OK server->PUA SIP/2.0 200 OK Via: SIP/2.0/UDP pua.example.com:5060 To: <sip:resource@example.com> From: <sip:resource@example.com> Call-ID: 12@pua.example.com CSeq: 2 REGISTER Contact: <sip:id@pua.example.com;methods=MESSAGE> ;description="hiding in storm shelter" Contact: <sip:id@pua.example.com;methods=QAUTH> Expires: 600 F11 NOTIFY server->watcher NOTIFY sip:user@watcherhost.example.com SIP/2.0 Via: SIP/2.0/UDP server.example.com:5060 From: <sip:resource@example.com> To: <sip:user@example.com> Call-ID: 3248546@watcherhost.example.com CSeq: 2 NOTIFY Content-Type: text/lpidf Content-Length: 131 To: sip:resource@example.com Contact: <sip:resource@example.com;method=MESSAGE> ; description="hiding in storm shelter" F12 200 OK watcher->server SIP/2.0 200 OK Via: SIP/2.0/UDP server.example.com:5060 From: <sip:resource@example.com><sip:resource@example.com>;tag=ffd2 To:<sip:user@example.com><pres:user@example.com> Call-ID:3248546@watcherhost.example.com2010@watcherhost.example.com CSeq: 2 NOTIFYF13 SUBSCRIBE watcher->server SUBSCRIBE sip:resource@example.com SIP/2.0 Via: SIP/2.0/UDP watcherhost.example.com:5060 From: User <sip:user@example.com> To: Resource <sip:resource@example.com> Call-ID: 3248546@watcherhost.example.com CSeq: 2 SUBSCRIBE Expires: 0 Contact: sip:user@watcherhost.example.com F14 200 OK server->watcher SIP/2.0 200 OK Via: SIP/2.0/UDP watcherhost.example.com:5060 From: User <sip:user@example.com> To: Resource <sip:resource@example.com> Call-ID: 3248546@watcherhost.example.com CSeq: 2 SUBSCRIBE Content-Type: text/lpidf Content-Length: 131 To: sip:resource@example.com Contact: <sip:resource@example.com;method=MESSAGE> ; description="hiding in storm shelter" 13.5 Delayed Subscription Approval11 Open Issues Thecall flow is similar to 13.4 with the difference being that the clientfollowing iscurrently offline. A watcher subscribes to a resource for whichtheserver but has not been authorized and a PUA forlist of known open issues: o This draft recommends thatresource is not available. The server queues the request until a PUA becomes available. The PUA grants permission, but sincetheoriginal subscription had expired, the server does not generate a NOTIFY. The watcher subscribes again, after the REGISTER has expired,To andhas its subscription approved. Note that since thereFrom field areno contacts registered for the resource atpopulated with presence URLs rather than sip URLs. Is thattime,reasonable? Will this lead to incompatibilities in proxies? Is there any issues with CPIM if thepresence documentSIP URL format isvacuous. watcher server PUA | | | | F1 SUBSCRIBE | | |--------------------->| (PUA not "online") | | F2 202 Accepted | | |<---------------------| | | (subscription expires) | | | F3 REGISTER | | |<--------------------| | | F4 200 OK | | |-------------------->| | | F5 QAUTH | | |-------------------->| | | F6 200 OK | | |<--------------------| | (registration expires)| | F7 SUBSCRIBE | | |--------------------->| | | F8 200 OK | | |<---------------------| | Message Details F1 SUBSCRIBE watcher->server SUBSCRIBE sip:resource@example.com SIP/2.0 Via: SIP/2.0/UDP watcherhost.example.com:5060 From: User <sip:user@example.com> To: Resource <sip:resource@example.com> Call-ID: 3248543@watcherhost.example.com CSeq: 1 SUBSCRIBE Date: Mon, 12 Jun 2000 16:00:00 GMT Expires: 600 Contact: sip:user@watcherhost.example.com F2 202 Accepted server->watcher SIP/2.0 202 Accepted Via: SIP/2.0/UDP watcherhost.example.com:5060 From: User <sip:user@example.com> To: Resource <sip:resource@example.com> Call-ID: 3248543@watcherhost.example.com CSeq: 1 SUBSCRIBE Expires: 600 F3 REGISTER PUA->server REGISTER sip:example.com SIP/2.0 Via: SIP/2.0/UDP pua.example.com:5060 To: <sip:resource@example.com> From: <sip:resource@example.com> Call-ID: 2001@pua.example.com CSeq: 1 REGISTER Date: Wed, 14 Jun 2000 09:57:16 GMT Contact: <sip:id@pua.example.com;methods=MESSAGE; description="open"> Contact: <sip:id@pua.example.com;methods=QAUTH> Expires: 600 F4 200 OK server->PUA SIP/2.0 200 OK Via: SIP/2.0/UDP pua.example.com:5060 To: <sip:resource@example.com> From: <sip:resource@example.com> Call-ID: 2001@pua.example.com CSeq: 1 REGISTER Contact: <sip:id@pua.example.com;methods=MESSAGE; description="open"> Contact: <sip:id@pua.example.com;methods=QAUTH> Expires: 600 F5 QAUTH server->PUA QAUTH sip:id@pua.example.com SIP/2.0 Via: SIP/2.0/UDP server.example.com:5060 From: User <sip:user@example.com> To: Resource <sip:resource@example.com> Call-ID: 47774@server.example.com CSeq: 1 QAUTH Expires: Sun, 14 Jun 2036 00:00:00 GMT Contact: sip:server.example.com F6 200 OK PUA->server SIP/2.0 200 OK Via: SIP/2.0/UDP server.example.com:5060 From: User <sip:user@example.com> To: Resource <sip:resource@example.com> Call-ID: 47774@server.example.com CSeq: 1 QAUTH Expires: Sun, 14 Jun 2036 00:00:00 GMT F7 SUBSCRIBE watcher->server SUBSCRIBE sip:resource@example.com SIP/2.0 Via: SIP/2.0/UDP watcherhost.example.com:5060 From: User <sip:user@example.com> To: Resource <sip:resource@example.com> Call-ID: 3248544@watcherhost.example.com CSeq: 1 SUBSCRIBE Date: Thu, 15 Jun 2000 07:22:15 GMT Expires: 600 Contact: sip:user@watcherhost.example.com F8 200 OK server->watcher SIP/2.0 200 OK Via: SIP/2.0/UDP watcherhost.example.com:5060 From: User <sip:user@example.com> To: Resource <sip:resource@example.com> Call-ID: 3248544@watcherhost.example.com CSeq: 1 SUBSCRIBE Expires: 600 Content-Type: text/lpidf Content-Length: 31 To: sip:resource@example.com 14 Checklist of requirementsused? Thissection examines the requirements for presence, as specified in RFC2779 [18], and indicates how each requirement is addressed by this extension. Only the requirements related to presence are discussed here. Requirements for instant messagingdepends on what components of a message arediscussed in [19] and presence data formatssigned in[10,11]. "Requirement 2.1.1. The protocols MUST allowCPIM. o Rate limitations on NOTIFY: do we want that? How do we pick aPRESENCE SERVICE to be available independent of whether an INSTANT MESSAGE SERVICEvalue? 5 seconds isavailable, and vice-versa." Presence and IM are supported by completely separate protocols, and do not depend on each other. "Requirement 2.1.2. The protocols must not assumearbitrary. o Merging of presence data from multiple PA has been removed. Is thatan INSTANT INBOX is necessarily reached byOK? o Placing IM URLs in thesame IDENTIFIER as thatContact header of aPRESENTITY. Specifically, the protocols must assumeREGISTER: is thatsome INSTANT INBOXes may have no associated PRESENTITIES, and vice versa."OK? What does it mean? o Thecomplete separationprocess ofIM andmigrating subscriptions from a presenceallows different identifiers to be used for each. "Requirement 2.1.3. The protocols MUST also allow an INSTANT INBOXserver tobe reached via the same IDENTIFIER as the IDENTIFIER of some PRESENTITY." The architecture provided here allows for the IM and presence identifiersPUA is not likely tobework in thesame, if so desired. "Requirement 2.1.4. The administrationcase where subscription refreshes use tags andnaming of ENTITIES withinRoute headers. So, we have agiven DOMAIN MUST be able to operate independently of actions in any other DOMAIN." This requirementchoice. Either migration ismet by SIP. SIP uses email-like identifiers which consist of a user name at a domain. Administration of user namesdisallowed, and we keep with leg oriented subscriptions, or migration isdone completely within the domain,allowed, andthese user names havethere is nodefined rulestags ororganization that needs to be known outside of the domain in order forRoute's associated with subscriptions. o Converting SIP URLs back tooperate. "Requirement 2.1.5.pres URLs. o Theprotocol MUST allow for an arbitrary number of DOMAINS within the NAMESPACE." This requirement is met by SIP.SIPuses standard DNS domains, whichto CPIM and CPIM to SIP gateways are notrestricted in number. "Requirement 2.2.1. It MUST be possible for ENTITIES in one DOMAIN to interoperate with ENTITIES in another DOMAIN, without the DOMAINS having previously been awarestateless, because ofeach other." This requirement is met by SIP, as it is essential for establishing sessions as well. DNS SRV [20] records are usedthe need todiscover servers formaintain Route, Call-ID, CSeq, and other parameters. Perhaps we can ask CPIM to define aparticular service withintoken value which is sent in adomain. They areCPIM request and returned in ageneralization of MX records, used for email routing. SIP defines procedures for usage of DNS recordsCPIM response. Would that help? o Need tofind servers in another domains, which include SRV lookups. This allows domainsspecify how tocommunication without prior setup. "Requirement 2.2.2: The protocol MUST be capable of meeting its other functionaltake Contacts from REGISTER andperformance requirements even when there are millions of ENTITIES withinbuild asingle DOMAIN." Whilst itpresence document. One obvious thing ishard to judge whether this can be met by examining the architecture of a protocol, SIP has numerous mechanisms for achieving large scales of users within a domain. It allows hierarchies of servers, whereby the namespace can be partitioned among servers. Servers near the top ofthat thehierarchy, used solely for routing, can be stateless, providing excellent scale. "Requirement 2.2.3: The protocol MUST be capable of meeting its other functional and performance requirements whencontact addresses don't go in thereare millions of DOMAINS withindirectly; you probably want to put thesingle NAMESPACE." The usageaddress ofDNS for dividing the namespace into domains providesrecord, otherwise calls might not go through thesame scale as todays email systems, which support millions of DOMAINS. "Requirement 2.2.4:proxy. 12 Changes from -00 Theprotocol MUST be capable of meeting its other functional and performance requirements when every single SUBSCRIBERdocument hasSUBSCRIPTIONSbeen completely rewritten, tohundreds of PRESENTITIES." Section 9 discussesreflect themeans by which our extension provides scale. "Requirement 2.2.5: The protocol MUST be capable of meeting its other functionalchange from a sales pitch andperformance requirements when hundreds of distinct SUBSCRIBERS have SUBSCRIPTIONSeducational document, to asingle PRESENTITY." Section 9 discusses the means by which our extension provides scale. "Requirement 2.2.6: Themore formal protocolMUST be capable of meeting its other functional and performance requirements when every single SUBSCRIBERspecification. It hasSUBSCRIPTIONSalso been changed toPRESENTITIES in hundreds of distinct DOMAINS." Section 9 discusses the means by which our extension provides scale. "Requirement 2.4.1: The protocol MUST allowalign with thecreation of a SUBSCRIPTION both directly and via intermediaries, such as PROXIES."SIPsupports proxies, but they are optional. User agents can communicate directly. This feature is inherited by this extension. "Requirement 2.4.2:event architecture and with CPIM. The specific protocolMUST allow the sending of a NOTIFICATION both directly and via intermediaries, such as PROXIES."changes resulting from this rewrite are: o Theuse of Record-Routing described here, andEvent header must now be used inRFC2543 [2] means that notifications can go directly from presence agent to subscriber, or through proxies, asthepolicy of each proxy dictates. "Requirement 2.4.4: The protocol proxying facilities and transport practices MUST allow ADMINISTRATORS ways to enable and disable protocol activity through existingSUBSCRIBE andcommonly-deployed FIREWALLS.NOTIFY requests. o Theprotocol MUST specify how it can be effectively filtered by such FIREWALLS." Although SIP itself runs on port 5060 by default, any other portSUBSCRIBE message canbe used. It is simple to specify that presence should run ononly have adifferent port, if so desired. "Requirement 2.5.1:single Contact header. -00 allowed for more than one. o Theprotocol MUST provide means to ensure confidence that a received message (NOTIFICATION or INSTANT MESSAGE) has not been corrupted or tampered with." SIP provides end to end authenticationFrom andmessage integrity using PGP; other mechanismsTo headers canbe specified. "Requirement 2.5.2.contain presence URIs. o Theprotocol MUST provide meansRequest-URI can contain a presence URI. o Subscriptions are responded toensure confidence thatwith areceived message (NOTIFICATION202 if they are pending orINSTANT MESSAGE) hasaccepted. o Presence documents are notbeen recordedreturned in the body of the SUBSCRIBE response. Rather, they are sent in a separate NOTIFY. This more cleanly separates subscription andplayed backnotification, and is mandated byan adversary." Replay attacks can be prevented through either challenge-response authentication, timestamp based checks,alignment with CPIM. o Authentication is now mandatory at the PA. Authorization is now mandatory at the PA. o Fake NOTIFY is sent for pending orstoragerejected subscriptions. o A rate limit on notifications was introduced. o Merging ofpreviously used sequence numbers and transaction identifiers. See Section 10.4. "Requirement 2.5.3:presence data has been removed. o Theprotocol MUST provide means to ensure that a sent message (NOTIFICATION or INSTANT MESSAGE) is only readable by ENTITIESsubscriber rejects notifications received with tags that don't match those in thesender allows." SIP provides end-to-end encryption using PGP. "Requirement 2.5.4: The protocol MUST allow any client202 response tousethe SUBSCRIBE. This meansto ensure non-corruption, non-playback, and privacy, but the protocol MUST NOT requirethatall clients use these means at all times." SIPs security mechanisms are optional. "Requirement 3.1.1: All ENTITIES MUST produce and consume at least a common base formatonly one PA will hold subscription state forPRESENCE INFORMATION." Here, we mandate the Lightweight Presence Information Data Format (LPIDF) [10]. "Requirement 3.2.1. A FETCHER MUST be able to fetch a PRESENTITY's PRESENCE INFORMATION even when the PRESENTITY is OUT OF CONTACT." The extension described here defines a fetch operation that can be made onapresence server; this server handles subscriptions and fetches whenparticular subscriber for apresence client is not available. "Requirement 3.2.2: A SUBSCRIBER MUST be able to requestparticular presentity. o IM URLs allowed in Contacts in register o CPIM mappings defined. o Persistent connections recommended for firewall traversal. Obtaining Authorization When aSUBSCRIPTION tosubscription arrives at aPRESENTITY's PRESENCE INFORMATION, even whenPA, thePRESENTITY is OUT OF CONTACT." Subscriptions are handledsubscription needs to be authorized bya presence server whenthepresence clientpresentity. In some cases, the presentity may have provided authorization ahead of time. However, in many cases, the subscriber is notavailable. "Requirement 3.2.3: If the PRESENCE SERVICE has SUBSCRIPTIONS for a PRESENTITY's PRESENCE INFORMATION, andpre-authorized. In thatPRESENCE INFORMATION changes,case, thePRESENCE SERVICE MUST deliver a NOTIFICATIONPA needs toeach SUBSCRIBER, unless prevented byquery the presentity for authorization. In order to do this, we define an implicit subscription at thePRESENTITY's ACCESS RULES."PA. This subscription issupported as described in Section 7. "Requirement 3.2.4. The protocol MUST provide a mechanismfordetecting whenaPRESENTITY or SUBSCRIBER has gone OUT OF CONTACT." The SIP REGISTER methodvirtual presentity, which isusedthe "set of subscriptions forthis purpose. "Requirement 3.2.5: The protocol MUST NOT depend on a PRESENTITY or SUBSCRIBER gracefully tellingpresentity X", and theservicesubscriber to thatit will no longer be in communication, sincevirtual presentity is X itself. Whenever aPRESENTITY or SUBSCRIBER may go OUT OF CONTACT duesubscription is received for X, the virtual presentity changes state tounanticipated failures." Registrationsreflect the new subscription for X. This state changes for subscriptions that aresoft state,approved andwill timeout if not refreshed. "Requirement 3.3.1: The protocol MUST include mechanisms to allow PRESENCE INFORMATION to be cached." Although not explicitly described here, this is easily supported as an implementation improvement. "Requirement 3.3.2: The protocol MUST include mechanisms to allow cached PRESENCE INFORMATION to be updatedfor ones that are pending. As a result of this, whenthe master copy changes." Presence data contains timestampsa subscription arrives for which authorization is needed, the state of the virtual presentity changes to indicateits expiration; this forcesafetch to go to the PA after expiration. "Requirement 3.3.3:pending subscription. Theprotocol caching facilities MUST NOT circumvent established ACCESS RULES or restrict choiceentire state ofauthentication/encryption mechanisms." The protocol does not explicitly circumvent access rules when caching is used; however, ifthecaching server does not choosevirtual presentity is then sent toauthenticate or authorize subscribers, no protocol intheworldsubscriber (the presentity itself). This way, the user behind that presentity canprevent this. "Requirement 3.4.1 When a PRESENTITY changes its PRESENCE INFORMATION, any SUBSCRIBER tosee thatinformation MUST be notified ofthere are pending subscriptions. It can then use some non-SIP means to install policy in thechanged information rapidly, except when such notification is entirely prevented by ACCESS RULES.server regarding this new user. Thisrequirement is met if each SUBSCRIBER's NOTIFICATIONpolicy istransported as rapidly as an INSTANT MESSAGE would be transportedthen used toan INSTANT INBOX." SIP is engineeredeither accept or reject the subscription. A call flow forrapid transfer of messages.this is shown in Figure 3. Infact, SIP (andthe case where the presentity is not online, the problem is also straightforward. When the user logs into their presenceextension) allows notificationsclient, it can fetch the state of the virtual presentity for X, check for pending subscriptions, and for each of them, upload a new policy which indicates the appropriate action togo directly from presence agenttake. A data format tosubscriber. 15represent the state of these virtual presentities can be found in [14]. A Acknowledgements We would like to thank the following people for their support and comments on this draft: Rick Workman Nortel Adam Roach Ericsson Sean Olson Ericsson Billy Biggs University of Waterloo Stuart Barkley UUNet Mauricio Arango SUN Richard Shockey Shockey Consulting LLC Jorgen Bjorkner Hotsip Henry Sinnreich MCI Worldcom Ronald Akers Motorola16B Authors Addresses Jonathan Rosenbergdynamicsoft| SUBSCRIBE X | | | -------------------> | | | | | | 202 Accepted | | | <------------------- | NOTIFY X-subscriptions| | |---------------------->| | | | | | 200Executive Drive Suite 120 West Orange,OK | | |<----------------------| | | | | | | | | HTTP POST w/ policy | | |<----------------------| | | | | | 200 OK | | |---------------------->| | | | | | | | | | Figure 3: Sequence diagram for online authorization dynamicsoft 72 Eagle Rock Avenue First Floor East Hanover, NJ0705207936 email: jdrosen@dynamicsoft.com Dean Willis dynamicsoft200 Executive Drive5100 Tennyson Parkway Suite120 West Orange, NJ 070521200 Plano, Texas 75024 email: dwillis@dynamicsoft.com Robert Sparks dynamicsoft200 Executive Drive5100 Tennyson Parkway Suite120 West Orange, NJ 070521200 Plano, Texas 75024 email: rsparks@dynamicsoft.com Ben Campbelldynamicsoft 200 Executive Drive5100 Tennyson Parkway Suite120 West Orange, NJ 070521200 Plano, Texas 75024 email: bcampbell@dynamicsoft.com Henning Schulzrinne Columbia University M/S 0401 1214 Amsterdam Ave. New York, NY 10027-7003 email: schulzrinne@cs.columbia.edu Jonathan Lennox Columbia University M/S 0401 1214 Amsterdam Ave. New York, NY 10027-7003 email: lennox@cs.columbia.edu Christian Huitema Microsoft Corporation One Microsoft Way Redmond, WA 98052-6399 email: huitema@microsoft.com Bernard Aboba Microsoft Corporation One Microsoft Way Redmond, WA 98052-6399 email: bernarda@microsoft.com David Gurle Microsoft Corporation One Microsoft Way Redmond, WA 98052-6399 email: dgurle@microsoft.com David Oran Cisco Systems 170 West Tasman Dr. San Jose, CA 95134 email: oran@cisco.com17C Bibliography [1] M. Day, J. Rosenberg, and H. Sugano, "A model for presence and instant messaging," Request for Comments 2778, Internet Engineering Task Force, Feb. 2000. [2] M. Handley, H. Schulzrinne, E. Schooler, and J. Rosenberg, "SIP: session initiation protocol," Request for Comments 2543, Internet Engineering Task Force, Mar. 1999. [3]H. Schulzrinne and J. Rosenberg, "SIP caller preferences and callee capabilities,"A. Roach, "Event notification in SIP," Internet Draft, Internet Engineering Task Force,Mar.Oct. 2000. Work in progress. [4]M. Handley and V. Jacobson, "SDP: session description protocol," Request for Comments 2327, Internet Engineering Task Force, Apr. 1998. [5] R. StewartD. Crocker et al. ,"Simple control transmission protocol,""A common profile for instant messaging (CPIM)," Internet Draft, Internet Engineering Task Force,Apr.Nov. 2000. Work in progress.[6] J. Rosenberg and[5] P. Calhoun, A. Rubens, H.Schulzrinne, "SCTP as a transport for SIP,"Akhtar, and E. Guttman, "DIAMETER base protocol," Internet Draft, Internet Engineering Task Force,JuneSept. 2000. Work in progress.[7][6] C. Rigney, S.KentWillens, A. Rubens, andR. Atkinson, "IP encapsulating security payload (ESP),"W. Simpson, "Remote authentication dial in user service (RADIUS)," Request for Comments2406,2865, Internet Engineering Task Force,Nov. 1998. [8]June 2000. [7] J. Boyle, R. Cohen, D.HarkinsDurham, S. Herzog, R. Rajan, andD. Carrel,A. Sastry, "Theinternet key exchange (IKE),"COPS (common open policy service) protocol," Request for Comments2409,2748, Internet Engineering Task Force,Nov. 1998. [9] J. Rosenberg, R. Sparks, D. Willis, B. Campbell,Jan. 2000. [8] H.Schulzrinne, J. Lennox, C. Huitema, B. Aboba,Schulzrinne andD. Gurle,J. Rosenberg, "SIPextensions for presence authorization,"caller preferences and callee capabilities," Internet Draft, Internet Engineering Task Force,JuneJuly 2000. Work in progress.[10][9] J. Rosenberg,R. Sparks,D.Willis, B. Campbell,Drew, and H. Schulzrinne,J. Lennox, C. Huitema, B. Aboba,"Getting SIP through firewalls andD. Gurle, "A lightweight presence information data format (LPIDF),"NATs," Internet Draft, Internet Engineering Task Force,JuneFeb. 2000. Work in progress.[11][10] J.Rosenberg, R. Sparks, D. Willis, B. Campbell,Rosenberg and H. Schulzrinne,J. Lennox, C. Huitema, B. Aboba,"SIP traversal through enterprise andD. Gurle, "A data format for presence using XML,"residential NATs and firewalls," Internet Draft, Internet Engineering Task Force,JuneNov. 2000. Work in progress.[12] J. Boyle, R. Cohen, D. Durham,[11] S.Herzog, R. Rajan,Kent andA. Sastry, "The COPS (common open policy service) protocol,"R. Atkinson, "IP encapsulating security payload (ESP)," Request for Comments2748, Internet Engineering Task Force, Jan. 2000. [13] J. Lennox and H. Schulzrinne, "CPL: a language for user control of internet telephony services," Internet Draft, Internet Engineering Task Force, Mar. 1999. Work in progress. [14] J. Lennox and H. Schulzrinne, "Transporting user control information in sip register payloads," Internet Draft,2406, Internet Engineering Task Force,Mar. 2000. Work in progress. [15]Nov. 1998. [12] T. Dierks and C. Allen, "The TLS protocol version 1.0," Request for Comments 2246, Internet Engineering Task Force, Jan. 1999.[16][13] B. Ramsdell and Ed, "S/MIME version 3 message specification," Request for Comments 2633, Internet Engineering Task Force, June 1999.[17][14] J. Rosenbergand H. Schulzrinne, "SIP extensions for managing persistent connections," Internet Draft, Internet Engineering Task Force, June 2000. Work in progress. [18] M. Day, S. Aggarwal, G. Mohr, and J. Vincent, "Instant messaging / presence protocol requirements," Request for Comments 2779, Internet Engineering Task Force, Feb. 2000. [19] J. Rosenberg, R. Sparks, D. Willis, B. Campbell, H. Schulzrinne, J. Lennox, C. Huitema, B. Aboba, and D. Gurle, "SIP extensionset al. , "An XML based format forinstant messaging,"watcher information," Internet Draft, Internet Engineering Task Force, June 2000. Work in progress.[20] A. Gulbrandsen, P. Vixie, and L. Esibov, "A DNS RR for specifying the location of services (DNS SRV)," Request for Comments 2782, Internet Engineering Task Force, Feb. 2000.Table of Contents 1 Introduction ........................................ 1 2Why use SIP as a base protocol for presence? ....... 3 3Definitions .........................................6 42 3 Overview of Operation ...............................8 4.1 Architecture ........................................ 8 4.2 Message Flow ........................................ 83 4 Naming .............................................. 4 5 Presence Event Package .............................. 5Subscriptions ....................................... 165.1Generating subscriptions ............................ 16Package Name ........................................ 5 5.2Sending subscriptions ............................... 19SUBSCRIBE bodies .................................... 5 5.3Proxying subscriptions .............................. 20Expiration .......................................... 5 5.4Presence server processing of SUBSCRIBE ............. 20NOTIFY Bodies ....................................... 6 5.5Presence agent processing of SUBSCRIBE .............. 21 5.5.1 Refreshes ........................................... 21 5.5.2 New subscriptions ................................... 22Processing Requirements at the PA ................... 6 5.6Subscriber processingGeneration ofSUBSCRIBE response ......... 23Notifications ......................... 7 5.7Unsubscribing ....................................... 24Rate Limitations on NOTIFY .......................... 8 5.8Fetching ............................................ 24Refresh Behavior .................................... 9 6 Publication .........................................249 6.1 Migrating the PA Function ........................... 10 7Notification ........................................ 26Mapping to CPIM ..................................... 11 7.1WhenSIP tosend ........................................ 26CPIM ......................................... 11 7.2Formatting of NOTIFY ................................ 27 7.3 RespondingCPIM toNOTIFY ................................ 28SIP ......................................... 14 8Access controls ..................................... 28Firewall and NAT Traversal .......................... 16 9Providing scalability ............................... 29 9.1 Partitioning of the namespace ....................... 30 9.2 Client notifications ................................ 31 9.3 Distributed subscription state ...................... 31 10Security considerations .............................34 10.117 9.1 Privacy .............................................34 10.217 9.2 Message integrity and authenticity ..................35 10.318 9.3 Outbound authentication .............................35 10.418 9.4 Replay prevention ...................................36 10.518 9.5 Denial of service attacks ...........................36 10.5.119 9.5.1 Smurf attacks through false contacts ................36 10.5.2 Annoyance subscriptions ............................. 37 10.6 Firewall traversal .................................. 37 11 Addressing Transport ................................ 37 12 Required SIP features ............................... 39 12.1 Needed components ................................... 39 12.2 Components not needed ............................... 40 1319 10 Example message flows ...............................41 13.119 10.1 Client to Client Subscription with Presentity State Changes ..................................................41 13.219 10.2 Presence Server with Client Notifications ...........45 13.3 Presence Server Notifications ....................... 51 13.423 10.3 Presence Server Notificationswith Client Authorization of Subscription .................................. 54 13.5 Delayed Subscription Approval.......................60 14 Checklist of requirements ........................... 64 1528 11 Open Issues ......................................... 32 12 Changes from -00 .................................... 32 A Acknowledgements ....................................68 1634 B Authors Addresses ...................................69 1734 C Bibliography ........................................7037