Internet Engineering Task Force Steven R. Donovan INTERNET DRAFT MCI February 10, 1999 Expires August 10, 1999 SIP Session Timer Status of this document This document is an Internet-Draft and is in full conformance with all provisions of Section 10 of RFC 2026. 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." To view the entire list of current Internet-Drafts, please check the "1id-abstracts.txt" listing contained in the Internet-Drafts Shadow Directories on ftp.is.co.za (Africa), ftp.nordu.net (Northern Europe), ftp.nis.garr.it (Southern Europe), munnari.oz.au (Pacific Rim), ftp.ietf.org (US East Coast), or ftp.isi.edu (US West Coast). Abstract This document proposes an extension to the SIP specification. This extension adds a new message header that is used to specify the duration of a requested session. The session timer can be used to limit the total duration of a session if, for instance, one of the participants in the session wants to limit the cost of the session. It can also be used by stateful SIP Proxy Servers to track the status of sessions for which session state exists on the servers. Currently a stateful SIP Proxy Server that is not handling the media stream(s) for the session has no mechinism to definitively determine the state of all sessions for which it has state. While the SIP Specification does provide the BYE method for terminating the session, there is no mechinism for a SIP Proxy Server to detect the end of a session when the BYE message is not sent or is lost due to network problems. Donovan [Page 1] Internet draft The SIP Session Timer February 10, 1999 1.0 Introduction The need for the addition of a session timer was initially motivated by the realization that stateful proxy servers currently have no method of determining the end of a session in certain anomalous situations. For instance, when a user agent fails to send a BYE message at the end of a session or the BYE message gets lost due to network problems. In this situation, the stateful proxy will maintain state for the session and will have no deterministic method for determining when the state no longer applies. With the addition of a session timer to the SIP protocol, the stateful proxy server will have the option of tearing down the session upon the expiration of the session timer. A session timer can also be used for other purposes. For instance, it could be used in the implementation of a prepaid service. In this case all session related signaling would be routed through a SIP server that would control the session time based on a subscriber's prepaid account. The SIP server could use the session timer to force tear down of the session within a specific time. The session timer could also be used by the user agent as a trigger to indicate to the subscriber that the prepaid account requires more funds to extend the call. This document proposes the addition of a the Session-Expires header to the SIP INVITE message. In addition, two new Request Failure messages are proposed. The first to allow a SIP Proxy Server (SPS) server or a User Agent Server (UAS) to indicate the need for the Session-Expires header in INVITE messages. The second to allow a SPS or UAS to reject a User Agent Client's (UAC) session timer request. This can be the UAC's initial INVITE or the UAC's request to extent an existing session. 2.0 Session-Expires Header Field Definition The Session-Expires header will be used by UAC to indicate the maximum duration of the session. The format of the contents of the Session-Expires header shall be equivalent to the format of the Expires header. As such, the end of the session can be specified as either an absolute or delta time. The Session-Expires header shall be valid only in INVITE requests. The UAS or any SPS in the path of the session signaling shall have the option of rejecting an INVITE that does not contain the Session-Expires header if the service context in which the session request is made requires the use of the session timer. The begin time of the session shall start upon receipt of the ACK by the SPS and UAS message indicating successful setup of the session. Donovan [Page 2] Internet draft The SIP Session Timer February 10, 1999 The UAC shall have the ability to request an extension to the duration of the session by sending a re-INVITE message for the session with a new Session-Expires header. See section 1.4.6, Changing an Existing Session, in [1]. The UAS or any SPS in the path of the session signaling shall have the ability to reject the change in the session duration. Upon expiration of the session timer, the UAS shall have the option of terminating the session using the normal BYE method. In addition, a SPS shall have the option of tearing down an expired session by sending a BYE to both the UAS and the UAC. 3.0 Behavior of SIP User Agents 3.1 Behavior of User Agent Clients A User Agent Client shall have the ability to include the Session- Expires header in an INVITE message. The UAC may need to keep a session based timer in order to determine the need for extending the session. The UAC shall have the ability to request an extension of the session timer by sending an INVITE message for an existing session with a Session-Expires header. 3.2 Behavior of User Agent Servers The User Agent Server shall have the ability to reject an INVITE message that does not contain a Session-Expires header if the INVITE is received in a service context that requires a session timer. The UAS shall reject the INVITE using the following response: 4xx Session-Expires Header Required If the Session-Expires header contains a delta time then the UAS shall calculate the end of the session based on receipt of the ACK message that completes a successful session initiation: End of session time = Receipt of ACK time + Session-Expires time The UAS shall have the ability to reject an INVITE request based on the Session-Expires header. For instance, the UAS may choose to reject the INVITE if the requested session time is longer than the UAS desires to participate in the session. The UAS shall use the following message to reject the request: 4xx Session Time Request Rejected Donovan [Page 3] Internet draft The SIP Session Timer February 10, 1999 The UAS shall have the ability to reject a request to extend the length of the session. The UAS shall do so by sending the following response: 4xx Session Time Request Rejected If the Session-Expires header in the re-INVITE contains a delta time then the UAS shall calculate the new end of the previous end of session time: New end of session time = Previous end of session time + delta time If a request to extend the session time is rejected by the UAS then the end of session time that existed prior to the extension request shall be used. Upon expiration of the session timer, the UAS shall explicitly terminate the session by sending a BYE message. 4.0 Behavior of SIP Proxy Servers A SIP Proxy Server has the option of tracking the duration of sessions for which it is a proxy. If the SPS receives an INVITE without a Session-Expires header, it has the option of sending the following message indicating that the Session-Expires header is required: 4xx Session-Expires Header Required A SPS has the option of rejecting an INVITE with a Session-Expires header based on the time specified in the header. For instance, if the time specified is too long. The proxy server UAS shall do by sending the following response: 4xx Session Time Request Rejected A SPS has the option of rejecting a request for an extension of the session timer for an existing session by sending the following message: 4xx Session Time Request Rejected If the SPS accepts the request to extend the session timer then it shall use the method of calculating the new end of session time specified in section 3.2. A SPS shall have the option of tearing down sessions that have expired. Note that the SPS should wait for the UAS to terminate the call using normal mechanisms. If the UAS fails to send a BYE as a result of session expiration then the SPS can choose to end the call. The SPS shall terminate the call by sending BYE requests to the UAC and the UAS. Donovan [Page 4] Internet draft The SIP Session Timer February 10, 1999 5.0 Header Field Definitions The following is an extension of tables 4 and 5 in [1] for the Session- Expires header: where enc. e-e ACK BYE CAN INV OPT REG Session-Expires r e - - - o - - 5.0 Security Considerations There are no security considerations unique to the Session-Expires header. 6.0 Example The following examples are meant to illustrate the functionality associated with the Session-Expires header. As such, other headers are intentionally left out of the SIP messages. Example One - In this example, the UAC initiates a session directly with the UAS using the Session-Expires header. The UAC subsequently requests and extension to the session timer which is accepted by the UAS. The session eventually times out and is terminated by the UAS. UAC->UAS INVITE Session-Expires: 120 UAS->UAC 200 OK UAC->UAS ACK UAC starts session timer UAS Receipt of ACK UAS starts session timer UAC->UAC INVITE Session-Expires: 120 UAC->UAS 200 OK UAC->UAS ACK UAC resets session end time UAS Receipt of ACK UAS resets session timer Session timeout UAS->UAC BYE UAC->UAS 200 OK Donovan [Page 5] Internet draft The SIP Session Timer February 10, 1999 Example Two In this scenario, the UAC session request without a Session-Expires header. The SPS rejects the INVITE, indicating that a Session-Expires header is required. The UAC re-requests a session with a Session-Expires header. This session is successfully set up through the SPS. The SPS eventually detects session timeout. UAC->SPS INVITE SPS->UAC 4xx Session-Expires Header Required UAC->SPS INVITE Session-Expires: 120 SPS->UAS INVITE To extend existing session Session-Expires: 120 UAS->SPS 200 OK SPS->UAC 200 OK UAC->SPS ACK UAC starts session timer SPS Receipt of ACK SPS starts session timer SPS->UAS ACK UAS starts session timer Session timeout detected by SPS SPS->UAC BYE SPS->UAS BYE UAS->SPS 200 OK UAC->SPS 200 OK 7.0 References [1] M. Handley, H. Schulzrinne, E. Schooler, and J. Rosenberg, "SIP: Session Initiation Protocol", Internet Draft, Internet Engineering Task Force, January 15, 1999. Work in progress. 8.0 Author's Address Steven R. Donovan MCI Worldcom 1493/678 901 International Parkway Richardson, Texas 75081 Email: steven.r.donovan@mci.com Donovan [Page 6]