Вы находитесь на странице: 1из 46

SIP

SessionInitiationProtocol

GENERALOVERVIEW
TheSessionInitiationProtocol(SIP)isaanapplicationlayer signaling,presence andinstantmessagingprotocoldevelopedtosetup,modify,andteardown multimediasessions,requestanddeliverpresenceandinstantmessagesoverthe Internet. Internet SIPisaendtoend,clientserver,extensible,textbasedprotocol ThedesignbasewasHTTP andSMTP SIPmessagesareeitherrequestsorresponses. g q p SIPmessagescarrieszeroormorebodies. SDP (Sessiondescriptionprotocol) isthecommonbodyforsessioninitiation. SIPrunsonanytransportprotocol(UDP,TCP,TLS TransportLayerSecurity,SCTP StreamControlTransmissionProtocol) Stream Control Transmission Protocol) SIPsupportsfivefunctionalityofestablishingandterminatingmultimedia communications:
Userlocation Useravailability User availability Usercapabilities Sessionsetup Sessionmanagement

SIPdoesnotprovideservices SIP d t id i
Butitenablesthesystemtoprovideservices IthasbeendemonstratedthatitiseasytoprovideserviceswithSIP

SIPworkswithbothIPv4andIPv6

SIPArchitecturalelements SIP Architectural elements

UserAgent

Anapplicationthatinitiates,receivesandterminatescalls.
UserAgentClients(UAC)Anentitythatinitiatesacall. UserAgentServer(UAS)Anentitythatreceivesacall. BothUACandUAScanterminateacall.

ProxyServer

Anintermediaryprogramthatactsasbothaserverandaclient tomakerequestsonbehalfofotherclients. Requestsareservicedinternallyorbypassingthemon,possibly Requests are serviced internally or by passing them on possibly aftertranslation,tootherservers. Interprets,rewritesortranslates arequestmessagebefore forwardingit. forwarding it.

RedirectServer

AserverthatacceptsaSIPrequest,mapstheaddressintozero ormorenewaddressesandreturnstheseaddressestothe client. client Unlikeaproxyserver,theredirectserverdoesnotinitiateits ownSIPrequest. Unlikeauseragentserver,theredirectserverdoesnotacceptor terminatecalls. i ll

RegistrarServer

AserverthatacceptsREGISTERrequests. Theregisterservermaysupportauthentication. Aregistrarserveristypicallycolocatedwithaproxyorredirect server and may offer location services. andmayofferlocationservices.

LocationServer

AlocationserverisusedbyaSIPredirectorproxyservertoobtaininformation aboutacalledparty spossiblelocation(s). about a called partys possible location(s). ItisnotaSIPelementandtheprotocols between theSIP (proxy/redirect)server and thelocation server isnotSIP (itmaybeLightweightDirectoryAccessProtocol (LDAP)) (LDAP) )

SIPGateway

Anapplication thatinterfacesaSIPnetworktoanetworkusinganother signalingprotocol Itcanalsoterminatethemediapath: l i h di h


aSIP/PSTN gatewayterminatesboththesignalingandthemediapath aSIP/H323 gatewayterminatesonlythesignalingpath

Itisjustaspecialtypeofuseragent(supportinglotsofusers) It is just a special type of user agent (supporting lots of users)

Basicconcepts Basic concepts

Dialog S i Session Transaction

Dialog
AdialogrepresentsapeertopeerSIPrelationshipbetweentwouseragents thatpersistsforsometime p Thedialogfacilitatessequencingofmessagesbetweentheuseragentsand properroutingofrequestsbetweenbothofthem. ThedialogrepresentsacontextinwhichtointerpretSIPmessages. Th di l t t t i hi h t i t t SIP AdialogisidentifiedateachUAwithadialogID,whichconsistsofaCallID value,alocaltagandaremotetag Adialogcanalsobeinthe"early"state,whichoccurswhenitiscreatedwith aprovisionalresponse,andthentransitiontothe"confirmed"statewhena 2xxfinalresponsearrives. 2xx final response arrives Dialogsarecreatedthroughthegenerationofnonfailureresponsesto requestswithspecificmethods.WithinthespecificationofRFC3261,only2xx and101199responseswithaTotag,wheretherequestwasINVITE,will establishadialog.

Session
SIPestablishes,modifies,andterminatesmultimediasessions.Itcanbe usedtoinvitenewmemberstoanexistingsessionortocreatebrand d i i b i i i b d newsessions. SessionsconsistingofRTPstreamscarryingaudioandvideoareusually g y g y describedusingSDP,butsometypesofsessioncanbedescribedwith otherdescriptionprotocols. AssumingBobwantstoplaychesswithLaura,hehastheoptionofusing Assuming Bob wants to play chess with Laura he has the option of using achessspecificsession,whichwillbedescribedbyachessspecific descriptionprotocolinsteadofSDP.

Transaction
SIPisatransactionalprotocol:interactionsbetweencomponentstake l l b k placeinaseriesofindependentmessageexchanges. Specifically,aSIPtransactionconsistsofasinglerequestandany p y, g q y responsestothatrequest,whichincludezeroormoreprovisional responsesandoneormorefinalresponses. InthecaseofatransactionwheretherequestwasanINVITE(knownasan In the case of a transaction where the request was an INVITE (known as an INVITEtransaction),thetransactionalsoincludestheACKonlyifthefinal responsewasnota2xxresponse. Iftheresponsewasa2xx,theACKisnotconsideredpartofthe transaction.

SIP Methods
SIP uses Methods / R M h d Requests and corresponding R d di Responses to establish a call session.

SIPmethods:
REGISTER :registeringcontactinformation INVITE,ACK,CANCEL:settingupsessions , , g p BYE :terminatingsessions OPTIONS : querying servers about their :queryingserversabouttheir capabilities INFO :carryingoutofband i f O i f b d information,like i lik DTMFdigits

SIPRequestmessages q g
INVITE:invitesapartytoparticipateinasession;mayincludeSDP descriptions;reINVITES areusetochangesessionstate BYE:terminates/leavesasession BYE: terminates/leaves a session ACK:confirmsthereceptionofanINVITEresponse(i.e. thesessionestablishment) CANCEL:cancelsapendingrequest(i.e.apendingINVITE) CANCEL: cancels a pending request (i e a pending INVITE) REGISTER:toregisteranaddresswithaSIPserver;mayconveyuserdata(e.g. callprocessingscripts) OPTIONS:queryaboutaserverforcapabilities OPTIONS: query about a server for capabilities SUBSCRIBE:installsasubscriptionforaresource NOTIFY:informsaboutchangesinthestateoftheresource MESSAGE:deliversanInstantMessage MESSAGE: delivers an Instant Message REFER:usedforcalltransfer,calldiversion,etc. PRACK:acknowledgesaprovisionalresponseforanINVITErequest UPDATE:changesthemediadescription(e.g.SDP)inanexistingsession UPDATE: changes the media description (e g SDP) in an existing session INFO:usedtotransportmidsessioninformation (DTMFdigits) PUBLISH:publicationofpresenceinformation

SIPResponses p
Class 1xx 2xx 3xx 4xx 5xx 6xx Description Informational Success Redirection Client error Server failure Global failure Action
Indicates status of call prior to completion. If first informational or provisional response. Request has succeeded If for an INVITE, ACK should succeeded. INVITE be sent; otherwise, stop retransmissions of request. Server has returned possible locations. The client should retry request at another server. The request has failed due to an error by the client. The client may retry the request if reformulated according to response. The request has failed due to an error by the server. The request may be retried at another server. The request has failed. The request should not be tried again at this or other servers. servers

SomeSIPresponses p

SIPgivesyouagloballyreachableaddress.

SIPaddresses SIP addresses

CallersbindtothisaddressusingSIPREGISTERmethod. Callersusethisaddresstoestablishrealtimecommunication withcallees.

SIPusesUniformResourceIdentifiers(URIs).Atleast,SIPURIsandSIPS URIsaresupported,althoughothers(suchasTELURL)arecommonly URI d lh h h ( h TEL URL) l supported.


sip:sergio.graziosi@ericsson.com sips:sergio.graziosi@ericsson.com sips:sergio graziosi@ericsson com sip:voicemail@iptel.org?subject=callme sip:wwwproxy.ericsson.se:3132 sip:anotherproxy.ericsson.se;transport=UDP sip:anotherproxy ericsson se;transport=UDP

TheURL must includehost,may includeusername,portnumber, parameters(e.g.,transport),etc.Itmay beembeddedinWebpages, g ,p y , emailsignatures,printedonyourbusinesscard,etc. Addressspaceisunlimited

SIPURLs SIP URLs


sip:sergio@ericsson.com:3132;user=ip;
port t list of parameters

scheme user-name

host

sip:+39-06-72588392@ericsson.com;user=phone
The user parameter is used to determine if a telephone number is present in the user-name portion of the th URL A SIP URL is resolved to an IP address using DNS lookups and (possibly) SIP servers and at the time of the call

SIPsyntax
request
method URL SIP/2 0 SIP/2.0 Via: From: To: Call-ID: Cseq: Content-Length: g Content-Type: Header:

response
SIP/2.0 SIP/2 0 status reason SIP/2.0/protocol host:port user <sip:name_from@source_domain> user <sip:name to@dest domain> <sip:name_to@dest_domain> local_id@host seq_num method length of body g y type of body parameter; par1=value; par2=value ;par3=folded into next line

header r

blank line V=0 o=origin_user ti i i timestamp ti t timestamp IN IP4 h t t host c=IN IP4 media destination address t=0 0 m media m=media type port RTP/AVP payload types

body b

SIPCallwithdestinationproxy p y

ALICE
INVITE 180 ringing 200 OK

Proxy Server
INVITE 180 ringing 200 OK ACK MEDIA BYE 200 OK

BOB

SIPMessages
Request URI

Decremented by each SIP server

Not used by the protocol


DNS lookup by user agent to locate the IP address of the proxy Database lookup is performed by the proxy to locate the IP address

INVITE sip:bob@ericsson.se SIP/2.0 Via: SIP/2.0/UDP 100.101.102.103:5060;branch=z9hG4bKmp17a Max-Forwards: 70 To: B b Hi h i b b@ i T Bob High <sip:bob@ericsson.se> From: Alice Nice <sip:alice@example.com>;tag=42 Call-ID: 10@100.101.102.103 CSeq: 1 INVITE Subject: Where are you? S bj t Wh ? Contact: <sip:alice@sip_phone.example.com> Content-Type: application/sdp Content-Length: 159 v=0
o=alice 2890844526 2890844526 IN IP4 100.101.102.103

s=Phone Call t=0 t 00 c=IN IP4 100.101.102.103 m=audio 49170 RTP/AVP 0 a=rtpmap:0 PCMU/8000

SIPMessages
INVITE sip:bob@200.201.22.4 SIP/2.0
Via: SIP/2.0/UDP proxy.ericsson.se:5060;branch=z9hG4bK83842.1

Proxy adds the Via header The branch parameter is a transaction identifier

Via: SIP/2.0/UDP 100.101.102.103:5060;branch=z9hG4bKmp17a Max-Forwards: Max Forwards: 69 To: Bob High <sip:bob@ericsson.se> From: Alice Nice <sip:alice@example.com>;tag=42 Call-ID: 10@100.101.102.103 CSeq: 1 INVITE Subject: Where are you? Contact: <sip:alice@sip_phone.example.com> Content-Type: application/sdp Content-Length: Content Length: 159 v=0 o=alice 2890844526 2890844526 IN IP4 100.101.102.103 s=Phone Call t=0 0 c=IN IP4 100.101.102.103 m=audio 49170 RTP/AVP 0 a=rtpmap:0 PCMU/8000

SIPMessages
All Via: headers are copied
SIP/2.0 180 Ringing
Via: SIP/2.0/UDP proxy.ericsson.se:5060;branch=z9hG4bK83842.1 Via: SIP/2.0/UDP 100.101.102.103:5060;branch=z9hG4bKmp17a

To:Bob High <sip:bob@ericsson.se>; tag=314159 From: Alice Nice <sip:alice@example.com>; tag=42 Call-ID: 10@100.101.102.103 CSeq: 1 INVITE Contact: <sip:bob@200.201.202.203> Content-Length: 0

To: and From: are not exchanged To Tag: is added No SDP information is carried

SIPMessages

SIP/2.0 180 Ringing Via: SIP/2 0/UDP 100 101 102 103 5060 b SIP/2.0/UDP 100.101.102.103:5060;branch=z9hG4bKmp17a h 9hG4bK 17 To:Bob High <sip:bob@ericsson.se>; tag=314159 From: Alice Nice <sip:alice@example.com>; tag=42 Call-ID: 10@100.101.102.103 CSeq: 1 INVITE Contact: <sip:bob@200.201.202.203> Content-Length: 0

Topmost Via: is removed

SIPMessages
All Via: headers are copied
SIP/2.0 200 OK
Via: SIP/2.0/UDP proxy.ericsson.se:5060;branch=z9hG4bK83842.1

Via: SIP/2.0/UDP 100.101.102.103:5060;branch=z9hG4bKmp17a To: Bob High <sip:bob@ericsson se>tag 314159 <sip:bob@ericsson.se>tag=314159 From: Alice Nice <sip:alice@example.com>;tag=42 Call-ID: 10@100.101.102.103 CSeq: 1 INVITE Contact: <sip:bob@200 201 202 203> <sip:bob@200.201.202.203> Content-Type: application/sdp Content-Length: 159

To: and From: are not exchanged Same To and From Tags Contact: will be used to send messages bypassing proxy
v=0 o=bob 2890844526 2890844526 IN IP4 200.201.202.203 s=Phone Call t=0 0 c=IN IP4 200 201 202 203 200.201.202.203 m=audio 49172 RTP/AVP 0 a=rtpmap:0 PCMU/8000

SIPMessages
Topmost Via: is removed
SIP/2.0 200 OK Via: SIP/2.0/UDP 100.101.102.103:5060;branch=z9hG4bKmp17a To: Bob High <sip:bob@ericsson.se>tag=314159 From: Alice Ni <sip:alice@example.com>;tag=42 F Ali Nice i li @ l t 42 Call-ID: 10@100.101.102.103 CSeq: 1 INVITE Contact: <sip:bob@200.201.202.203> Content-Type: application/sdp C t tT li ti / d Content-Length: 159 v=0 o=b b 2890844526 2890844526 IN IP4 200 201 202 203 bob 200.201.202.203 s=Phone Call t=0 0 c=IN IP4 200.201.202.203 m=audio 49172 RTP/AVP 0 di a=rtpmap:0 PCMU/8000

This Thi response also indicates that l i di t th t the type of media session proposed by the caller is acceptable

SIPMessages
The branch parameter in the Via header field contains a new transaction identifier than the INVITE
ACK sip:bob@200.201.202.203 SIP/2.0 Via: SIP/2 0/UDP 100 101 102 103 5060 b SIP/2.0/UDP 100.101.102.103:5060;branch=z9hG4bKa42 h 9hG4bK 42 Max-Forwards: 70 To:Bob High <sip:bob@ericsson.se>; tag=314159 From: Alice Nice <sip:alice@example.com>; tag=42 Call-ID: 10@100.101.102.103 Call ID: 10@100 101 102 103 CSeq: 1 ACK Content-Length: 0

The ACK message is sent end-to-end

SIPMessages
The BYE message is sent end-to-end end to end
BYE sip:alice@sip_phone.example.com SIP/2.0 Via: SIP/2 0/UDP 100 101 102 103 5060 b SIP/2.0/UDP 100.101.102.103:5060;branch=z9hG4bK4332 h 9hG4bK4332 Max-Forwards: 70 To:Alice Nice <sip:alice@example.com>; tag=42 From: Bob High <sip:bob@ericsson.se>; tag=314159 Call-ID: 10@100.101.102.103 Call ID: 10@100 101 102 103 CSeq: 2000 BYE Content-Length: 0

To and From header fields are reversed from the messages in the g previous transaction

new transaction identifier from the INVITE or ACK transactions shown previously

SIPMessages
Same branch

SIP/2.0 200 OK Via: SIP/2 0/UDP 100 101 102 103 5060 b SIP/2.0/UDP 100.101.102.103:5060;branch=z9hG4bK4332 h 9hG4bK4332 To:Alice Nice <sip:alice@example.com>; tag=42 From: Bob High <sip:bob@ericsson.se>; tag=314159 Call-ID: 10@100.101.102.103 CSeq: 2000 BYE Content-Length: 0

The response echoes the CSeq p q of the original request: 2000 BYE

SIPMobility SIP Mobility


Terminalmobility
terminalmovesbetweensubnets

Personalmobility
diff differentterminals,same(IP/logical)address i l (IP/l i l) dd

Servicemobility y
keepsameserviceswhilemobile

Session mobility Sessionmobility


moveactivesessionacrossterminals

Encapsulationandtranslation Encapsulation and translation


E Encapsulation:SomeofSS7ISUPmessages l ti S f SS7 ISUP areencapsulatedintotheSIPmessagebody inorderthatinformationnecessaryfor q servicesisnotdiscardedintheSIPrequest. Translation:SomecriticalSS7ISUPmessages aretranslatedintothecorrespondingSIP t l t d i t th di SIP headersinordertodeterminehowtheSIP requestwillberouted.

WhatisSIPT What is SIP T


SIP-T : Session Initiation Protocol for Telephones IETF RFC 3372 SIP-T is not a new protocol, it is a set of mechanisms for interfacing traditional telephone signaling with SIP. (SIP - ISUP) Provide P id protocol translation and feature t t lt l ti df t transparency across points of PSTN-SIP interconnection. SIP-T SIP T for ISUP Interworking SIP and the proposed two methods, namely, encapsulation and mapping, respectively, as defined by RFC3204 and RFC3398. However, SIP-T is only SIP T focused on the basic call interoperability, for supplementary services are largely not involved

SIPTbasiccallmodel SIP T basic call model PSTN>IP>PSTN(SIPbridging) PSTN>IP IP>PSTN

SIPTflows SIP T flows


SIP Bridging (PSTN - IP - PSTN) PSTN origination - IP termination :The terminator has no use for t e e capsu ated ISUP a d as o o the encapsulated SU and ignores it. IP origination - PSTN termination: The terminating gateway only performs translation. IP origination - IP termination: This is a case for pure SIP.

SIP brigding (PSTN IP PSTN) (PSTN IP

PSTN
SIP Proxy

MGC SS7 ISUP

SIP
SIP Proxy

PSTN Phone

PSTN

MGC

SS7 ISUP

SIP brigding (PSTN IP PSTN) (PSTN IP


MGC#1 IAM MGC#2
PSTN Phone Ph

PSTN Phone

SIP Proxy

ACM ANM

INVITE 100 TRYING 18X 200 OK ACK CONVERSATION BYE 200 OK

IAM ACM ANM

REL RLC

REL RLC

PSTN orig -> IP term orig. term.

SIP Proxy

SIP Proxy

SIP

SIP
SIP Proxy

PSTN

MGC

SIP Phone Ph

SS7 ISUP
PSTN Phone

PSTN orig -> IP term orig. term.


MGC IAM
PSTN Phone
SIP Proxy

SIP Phone

ACM ANM

INVITE 100 TRYING 18X 200 OK ACK CONVERSATION BYE 200 OK

INVITE 18X 200 OK ACK

REL RLC BYE 200 OK

IP orig -> PSTN term orig. term.

SIP Proxy

PSTN

MGC SS7 ISUP SIP


SIP Proxy P SIP Proxy

SIP SIP Phone

IP orig -> PSTN term orig. > term.


SIP Phone INVITE 100 TRYING SIP Proxy MGC

INVITE 100 TRYING 18X ANM 200 OK ACK CONVERSATION BYE IAM ACM

18X 200 OK ACK

BYE 200 OK 200 OK REL

What is SIP-I
SIPwithEncapsulated ISUP I l di th ITU TSG11 group of TRQ 2815 d Q 1912 5 Including the ITU-TSG11 f TRQ.2815and Q.1912.5 TRQ.2815definestheSIPandBICC/ISUPinterworkingwhenthe technicalrequirements,includingtheexchangeinterfacemodel, technical requirements including the exchange interface model IWUIWU protocolsupporttheabilitytobeset,interoperable securitymodelinterfacesandsoon.Q.1912.5,whichaccordingto IWUintheSIPsideoftheNNIagreementonthenecessarysupport IWU i th SIP id f th NNI t th t totheabilitytoconfiguredifferentsets,adetaileddefinitionofthe 3GPPSIPandBICC/ISUPinteroperability,undernormal / p y, circumstancesSIPandBICC/ISUPinteroperability,SIPwithISUP messageWhenpackage(SIPI)andBICC/ISUPInterworking,etc. SIP I SIPIprotocolfamilyreusedanumberofIETFstandardsanddrafts, l f il d b f IETF d d dd f contenttocovernotonlybasiccallinteroperability,butalso / pp y g includestheBICC/ISUPSupplementaryServiceInterworking

ISUP-SIP message mapping (example) IAM<>INVITE ACM<>18X REL BYE REL<>BYE

SIP-I includes mapping for BICC and ISUP; SIP-T considers only ISUP SIP-T allows calls to originate and terminate at SIP endpoints, g p not just gateways

1. SIP-I 1 SIP I and SIP-T are two similar approaches that define SIP T interworking between SIP and ISUP networks Suppo d e e (SIP-T interworks with native e o s a e Support different use cases (S SIP terminals; SIP-I includes mapping for BICC) 2. Designed to allow ISUP to pass transparently through a SIP network if both endpoints are ISUP 3. 3 Allow deployment of SIP services for use in both SIP/IMS and PSTN/PLMN networks 4. Fully defined and widely deployed for basic calling, some y y p y g, class services 5. Ongoing work to add remaining class services for mixednetwork interworking

InternetEngineeringTaskForce(IETF) rfc
http://www.ietf.org/html.charters/sip-charter.html http://www ietf org/html charters/sip charter html SIP: Session Initiation Protocol h // http://www.ietf.org/rfc/rfc3261.txt i f / f / f 3261 Session Initiation Protocol (SIP) Basic Call Flow Examples http://www.ietf.org/rfc/rfc3665.txt Session Initiation Protocol (SIP): Locating SIP Servers http://www.ietf.org/rfc/rfc3263.txt SDP: Session Description Protocol http://www.ietf.org/rfc/rfc4566.txt An Offer/Answer Model with the Session Description Protocol http://www.ietf.org/rfc/rfc3264.txt y pp IP Mobility Support http://www.ietf.org/rfc/rfc2002.txt

Вам также может понравиться