sip version2.1

61
SIP demystified

Upload: fahmy111

Post on 15-Nov-2014

127 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: SIP Version2.1

SIP demystified

Page 2: SIP Version2.1

A bit of history

• The internet multimedia conferencing architecture still had a missing piece: it did not have a way to explicitly invite users to join a particular session.

• A multicast session could be announced but it was up to the potential receiver to check through all of the announced sessions periodically to find one he wanted to join.

• Inviting users to sessions was the original purpose of SIP. The protocol has evolved steadily and SIP is currently used to invite users to all types of sessions, including multicast and point-to-point sessions.

Page 3: SIP Version2.1

SIP functionality

• Establishment.• Modification.• Termination.

Could invite users to an ongoing session or to a session that is yet to be established.

Supports negotiation to the parameters of the new session. Compatible with session description protocol to announce the parameters

of the session.

Page 4: SIP Version2.1

SIP addressing

• Users in a SIP environment are identified by SIP Uniform Resource Locators (URLs).

• SIP:[email protected].

Registrations:• A user may register on the proxy server using his current location like :

SIP:[email protected].

Page 5: SIP Version2.1

SIP Entities

• User agents.• Redirect Servers:

– Group addresses

• Proxy Servers– Forking proxies– Group addresses

• Registrars• Location servers

Bob’s computer (user agent)

I am "Bob Johnson."Today I will be reachable at:sip: [email protected]

SIP server (registrar and proxy) at company.com

Location server

I am "Bob Johnson."Today I will be reachable at:sip: [email protected]

Page 6: SIP Version2.1

SIP features

• Interoperability.• Future-proof.• Separation between establishment and description of session.• Intelligence in end systems.• Scalability.• Service creation.

– Combined services and unified communication.– Sane infrastructure for providing new services.

• Messages are human readable. As it is text based not binary based.

Page 7: SIP Version2.1

Client/Server Transactions

• SIP is based on the Web protocol Hypertext Transfer Protocol (HTTP) and like HTTP, SIP is a request/response protocol.

• A client is a SIP entity that generates requests. A server is a SIP entity that receives requests and returns responses.

• A SIP request, together with the responses it triggers, is referred to as a SIP transaction.

Page 8: SIP Version2.1

SIP Responses

• Every response has a code that indicates the status of the transaction.• integers ranging from 100 to 699 and are grouped into classes.

- 100—199 Informational- 200—299 Success- 300—399 Redirection- 400—499 Client error- 500—599 Server error- 600—699 Global failure

• A response with a status code from 100 to 199 is considered provisional. Responses from 200 to 699 are final responses.

Page 9: SIP Version2.1

SIP Requests

• The core SIP defines 6 methods: INVITE ACK OPTIONS BYE CANCEL REGISTER

Page 10: SIP Version2.1

INVITE method

• Invites the user to a certain session.• Body contains the description of the session in SDP format.

• The response contains the port number and the other info reported by the accepting party.

v=0o=Bob 2890844526 2890842807 IN IP4 131.160.1.112s=I want to know how you are doingc=IN IP4 131.160.1.112t=0 0m=audio 49170 RTP/AVP 0

v=0o=Laura 2891234526 2812342807 IN IP4 138.85.27.10s=I want to know how you are doingc=IN IP4 138.85.27.10t=0 0m=audio 20000 RTP/AVP 0

Page 11: SIP Version2.1

INVITE method

Bob Laura

INVITE

180 RINGING

200 OK

Page 12: SIP Version2.1

ACK method• Declares the reception of a final response.• Providing a three way handshake.• To avoid a retransmission of the requests.

Bob Laura

INVITE

200 OK

INVITE

INVITE

INVITE

Page 13: SIP Version2.1

ACK method

Bob Laura

INVITE

180 RINGING

200 OK

Ack

Conversation

Page 14: SIP Version2.1

CANCEL method

• Cancel pending transactions.• the CANCEL request will have no effect on the transaction after the final

response.

Bob Laura

180 RINGING

200 OK

ACK

INVITE

CANCEL

487 TRANSACTION CANCELED

Page 15: SIP Version2.1

CANCEL method

Laura

ACK

INVITE

CANCEL

200 OK200 OK

ACK

Conversation

200 OK

487 CANCELED

ACK

CANCEL

200 OK

487 CANCELED

Forking proxy Company.com university.com131.160.1.112

INVITE

INVITE

INVITE

Bob

Page 16: SIP Version2.1

BYE and REGISTER methods• BYE requests are used to abandon sessions.• REGISTER requests to inform a server (in this case, referred to as a

registrar) about their current location.

Bob Laura

INVITE

180 RINGING

200 OK

ACK

Conversation

200 OK

BYE

Bob

REGISTER

200 OK

REGISTRAR

Page 17: SIP Version2.1

OPTIONS method

• OPTIONS requests query a server about its capabilities including which methods and which session description protocols it supports.

OPTIONS

200 OK

Bob SIP SERVER

Page 18: SIP Version2.1

SIP request format

• Request line.– Method. – Request-URI (next hop).– Protocol version.

• Several headers.• Empty line.• Message body.

– INVITE sip:[email protected] SIP/2.0

Page 19: SIP Version2.1

SIP Response Format

• Status line (SIP/2.0 180 Ringing)– Protocol version.– Status code.– Reason phrase.

• Several headers.• Empty line.• Message body.

Page 20: SIP Version2.1

SIP headers• Headers provide information about the request (or response) and

about the body it contains.• The header consists of the header name, followed by a colon,

followed by the header value.– From: Bob Johnson sip:[email protected]

Call-ID:Bob

LauraINVITE

200 OK

ACK

INVITE

200 OK

ACK

Conversation

200 OK

BYECall-ID: [email protected]

Call-ID: [email protected]

Call-ID: [email protected]

Call-ID: [email protected]

Call-ID: [email protected]

Call-ID: [email protected]

Call-ID: [email protected]

Call-ID: [email protected]

Page 21: SIP Version2.1

SIP headers• Contact

– provides a URL where the user can be reached directly.

LAURA

BobINVITE

200 OK

INVITE

200 OK

ACK

Conversation

200 OK

BYESIP: [email protected] SIP/2.0

SIP: [email protected] SIP/2.0

Contact: SIP: [email protected]

SIP: [email protected] SIP/2.0

Contact: SIP: [email protected]

SIP: [email protected] SIP/2.0

SIP proxy

Page 22: SIP Version2.1

SIP headers• Cseq (Cseq: 1 INVITE)

• From:– contains the initiator of the request and a SIP URL From: Bob Johnson <sip:[email protected]>

Bob

LauraINVITE

200 OK

ACK

INVITE

200 OK

ACK

Conversation

200 OK

BYECseq: 3 BYE

Cseq: 3 BYE

Cseq: 2 ACK

Cseq: 2 INVITE

Cseq: 2 INVITE

Cseq: 1 ACK

Cseq: 1 INVITE

Cseq: 1 INVITE

Page 23: SIP Version2.1

SIP headers• TO

– Always contains the recipient of the request.– Does not change through a session.

• Via– Store all the proxies that handle the request.– Used for detecting routing loops.

LAURA

Bob

INVITE SIP: [email protected] SIP/2.0

200 OK200 OK

ACK

Conversation

200 OK

BYEVia: SIP/2.0/UDP workstation1000.university.com: 5060

Via: SIP/2.0/UDP workstation1000.university.com: 5060

Via: SIP/2.0/UDP workstation1000.university.com: 5060

Via: SIP/2.0/UDP workstation1000.university.com: 5060

Via: SIP/2.0/UDP 131.160.1.100: 5060Via: SIP/2.0/UDP workstation1000.university.com: 5060

Via: SIP/2.0/UDP workstation1000.university.com: 5060

SIP proxy

INVITE SIP:[email protected] SIP/2.0

Via: SIP/2.0/UDP 131.160.1.100: 5060

Via: SIP/2.0/UDP workstation1000.university.com: 5060

Page 24: SIP Version2.1

Record-Route and Route• These two headers are used by proxies that want to be in the

signaling path for the entire session.

LAURA

Bob

INVITE SIP: [email protected] SIP/2.0

200 OK200 OK

ACK

Conversation

200 OK

BYE SIP: [email protected] SIP/2.0Route:<SIP: [email protected]

Route:<SIP:[email protected]>

Contact:<SIP:[email protected]>Record–Route:<SIP:[email protected];

maddr=123.160.1.110

Record-Route:<SIP:[email protected];maddr=131.160.1.112

Contact: <SIP:[email protected]>Record-Route:<SIP:[email protected];

maddr=131.160.1.112

SIP proxy

INVITE SIP:[email protected] SIP/2.0

ACKSIP:[email protected] SIP/2.0

BYE SIP: [email protected] SIP/2.0

200 OK

Page 25: SIP Version2.1

Extending SIP• Some implementations need functionality beyond the core protocol,

which means that SIP needs to be enhanced somehow. Extension negotiation:• Negotiation process is needed in order to determine the extensions

that will be used within any given session.• The process of negotiating is conducted using two headers: Require

and Supported

Bob INVITE

200 OK

ACK

Require: foo1Supported: foo2, foo3, foo4

Require: foo1, foo2Supported: foo4, foo5

Laura

Page 26: SIP Version2.1

Mid-session Transactions That Do NotChange the State of the Session

• The core SIP specification provides a mean to change the parameters of the sessions through re-INVITEs.

• Parties involved in a session may need to exchange information that does not influence the state of the session in any way

• A new SIP method called INFO was defined.

Bob LauraINVITE

200 OK

ACK

200 OK

BYE

200 OK

INFO

200 OK

INFO

Page 27: SIP Version2.1

Instant Messages• If a message is need to be sent during a session.• A new method (MESSAGE) was modified.

Bob Laura

INVITE

200 OK

ACK

200 OK

MESSAGE

Page 28: SIP Version2.1

Preconditions to Be Fulfilled Before Alerting• For sessions needing special requirements, the way of establishing a

session immediately doesn’t work properly.• for sessions requiring a certain QoS a way was to be done to

guarantee the required QoS.• A new method called preCOnditions MET (COMET) was defined.

Bob LauraINVITE

183 session progress

PRACK

200 OK

COMET

QoS preconditions

Bob

per

form

sQ

oS r

eser

vatio

ns

200 OK

180 ringing

LAU

RA

pe

rfor

ms

QoS

res

erva

tions

Page 29: SIP Version2.1

Call preferences

(5) INVITEAccept-Contact: *;mobility="fixed"

Reject-Contact: *;mobility="mobile"Request-Disposition: no-fork

(6) INVITEAccept-Contact: *;mobility="fixed"

Reject-Contact: *;mobility="mobile"Request-Disposition: no-fork

(1) REGISTERContact: [email protected];

mobility="fixed";class="business"

(3) REGISTERContact: [email protected];

mobility="mobile";class="personal"

200 OK

200 OK

Proxy

Bob'smobile

terminal

Bob'sfixed

terminalLaura

Page 30: SIP Version2.1

Asynchronous Notification of Events

Bob LauraINVITE

484 busy here

ACK

SUBSCRIBE: Laura’s status200 OK

Notify: Laura busy

ACK

Notify: Laura Available

ACK

INVITE

Page 31: SIP Version2.1

Session transfer

INVITE

200 OK

ACK

Conversation

INVITE(hold)

200 OK

ACK

REFERRefer-To: SIP: [email protected]: SIP: [email protected]

ACCEPTED

INVITE

200 OK

ACK

Referred-By: SIP: [email protected]

NOTIFY

200 OK

BYE

200 OK

Conversation

Laura

Bob’s secretary

Bob

Page 32: SIP Version2.1

Third party call control

INVITESDP computer

200 OKSDP conference unit

INVITE NO SDP

200 OKSDP computer

ACKNo SDP

ACKSDP conference

unit

BobBob’s Computer

Conference unit

Page 33: SIP Version2.1

Types of proxies• Call stateful proxy:

– Call stateful proxies need to be informed of all the SIP transactions that occur during the session.

– These proxies store state information from the moment the session is established until the moment it ends.

– Useful in call charging.

• Stateful Proxy:– sometimes called transaction stateful proxies because the transaction is their sole

concern.– Forking proxies are good examples of stateful proxies.

• Stateless Proxy:– Stateless proxies don’t keep any state. They receive a request, forward it to the

next hop, and immediately delete all state related to that request.

Page 34: SIP Version2.1

Call Stateful proxies

INVITE

200 OK

ACK

BobBob’s Computer

Conference unit

INVITE

200 OK

ACK

Conversation

BYEBYE

200 OK200 OK

E-mail

E-mail:Your last call lasted five minutes

and twenty seconds

Page 35: SIP Version2.1

Distribution of Proxies

Call Stateful proxies

Core

Stateful proxies

Stateless proxies

Page 36: SIP Version2.1

B2BUA

• A B2BUA is a logical entity acts as a user agent to both ends of a SIP call. They remain in the path of the call from establishment till termination.

• Used to implement prepaid services and charging.

Page 37: SIP Version2.1

IMS• The 3GPP divided the UMTS architecture into Access network (AN)

and Core Network (CN). The Core Network can be further split into:– The Circuit-Switched (CS) Domain.– The Packet-Switched (PS) Domain.– The Internet Multimedia Subsystem (IMS).

• It relies on the IP connectivity provided by the PS domain. • The IMS is based on the SIP protocol and architecture.

IMSCS-Domain

PS-Domain

CNAN

Page 38: SIP Version2.1

High-Level IMS Requirements• IP Connectivity.

– terminal mobility.– user mobility.

• Access Independence.• Roaming Support.• QoS support.• Security

Visited IMS (proxy)

Home IMS(service control)

Visited PS Domain

Visited IMS (proxy)

Home IMS(service control)

Visited PS Domain

HomePS Domain

Page 39: SIP Version2.1

Overview of IMS architecture

• S-CSCF:– Serving Call Session Control Function.– Authentication.– User profiles (downloaded from HSS (Home Subscriber Server) via diameter interface).– Initiating Call control.– Service control (through communicating with application servers(AS)).

– Prohibition of media types.

• P-CSCF:– Integrity & confidentiality (through TLS & IPSEC SA)– SIP messages compression.– Prohibit codecs.– Policy control.

Page 40: SIP Version2.1

IMS Architecture

• I-CSCF:– Receives both the registrations and the incoming requests.– Interrogates the HSS to receive assistance for subsequent routing to the proper S-

CSCF.– Forwards the SIP requests to the corresponding S-CSCF.

Page 41: SIP Version2.1

IMS Architecture

UE S-CSCF

HSS

P-CSCF I-CSCF(1) register (2) register

(3)

S-C

SC

F

assi

gnm

ent

(4) register

5. S-CSCF assigned

and user profile

download

UE I-CSCF

HSS

P-CSCF S-CSCF(5) Invite (4) Invite (3) Invite

(2)

Que

ry fo

r

S-C

SC

F

(1) Invite

Page 42: SIP Version2.1

The application server and the media server

• Application server.

• Media server:– MRFP.

• media stream source• media stream processing• mixing of media streams

– MRFC.

AS

S-CSCF(1) SIP request

(2)

SIP

re

ques

t

(4) SIP request

(3) SIP

request

AS

S-CSCF MRFC

MRFP

SIP

SIP

ME

GA

CO

Page 43: SIP Version2.1

IMS Architecture• All the depicted interfaces are based on SIP, except for:

– Mn and Mp: based on MEGACO– Cx and Sh: based on Diameter

Page 44: SIP Version2.1

Call Flows (register)

UE IP-CAN P-CSCF I-CSCF HSS S-CSCF

Home network

Downloadof user profile

retrieveauth. vector

S-CSCFassignment

Access bearerset-up and

P-CSCF discovery

200 OK

200 OK

REGISTER

REGISTER

REGISTER

401 Unauthorized401 Unauthorized

401 Unauthorized

REGISTER

REGISTERREGISTER

Page 45: SIP Version2.1

Registration (Roaming case)

UE IP-CAN P-CSCF I-CSCF HSS S-CSCF

Downloadof user profile

retrieveauth. vector

S-CSCFassignment

Access bearerset-up and

P-CSCF discovery

200 OK

200 OK

REGISTER

REGISTER

REGISTER

401 Unauthorized401 Unauthorized

401 Unauthorized

REGISTER

REGISTERREGISTER

Visited network Home network

Page 46: SIP Version2.1

Call Setup

UE P-CSCF S-CSCF I-CSCF HSS S-CSCF

Home network Visited network

P-CSCF UEINVITE

INVITEINVITE

INVITE

S-CSCFlocationquery

INVITE

INVITE

183

183

183

183183

183

Page 47: SIP Version2.1

IMS Security

UE P-CSCF I-CSCF S-CSCF HSS AUC

AUTNcheck

RES=XRES?

REGISTERREGISTER

REGISTER

401UnauthorizedRAND, AUTN,

IK, CK

401UnauthorizedRAND, AUTN,

IK, CK

401UnauthorizedRAND, AUTN,

IK, CK

AuthenticationAnswer

RAND,AUTN,XRES, IK, CK

Authenticationrequest

Authenticationinfo

SAsestablishmentREGISTER

RES REGISTERRES REGISTER

RES

User profiledownload200 OK200 OK200 OK

Page 48: SIP Version2.1

The IM call model• The IMS standards divide the call execution flow into two parts:

originating and terminating. Associated with each part is a service control entity:

– The service control in the originating part is done by the home S-CSCF of the originator of the request.

– The service control in the terminating part is done by the home S-CSCF of the recipient of the request.

AS

S-SCSF

External AS

Page 49: SIP Version2.1

The IM call model

AS4AS3AS2AS1

S-CSCFiFC 1 and 4 are metiFC 2and 3 not met

Page 50: SIP Version2.1

Charging• Offline Charging:

– All the IMS elements (P/I/S-CSCF, BGCF, MGCF, MRFC, SIP AS) can generate offline charging information. The charging information is sent via Diameter protocol to a Charging Collection Function (Rf interface). The CCF processes the received information, and generates billing records that are sent via FTP to the billing system (Bi interface).

P-CSCF

CCF

S-CSCF I-CSCF BGCF MGCF MRFC

Billing system

AS

Rf

Bi

Page 51: SIP Version2.1

Online Charging

• The S-CSCF, AS, and MRFC support a Diameter-based charging interface (Ro) toward an Online Charging Function (OCF). The OCF is a functional element capable of charging in realtime. It performs mainly three functions:

– Charging control.– Account balance management.– Rating.

OCF

S-CSCF MRFC AS

Ro

Page 52: SIP Version2.1

New Requirements on SIP due to IMS

• Service Route Discovery During Registration:

S-CSCFI-CSCFP-CSCFUE

pcscf1.ocean.com scscf1.ocean.com

REGISTER

REGISTER

REGISTER

200 OKService-Route:

scscf1.ocean.com200 OK

Service-Route:scscf1.ocean.com

200 OKService-Route:

scscf1.ocean.comINVITE

Route: pcscf1.ocean.com;scscf1.ocean.com INVITE

Route: scscf1.ocean.com

Page 53: SIP Version2.1

New Requirements on SIP due to IMS

• Discovering Adjacent Contacts:

S-CSCFI-CSCFP-CSCFUE

pcscf1.ocean.com scscf1.ocean.com

REGISTER

REGISTERPath: pcscf1.ocean.com

200 OK

200 OK200 OK

INVITER-U: [email protected]

INVITER-U: [email protected]: pcscf1.ocean.com

REGISTERPath: pcscf1.ocean.com

INVITER-U: [email protected]

230.40.45.12

Page 54: SIP Version2.1

Private SIP Extensions for 3GPP IMS

• P-Visited-Network-ID Header.• P-Access-Network-Info Header• P-Charging-Function-Address Header• P-Charging-Vector Header• P-Associated-URI• P-Called-Party-ID

Page 55: SIP Version2.1

Voice XML (VXML)• Standard XML format for specifying interactive voice dialogues between a

human and a computer.• VoiceXML is designed for:

– Creating audio dialogs that feature synthesized speech– Digitized audio– Recognition of spoken and DTMF key input– Recording of spoken input, telephony, and mixed initiative conversations– Its major goal is to bring the advantages of Web-based development and content

delivery to interactive voice response applications.

• HTTP is used as the transport protocol for fetching VoiceXML pages.• Associated with other standards like:

– Speech recognition grammar specification (SRGS).– Speech synthesis markup language (SSML).– Pronunciation lexicon specification (PLS). – Call control extensible markup language (CCXML).

Page 56: SIP Version2.1

VXML applications

• Order inquiry.• package tracking.• emergency notification.• flight tracking.• voice access to email.• customer relationship management.• prescription refilling.• audio newsmagazines.• voice dialing.• real-estate information and national directory assistance applications.

Page 57: SIP Version2.1

SIP IVR

• SIP protocol can be used as a signaling mean for an IVR.• A session between the IVR and the Transmission delivery station ought to

be established using SIP.• Voice and DTMF signals should be described in the session description in

the invite method.• Voice and DTMF signals are made to be transferred in separate sessions.• Next follows an example of SDP that offers support for DTMF:

– m = audio 42000 RTP/AVP 100.– a = rtpmap:100 telephone-event/8000.

Transmission delivery station

IVRSession establishment

(containing voice and DTMF signals) using SIP

Page 58: SIP Version2.1

ISUP to SIP converter

• May be used for the interaction between IP based systems and PSTN/PLMN.

• Signaling Plane:- An IP/PSTN gateway can perform two operations at the signaling plane:

– Protocol translation back and forth between ISUP and SIP.– ISUP encapsulation in SIP messages, and ISUP decapsulation from SIP messages.

Page 59: SIP Version2.1

ISUP to SIP converter

• Media plane:– In the media plane, the conversion occurs between RTP, in the IP side, and

TDM in the PSTN side.– TDM and RTP will still contain PCM 6 -encoded voice.

GW

Page 60: SIP Version2.1

ISUP to SIP converter

• Example:– PSTN to PSTN call via IP:

Page 61: SIP Version2.1

Thank you