Jump to content

Session Initiation Protocol: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
m Reverted edits by 106.51.15.170 (talk) to last version by Kgfleischmann
m Reverted edit by Oreofrappe619 (talk) to last version by Kvng
 
(358 intermediate revisions by more than 100 users not shown)
Line 1: Line 1:
{{Short description|Voice-over-IP communications protocol}}
{{Infobox networking protocol
| title =
| logo =
| logo alt =
| image =
| image alt =
| caption =
| abbreviation = SIP
| purpose = [[Internet telephony]]
| developer =
| date = {{Start date and age|1999|03}}
| based on =
| influenced =
| osilayer = [[Application layer]] (Layer 7)
| ports = 5060, 5061
| rfcs = 2543, 3261
| hardware =
}}
{{IPstack}}
{{IPstack}}
The '''Session Initiation Protocol''' ('''SIP''') is a communications protocol for [[Signaling (telecommunications)|signaling]] and controlling multimedia [[communication session]]s. The most common applications of SIP are in [[Internet telephony]] for voice and video calls, as well as [[instant messaging]] all over [[Internet Protocol]] (IP) networks.
The '''Session Initiation Protocol''' ('''SIP''') is a [[signaling protocol]] used for initiating, maintaining, and terminating [[communication session]]s that include voice, video and messaging applications.<ref name="What is SIP?"/> SIP is used in [[Internet telephony]], in private IP telephone systems, as well as mobile phone calling over [[LTE (telecommunication)|LTE]] ([[VoLTE]]).<ref>{{Cite web |title=4G {{!}} ShareTechnote |url=https://www.sharetechnote.com/html/Handbook_LTE_VoLTE.html |access-date=2023-03-09 |website=www.sharetechnote.com}}</ref>


The protocol defines the messages that are sent between endpoints, which govern establishment, termination and other essential elements of a call. SIP can be used for creating, modifying and terminating [[Session (computer science)|sessions]] consisting of one or several [[Streaming media|media streams]]. SIP is an [[application layer]] protocol designed to be independent of the underlying [[transport layer]]. It is a text-based protocol, incorporating many elements of the [[Hypertext Transfer Protocol]] (HTTP) and the [[Simple Mail Transfer Protocol]] (SMTP).<ref>{{cite book |author=Johnston, Alan B. |year=2004 |title=SIP: Understanding the Session Initiation Protocol, Second Edition |publisher=Artech House |ISBN=1-58053-168-7}}</ref>
The protocol defines the specific format of messages exchanged and the sequence of communications for cooperation of the participants. SIP is a [[text-based protocol]], incorporating many elements of the [[Hypertext Transfer Protocol]] (HTTP) and the [[Simple Mail Transfer Protocol]] (SMTP).<ref name="Johnston">{{cite book |last=Johnston|first=Alan B. |year=2004 |title=SIP: Understanding the Session Initiation Protocol |edition=Second |publisher=Artech House |isbn=9781580531689}}</ref> A call established with SIP may consist of multiple [[Streaming media|media streams]], but no separate streams are required for applications, such as [[text messaging]], that exchange data as payload in the SIP message.


SIP works in conjunction with several other application layer protocols that identify and carry the session media. Media identification and negotiation is achieved with the [[Session Description Protocol]] (SDP). For the transmission of media streams (voice, video) SIP typically employs the [[Real-time Transport Protocol]] (RTP) or [[Secure Real-time Transport Protocol]] (SRTP). For secure transmissions of SIP messages, the protocol may be encrypted with [[Transport Layer Security]] (TLS).
SIP works in conjunction with several other protocols that specify and carry the session media. Most commonly, media type and parameter negotiation and media setup are performed with the [[Session Description Protocol]] (SDP), which is carried as payload in SIP messages. SIP is designed to be independent of the underlying [[transport layer]] protocol and can be used with the [[User Datagram Protocol]] (UDP), the [[Transmission Control Protocol]] (TCP), and the [[Stream Control Transmission Protocol]] (SCTP). For secure transmissions of SIP messages over insecure network links, the protocol may be encrypted with [[Transport Layer Security]] (TLS). For the transmission of media streams (voice, video) the SDP payload carried in SIP messages typically employs the [[Real-time Transport Protocol]] (RTP) or the [[Secure Real-time Transport Protocol]] (SRTP).


==History==
==History==
SIP was originally designed by [[Mark Handley (computer scientist)|Mark Handley]], [[Henning Schulzrinne]], [[Eve Schooler]] and [[Jonathan Rosenberg (SIP author)|Jonathan Rosenberg]] in 1996. The protocol was standardized as RFC 2543 in 1999 (SIP 1.0). In November 2000, SIP was accepted as a [[3GPP]] signaling protocol and permanent element of the [[IP Multimedia Subsystem]] (IMS) architecture for IP-based streaming multimedia services in [[cellular communication networks|cellular systems]]. {{As of|2014}}, the latest version (SIP 2.0) of the specification is RFC 3261, published in June 2002,<ref>{{cite web|url=http://www.ietf.org/dyn/wg/charter/sipcore-charter.html |title=SIP core working group charter |publisher=Ietf.org |date=2010-12-07 |accessdate=2011-01-11}}</ref> with extensions and clarifications since then.<ref>{{cite web|title=Search Internet-Drafts and RFCs|url=https://datatracker.ietf.org/doc/search/?name=SIP&rfcs=on&sort=date|publisher=[[Internet Engineering Task Force]]}}</ref>
SIP was originally designed by [[Mark Handley (computer scientist)|Mark Handley]], [[Henning Schulzrinne]], [[Eve Schooler]] and [[Jonathan Rosenberg (SIP author)|Jonathan Rosenberg]] in 1996 to facilitate establishing [[multicast]] multimedia sessions on the [[Mbone]]. The protocol was standardized as {{IETF RFC|2543}} in 1999. In November 2000, SIP was accepted as a [[3GPP]] signaling protocol and permanent element of the [[IP Multimedia Subsystem]] (IMS) architecture for IP-based streaming multimedia services in [[cellular network]]s. In June 2002 the specification was revised in {{IETF RFC|3261}}<ref>{{cite web|url=http://www.ietf.org/dyn/wg/charter/sipcore-charter.html |title=SIP core working group charter |publisher=[[Internet Engineering Task Force]] |date=2010-12-07 |access-date=2011-01-11}}</ref> and various extensions and clarifications have been published since.<ref>{{cite web|title=Search Internet-Drafts and RFCs|url=https://datatracker.ietf.org/doc/search/?name=SIP&rfcs=on&sort=date|publisher=[[Internet Engineering Task Force]]}}</ref>


SIP was designed to provide a signaling and call setup protocol for IP-based communications supporting the call processing functions and features present in the [[public switched telephone network]] (PSTN) with a vision of supporting new multimedia applications. It has been extended for [[video conferencing]], [[streaming media]] distribution, [[instant messaging]], [[presence information]], [[file transfer]], [[Internet fax]] and [[online game]]s.<ref name="What is SIP?">{{cite web|title=What is SIP?|url=http://www.networkworld.com/article/2332980/lan-wan/what-is-sip-.html|archive-url=https://web.archive.org/web/20140624044447/http://www.networkworld.com/article/2332980/lan-wan/what-is-sip-.html|url-status=dead|archive-date=June 24, 2014|publisher=[[Network World]]|date=May 11, 2004}}</ref><ref name="RFC 3261">{{cite IETF|rfc=3261 |title=SIP: Session Initiation Protocol |year=2002}}</ref><ref>{{cite web |first=Margaret|last=Rouse |title=Session Initiation Protocol (SIP) |url=http://searchunifiedcommunications.techtarget.com/definition/Session-Initiation-Protocol |publisher=[[TechTarget]]}}</ref>
The U.S. [[National Institute of Standards and Technology]] (NIST), Advanced Networking Technologies Division provides a public-domain [[Java (programming language)|Java]] implementation<ref>{{cite web |url= http://java.net/projects/jsip |title=JAIN SIP project |accessdate=2011-07-26}}</ref> that serves as a [[reference implementation]] for the standard. The implementation can work in proxy server or user agent scenarios and has been used in numerous commercial and research projects. It supports RFC 3261 in full and a number of extension RFCs including RFC 6665 (event notification) and RFC 3262 (reliable provisional responses).


SIP is distinguished by its proponents for having roots in the Internet community rather than in the [[telecommunications industry]]. SIP has been standardized primarily by the [[Internet Engineering Task Force]] (IETF), while other protocols, such as [[H.323]], have traditionally been associated with the [[International Telecommunication Union]] (ITU).
While originally developed based on voice applications, the protocol was envisioned and supports a diverse array of applications, including [[video conferencing]], streaming multimedia distribution, [[instant messaging]], [[presence information]], [[file transfer]], [[T.38|fax over IP]] and [[online game]]s.<ref>{{cite web|title=What is SIP?|url=http://www.networkworld.com/article/2332980/lan-wan/what-is-sip-.html|publisher=[[Network World]]|date=May 11, 2004}}</ref><ref name="voip-info_SIP">{{cite web|title=SIP|url=http://www.voip-info.org/wiki/view/SIP|publisher=Voip-Info.org}}</ref><ref name="IETF_RFC_3261">{{cite web|title=RFC 3261 – SIP: Session Initiation Protocol|url=https://tools.ietf.org/html/rfc3261|publisher=[[IETF]]|year=2002}}</ref><ref>{{cite web|author=Margaret Rouse|title=Session Initiation Protocol (SIP)|url=http://searchunifiedcommunications.techtarget.com/definition/Session-Initiation-Protocol|publisher=[[TechTarget]]}}</ref>


==Protocol operation==
==Protocol operation==
[[File:SIP session setup example.svg|300px|thumb|An example of a SIP message exchange between two users, Alice and Bob, to establish and end a direct media session.]]
SIP is independent from the underlying transport protocol. It runs on the [[Transmission Control Protocol]] (TCP), the [[User Datagram Protocol]] (UDP) or the [[Stream Control Transmission Protocol]] (SCTP).<ref>RFC 4168, ''The Stream Control Transmission Protocol (SCTP) as a Transport for the Session Initiation Protocol (SIP)'', IETF, The Internet Society (2005)</ref> SIP can be used for two-party ([[unicast]]) or multiparty ([[multicast]]) sessions.
SIP is only involved in the signaling operations of a media communication session and is primarily used to set up and terminate voice or video calls. SIP can be used to establish two-party ([[unicast]]) or multiparty ([[multicast]]) sessions. It also allows modification of existing calls. The modification can involve changing addresses or [[Computer port (software)|ports]], inviting more participants, and adding or deleting media streams. SIP has also found applications in messaging applications, such as instant messaging, and event subscription and notification.


SIP works in conjunction with several other protocols that specify the media format and coding and that carry the media once the call is set up. For call setup, the body of a SIP message contains a [[Session Description Protocol]] (SDP) data unit, which specifies the media format, codec and media communication protocol. Voice and video media streams are typically carried between the terminals using the [[Real-time Transport Protocol]] (RTP) or [[Secure Real-time Transport Protocol]] (SRTP).<ref name="Johnston"/><ref>{{Cite book |title=Telecom 101 |last=Coll |first=Eric |publisher=Teracom Training Institute |year=2016 |isbn=9781894887038 |pages=77–79}}</ref>
SIP employs design elements similar to the HTTP request/response transaction model.<ref name="ws_209">William Stallings, p.209<!--which WS book are we referring to here?--></ref> Each transaction consists of a client request that invokes a particular method or function on the server and at least one response. SIP reuses most of the header fields, encoding rules and status codes of HTTP, providing a readable text-based format.


Each resource of a SIP network, such as a user agent or a voicemail box, is identified by a [[uniform resource identifier]] (URI), based on the general standard syntax also used in Web services and e-mail.<ref>RFC 3986, ''Uniform Resource Identifiers (URI): Generic Syntax'', IETF, The Internet Society (2005)</ref> The URI scheme used for SIP is ''sip'' and a typical SIP URI is of the form ''<nowiki>sip:username:password@host:port</nowiki>.
Every resource of a SIP network, such as user agents, call routers, and voicemail boxes, are identified by a [[Uniform Resource Identifier]] (URI). The syntax of the URI follows the general standard syntax also used in [[Web service]]s and e-mail.<ref name="RFC 3986">{{cite IETF |rfc=3986 |title=Uniform Resource Identifiers (URI): Generic Syntax |date=2005}}</ref> The URI scheme used for SIP is ''sip'' and a typical SIP URI has the form ''<nowiki>sip:username@domainname</nowiki>'' or ''<nowiki>sip:username@hostport</nowiki>'', where ''domainname'' requires DNS [[SRV record]]s to locate the servers for SIP domain while ''hostport'' can be an [[IP address]] or a [[fully qualified domain name]] of the host and port. If [[secure transmission]] is required, the scheme ''sips'' is used.{{sfn|Miikka Poikselkä|Georg Mayer|Hisham Khartabil|Aki Niemi|2004}}{{sfn|Brian Reid|Steve Goodman|2015}}


SIP employs design elements similar to the HTTP request and response transaction model.<ref>{{cite web|title=SIP: Session Initiation Protocol|url=https://www.ietf.org/rfc/rfc3261|website=IETF}}</ref> Each transaction consists of a client request that invokes a particular method or function on the server and at least one response. SIP reuses most of the header fields, encoding rules and status codes of HTTP, providing a readable text-based format.
If [[secure transmission]] is required, the scheme ''sips'' is used and mandates that each hop over which the request is forwarded up to the target domain must be secured with [[Transport Layer Security]] (TLS). The last hop from the proxy of the target domain to the user agent has to be secured according to local policies. TLS protects against attackers who try to listen on the signaling link but it does not provide real end-to-end security to prevent espionage and law enforcement interception, as the encryption is only hop-by-hop and every single intermediate proxy has to be trusted.


SIP can be carried by several [[transport layer]] protocols including [[Transmission Control Protocol]] (TCP), [[User Datagram Protocol]] (UDP), and [[Stream Control Transmission Protocol]] (SCTP).<ref name="RFC 4168">{{cite IETF |rfc=4168 |title=The Stream Control Transmission Protocol (SCTP) as a Transport for the Session Initiation Protocol (SIP) |date=2005}}</ref><ref>{{Cite journal|last1=Montazerolghaem|first1=Ahmadreza|last2=Hosseini Seno|first2=Seyed Amin|last3=Yaghmaee|first3=Mohammad Hossein|last4=Tashtarian|first4=Farzad|date=2016-06-01|title=Overload mitigation mechanism for VoIP networks: a transport layer approach based on resource management|journal=Transactions on Emerging Telecommunications Technologies|volume=27|issue=6|pages=857–873|doi=10.1002/ett.3038|s2cid=27215205 |issn=2161-3915}}</ref> SIP clients typically use TCP or UDP on [[port number]]s 5060 or 5061 for SIP traffic to servers and other endpoints. Port 5060 is commonly used for non-encrypted signaling traffic whereas port 5061 is typically used for traffic encrypted with [[Transport Layer Security]] (TLS).
SIP works in concert with several other protocols and is only involved in the signaling portion of a communication session. SIP clients typically use TCP or UDP on [[port number]]s 5060 or 5061 to connect to SIP servers and other SIP endpoints. Port 5060 is commonly used for non-encrypted signaling traffic whereas port 5061 is typically used for traffic encrypted with [[Transport Layer Security]] (TLS). SIP is primarily used in setting up and tearing down voice or video calls. It also allows modification of existing calls. The modification can involve changing addresses or [[Computer port (software)|ports]], inviting more participants, and adding or deleting media streams. SIP has also found applications in messaging applications, such as instant messaging, and event subscription and notification. A suite of SIP-related [[Internet Engineering Task Force]] (IETF) rules define behavior for such applications. The voice and video stream communications in SIP applications are carried over another application protocol, the [[Real-time Transport Protocol]] (RTP). Parameters (port numbers, protocols, [[codecs]]) for these media streams are defined and negotiated using the [[Session Description Protocol]] (SDP), which is transported in the SIP packet body.


SIP-based telephony networks often implement call processing features of [[Signaling System 7]] (SS7), for which special SIP protocol extensions exist, although the two protocols themselves are very different. SS7 is a centralized protocol, characterized by a complex central network architecture and dumb endpoints (traditional telephone handsets). SIP is a [[client-server]] protocol of equipotent peers. SIP features are implemented in the communicating endpoints, while the traditional SS7 architecture is in use only between switching centers.
A motivating goal for SIP was to provide a signaling and call setup protocol for IP-based communications that can support a superset of the call processing functions and features present in the [[public switched telephone network]] (PSTN). SIP by itself does not define these features; rather, its focus is call-setup and signaling. The features that permit familiar telephone-like operations (i.e. dialing a number, causing a phone to ring, hearing ringback tones or a busy signal) are performed by proxy servers and user agents. Implementation and terminology are different in the SIP world but to the end-user, the behavior is similar.

SIP-enabled telephony networks can also implement many of the more advanced call processing features present in [[Signaling System 7]] (SS7), though the two protocols themselves are very different. SS7 is a centralized protocol, characterized by a complex central network architecture and dumb endpoints (traditional telephone handsets). SIP is a [[client-server]] protocol, however most SIP-enabled devices may perform both the client and the server role. In general, session initiator is a client, and the call recipient performs the server function. SIP features are implemented in the communicating endpoints, contrary to traditional SS7 features, which are implemented in the network.

SIP is distinguished by its proponents for having roots in the IP community rather than in the telecommunications industry. SIP has been standardized and governed primarily by the IETF, while other protocols, such as H.323, have traditionally been associated with the [[International Telecommunication Union]] (ITU).


==Network elements==
==Network elements==
The network elements that use the Session Initiation Protocol for communication are called ''SIP user agents''. Each ''user agent'' (UA) performs the function of a ''user agent client'' (UAC) when it is requesting a service function, and that of a ''user agent server'' (UAS) when responding to a request. Thus, any two SIP endpoints may in principle operate without any intervening SIP infrastructure. However, for network operational reasons, for provisioning public services to users, and for directory services, SIP defines several specific types of network server elements. Each of these service elements also communicates within the client-server model implemented in user agent clients and servers.<ref>{{Cite journal|last1=Montazerolghaem|first1=A.|last2=Moghaddam|first2=M. H. Y.|last3=Leon-Garcia|first3=A.|date=March 2018|title=OpenSIP: Toward Software-Defined SIP Networking|journal=IEEE Transactions on Network and Service Management|volume=15|issue=1|pages=184–199|doi=10.1109/TNSM.2017.2741258|issn=1932-4537|arxiv=1709.01320|s2cid=3873601}}</ref>
SIP defines user-agents as well as several types of server network elements. Two SIP endpoints can communicate without any intervening SIP infrastructure. However, this approach is often impractical for a public service, which needs directory services to locate available nodes on the network.


===User agent===
===User agent===
A SIP user agent (UA) is a logical network end-point used to create or receive SIP messages and thereby manage a SIP session. A SIP UA can perform the role of a user agent client (UAC), which sends SIP requests, and the user agent server (UAS), which receives the requests and returns a SIP response. These roles of UAC and UAS only last for the duration of a SIP transaction.<ref name="IETF_RFC_3261"/>
A user agent is a logical network endpoint that sends or receives SIP messages and manages SIP sessions. User agents have client and server components. The user agent client (UAC) sends SIP requests. The user agent server (UAS) receives requests and returns a SIP response. Unlike other network protocols that fix the roles of client and server, e.g., in HTTP, in which a web browser only acts as a client, and never as a server, SIP requires both peers to implement both roles. The roles of UAC and UAS only last for the duration of a SIP transaction.<ref name="RFC 3261"/>


A SIP phone is an [[IP phone]] that implements SIP user agent and server functions, which provide the traditional call functions of a telephone, such as dial, answer, reject, hold/unhold, and call transfer.<ref name="Azzedine">{{cite book|last=Azzedine|title=Handbook of algorithms for wireless networking and mobile computing|publisher=CRC Press|year=2006|page=774|url=http://books.google.com/books?id=b8oisvv6fDAC&pg=PT774 | isbn=978-1-58488-465-1}}</ref><ref>{{cite book|last=Porter|first=Thomas |author2=Andy Zmolek |author3=Jan Kanclirz |author4=Antonio Rosela |title=Practical VoIP Security|publisher=Syngress |year=2006|pages=76–77|url=http://books.google.com/books?id=BYxdyekyRlwC&pg=PA76 | isbn=978-1-59749-060-3}}</ref> SIP phones may be implemented as a hardware device or as a [[softphone]]. As vendors increasingly implement SIP as a standard telephony platform, often driven by [[4G]] efforts, the distinction between hardware-based and software-based SIP phones is being blurred and SIP elements are implemented in the basic firmware functions of many IP-capable devices. Examples are devices from [[Nokia]] and [[BlackBerry Ltd|BlackBerry]].<ref>{{cite web|url=http://na.blackberry.com/eng/services/business/blackberry_mvs/ |title=BlackBerry MVS Software |publisher=Na.blackberry.com |accessdate=2011-01-11}}</ref>
A SIP phone is an [[IP phone]] that implements client and server functions of a SIP user agent and provides the traditional call functions of a telephone, such as dial, answer, reject, call hold, and call transfer.<ref name="Azzedine">{{cite book|last=Azzedine|title=Handbook of algorithms for wireless networking and mobile computing|publisher=CRC Press|year=2006|page=774|url=https://books.google.com/books?id=b8oisvv6fDAC&pg=PT774 | isbn=978-1-58488-465-1}}</ref><ref>{{cite book|last=Porter|first=Thomas |author2=Andy Zmolek |author3=Jan Kanclirz |author4=Antonio Rosela |title=Practical VoIP Security|publisher=Syngress |year=2006|pages=76–77|url=https://books.google.com/books?id=BYxdyekyRlwC&pg=PA76 | isbn=978-1-59749-060-3}}</ref> SIP phones may be implemented as a hardware device or as a [[softphone]]. As vendors increasingly implement SIP as a standard telephony platform, the distinction between hardware-based and software-based SIP phones is blurred and SIP elements are implemented in the basic firmware functions of many IP-capable communications devices such as [[smartphone]]s.


In SIP, as in HTTP, the [[user agent]] may identify itself using a message header field ''User-Agent'', containing a text description of the software/hardware/product involved. The user agent field is sent in request messages, which means that the receiving SIP server can see this information. SIP network elements sometimes store this information,<ref>[http://web.archive.org/web/20110716170218/http://www.voipuser.org/forum_topic_14998.html "User-Agents We Have Known "][[VoIP User|VoIP User.org]]</ref> and it can be useful in diagnosing SIP compatibility problems.
In SIP, as in HTTP, the [[user agent]] may identify itself using a message header field (''User-Agent''), containing a text description of the software, hardware, or the product name. The user agent field is sent in request messages, which means that the receiving SIP server can evaluate this information to perform device-specific configuration or feature activation. Operators of SIP network elements sometimes store this information in customer account portals,<ref>{{cite web |url=http://www.voipuser.org/forum_topic_14998.html |archive-date=2011-07-16 |archive-url=https://web.archive.org/web/20110716170218/http://www.voipuser.org/forum_topic_14998.html |title=User-Agents We Have Known |publisher=VoIP User}}</ref> where it can be useful in diagnosing SIP compatibility problems or in the display of service status.


===Proxy server===
===Proxy server===
A proxy server is a network server with UAC and UAS components that functions as an intermediary entity for the purpose of performing requests on behalf of other network elements. A proxy server primarily plays the role of call routing; it sends SIP requests to another entity closer to the destination. Proxies are also useful for enforcing policy, such as for determining whether a user is allowed to make a call. A proxy interprets, and, if necessary, rewrites specific parts of a request message before forwarding it.
The proxy server is an intermediary entity that acts as both a server and a client for the purpose of making requests on behalf of other clients.

A proxy server primarily plays the role of routing, meaning that its job is to ensure that a request is sent to another entity closer to the targeted user. Proxies are also useful for enforcing policy, such as for determining whether a user is allowed to make a call. A proxy interprets, and, if necessary, rewrites specific parts of a request message before forwarding it.
SIP proxy servers that route messages to more than one destination are called forking proxies. The forking of a SIP request establishes multiple dialogs from the single request. Thus, a call may be answered from one of multiple SIP endpoints. For identification of multiple dialogs, each dialog has an identifier with contributions from both endpoints.

===Redirect server===
A redirect server is a user agent server that generates [[List of HTTP status codes#3xx redirection|3xx (redirection) responses]] to requests it receives, directing the client to contact an alternate set of URIs. A redirect server allows proxy servers to direct SIP session invitations to external domains.


===Registrar===
===Registrar===
[[File:SIP-registration-flow.png|thumb|280px|SIP User Agent registration on SIP Registrar with authentication by login]]
[[File:SIP-registration-flow.png|thumb|280px|SIP user agent registration to SIP registrar with authentication.]]
[[File:SIP call flow between UA, Redirect Server, Proxy and UA.png|thumb|280px|Call flow through Redirect Server and proxy]]
[[File:SIP-B2BUA-call-flow.png|thumb|280px|Establishment a connection with the [[Back-to-back user agent|B2BUA]]]]
A registrar is a SIP endpoint that accepts REGISTER requests and places the information it receives in those requests into a location service for the domain it handles. The location service links one or more [[IP address]]es to the SIP [[URI]] of the registering agent. The URI uses the <tt>sip:</tt> scheme, although other protocol schemes are possible, such as <tt>tel:</tt>. More than one [[user agent]] can register at the same URI, with the result that all registered user agents receive the calls to the URI.


A registrar is a SIP endpoint that provides a location service. It accepts REGISTER requests, recording the address and other parameters from the user agent. For subsequent requests, it provides an essential means to locate possible communication peers on the network. The location service links one or more IP addresses to the SIP URI of the registering agent. Multiple user agents may register for the same URI, with the result that all registered user agents receive the calls to the URI.
SIP registrars are logical elements, and are commonly co-located with SIP proxies. But it is also possible and often good for network scalability to place this location service with a redirect server.


SIP registrars are logical elements and are often co-located with SIP proxies. To improve network scalability, location services may instead be located with a redirect server.
===Redirect server===
A user agent server that generates 3xx (Redirection) responses to requests it receives, directing the client to contact an alternate set of URIs. The redirect server allows proxy servers to direct SIP session invitations to external domains.


===Session border controller===
===Session border controller===
[[File:SIP-B2BUA-call-flow.png|thumb|280px|Establishment of a session through a [[back-to-back user agent]].]]
[[Session border controller]]s serve as ''middle boxes'' between UA and SIP servers for various types of functions, including network topology hiding, and assistance in [[NAT traversal]].

[[Session border controller]]s (SBCs) serve as [[middlebox]]es between user agents and SIP servers for various types of functions, including network topology hiding and assistance in [[NAT traversal]]. SBCs are an independently engineered solution and are not mentioned in the SIP RFC.


===Gateway===
===Gateway===
[[Gateway (telecommunications)|Gateways]] can be used to interface a SIP network to other networks, such as the [[public switched telephone network]], which use different protocols or technologies.
[[Gateway (telecommunications)|Gateways]] can be used to interconnect a SIP network to other networks, such as the PSTN, which use different protocols or technologies.


==SIP messages==
==SIP messages==
SIP is a text-based protocol with syntax similar to that of HTTP. There are two different types of SIP messages: requests and responses. The first line of a request has a ''method'', defining the nature of the request, and a Request-URI, indicating where the request should be sent.<ref name="stallings_214">Stallings, p.214</ref> The first line of a response has a ''response code''.
SIP is a text-based protocol with syntax similar to that of HTTP. There are two different types of SIP messages: requests and responses. The first line of a request has a ''method'', defining the nature of the request, and a Request-URI, indicating where the request should be sent.<ref>Stallings, p.214<!--which William Stallings book are we referring to here?--></ref> The first line of a response has a ''response code''.

===Requests===
Requests initiate a functionality of the protocol. They are sent by a user agent client to the server and are answered with one or more [[SIP responses]], which return a result code of the transaction, and generally indicate the success, failure, or other state of the transaction.


{|class="wikitable"
===SIP request===
|+ SIP requests
For SIP requests, RFC 3261 defines the following methods:<ref name="stallings_214-5">Stallings, pp.214-215</ref>
! Request name !! Description !! Notes !! RFC references
{{Main|List of SIP request methods}}
|-
* REGISTER: Used by a UA to register to the registrar.
| REGISTER || Register the URI listed in the To-header field with a location server and associates it with the network address given in a ''Contact'' header field. || The command implements a location service. || {{IETF RFC|3261}}
* INVITE: Used to establish a media session between user agents.
|-
* ACK: Confirms reliable message exchanges.
| INVITE || Initiate a dialog for establishing a call. The request is sent by a user agent client to a user agent server. || When sent during an established dialog (''reinvite'') it modifies the sessions, for example placing a call on hold. || {{IETF RFC|3261}}
* CANCEL: Terminates a pending request.
|-
* BYE: Terminates an existing session.
| ACK || Confirm that an entity has received a final response to an INVITE request. || || {{IETF RFC|3261}}
* OPTIONS: Requests information about the capabilities of a caller without the need to set up a session. Often used as keepalive messages.
|-
* REFER: indicates that the recipient (identified by the Request-URI) should contact a third party using the contact information provided in the request. (call transfer)
| BYE || Signal termination of a dialog and end a call. || This message may be sent by either endpoint of a dialog. || {{IETF RFC|3261}}
A new method has been introduced in SIP in RFC 3262:
|-
* PRACK (Provisional Response Acknowledgement): PRACK improves network reliability by adding an acknowledgement system to the provisional responses (1xx). PRACK is sent in response to provisional response (1xx).
| CANCEL || Cancel any pending request. || Usually means terminating a call while it is still ringing, before answer. || {{IETF RFC|3261}}
|-
| UPDATE || Modify the state of a session without changing the state of the dialog. || || {{IETF RFC|3311}}
|-
| REFER || Ask recipient to issue a request for the purpose of call transfer. || || {{IETF RFC|3515}}
|-
| PRACK || Provisional acknowledgement. || PRACK is sent in response to provisional response (1xx). || {{IETF RFC|3262}}
|-
| SUBSCRIBE || Initiates a subscription for notification of events from a notifier. || || {{IETF RFC|6665}}
|-
| NOTIFY || Inform a subscriber of notifications of a new event. || || {{IETF RFC|6665}}
|-
| PUBLISH || Publish an event to a notification server. || || {{IETF RFC|3903}}
|-
| MESSAGE || Deliver a text message. || Used in instant messaging applications. || {{IETF RFC|3428}}
|-
| INFO || Send mid-session information that does not modify the session state. || This method is often used for DTMF relay. || {{IETF RFC|6086}}
|-
| OPTIONS || Query the capabilities of an endpoint. || It is often used for NAT [[keepalive]] purposes. || {{IETF RFC|3261}}
|-
|}


===SIP response===
===Responses===
The SIP response types defined in RFC 3261 fall in one of the following categories:<ref name="stallings_216-7">Stallings, pp.216-217</ref>
{{Main|List of SIP response codes}}
{{Main|List of SIP response codes}}
Responses are sent by the user agent server indicating the result of a received request. Several classes of responses are recognized, determined by the numerical range of result codes:<ref>Stallings, pp.216-217<!--which William Stallings book are we referring to here?--></ref>
* Provisional (1xx): Request received and being processed.
* 1xx: Provisional responses to requests indicate the request was valid and is being processed.
* Success (2xx): The action was successfully received, understood, and accepted.
* 2xx: Successful completion of the request. As a response to an INVITE, it indicates a call is established. The most common code is 200, which is an unqualified success report.
* Redirection (3xx): Further action needs to be taken (typically by sender) to complete the request.
* 3xx: Call redirection is needed for completion of the request. The request must be completed with a new destination.
* Client Error (4xx): The request contains bad syntax or cannot be fulfilled at the server.
* Server Error (5xx): The server failed to fulfill an apparently valid request.
* 4xx: The request cannot be completed at the server for a variety of reasons, including bad request syntax (code 400).
* 5xx: The server failed to fulfill an apparently valid request, including server internal errors (code 500).
* Global Failure (6xx): The request cannot be fulfilled at any server.
* 6xx: The request cannot be fulfilled at any server. It indicates a global failure, including call rejection by the destination.


==Transactions==
==Transactions==
[[Image:SIP signaling.png|right|thumb|Example: User1’s UAC uses an ''Invite Client Transaction'' to send the initial INVITE (1) message. If no response is received after a timer controlled wait period the UAC may chose to terminate the transaction or retransmit the INVITE. Once a response is received, User1 is confident the INVITE was delivered reliably. User1’s UAC must then acknowledge the response. On delivery of the ACK (2) both sides of the transaction are complete. In this case, a dialog may have been established.<ref>{{cite web|author=James Wright |publisher=Konnetic |url=http://www.konnetic.com/Documents/KonneticSIPIntroduction.pdf |title=SIP - An Introduction |format=PDF |accessdate=2011-01-11}}</ref>]]
[[Image:SIP signaling.png|right|thumb|Example: User1's UAC uses an ''invite client transaction'' to send the initial INVITE (1) message. If no response is received after a timer-controlled wait period the UAC may choose to terminate the transaction or retransmit the INVITE. Once a response is received, User1 is confident the INVITE was delivered reliably. User1's UAC must then acknowledge the response. On delivery of the ACK (2), both sides of the transaction are complete. In this case, a dialog may have been established.<ref>{{cite web|first=James|last=Wright |publisher=Konnetic |url=http://www.konnetic.com/Documents/KonneticSIPIntroduction.pdf |title=SIP - An Introduction |access-date=2011-01-11}}</ref>]]


SIP makes use of transactions to control the exchanges between participants and deliver messages reliably. The transactions maintain an internal state and make use of timers. ''Client Transactions'' send requests and ''Server Transactions'' respond to those requests with one-or-more responses. The responses may include zero-or-more Provisional (1xx) responses and one-or-more final (2xx-6xx) responses.
SIP defines a transaction mechanism to control the exchanges between participants and deliver messages reliably. A transaction is a state of a session, which is controlled by various timers. Client transactions send requests and server transactions respond to those requests with one or more responses. The responses may include provisional responses with a response code in the form ''1xx'', and one or multiple final responses (2xx6xx).


Transactions are further categorized as either ''Invite'' or ''Non-Invite''. ''Invite'' transactions differ in that they can establish a long-running conversation, referred to as a ''Dialog'' in SIP, and so include an acknowledgment (ACK) of any non-failing final response (e.g. 200 OK).
Transactions are further categorized as either type ''invite'' or type ''non-invite''. Invite transactions differ in that they can establish a long-running conversation, referred to as a ''dialog'' in SIP, and so include an acknowledgment (ACK) of any non-failing final response, e.g., ''200 OK''.

Because of these transactional mechanisms, SIP can make use of un-reliable transports such as [[User Datagram Protocol]] (UDP).


==Instant messaging and presence==
==Instant messaging and presence==
The [[SIMPLE (instant messaging protocol)|Session Initiation Protocol for Instant Messaging and Presence Leveraging Extensions]] (SIMPLE) is the SIP-based suite of standards for [[instant messaging]] and [[presence information]]. MSRP ([[Message Session Relay Protocol]]) allows instant message sessions and file transfer.
The [[Session Initiation Protocol for Instant Messaging and Presence Leveraging Extensions]] (SIMPLE) is the SIP-based suite of standards for [[instant messaging]] and [[presence information]]. [[Message Session Relay Protocol]] (MSRP) allows instant message sessions and file transfer.


==Conformance testing==
==Conformance testing==
[[TTCN-3]] test specification language is used for the purposes of specifying conformance tests for SIP implementations. SIP test suite is developed by a Specialist Task Force at [[ETSI]] (STF 196).<ref>[http://portal.etsi.org/ptcc/downloads/TTCN3SIPOSP.pdf Experiences of Using TTCN-3 for Testing SIP and also OSP] {{wayback|url=http://portal.etsi.org/ptcc/downloads/TTCN3SIPOSP.pdf |date=20140330061038 }}</ref> The SIP developer community meets regularly at the SIP Forum [http://www.sipit.net/ SIPit] events to test interoperability and test implementations of new RFCs.
The SIP developer community meets regularly at conferences organized by SIP Forum to test interoperability of SIP implementations.<ref>{{cite web |url=http://www.sipit.net/ |title=SIPit Wiki |access-date=2017-10-07}}</ref> The [[TTCN-3]] test specification language, developed by a task force at [[ETSI]] (STF 196), is used for specifying conformance tests for SIP implementations.<ref>{{citation |url=http://portal.etsi.org/ptcc/downloads/TTCN3SIPOSP.pdf |title=Experiences of Using TTCN-3 for Testing SIP and also OSP |archive-url=https://web.archive.org/web/20140330061038/http://portal.etsi.org/ptcc/downloads/TTCN3SIPOSP.pdf |archive-date=March 30, 2014}}</ref>

==Performance testing==
When developing SIP software or deploying a new SIP infrastructure, it is important to test the capability of servers and IP networks to handle certain call load: number of concurrent calls and number of calls per second. SIP performance tester software is used to simulate SIP and RTP traffic to see if the server and IP network are stable under the call load.<ref name="performance_tests">{{cite web
| url = http://startrinity.com/VoIP/TestingSipPbxSoftswitchServer.aspx
| title = Performance and Stress Testing of SIP Servers, Clients and IP Networks
| date = 2016-08-13
| publisher = StarTrinity
}}</ref> The software measures performance indicators like answer delay, [[answer/seizure ratio]], RTP [[jitter]] and [[packet loss]], [[round-trip delay time]].


==Applications==
==Applications==
A '''SIP connection''' is a marketing term for [[voice over Internet Protocol]] (VoIP) services offered by many [[Internet telephony service provider]]s (ITSPs). The service provides routing of telephone calls from a clients [[private branch exchange]] (PBX) telephone system to the [[public switched telephone network]] (PSTN). Such services may simplify corporate information system infrastructure by sharing [[Internet access]] for voice and data, and removing the cost for [[Basic Rate Interface]] (BRI) or [[Primary Rate Interface]] (PRI) telephone circuits.
''SIP connection'' is a marketing term for [[voice over Internet Protocol]] (VoIP) services offered by many [[Internet telephony service provider]]s (ITSPs). The service provides routing of telephone calls from a client's [[private branch exchange]] (PBX) telephone system to the PSTN. Such services may simplify corporate information system infrastructure by sharing [[Internet access]] for voice and data, and removing the cost for [[Basic Rate Interface]] (BRI) or [[Primary Rate Interface]] (PRI) telephone circuits.


[[SIP trunking]] is a similar marketing term preferred for when the service is used to simplify a telecom infrastructure by sharing the carrier access circuit for voice, data, and Internet traffic while removing the need for PRI circuits.<ref>{{Cite web|url=http://sip-trunking.tmcnet.com/topics/enterprise-voip/articles/109840-att-discusses-its-sip-peering-architecture.htm|title=AT&T Discusses Its SIP Peering Architecture|website=sip-trunking.tmcnet.com|access-date=2017-03-20}}</ref><ref>{{Cite web|url=http://hdvoicenews.com/2010/10/18/from-iit-voip-conference-expo-att-sip-transport-powerpoint-slides/|title=From IIT VoIP Conference & Expo: AT&T SIP transport PowerPoint slides|date=2010-10-19|website=HD Voice News|access-date=2017-03-20}}</ref>
Many [[VoIP]] phone companies allow customers to use their own SIP devices, such as SIP-capable telephone sets, or [[softphone]]s.


SIP-enabled video surveillance cameras can make calls to alert the owner or operator that an event has occurred; for example, to notify that motion has been detected out-of-hours in a protected area.
SIP-enabled video surveillance cameras can initiate calls to alert the operator of events, such as the motion of objects in a protected area.


SIP is used in [[audio over IP]] for [[broadcasting]] applications where it provides an interoperable means for audio interfaces from different manufacturers to make connections with one another.<ref>{{cite web |url=http://tech.ebu.ch/webdav/site/tech/shared/techreview/trev_2008-Q1_coinchon.pdf |title=Streaming audio contributions over IP |accessdate=2010-12-27 |last=Jonsson |first=Lars |author2=Mathias Coinchon |year=2008 |format=PDF |work=EBU Technical Review}}</ref>
SIP is used in [[audio over IP]] for [[broadcasting]] applications where it provides an interoperable means for audio interfaces from different manufacturers to make connections with one another.<ref>{{cite web |url=http://tech.ebu.ch/webdav/site/tech/shared/techreview/trev_2008-Q1_coinchon.pdf |title=Streaming audio contributions over IP |access-date=2010-12-27 |last=Jonsson |first=Lars |author2=Mathias Coinchon |year=2008 |work=EBU Technical Review}}</ref>


==Implementations==
==SIP-ISUP interworking==
The U.S. [[National Institute of Standards and Technology]] (NIST), Advanced Networking Technologies Division provides a public-domain [[Java (programming language)|Java]] implementation<ref>{{cite web |url= https://github.com/usnistgov/jsip |title=JAIN SIP project |website=[[GitHub]] |access-date=2024-06-24}}</ref> that serves as a [[reference implementation]] for the standard. The implementation can work in proxy server or user agent scenarios and has been used in numerous commercial and research projects. It supports {{IETF RFC|3261}} in full and a number of extension RFCs including {{IETF RFC|6665}} (event notification) and {{IETF RFC|3262}} (reliable provisional responses).
SIP-I, or the Session Initiation Protocol with encapsulated [[ISDN User Part|ISUP]], is a protocol used to create, modify, and terminate communication sessions based on ISUP using SIP and IP networks. Services using SIP-I include voice, video telephony, fax and data. SIP-I and SIP-T<ref>{{cite web|url=http://www.ietf.org/rfc/rfc3372.txt |title=RFC3372: SIP-T Context and Architectures |date=September 2002 |accessdate=2011-01-11}}</ref> are two protocols with similar features, notably to allow ISUP messages to be transported over SIP networks. This preserves all of the detail available in the ISUP header, which is important as there are many country-specific variants of ISUP that have been implemented over the last 30 years, and it is not always possible to express all of the same detail using a native SIP message. SIP-I was defined by the [[ITU-T]], whereas SIP-T was defined via the [[IETF]] [[Request for Comments|RFC]] route.<ref>[http://www.4gamericas.org/documents/3G_Americas_SIP-I_White_Paper_August_2007-FINAL.pdf White Paper: "Why SIP-I? A Switching Core Protocol Recommendation"]</ref>


Numerous other commercial and open-source SIP implementations exist. See [[List of SIP software]].
==Deployment issues==
If the call traffic runs on the same connection with other traffic, such as email or Web browsing, voice and even signaling packets may be dropped and the voice stream may be interrupted.


==SIP-ISUP interworking==
To mitigate this, many companies split voice and data between two separate internet connections. Alternately, some networks use the Differentiated services ([[DiffServ]]) field (previously defined as Type of Service ([[Type_of_service|ToS]]) field) in the header of [[IPv4_header#Header|IPV4]] packets to mark the relative time-sensitivity of SIP and RTP as compared to web, email, video and other types of IP traffic. This precedence marking method requires that all routers in the SIP and RTP paths support separate queues for different traffic types. Other options to control delay and loss include incorporating multiple VLANs (virtual local area networks), [[traffic shaping]] to avoid this resource conflict, but the efficacy of this solution is dependent on the number of packets dropped between the Internet and the PBX.
SIP-I, Session Initiation Protocol with encapsulated [[ISDN User Part|ISUP]], is a protocol used to create, modify, and terminate communication sessions based on ISUP using SIP and IP networks. Services using SIP-I include voice, video telephony, fax and data. SIP-I and SIP-T<ref name="RFC 3372">{{cite IETF |rfc=3372 |title=SIP-T Context and Architectures |date=September 2002}}</ref> are two protocols with similar features, notably to allow ISUP messages to be transported over SIP networks. This preserves all of the detail available in the ISUP header.{{efn|ISUP detail is important as there are many country-specific variants of ISUP that have been implemented over the last 30 years, and it is not always possible to express all of the same detail using a native SIP message.}} SIP-I was defined by the [[ITU-T]], whereas SIP-T was defined by the [[IETF]].<ref>{{cite web |url=http://www.4gamericas.org/documents/3G_Americas_SIP-I_White_Paper_August_2007-FINAL.pdf |title=Why SIP-I? A Switching Core Protocol Recommendation |archive-url=https://web.archive.org/web/20120317091603/http://www.4gamericas.org/documents/3G_Americas_SIP-I_White_Paper_August_2007-FINAL.pdf |archive-date=2012-03-17 |url-status=dead}}</ref>


==Encryption==
Registration is required if the end user has a dynamic IP address, if the provider does not support static hostnames, or if [[Network address translation|NAT]] is used. In order to share several DID numbers on the same registration, the IETF has defined additional headers (for example "P-Preferred-Identity", see RFC 3325). This avoids multiple registrations from one PBX to the same provider. Using this method the PBX can indicate what identity should be presented to the [[Called party]] and what identity should be used for authenticating the call. This feature is also useful when the PBX redirects an incoming call to a PSTN number, for example a cell phone, to preserve the original [[Caller ID]].
Concerns about the security of calls via the public Internet have been addressed by encryption of the SIP protocol for [[secure transmission]]. The URI scheme SIPS is used to mandate that SIP communication be secured with [[Transport Layer Security]] (TLS). SIPS URIs take the form sips:user@example.com.


[[End-to-end encryption]] of SIP is only possible if there is a direct connection between communication endpoints. While a direct connection can be made via [[Peer-to-peer SIP]] or via a [[VPN]] between the endpoints, most SIP communication involves multiple hops, with the first hop being from a user agent to the user agent's [[ITSP]]. For the multiple-hop case, SIPS will only secure the first hop; the remaining hops will normally not be secured with TLS and the SIP communication will be insecure. In contrast, the [[HTTPS]] protocol provides end-to-end security as it is done with a direct connection and does not involve the notion of hops.
Users should also be aware that a SIP connection can be used as a channel for attacking the company's internal networks, similar to Web and Email attacks. Users should consider installing appropriate security mechanisms to prevent malicious attacks.


The media streams (audio and video), which are separate connections from the SIPS signaling stream, may be encrypted using SRTP. The key exchange for SRTP is performed with [[SDES]] ({{IETF RFC|4568}}), or with [[ZRTP]] ({{IETF RFC|6189}}). When SDES is used, the keys will be transmitted via insecure SIP unless SIPS is used. One may also add a [[MIKEY]] ({{IETF RFC|3830}}) exchange to SIP to determine session keys for use with SRTP.
==Encryption==
The increasing concerns about security of calls that run over the public Internet has made SIP encryption more popular. Because [[VoIP VPN|VPN]] is not an option for most service providers, most service providers that offer secure SIP (SIPS) connections use [[Transport Layer Security|TLS]] for securing signaling. The relationship between SIP (port 5060) and SIPS (port 5061), is similar to that as for HTTP and HTTPS, and uses URIs in the form "sips:user@example.com". The media streams, which occur on different connections to the signaling stream, can be encrypted with [[Secure Real-time Transport Protocol|SRTP]]. The key exchange for SRTP is performed with [[SDES]] (RFC 4568), or the newer and often more user friendly [[ZRTP]] (RFC 6189), which can automatically upgrade RTP to SRTP using dynamic key exchange (and a verification phrase). One can also add a [[MIKEY]] (RFC 3830) exchange to SIP and in that way determine session keys for use with SRTP.


==See also==
==See also==
{{div col|colwidth=20em}}
{{div col}}
* [[Rendezvous protocol]]
* [[Peer-to-peer SIP]]
* [[Computer telephony integration]] (CTI)
* [[Computer telephony integration]] (CTI)
* [[Computer-supported telecommunications applications]] (CSTA)
* [[Computer-supported telecommunications applications]] (CSTA)
* [[H.323]] protocols [[H.225.0]] and [[H.245]]
* [[H.323]] protocols [[H.225.0]] and [[H.245]]
* [[IP Multimedia Subsystem]] (IMS)
* [[IP Multimedia Subsystem]] (IMS)
* [[Extensions to the Session Initiation Protocol for the IP Multimedia Subsystem]]
* [[List of SIP software]]
* [[Media Gateway Control Protocol]] (MGCP)
* [[Media Gateway Control Protocol]] (MGCP)
* [[Message Session Relay Protocol]] (MSRP)
* [[Mobile VoIP]]
* [[Mobile VoIP]]
* [[MSCML]] (Media Server Control Markup Language)
* [[MSCML]] (Media Server Control Markup Language)
* [[Network convergence]]
* [[Network convergence]]
* [[Rendezvous protocol]]
* [[RTP audio video profile]]
* [[RTP payload formats]]
* [[SIGTRAN]] (Signaling Transport)
* [[SIGTRAN]] (Signaling Transport)
* [[SIP extensions for the IP Multimedia Subsystem]]
* [[SIP trunking]]
* [[SIP provider]]
* [[SIP provider]]
* [[Skinny Client Control Protocol]] (SCCP)
* [[Skinny Client Control Protocol]] (SCCP)
* [[T.38]]
* [[XIMSS]] (XML Interface to Messaging, Scheduling, and Signaling)
* [[XIMSS]] (XML Interface to Messaging, Scheduling, and Signaling)
* [[ZRTP]]
{{div col end}}
{{div col end}}

==Notes==
{{Notelist}}


==References==
==References==
{{Reflist|colwidth=30em}}
{{Reflist}}
{{Refbegin}}
* {{citation |author1=Brian Reid|author2=Steve Goodman|title=Exam Ref 70-342 Advanced Solutions of Microsoft Exchange Server 2013 (MCSE)|date=22 January 2015|publisher=Microsoft Press|isbn=9780735697904|page=24|ref={{sfnref|Brian Reid|Steve Goodman|2015}}}}
* {{citation |author1=Miikka Poikselkä|author2=Georg Mayer|author3=Hisham Khartabil|author4=Aki Niemi|title=The IMS: IP Multimedia Concepts and Services in the Mobile Domain|date=19 November 2004|publisher=John Wiley & Sons|isbn=978047087114-0|page=268|ref={{sfnref|Miikka Poikselkä|Georg Mayer|Hisham Khartabil|Aki Niemi|2004}}}}
{{Refend}}


==External links==
==External links==
* [https://www.iana.org/assignments/sip-parameters IANA: SIP Parameters]
* {{dmoz|Computers/Internet/Protocols/SIP/|Computers/Internet/Protocols/SIP/}}
* [https://www.iana.org/assignments/sip-events/sip-events.xhtml IANA: SIP Event Types Namespace]
* [http://www.cs.columbia.edu/sip/ Henning Schulzrinne's SIP homepage] hosted by Columbia University
* [http://www.siptutorial.net/SIP/ SIP Beginners' Tutorial] SIP Basics to get started
* [http://www.iana.org/assignments/sip-parameters IANA: SIP Parameters]
* [http://www.iana.org/assignments/sip-events/sip-events.xhtml IANA: SIP Event Types Namespace]
* [http://blog.trueconf.com/reviews/why-sip-better-than-h323.html Key Differences Between SIP and H.323]


{{Instant messaging}}
{{Instant messaging}}
{{Authority control}}


[[Category:VoIP protocols]]
[[Category:VoIP protocols]]
[[Category:VoIP terminology & concepts]]
[[Category:Videotelephony]]
[[Category:Videotelephony]]
[[Category:Application layer protocols]]
[[Category:Application layer protocols]]

Latest revision as of 12:29, 14 December 2024

Session Initiation Protocol
Communication protocol
AbbreviationSIP
PurposeInternet telephony
IntroductionMarch 1999; 25 years ago (1999-03)
OSI layerApplication layer (Layer 7)
Port(s)5060, 5061
RFC(s)2543, 3261

The Session Initiation Protocol (SIP) is a signaling protocol used for initiating, maintaining, and terminating communication sessions that include voice, video and messaging applications.[1] SIP is used in Internet telephony, in private IP telephone systems, as well as mobile phone calling over LTE (VoLTE).[2]

The protocol defines the specific format of messages exchanged and the sequence of communications for cooperation of the participants. SIP is a text-based protocol, incorporating many elements of the Hypertext Transfer Protocol (HTTP) and the Simple Mail Transfer Protocol (SMTP).[3] A call established with SIP may consist of multiple media streams, but no separate streams are required for applications, such as text messaging, that exchange data as payload in the SIP message.

SIP works in conjunction with several other protocols that specify and carry the session media. Most commonly, media type and parameter negotiation and media setup are performed with the Session Description Protocol (SDP), which is carried as payload in SIP messages. SIP is designed to be independent of the underlying transport layer protocol and can be used with the User Datagram Protocol (UDP), the Transmission Control Protocol (TCP), and the Stream Control Transmission Protocol (SCTP). For secure transmissions of SIP messages over insecure network links, the protocol may be encrypted with Transport Layer Security (TLS). For the transmission of media streams (voice, video) the SDP payload carried in SIP messages typically employs the Real-time Transport Protocol (RTP) or the Secure Real-time Transport Protocol (SRTP).

History

[edit]

SIP was originally designed by Mark Handley, Henning Schulzrinne, Eve Schooler and Jonathan Rosenberg in 1996 to facilitate establishing multicast multimedia sessions on the Mbone. The protocol was standardized as RFC 2543 in 1999. In November 2000, SIP was accepted as a 3GPP signaling protocol and permanent element of the IP Multimedia Subsystem (IMS) architecture for IP-based streaming multimedia services in cellular networks. In June 2002 the specification was revised in RFC 3261[4] and various extensions and clarifications have been published since.[5]

SIP was designed to provide a signaling and call setup protocol for IP-based communications supporting the call processing functions and features present in the public switched telephone network (PSTN) with a vision of supporting new multimedia applications. It has been extended for video conferencing, streaming media distribution, instant messaging, presence information, file transfer, Internet fax and online games.[1][6][7]

SIP is distinguished by its proponents for having roots in the Internet community rather than in the telecommunications industry. SIP has been standardized primarily by the Internet Engineering Task Force (IETF), while other protocols, such as H.323, have traditionally been associated with the International Telecommunication Union (ITU).

Protocol operation

[edit]
An example of a SIP message exchange between two users, Alice and Bob, to establish and end a direct media session.

SIP is only involved in the signaling operations of a media communication session and is primarily used to set up and terminate voice or video calls. SIP can be used to establish two-party (unicast) or multiparty (multicast) sessions. It also allows modification of existing calls. The modification can involve changing addresses or ports, inviting more participants, and adding or deleting media streams. SIP has also found applications in messaging applications, such as instant messaging, and event subscription and notification.

SIP works in conjunction with several other protocols that specify the media format and coding and that carry the media once the call is set up. For call setup, the body of a SIP message contains a Session Description Protocol (SDP) data unit, which specifies the media format, codec and media communication protocol. Voice and video media streams are typically carried between the terminals using the Real-time Transport Protocol (RTP) or Secure Real-time Transport Protocol (SRTP).[3][8]

Every resource of a SIP network, such as user agents, call routers, and voicemail boxes, are identified by a Uniform Resource Identifier (URI). The syntax of the URI follows the general standard syntax also used in Web services and e-mail.[9] The URI scheme used for SIP is sip and a typical SIP URI has the form sip:username@domainname or sip:username@hostport, where domainname requires DNS SRV records to locate the servers for SIP domain while hostport can be an IP address or a fully qualified domain name of the host and port. If secure transmission is required, the scheme sips is used.[10][11]

SIP employs design elements similar to the HTTP request and response transaction model.[12] Each transaction consists of a client request that invokes a particular method or function on the server and at least one response. SIP reuses most of the header fields, encoding rules and status codes of HTTP, providing a readable text-based format.

SIP can be carried by several transport layer protocols including Transmission Control Protocol (TCP), User Datagram Protocol (UDP), and Stream Control Transmission Protocol (SCTP).[13][14] SIP clients typically use TCP or UDP on port numbers 5060 or 5061 for SIP traffic to servers and other endpoints. Port 5060 is commonly used for non-encrypted signaling traffic whereas port 5061 is typically used for traffic encrypted with Transport Layer Security (TLS).

SIP-based telephony networks often implement call processing features of Signaling System 7 (SS7), for which special SIP protocol extensions exist, although the two protocols themselves are very different. SS7 is a centralized protocol, characterized by a complex central network architecture and dumb endpoints (traditional telephone handsets). SIP is a client-server protocol of equipotent peers. SIP features are implemented in the communicating endpoints, while the traditional SS7 architecture is in use only between switching centers.

Network elements

[edit]

The network elements that use the Session Initiation Protocol for communication are called SIP user agents. Each user agent (UA) performs the function of a user agent client (UAC) when it is requesting a service function, and that of a user agent server (UAS) when responding to a request. Thus, any two SIP endpoints may in principle operate without any intervening SIP infrastructure. However, for network operational reasons, for provisioning public services to users, and for directory services, SIP defines several specific types of network server elements. Each of these service elements also communicates within the client-server model implemented in user agent clients and servers.[15]

User agent

[edit]

A user agent is a logical network endpoint that sends or receives SIP messages and manages SIP sessions. User agents have client and server components. The user agent client (UAC) sends SIP requests. The user agent server (UAS) receives requests and returns a SIP response. Unlike other network protocols that fix the roles of client and server, e.g., in HTTP, in which a web browser only acts as a client, and never as a server, SIP requires both peers to implement both roles. The roles of UAC and UAS only last for the duration of a SIP transaction.[6]

A SIP phone is an IP phone that implements client and server functions of a SIP user agent and provides the traditional call functions of a telephone, such as dial, answer, reject, call hold, and call transfer.[16][17] SIP phones may be implemented as a hardware device or as a softphone. As vendors increasingly implement SIP as a standard telephony platform, the distinction between hardware-based and software-based SIP phones is blurred and SIP elements are implemented in the basic firmware functions of many IP-capable communications devices such as smartphones.

In SIP, as in HTTP, the user agent may identify itself using a message header field (User-Agent), containing a text description of the software, hardware, or the product name. The user agent field is sent in request messages, which means that the receiving SIP server can evaluate this information to perform device-specific configuration or feature activation. Operators of SIP network elements sometimes store this information in customer account portals,[18] where it can be useful in diagnosing SIP compatibility problems or in the display of service status.

Proxy server

[edit]

A proxy server is a network server with UAC and UAS components that functions as an intermediary entity for the purpose of performing requests on behalf of other network elements. A proxy server primarily plays the role of call routing; it sends SIP requests to another entity closer to the destination. Proxies are also useful for enforcing policy, such as for determining whether a user is allowed to make a call. A proxy interprets, and, if necessary, rewrites specific parts of a request message before forwarding it.

SIP proxy servers that route messages to more than one destination are called forking proxies. The forking of a SIP request establishes multiple dialogs from the single request. Thus, a call may be answered from one of multiple SIP endpoints. For identification of multiple dialogs, each dialog has an identifier with contributions from both endpoints.

Redirect server

[edit]

A redirect server is a user agent server that generates 3xx (redirection) responses to requests it receives, directing the client to contact an alternate set of URIs. A redirect server allows proxy servers to direct SIP session invitations to external domains.

Registrar

[edit]
SIP user agent registration to SIP registrar with authentication.

A registrar is a SIP endpoint that provides a location service. It accepts REGISTER requests, recording the address and other parameters from the user agent. For subsequent requests, it provides an essential means to locate possible communication peers on the network. The location service links one or more IP addresses to the SIP URI of the registering agent. Multiple user agents may register for the same URI, with the result that all registered user agents receive the calls to the URI.

SIP registrars are logical elements and are often co-located with SIP proxies. To improve network scalability, location services may instead be located with a redirect server.

Session border controller

[edit]
Establishment of a session through a back-to-back user agent.

Session border controllers (SBCs) serve as middleboxes between user agents and SIP servers for various types of functions, including network topology hiding and assistance in NAT traversal. SBCs are an independently engineered solution and are not mentioned in the SIP RFC.

Gateway

[edit]

Gateways can be used to interconnect a SIP network to other networks, such as the PSTN, which use different protocols or technologies.

SIP messages

[edit]

SIP is a text-based protocol with syntax similar to that of HTTP. There are two different types of SIP messages: requests and responses. The first line of a request has a method, defining the nature of the request, and a Request-URI, indicating where the request should be sent.[19] The first line of a response has a response code.

Requests

[edit]

Requests initiate a functionality of the protocol. They are sent by a user agent client to the server and are answered with one or more SIP responses, which return a result code of the transaction, and generally indicate the success, failure, or other state of the transaction.

SIP requests
Request name Description Notes RFC references
REGISTER Register the URI listed in the To-header field with a location server and associates it with the network address given in a Contact header field. The command implements a location service. RFC 3261
INVITE Initiate a dialog for establishing a call. The request is sent by a user agent client to a user agent server. When sent during an established dialog (reinvite) it modifies the sessions, for example placing a call on hold. RFC 3261
ACK Confirm that an entity has received a final response to an INVITE request. RFC 3261
BYE Signal termination of a dialog and end a call. This message may be sent by either endpoint of a dialog. RFC 3261
CANCEL Cancel any pending request. Usually means terminating a call while it is still ringing, before answer. RFC 3261
UPDATE Modify the state of a session without changing the state of the dialog. RFC 3311
REFER Ask recipient to issue a request for the purpose of call transfer. RFC 3515
PRACK Provisional acknowledgement. PRACK is sent in response to provisional response (1xx). RFC 3262
SUBSCRIBE Initiates a subscription for notification of events from a notifier. RFC 6665
NOTIFY Inform a subscriber of notifications of a new event. RFC 6665
PUBLISH Publish an event to a notification server. RFC 3903
MESSAGE Deliver a text message. Used in instant messaging applications. RFC 3428
INFO Send mid-session information that does not modify the session state. This method is often used for DTMF relay. RFC 6086
OPTIONS Query the capabilities of an endpoint. It is often used for NAT keepalive purposes. RFC 3261

Responses

[edit]

Responses are sent by the user agent server indicating the result of a received request. Several classes of responses are recognized, determined by the numerical range of result codes:[20]

  • 1xx: Provisional responses to requests indicate the request was valid and is being processed.
  • 2xx: Successful completion of the request. As a response to an INVITE, it indicates a call is established. The most common code is 200, which is an unqualified success report.
  • 3xx: Call redirection is needed for completion of the request. The request must be completed with a new destination.
  • 4xx: The request cannot be completed at the server for a variety of reasons, including bad request syntax (code 400).
  • 5xx: The server failed to fulfill an apparently valid request, including server internal errors (code 500).
  • 6xx: The request cannot be fulfilled at any server. It indicates a global failure, including call rejection by the destination.

Transactions

[edit]
Example: User1's UAC uses an invite client transaction to send the initial INVITE (1) message. If no response is received after a timer-controlled wait period the UAC may choose to terminate the transaction or retransmit the INVITE. Once a response is received, User1 is confident the INVITE was delivered reliably. User1's UAC must then acknowledge the response. On delivery of the ACK (2), both sides of the transaction are complete. In this case, a dialog may have been established.[21]

SIP defines a transaction mechanism to control the exchanges between participants and deliver messages reliably. A transaction is a state of a session, which is controlled by various timers. Client transactions send requests and server transactions respond to those requests with one or more responses. The responses may include provisional responses with a response code in the form 1xx, and one or multiple final responses (2xx – 6xx).

Transactions are further categorized as either type invite or type non-invite. Invite transactions differ in that they can establish a long-running conversation, referred to as a dialog in SIP, and so include an acknowledgment (ACK) of any non-failing final response, e.g., 200 OK.

Instant messaging and presence

[edit]

The Session Initiation Protocol for Instant Messaging and Presence Leveraging Extensions (SIMPLE) is the SIP-based suite of standards for instant messaging and presence information. Message Session Relay Protocol (MSRP) allows instant message sessions and file transfer.

Conformance testing

[edit]

The SIP developer community meets regularly at conferences organized by SIP Forum to test interoperability of SIP implementations.[22] The TTCN-3 test specification language, developed by a task force at ETSI (STF 196), is used for specifying conformance tests for SIP implementations.[23]

Performance testing

[edit]

When developing SIP software or deploying a new SIP infrastructure, it is important to test the capability of servers and IP networks to handle certain call load: number of concurrent calls and number of calls per second. SIP performance tester software is used to simulate SIP and RTP traffic to see if the server and IP network are stable under the call load.[24] The software measures performance indicators like answer delay, answer/seizure ratio, RTP jitter and packet loss, round-trip delay time.

Applications

[edit]

SIP connection is a marketing term for voice over Internet Protocol (VoIP) services offered by many Internet telephony service providers (ITSPs). The service provides routing of telephone calls from a client's private branch exchange (PBX) telephone system to the PSTN. Such services may simplify corporate information system infrastructure by sharing Internet access for voice and data, and removing the cost for Basic Rate Interface (BRI) or Primary Rate Interface (PRI) telephone circuits.

SIP trunking is a similar marketing term preferred for when the service is used to simplify a telecom infrastructure by sharing the carrier access circuit for voice, data, and Internet traffic while removing the need for PRI circuits.[25][26]

SIP-enabled video surveillance cameras can initiate calls to alert the operator of events, such as the motion of objects in a protected area.

SIP is used in audio over IP for broadcasting applications where it provides an interoperable means for audio interfaces from different manufacturers to make connections with one another.[27]

Implementations

[edit]

The U.S. National Institute of Standards and Technology (NIST), Advanced Networking Technologies Division provides a public-domain Java implementation[28] that serves as a reference implementation for the standard. The implementation can work in proxy server or user agent scenarios and has been used in numerous commercial and research projects. It supports RFC 3261 in full and a number of extension RFCs including RFC 6665 (event notification) and RFC 3262 (reliable provisional responses).

Numerous other commercial and open-source SIP implementations exist. See List of SIP software.

SIP-ISUP interworking

[edit]

SIP-I, Session Initiation Protocol with encapsulated ISUP, is a protocol used to create, modify, and terminate communication sessions based on ISUP using SIP and IP networks. Services using SIP-I include voice, video telephony, fax and data. SIP-I and SIP-T[29] are two protocols with similar features, notably to allow ISUP messages to be transported over SIP networks. This preserves all of the detail available in the ISUP header.[a] SIP-I was defined by the ITU-T, whereas SIP-T was defined by the IETF.[30]

Encryption

[edit]

Concerns about the security of calls via the public Internet have been addressed by encryption of the SIP protocol for secure transmission. The URI scheme SIPS is used to mandate that SIP communication be secured with Transport Layer Security (TLS). SIPS URIs take the form sips:user@example.com.

End-to-end encryption of SIP is only possible if there is a direct connection between communication endpoints. While a direct connection can be made via Peer-to-peer SIP or via a VPN between the endpoints, most SIP communication involves multiple hops, with the first hop being from a user agent to the user agent's ITSP. For the multiple-hop case, SIPS will only secure the first hop; the remaining hops will normally not be secured with TLS and the SIP communication will be insecure. In contrast, the HTTPS protocol provides end-to-end security as it is done with a direct connection and does not involve the notion of hops.

The media streams (audio and video), which are separate connections from the SIPS signaling stream, may be encrypted using SRTP. The key exchange for SRTP is performed with SDES (RFC 4568), or with ZRTP (RFC 6189). When SDES is used, the keys will be transmitted via insecure SIP unless SIPS is used. One may also add a MIKEY (RFC 3830) exchange to SIP to determine session keys for use with SRTP.

See also

[edit]

Notes

[edit]
  1. ^ ISUP detail is important as there are many country-specific variants of ISUP that have been implemented over the last 30 years, and it is not always possible to express all of the same detail using a native SIP message.

References

[edit]
  1. ^ a b "What is SIP?". Network World. May 11, 2004. Archived from the original on June 24, 2014.
  2. ^ "4G | ShareTechnote". www.sharetechnote.com. Retrieved 2023-03-09.
  3. ^ a b Johnston, Alan B. (2004). SIP: Understanding the Session Initiation Protocol (Second ed.). Artech House. ISBN 9781580531689.
  4. ^ "SIP core working group charter". Internet Engineering Task Force. 2010-12-07. Retrieved 2011-01-11.
  5. ^ "Search Internet-Drafts and RFCs". Internet Engineering Task Force.
  6. ^ a b SIP: Session Initiation Protocol. 2002. doi:10.17487/RFC3261. RFC 3261.
  7. ^ Rouse, Margaret. "Session Initiation Protocol (SIP)". TechTarget.
  8. ^ Coll, Eric (2016). Telecom 101. Teracom Training Institute. pp. 77–79. ISBN 9781894887038.
  9. ^ Uniform Resource Identifiers (URI): Generic Syntax. 2005. doi:10.17487/RFC3986. RFC 3986.
  10. ^ Miikka Poikselkä et al. 2004.
  11. ^ Brian Reid & Steve Goodman 2015.
  12. ^ "SIP: Session Initiation Protocol". IETF.
  13. ^ The Stream Control Transmission Protocol (SCTP) as a Transport for the Session Initiation Protocol (SIP). 2005. doi:10.17487/RFC4168. RFC 4168.
  14. ^ Montazerolghaem, Ahmadreza; Hosseini Seno, Seyed Amin; Yaghmaee, Mohammad Hossein; Tashtarian, Farzad (2016-06-01). "Overload mitigation mechanism for VoIP networks: a transport layer approach based on resource management". Transactions on Emerging Telecommunications Technologies. 27 (6): 857–873. doi:10.1002/ett.3038. ISSN 2161-3915. S2CID 27215205.
  15. ^ Montazerolghaem, A.; Moghaddam, M. H. Y.; Leon-Garcia, A. (March 2018). "OpenSIP: Toward Software-Defined SIP Networking". IEEE Transactions on Network and Service Management. 15 (1): 184–199. arXiv:1709.01320. doi:10.1109/TNSM.2017.2741258. ISSN 1932-4537. S2CID 3873601.
  16. ^ Azzedine (2006). Handbook of algorithms for wireless networking and mobile computing. CRC Press. p. 774. ISBN 978-1-58488-465-1.
  17. ^ Porter, Thomas; Andy Zmolek; Jan Kanclirz; Antonio Rosela (2006). Practical VoIP Security. Syngress. pp. 76–77. ISBN 978-1-59749-060-3.
  18. ^ "User-Agents We Have Known". VoIP User. Archived from the original on 2011-07-16.
  19. ^ Stallings, p.214
  20. ^ Stallings, pp.216-217
  21. ^ Wright, James. "SIP - An Introduction" (PDF). Konnetic. Retrieved 2011-01-11.
  22. ^ "SIPit Wiki". Retrieved 2017-10-07.
  23. ^ Experiences of Using TTCN-3 for Testing SIP and also OSP (PDF), archived from the original (PDF) on March 30, 2014
  24. ^ "Performance and Stress Testing of SIP Servers, Clients and IP Networks". StarTrinity. 2016-08-13.
  25. ^ "AT&T Discusses Its SIP Peering Architecture". sip-trunking.tmcnet.com. Retrieved 2017-03-20.
  26. ^ "From IIT VoIP Conference & Expo: AT&T SIP transport PowerPoint slides". HD Voice News. 2010-10-19. Retrieved 2017-03-20.
  27. ^ Jonsson, Lars; Mathias Coinchon (2008). "Streaming audio contributions over IP" (PDF). EBU Technical Review. Retrieved 2010-12-27.
  28. ^ "JAIN SIP project". GitHub. Retrieved 2024-06-24.
  29. ^ SIP-T Context and Architectures. September 2002. doi:10.17487/RFC3372. RFC 3372.
  30. ^ "Why SIP-I? A Switching Core Protocol Recommendation" (PDF). Archived from the original (PDF) on 2012-03-17.
  • Brian Reid; Steve Goodman (22 January 2015), Exam Ref 70-342 Advanced Solutions of Microsoft Exchange Server 2013 (MCSE), Microsoft Press, p. 24, ISBN 9780735697904{{citation}}: CS1 maint: ref duplicates default (link)
  • Miikka Poikselkä; Georg Mayer; Hisham Khartabil; Aki Niemi (19 November 2004), The IMS: IP Multimedia Concepts and Services in the Mobile Domain, John Wiley & Sons, p. 268, ISBN 978047087114-0{{citation}}: CS1 maint: ref duplicates default (link)
[edit]