• No results found

SIP Session Initiation Protocol

N/A
N/A
Protected

Academic year: 2021

Share "SIP Session Initiation Protocol"

Copied!
41
0
0

Loading.... (view fulltext now)

Full text

(1)

Laurent Réveillère

Enseirb

Département Télécommunications

[email protected]

SIP

(2)

2

SIP [RAISIN 2007] / ENSEIRB

Overview

The Internet

This is a funny movie! I bet Laura

would love to watch it…

How could I tell her about it?

(3)

Functionality Provided by SIP

Session establishment, modification, and termination

Used to create brand new sessions

Used to invite new members to an existing session

Sessions are established only if

The callee accepts the call

Caller and callee agree on the media parameters that will be used

Independence of

The type of multimedia session handheld

»

Videoconferences, audio calls, shared whiteboards,

gaming sessions, …

The mechanism used to describe the session

»

Usually SDP for RTP streams carrying audio and video

(4)

4

SIP [RAISIN 2007] / ENSEIRB

Where to find SIP?

Voice over LAN / Broadband

Cable Telephony

IM, Web phones, Multimedia

IP PBX and IP

Centrex

SIP

Applications

Interconnect

(5)

SIP Philosophy

Internet Standard

IETF -

http://www.ietf.org

Based on Client-Server Model

Clients send requests, receive responses

Servers receive requests, send responses

Reuse Internet addressing (URIs, DNS, proxies)

Utilizes rich Internet features set

Reuse HTTP coding

Text based

Makes no assumptions about underlying protocol

TCP, UDP, X.25, frame relay, ATM, etc.

(6)

6

SIP [RAISIN 2007] / ENSEIRB

Where is SIP in the Protocol Zoo?

Source: Henning Schulzrinne

(7)

SIP Architecture

Location

Server

Feature

Server

Registrar

Server

Proxy

Server

SIP Components

Proxy

Server

(8)

8

SIP [RAISIN 2007] / ENSEIRB

SIP Architecture

Location

Server

Feature

Server

Registrar

Server

Proxy

Server

SIP Components

Proxy

Server

User Agent

User Agent

(9)

User Agent (UA)

SIP entity that interacts with the user

Has an interface towards the user

May respond or forward invitations on user’s behalf

»

Does not necessary maintain interaction with the user

UAC (User Agent Client)

Caller application that initiates and sends SIP requests

UAS (User Agent Server)

Receives and responds to SIP requests on behalf of clients

Accepts, redirects or refuses calls

(10)

10

SIP [RAISIN 2007] / ENSEIRB

SIP Architecture

Location

Server

Feature

Server

Registrar

Server

Proxy

Server

SIP Components

Proxy

Server

User Agent

User Agent

(11)

Registrar Server

Accept registrar requests

Usually co-located with a location or proxy server

Store current location of users

A user can register from different locations

SIP Registrar Server

at company.com

I am “Bob.Johnson”

Today I will be reachable at:

sip:[email protected]

(12)

12

SIP [RAISIN 2007] / ENSEIRB

SIP Architecture

Location

Server

Feature

Server

Registrar

Server

Proxy

Server

SIP Components

Proxy

Server

User Agent

User Agent

(13)

Location Server

Not really a SIP entity

General term used for a database (RFC 2543)

SIP servers use non-SIP protocols to query, update, and retrieve

records from a location server

»

Example: LDAP (Lightweight Directory Access Protocol)

Main purpose

Stores and returns information about a user

»

Current URI

»

IP address

»

User preferences

»

Usually accessed through a registrar server and/or a proxy

server

(14)

14

SIP [RAISIN 2007] / ENSEIRB

SIP Architecture

Location

Server

Feature

Server

Registrar

Server

Proxy

Server

SIP Components

Proxy

Server

User Agent

User Agent

(15)

Proxy Server

Acts as both a server and a client

Make requests on behalf of other clients

Performs routing function

Determine to which hop signaling should be relayed

»

User agent, proxy, …

Interprets, rewrites or translates a request message before

forwarding it

Forking

Tries more than one location for a user

Parallel call

»

Trying all possible locations at the same time

Sequential search

(16)

16

SIP [RAISIN 2007] / ENSEIRB

Programming SIP

Location

Server

Feature

Server

Registrar

Server

Proxy

Server

SIP Components

Proxy

Server

User Agent

User Agent

(17)

Programming SIP

A SIP based system can support rapid service creations

Example of services

Basic call features

»

Call waiting, call forwarding, call blocking, etc.

Click to call

Call center

Find me / follow me

Service logic options

Call Processing Language (CPL)

Session Processing Language (SPL)

SIP Common Gateway Interface (SIP-CGI)

SIP Java Servlet (SIP-Servlet)

SIP

Java API for Integrated Networks (SIP-JAIN)

SIP Express Router Language (SER)

Microsoft SIP Processing Language (MSPL)

(18)

Laurent Réveillère

Enseirb

Département Télécommunications

[email protected]

Session Initiation Protocol – Raisin 2007

(19)

Client/Server Transaction

Request Response 1 Response n

Client

Server

Transaction

(20)

20

SIP [RAISIN 2007] / ENSEIRB

Requests and Responses

Similarities with HTTP

Text format (readability vs size)

Headers

Response code

»

Classes

»

Hierarchy

Body of requests and responses

Parameters (e.g., Session Description Protocol)

(21)

Session Description Protocol (SDP)

Format to describe a session (not a protocol)

Examples:

Name and purpose of the session

Media parameters of the underlying audio and video streams

IP addresses and port numbers

Session descriptions transferred via other protocols (SIP,

SAP, RTSP, HTTP…)

(22)

22

SIP [RAISIN 2007] / ENSEIRB

SDP Syntax

A set of lines of the form

Type = value

Type: One character

value: Format depends on type

Two sections

Session-level information

»

First line – SDP version: v=0

»

Applies to the whole session

»

Examples: originator or session name

Media-level information (if present)

»

First line – media type: m

»

Applies to a particular media stream

(23)

Example

v=0

o=bob 2890844526 28900842807 IN IP4 131.160.1.112

s=SIP seminar

i=A seminar on the Session Initiation Protocol

u=http://www.cs.columbia.edu/sip

[email protected]

c=IN IP4 224.2.17.12/127

t=2873397496 2873404696

a=recvonly

m=audio 49170 RTP/AVP 0

a=rtpmap:0 PCMU/8000

m=video 51372 RTP/AVP 31

a=rtpmap:31 H261/9000

m=video 53 RTP/AVP 32

a=rtpmap:32 MPV/9000

“o”: creator of the session and his IP addr

“s”: name of the session

“i”: general information about the session

“u”: URI for more information

“e”: e-mail address of the contact person

“c”: multicast address of the session

“t”: when the session is active

“m

”=<media type> <port #> <transp. prot.> <media fmt>

“a”: information about media format

Pars: clock rate, number of channels…

Introduction of new attributes

E.g., a=volume:8

Examples

(24)

24

SIP [RAISIN 2007] / ENSEIRB

SIP Responses

Range

Response class

100-199

Informational (provisional)

200-299

Success

300-399

Redirection

400-499

Client error

500-599

Server error

600-699

Global Failure

(25)

Protocol Operations/Methods

OPTIONS

Querying capabilities

»

Supported methods (future extensions)

»

Supported SDP

»

Supported message body encoding

REGISTER

Register current location

Multiple locations can be registered for a user

INVITE

ACK

BYE

(26)

26

SIP [RAISIN 2007] / ENSEIRB

Session Invitation (INVITE)

(1)INVITE (4) ACK (2) 180 Ringing (3) 200 OK

Conversation

Bob

Laura

(27)

Three-way Handshake (1)

(1)INVITE (4) ACK (2) 180 Ringing

Conversation

Response delay

Server

Client still there

Successful session

Billing

Parallel requests

(28)

28

SIP [RAISIN 2007] / ENSEIRB

Three-way Handshake (2) – Unreliable Protocol (UDP)

(1)INVITE

?

(2)INVITE (3)INVITE (4)INVITE

Bob

gives up

(5) 200 OK

(29)

End of Session (BYE)

(1)INVITE

(4) ACK (2) 180 Ringing

Conversation

Abandon by the issuing

participant

(3) 200 OK

(5) BYE (6) 200 OK

(30)

30

SIP [RAISIN 2007] / ENSEIRB

Session Cancellation (CANCEL)

(1)INVITE (4) 200 OK (2) 180 Ringing (3) CANCEL (5) 487 Transaction Cancelled (6) ACK

Interpretation

If session not established

»

Cancel

If session established

»

No effect

Three-way handshake

even for cancellation

Usage context

(31)

Forking Proxy and Cancellation

(1)INVITE (7) ACK

Conversation

(2)INVITE (3)INVITE (4)INVITE (5) 200 OK (6) 200 OK (8) CANCEL (9) 200 OK (10) 487 Cancelled (11) ACK (12) CANCEL (13) 200 OK (14) 487 Cancelled (15) ACK

Forking

(32)

32

SIP [RAISIN 2007] / ENSEIRB

Format of SIP messages

Status line

Protocol version

Status code

Reason phrase

Request-line

Header

Header-name : Header-value

Header

Message body (optional)

Empty Line

Status line

Header

Header-name : Header-value

Header

Message body (optional)

Request-line

Method

Request-URI (next hop)

Protocol version

Empty Line

(33)

The SIP Headers

Accept

Content-encoding

Max-forwards

Route

Accept-encoding

Content-language

MIME-version

Server

Accept-language

Content-length

Organization

Subject

Alert-info

Content-type

Priority

Supported

Allow

Cseq

Proxy-authenticate

Timestamp

Also

Date

Proxy-authorization

To

Authorization

Encryption

Proxy-require

Unsupported

Call-ID

Error-info

Record-route

User-agent

Call-info

Expires

Require

Via

Contact

From

Response-key

Warning

(34)

34

SIP [RAISIN 2007] / ENSEIRB

To Header

(1) INVITE SIP:[email protected] SIP/2.0 To:SIP:[email protected] (2) INVITE SIP:[email protected] SIP/2.0 To:SIP:[email protected]

Laura

P2

131.6.2.1

university.com

(3) INVITE SIP:[email protected] SIP/2.0 To:SIP:[email protected]

Recipient of the request

Also the public address

Unchanged throughout the session (not changed by proxies)

Different from the Request-URI, which is

The next hop in the signaling path

(35)

Call-ID Header

(1)INVITE

(3) ACK

Conversation

signaling relationship

among 2 or more users

Unique identifier of an

invitation and subsequent

related transactions

Association mechanism of

messages for servers

(2) 200 OK (7) BYE (8) 200 OK Call-ID: [email protected] Call-ID: [email protected] Call-ID: [email protected] (4)INVITE (6) ACK (5) 200 OK Call-ID: [email protected] Call-ID: [email protected] Call-ID: [email protected] Call-ID: [email protected] Call-ID: [email protected]

Game

(36)

36

SIP [RAISIN 2007] / ENSEIRB

Contact Header

(1)INVITE

(5) ACK

Conversation

Where the user can be

reached

Enabling server(s) to be

skipped

(6) BYE (7) 200 OK (2)INVITE (3) 200 OK (4) 200 OK sip:[email protected] SIP/2.0 Contact: sip:[email protected]

Bob

SIP proxy

Laura

sip:[email protected] SIP/2.0 Contact: sip:[email protected]

Contact: sip:[email protected]

Contact: sip:[email protected]

(37)

Cseq Header

(1)INVITE

(3) ACK

Command sequence (Cseq)

An integer: request order within

a session (Call-ID)

Method name: to distinguish

OK response from CANCEL

and INVITE

Request/response matching

New Cseq only generated by

UA for 2 methods

INVITE

BYE

Cseq generated independently

between sender receiver

CANCEL’s Cseq = INVITE’s

(2) 200 OK (4)INVITE (6) ACK (5) 200 OK (7) BYE (8) 200 OK Cseq: 1 INVITE Cseq: 1 INVITE Cseq: 1 ACK Cseq: 2 INVITE Cseq: 2 INVITE Cseq: 2 ACK Cseq: 3 BYE Cseq: 3 BYE

Re-invite

(38)

38

SIP [RAISIN 2007] / ENSEIRB

Responses for INVITEs and CANCELs Differ Thanks to Cseq

(1)INVITE

(3)200 OK

The response OK is either for

INVITE

CANCEL

Method name of the Cseq

enables to make the distinction

(2) CANCEL (4)487 Transaction cancelled (5) ACK Cseq: 1 INVITE Cseq: 1 CANCEL Cseq: 1 CANCEL Cseq: 1 INVITE Cseq: 1 ACK

(39)

Via Header

Conversation

(1) INVITE SIP:[email protected] SIP/2.0 Via:SIP/2.0/UDP Workst 100.univ.com:5060

(2) INVITE SIP:[email protected] SIP/2.0 Via:SIP/2.0/UDP 131.6.2.1:5060 Via:SIP/2.0/UDP Workst 100.univ.com:5060

(3) 200 OK

Via:SIP/2.0/UDP 131.6.2.1:5060 Via:SIP/2.0/UDP Workst 100.univ.com:5060 (4) 200 OK

Via:SIP/2.0/UDP Workst 100.univ.com:5060

(5) ACK SIP:[email protected] SIP/2.0 Via:SIP/2.0/UDP Workst 100.univ.com:5060

(6) BYE SIP:[email protected] SIP/2.0 Via:SIP/2.0/UDP Workst 100.univ.com:5060

(7) OK SIP:[email protected] SIP/2.0

Via:SIP/2.0/UDP Workst 100.univ.com:5060

Laura

SIP Proxy

Bob

Via headers store all proxies that handle the request

They contain the signaling path

Used to detect loop

Also used to route the response (opposite of request route)

(40)

40

SIP [RAISIN 2007] / ENSEIRB

Record-Route and Route Headers (1)

(1)INVITE

Conversation

Headers used by proxies

Opposite of Contact header

(aimed to short-circuit proxies)

Proxies stay in signaling

path

Security: filtering incoming

messages

Service provision:

session-related service needs (e.g.,

duration)

(7) BYE SIP:[email protected] SIP/2.0

(2)INVITE SIP:[email protected] SIP/2

(3) 200 OK (4) 200 OK

SIP:[email protected] SIP/2

Laura

SIP proxy

131.6.1.99

Bob

131.6.1.2 Record-Route:<SIP:[email protected]; maddr=131.6.1.99 Route:<SIP:[email protected]> Contact:<SIP:[email protected]> Record-Route:<SIP:[email protected]; maddr=131.6.1.99 Contact:<SIP:[email protected]> Record-Route:<SIP:[email protected]; maddr=131.6.1.99

(6) ACK SIP:[email protected] SIP/2

(8) BYE SIP:[email protected] SIP/2.0

(10) 200 OK

(9) 200 OK (5) ACK SIP:[email protected] SIP/2

(41)

Record-Route and Route Headers (2)

Laura

P1

P2

P3

Bob

Record-Route:P1 (1)INVITE (2)INVITE Record-Route:P1 (3)INVITE Record-Route:P3 Record-Route:P1 (4)INVITE Contact:Bob Record-Route:P3 Record-Route:P1 (5)200 OK Contact:Bob Record-Route:P3 Record-Route:P1 (6)200 OK Contact:Bob Record-Route:P3 Record-Route:P1 (7)200 OK Contact:Bob Record-Route:P3 Record-Route:P1 (8)200 OK Route:P3 Route:Bob (9) ACK Route:Bob (10) ACK (11) ACK

Conversation

Route:P3 Route:Bob (12) BYE Route:Bob (13) BYE (14) BYE (15) 200 OK (16) 200 OK

References

Related documents

At the end of the framework partnership period for which a Masters Course has been selected, the co- ordinating institution of the consortium shall submit a Final Summary Report

Structural equation models embody causal information in both the equations and the probability function P (u) assigned to the error vari- ables; the former is encoded as missing

The SIP User Agents initially register their current network location with their local registrar by sending a REGISTER request A registrar server is typically co-located with a

Though, user clients register to the registrar server, so the outbound proxy server authenticates the user client in co-operation with the registrar server in that trusted SIP

In case of public deployment of SIP, when the SIP proxy server is on public domain and User agent is in private network space, signaling message response coming

If the IP address of the SIP URL for the called user agent is incorrect, then the INVITE message that is forwarded from the SIP proxy server would result in an ICMP message similar

It is well-known that variables such as particle shape, size, surface roughness, among others, influence the gas-particle interaction in fixed-bed drying because

In several countries public LTC insurance is offered by non-competing agents that are not at risk for providing coverage. This situation is suboptimal because it provides