You are on page 1of 108

Session Initiation Protocol (SIP)

SIP , entity , . interoperation .

Goal We want to know


SIP Architecture SIP Messages Syntax Basic Call Example Session Description Protocol (SDP) SIP Extensions Interworking with PSTN and H.323

Question: 1. SIP message redundancy, response request header, . We need get To: and From: once. It is not necessary to send it many times. Why? 2. If SIP agent finds the copied data is not consistent as the original one (ex: To, is it necessary to reply an error? 3. To: tag, From: tag, Call ID form a dialog ID. Why not to use a unique value for dialog ID.

SIP Architecture

Introduction to SIP SIP Network Entities Simple Example

Introduction
A powerful alternative to H.323 More flexible, simpler Easier to implement
Advanced features

Better suited to the support of intelligent user devices A part of IETF multimedia data and control architecture SDP (Session Description Protocol), RTSP (Real-Time Streaming Protocol), SAP (Session Announcement Protocol)
4

SIP call setup , protocols, SDP (Session Description Protocol) session media codec RTSP (Real-Time Streaming Protocol) application-layer proposed standard, RFC 2205, multimedia streaming. framework, TCP, UDP transport, RTP streaming data control signals. SAP (Session Announcement Protocol) RFC 2974, multicast session directory announcement protocol. multimedia conference, directory session setup (ex: pre-arranged conference). directory distributed , announcement, .

The Popularity of SIP


Originally Developed in the MMUSIC (Multiparty Multimedia Session Control)
A separate SIP working group RFC 2543 The latest version: RFC 3261

SIP + MGCP/MEGACO
The VoIP signaling in the future

bake-off or SIPit (SIP Interoperability Tests)


Various vendors come together and test their products against each other
To ensure that they have implemented the specification correctly To ensure compatibility with other implementations
5

SIP IETF 1993 3 , Internet conferencing, telephony , , , . Application protocol. IETF (Internet Engineering Task Force) MMUSIC (Multiparty Multimedia Session Control) Working group SIP, SIP , SIP working group. SIP 1999 RFC 2543 RFC 3261 (2002 May), proposed standard H.323 SIP Text-based encoding HTTP request-response transcation model implement MGCP/MEGACO SIP, VoIP signaling protocol . 3GPP SIP All IP Network . , SIP . SIPit (SIP Interoperability Tests). 7 bake-off (). Fig 5-1 . , , SIP . SIPit-14 Feb 2004.

SIP Basic (1/2)


SIP is a peer-to-peer protocol SIP is an application layer signaling protocol
End-devices initiate sessions Create, modify and terminate sessions Applications can be voice, video, gaming, instant messaging, presence, call control, etc. Message formatting (HTTP 1.1) Name resolution and mobility (DHCP and DNS) Media (RTP) Media negotiation (Session Description Protocol SDP) Application encoding (MIME)
6

SIP uses existing IETF protocols to provide:

: SIP service, SIP primitives (), service.

SIP Basic (2/2)


SIP is ASCII text-based Uses URI style addresses and syntax Flexible transport
can use UDP, TCP, TLS, or SCTP Audio, video, realtime text ... Eases implementation and debugging

Uses SDP for describing media sessions Simple extensible protocol


MethodsDefine transaction HeadersDescribe transaction BodySDP and other MIME content
7

SIP Architecture
A signaling protocol
The setup, modification, and tear-down of multimedia sessions

SIP + SDP
Describe the session characteristics

Separate signaling and (RTP) media streams

SIP Signaling IP Network

RTP Media Stream SIP User SIP User

SIP (signaling protocol) sessions SIP contents SDP session SDP codec SIP signaling media RTP signaling media H.323 media signaling . SIP user PC+ handset SIP phone.

SIP Network Entities


Client-Server Model Clients
User agent clients (UAC) Application programs sending SIP requests

Servers
Responds to clients requests Four types of servers

SIP client-server , SIP client, server, client/server proxy : SIP (client) User Agent Client (UAC) SIP request SIP Client SIP Phone SIP Server Client request response Servers , . Server agent server (UAS) , UAC. User Agent = UAC + UAS. User agent client server

Types of Servers (1/3)


Proxy servers
Handle requests or forward requests to other servers Can be used for call forwarding, time-of-day routing, or follow-me services

1.Request Collins@work.com

2.Request Collins@home.net

Caller@work.com

4.Response

SIP Proxy

3.Response

Collins@home.net

10

Server :
Proxy server optional SIP component.

Proxy server web service proxy (routing) request response Proxy client server , Proxy server initiate SIP messages Proxy sever time-of-day routing , follow-me service . Collins (:) 2 SIP devices () SIP phone. Collins Collins@work.com, work.com domain name. SIP devices Collins@home.net. Collins Caller ( Caller@work.com ) Collins. Caller Invite proxy, proxy Collins , request Collins . , response proxy caller. Note: trunk proxy . Proxy Caller ISP , ISP proxy .

Types of Servers (2/3)


Redirect servers
Map the destination address to zero or more new addresses
1.Request Collins@work.com 2.Moved temporarily Contact: Collins@home.net Caller@work.com 3.ACK Redirect Server

4.Request Collins@home.net 5.Response Collins@home.net

11

Redirect server optional SIP component.

Redirect server , 1 redirect server 302 response UAC callee Caller Collins, Collins . Caller redirect server, Collins Collins@work.com. Redirect server , Collins SIP phone Collins@home.net , Caller Acknowledge. Caller Invite request Collins . , Collins response. Note: redirect server call-forwarding, follow-me service . Redirect server proxy redirect server request, UA. trunk redirect server.

Types of Servers (3/3)


A user agent server (UAS)
Accepts SIP requests and contacts the user The user responds an SIP response Usually, a SIP device = UAC+UAS

A registrar
Accepts SIP REGISTER requests
Indicating that the user is at a particular address Personal mobility

Typically combined with a proxy or redirect server

12

Server agent server (UAS) , UAC request, UAC. UAS UCSSIP Phone User agent, SIP peer-to-peer .
Registrar optional SIP component.

SIP , , Registrar . Collins , PC registrar , . SIP REGISTER request registrar user mobility Registrar request, UA. registrar proxy, redirect server . UAS UAC . user agent proxy server.

SIP Call Establishment


It is simple, which contains a number of interim responses.
SIP device A
a b c d e f g BYE OK
13

SIP device B
INVITE Ringing OK ACK Conversation

SIP INVITE, OK, ACK 3way handshake Ringing response (provisional response). provisional response , caller B SIP device (INVITE) , provisonal. , INVITE , B 200 OK. OK response (final response). A ACK request callee B final response caller Step e . , ( A ), BYE B. B , OK.

Call Completion to Busy Subscriber Service


SIP device A
a b c d e f g h i j BYE OK ACK Conversation INVITE Busy (Try at 4pm) ACK INVITE Ringing OK

SIP device B

14

SIP , Call Completion to Busy Subscriber Service . A B. Steps a,b,c: A B, device B Busy, A , 4pm . Device A 4:00 pm A, B. Steps d,e: Device A device B, . Steps f, g: B , OK, Device A ACK. Step h: . Steps i, j :, ( A ), BYE B. B , OK.

SIP Advantages
Attempt to keep the signaling as simple as possible Offer a great deal of flexibility
Does not care what type of media is to be exchanged during a session or the type of transport to be used for the media

Various pieces of information can be included within the messages


Including non-standard information Enable the users to make intelligent decisions
The control of the intelligent features is placed in the hands of the customer, not the network operator.

E.g., SUBJECT header

15

, SIP , , : , SIP TCP, TLS, UDP transport layer , SIP application layer service, transport layer. SIP optional , . , () . SIP media format, media . , SIP . SIP INVITE SUBJECT . Callee , . SIP , , .

Overview of SIP Messaging Syntax

SIP Message Syntax SIP Request Messages Simple Example

SIP Messaging Syntax (1/2)


Text-based
Similar to HTTP (Hypertext Transfer Protocol) Disadvantage more bandwidth consumption

SIP messages
message = start-line *message-header CRLF [message-body] start-line = request-line | status-line

Request-line specifies the type of request Response line (status-line) indicates the success or failure of a given request.
17

SIP message (text-based) HTTP binary-based SIP parsing SIP message start-line SIP Request SIP Response . | . , SIP : request response. start-line=request-line request. startline=status-line response .Ex: request-line = INVITE. message header, header CRLF message-body. * message-header . [] message-body . CRLF (carriage-return line-feed sequence)

SIP Messaging Syntax (2/2)


Message headers
Additional information of the request or response E.g.,
From: /To: headers for the originator and recipient Retry-after header Subject header

Message body
Describe the type of session The most common structure for the message body is SDP (Session Description Protocol). Could include an ISDN User Part message Examined only at the two ends
18

Message header request/response . Ex: . Retry-after header .Subject . Header entities lookup. Message body session , media. SIP , . message body , . SDP. Ex: SDP G.711 A-law. Ex: SIP PSTN SS7 , capability ISUP (ISDN User Part) , SDP . MIME content. Ex: INVITE response HTML document, image. message-body endpoints

SIP Requests
Method SP Request-URI SP SIP-version CRLF Ex: INVITE sip:yoyo@s1.yy.com SIP/2.0 Request-URI
The address of the destination

Methods
RFC 2543: INVITE, ACK, OPTIONS, BYE, CANCLE, REGISTER RFC 3261: SUPPORT, RFC 2976: INFO, RFC 3262: PRACK, RFC 3265: SUSCRIBE & NOTIFY, RFC 3311: UPDATE, RFC 3428: MESSAGE, RFC 3515:REFER

19

Request SIP , Method( SP)RequestURI( SP)SIP-version(CRLF) Method sender session (ex: INVITE: ) Request-URI Request , SIP. SIP-version 2.0 . RFC 3261 6 methods: INVITE, ACK, OPTIONS, BYE, CANCLE, REGISTER. , RFC 2976 INFO, RFC 3311 UPDATE, RFC 3315 REFER. INFO , application-layer information UPDATE SDP session media. REFER . PRACK provisional acknowledgement, receiver provisional response, . SUBSCRIBE/NOTIFY event (ex: presence, monitoring of calls), -. MESSAGE page mode instant messaging service.

SIP Methods (1/2)


INVITE
Initiate a session Information of the calling and called parties The type of media Similar to IAM (initial address message) of ISUP

ACK
Only when receiving the final response

BYE
Terminate a session Can be issued by either the calling or called party

20

INVITE session, session. conference call. INVITE SIP , , media . ISUP IAM (Initial address message). ACK INVITE, response (ex: 200 OK, 1xx response). INVITE , (altering), caller altering, , ACK. , INVITE , (busy), caller ACK. method ACK. BYE session. , , BYE.

SIP Methods (2/2)


OPTIONS
Query a server as to its capabilities
A particular type of media

CANCEL
Terminate a pending request E.g., an INVITE did not receive a final response

REGISTER
Log in and register the address with a SIP server all SIP servers multicast address (224.0.1.175) Can register with multiple servers Can have several registrations with one server
21

OPTIONS () called party capabilities. , media type (ex: response method, content types, extensions, codec). CANCEL session. , INVITE , response, caller parallel search ( ). final response, caller CANCEL. REGISTER user-agent client SIP server , (registrar) address. User-agent local SIP server , 224.0.1.175 multicast address SIP severs . One number service SIP server .

One number Service


User at Address 2 User at Address 1 Registrar/Proxy Caller

Register (address 1) OK Register (address 2) OK INVITE Trying INVITE INVITE OK CANCEL OK (for INVITE) OK (for CANCEL) ACK ACK Conversation

22

One number service follow me service message flow (Address1/address2) proxy forking proxy INVITE , 200 OK, proxy CANCEL sip:collins@work.com address, Collins , work.com domain name, registrar, collins , . Question: Collins , , Collins ( or ) cancel.

SIP Responses
SIP-Version SP Status-Code SP ReasonPhrase CRLF Request: INVITE sip:yoyo@s1.yy.com SIP/2.0 Response: SIP/2.0 200 ok Status-Code
A three-digit number

Reason-Phrase
A textual description of the outcome Could be presented to the user

23

Response SIP , SIP-version()StatusCode()Reason-Phrase(CRLF) Status Code response (Ex: INVITE sip:yoyo@s1.yy.com SIP/2.0), , (ex: 200: ), sender . Reason Phrase status code (ex: OK), SIP . SIP-version 2.0 .

Status Code
Provisional response
1XX Informational (ex: 181 Ringing)

Final response
2XX 3XX 4XX 5XX 6XX Success (ex: 200 OK) Redirection (ex: 302 Moved temporarily) Client Error (ex: 401 Unauthorized) Server Error (ex: 505 SIP version not supported) Global Failure (ex: 604 Does not exist anywhere)

All responses, except for 1XX, are considered final and Should be ACKed.
24

Status code 6 , : 1XX (Provisional information) , , request , . Ex: 181 Ringing . 2XX (Success) request , , . SIP 200 OK . Ex: INVITE, 200 OK . REFER method , 202 accepted . 3XX (Redirection) request agent . Ex: 302 , sender response address. 4XX (Client Error): request syntax, request server . Ex: 401 Unauthorized sender , . 5XX (Server Error): request, server . Ex: 505 SIP version not supported SIP . 6XX (Global Failure): request, server . Ex: 604 Does not exist anywhere . 2XX - 6XX . , response sender, 1XX response, ACK.

SIP Addressing
SIP URIs (Uniform Resource Identifier)
user@host Also called as URLs (Uniform Resource Locators)

Two types of SIP URIs:


sip:collins@work.com

Address of Record (AOR) (identifies a user) Contact (identifies a device and is usually a Fully Qualified Domain Name, FQDN)
sip:line2@127.24.45.4 or sip:collins@station1.work.com

Other example:
sip:3344556789@telcom.net sip:3344556789@telcom.net;user=phone sips:bob@biloxi.com

25

Uniform Resource Indicators (URIs) Uniform Resource Locators (URLs). URI SIP , . SIP (host)(user), URI . user@host. email address, email address. email mailto:collins@home.net, SIP sip:collins@home.net. (i.e., ), , SIP URIs : Address of Record (AOR) Ex: sip:collins@work.com, work.com domain name, . DNS domain. . Contact . Fully Qualified Domain Name (FQDN) . Ex: sip:collins@station1.work.com station1. : PSTN , , SIP address, sip:3344556789@telcom.net, gateway telcom.net . SIP URI , , sip:3344556789@telcom.net;user=phone, user=phone user=3344556789 PSTN , user name. URI : sip:alice@example.com SIP URI, , RFC 2543 . sips:bob@biloxi.com is a Secure SIP URI SIP URI, RFC 3261, security, TLS (transport layer security) over TCP . Registrar, Proxy, Redirect TLS. Note: hop-by-hop security, IPSec. Tel:54065;phone-context=dialplan.biloxi.comtel SIP URI, telephone numbers . Tel:+18005551212;phone-context=e164.arpa e164 . ENUM .

Message Headers
Provide further information about the message
Ex: Subject: vacation Ex: Content-Type:application/sdp

Table 5-2, Table 5-3 Four main categories


General, Request, Response, and Entity headers

26

start-line , SIP message headers, . header (CRLF) . Q.931 information element . message header . Ex: INVITE Subject vacation, Content-Type message body SDP. , : message header: general, request, response, entity header. Table 5-2 request header , i.e., request header. Table 5-3 response header .

General Headers
Used in both requests and responses To, From, CSeq, Call-ID, and Via are mandatory for all SIP messages. Basic information
To: header in a REGISTER indicates the addressof-record of the user.
Ex: To: Collins@work.com

To: header in an INVITE indicates the called party.


Ex: To: Boss<sip:Manager@work.com> Ex: To: Boss<sip:Manager@station2.work.com>

From: header indicates the originator.


Ex: From: Daniel<sip:Collins@work.com>;tag=4455
27

(general header) request/response , . To, From, CSeq, Call-ID, and Via SIP mandatory. Max-Forwards SIP request mandatory. To (callee URI)From (CallerURI)Call-ID ( session)Contact ( SIP URI) Ex: REGISTER To:header Registrar user (address of record). Ex: INVITE To:header . Ex: SIP From:header .

To: Header
The To header field first and foremost specifies
The desired "logical" recipient of the request The address-of-record of the user or resource that is the target of this request.

The original recipient may or may not be the UAS processing the request, due to call forwarding or other proxy operations. Request-URI identifies the UAS that is to process the request.

28

To: header (From: ) (1) request logical & original , (2) request address-of-record resource. Request URI request UA. To: header request . call forwarding, proxy . Ex: To: Boss<sip:Manager@work.com> Boss addressof-record URI, proxy Manager@station2.work.com . request UAS, To: header URI , request. ( software , ). SIP , UAS To: URI, request. UAS 403 (Forbidden) request.

Request-URI
Request-URI identifies the UAS that is to process the request. The initial Request-URI of the message SHOULD be set to the same value of the URI in the To field.
One notable exception is the REGISTER

A UA uses the REGISTER method to bind its address-of-record to a specific contact address.

29

To: header Request-URI : Request-URI request UA. Request-URI SIP URI SIPS URI a general URI (RFC 2396) "tel" URI (RFC 2806) request UAS Request-URI, UAS 416 (Unsupported URI Scheme) request. Request-URI request UAS, proxy 404 (Not Found) request. UA REGISTER address-of-record contact (bind) . UA SIP Request-URI (SHOULD) To: header URI . (Request-URI ) REGISTER, Request-URI registrar, To: user address of record. To: From: caller callee , specification proxy , .

Contact: Header
Provides a URI for use in future communication regarding a particular session Ex1: In a SIP INVITE, the Contact header might be different from the From header.
An third-party administrator initiates a multiparty session.

Ex 2: Used in response, it is useful for directing further requests directly to the called user. Ex 3: It is used to indicate a more appropriate address if an INVITE issued to a given URI failed to reach the user.
30

Contact INVITE transaction. Contact header, : INVITE Contact: header, From: header, From: Address of record, ; session , session , Contact SIP URI multiparty session, , conference call. request, proxy , , response. request , proxy, response Contact: header, , request ( ACK) callee. Contact: header INVITE INVITE URI (), . receiver 302 moved temporarily Contact:, SIP URI. Contact From

Request / Response Headers


Request Headers
Apply only to SIP requests Addition information about the request or the client Ex: Subject: vacation Ex: Priority: (emergency, urgent, normal, or nonurgent)

Response Headers
Further information about the response that cannot be included in the status line Ex: Unsupported Ex: Retry-After

31

Request Header header SIP request , . Subject: header session . Priority: header request session . emergency, urgent, normal, non-urgent. Response Header header SIP response , status code , . Unsupported: header server . Retry-After: header , .

Entity Headers
Indicate the type and format of information included in the message body Content-Length: the length of the message body Content-Type: media type of the message body
Ex: Content-Type:application/sdp

Content-Encoding: for message compression Content Disposition: how a message part should be interpreted
session, icon, alert, render

32

Entity Header header SIP message body , . Context-Length: header message body . ( byte) Context-Type: header message body , SDP. Context-Encoding: header message body . Context-Disposition: header message body , . session, message body session , session . icon, message body sender , . render, message body sender . alert, message body ring tone ( audio clip ), .

Examples

Registration Invitation Termination of a Call

Registration
Collins@station1.work.com Registrar

REGISTER sip:registrar.work.com SIP/2.0 Via: SIP/2.0/UDP station1.work.com; branch=z9hG4bK123 Max-Forwards: 70 From: sip:Collins@work.com; tag = 123456 To: sip:Collins@work.com Call-ID: 123456@station1.work.com CSeq: 1 REGISTER Contact: sip:Collins@station1.work.com Expires: 7200 Content-Length: 0 SIP/2.0 200 OK Via: SIP/2.0/UDP station1.work.com; branch=z9hG4bK123 From: sip:Collins@work.com; tag = 123456 To: sip:Collins@work.com Call-ID: 123456@station1.work.com CSeq: 1 REGISTER Contact: sip:Collins@station1.work.com Expires: 3600 Content-Length: 0

34

Registration server . , Daniel Collins log in station1.work.com , . Collins Registrar . Request-URI , proxy, Request-URI callee . To: header, Registration registrar address of record. INVITE , To: header caller callee . proxy To: header. REGISTER header: Via: header request , . Via : UDP. SIP UDP. TCP, SCTP, TLS. Via response , , port number. proxy , response via , originator. Via branch parameter, proxy. From: header . ( manager, ). From tag parameter, sender , sender ID. To: header Registrar , Collins (Address of record). Note: request To: tag, dialog, response To: receiver tag, receiver ID. Dialog two user agents peer-to-peer . dialog . Call-ID sender , SIP (ex: 123456@station1.work.com), user , Registrar , Call-ID. , local-id@host . random number, URI. CSeq (Command Sequence) transaction () order () . 32-bit unsigned transaction request method. Transaction Request 1xx response, . dialog , transaction request / final response CSeq transaction (for new request) CSeq1 request/response ACK Cancel , request CSeq . ACK/Cancel transaction. CSeq 31 bits of 32-bits clock, overflow (warp around). Contact Call-ID , Contact , . Expires 32-bit unsigned . 7200 ( sec) Collins 2 hours. Registrar (3600 sec), . 136 . request Expire , Registrar status code 423 Interval too brief, client registration interval. Content-Length payload SIP message SDP content 0 Collins , , Collins (, record)

Daniel<sip:Collins@work.com>

Boss<sip:Manager@station2.work.com>

Invitation
a

A two-party call
Subject:
optional

Content-Type:
application/sdp

INVITE sip:manager@station2.work.com SIP/2.0 Via: SIP/2.0/UDP station1.work.com; branch=z9hG4bK123 Max-Forwards: 70 From: Daniel<sip:Collins@work.com>; tag=44551 Contact: sip:Collins@station1.work.com To: Boss<sip:Manager@station2.work.com> Call-ID: 123456@station1.work.com CSeq: 1 INVITE Subject: Vacation Content-Length: xxx Content-Type: application/sdp Content-Disposition: session (message body) SIP/2.0 180 Ringing Via:SIP/2.0/UDP station1.work.com;branch= z9hG4bK123 From: Daniel<sip:Collins@work.com>; tag=44551 To: Boss<sip:Manager@station2.work.com>; tag=11222 Contact: sip:manager@station2.work.com Call-ID: 123456@station1.work.com CSeq: 1 INVITE Content-Length: 0 SIP/2.0 200 OK Via: SIP/2.0/UDP station1.work.com; branch=z9hG4bK123 From: Daniel<sip:Collins@work.com>; tag=44551 To: Boss<sip:Manager@station2.work.com>; tag=11222 Contact: sip:manager@station2.work.com Call-ID: 123456@station1.work.com CSeq: 1 INVITE Subject: Vacation Content-Length: xxx Content-Type: application/sdp Content-Disposition: session (message body)

Transaction:
Command Sequence
c

A dialog ID
To identify a peer-to-peer relationship between two user agents Tag in From Tag in To Call-ID

ACK sip:manager@station2.work.com SIP/2.0 Via:SIP/2.0/UDP station1.work.com;branch= z9hG4bK123 Max-Forwards: 70 From: Daniel<sip:Collins@work.com>; tag=44551 To: Boss<sip:Manager@station2.work.com>; tag=11222 Call-ID: 123456@station1.work.com CSeq: 1 ACK Content-Length: 0 Conversation

Collins ( Daniel) two-party , Manager (Boss). LAN . INVITE sip:manager@station2.work.com SIP/2.0. , proxy, INVITE station2.work.com, To: header URI. caller callee . Max-Forwards: 70 () 70 proxy . proxy 1. From: header URI , display name. , Daniel , Boss, URI. Subject: . Contact: Daniel Collins@stations1.work.com. Context-Type: message body SDP . Context-Disposition message body session . Context-length message body . message body caller media . SIP/2.0 180 Ringing. , . response request , Content-length=0 message body, Context-type: header. To: header callee tag ( address tag). , From tag, To tag, Call-ID dialog ID, peer-to-peer dialog (). From, To tag, dialog . Note: session , 180 ring dialog . dialog early. 200 OK, dialog confirmed. Boss , Invite , SIP/2.0 200 OK. response request , message body called media . INVITE transaction (). ACK, response. CSeq: header 1 ACK, request. .

Termination of a Call
Daniel<sip:Collins@work.com> Boss<sip:Manager@station2.work.com>

a BYE sip:manager@work.com SIP/2.0 Via: SIP/2.0/UDP station1.work.com; branch=z9hG4bK123 Max-Forwards: 70 From: Daniel<sip:Collins@work.com>; tag=44551 To: Boss<sip:Manager@station2.work.com>; tag=11222 Call-ID: 123456@station1.work.com CSeq: 2 BYE Content-Length: 0 b SIP/2.0 200 OK Via: SIP/2.0/UDP station1.work.com; branch=z9hG4bK123 From: Daniel<sip:Collins@work.com>; tag=44551 To: Boss<sip:Manager@station2.work.com>; tag=11222 Call-ID: 123456@station1.work.com CSeq: 2 BYE Content-Length: 0
36

BYE request session. media . BYE header INVITE , CSeq BYE request. 200 OK.

Redirect and Proxy Servers

Redirect Servers Proxy Servers

proxy .

Redirect Servers
Daniel<sip:Collins@work.com> Redirect Server Boss<sip:Manager@pc1.home.net>

An alternative address
302 Moved temporarily

Another INVITE
Same Call-ID CSeq ++

INVITE sip:manager@work.com SIP/2.0 Via: SIP/2.0/UDP station1.work.com; branch=z9hG4bK123 Max-Forwards: 70 From: Daniel<sip:Collins@work.com>; tag=44551 Contact: sip:Collins@station1.work.com To: Boss<sip:Manager@work.com> Call-ID: 123456@station1.work.com CSeq: 1 INVITE Subject: Vacation Content-Length: xxx Content-Type: application/sdp Content-Disposition: session (message body) SIP/2.0 302 Moved Temporarily Via:SIP/2.0/UDP station1.work.com;branch=z9hG4bK123 From: Daniel<sip:Collins@work.com>; tag=44551 To: Boss<sip:Manager@work.com>; tag=11222 Call-ID: 123456@station1.work.com CSeq: 1 INVITE Contact: sip:Manager@pc1.home.net ACK sip:manager@work.com SIP/2.0 Via: SIP/2.0/UDP station1.work.com; branch=z9hG4bK123 Max-Forwards: 70 From: Daniel<sip:Collins@work.com>; tag=44551 To: Boss<sip:Manager@work.com> Call-ID: 123456@station1.work.com CSeq: 1 ACK

d INVITE sip:manager@pc1.home.net SIP/2.0 Via: SIP/2.0/UDP station1.work.com; branch=z9hG4bK124 Max-Forwards: 70 From: Daniel<sip:Collins@work.com>; tag=44551 Contact: sip:Collins@station1.work.com To: Boss<sip:Manager@work.com> Call-ID: 123456@station1.work.com CSeq: 2 INVITE Subject: Vacation Content-Length: xxx Content-Type: application/sdp Content-Disposition: session (message body)

Redirect server , 1 UAC callee redirect server 302 response UAC callee redirect server URI, 4xx, 5xx, 6xx Error. redirect server CANCEL , 200 OK. Daniel two-party , Boss. Boss , Manager@pc1.home.net . , Daniel INVITE redirect server. INVITE sip:manager@work.com SIP/2.0. Fig 5-9 INVITE . , Request-URI To: header Boss , Address of record . redirect server 302 response, Contact: header UAC callee Step c Daniel ACK, transaction. Step c Daniel INVITE manager@pc1.home.net, CSeq 1, Call-ID ().

Proxy Servers
Sits between a user-agent client and the farend user-agent server Numerous proxies can reside in a chain between the caller and callee. The proxy may change the Request-URI. caller p1 p2 p3 Via: header INVITE
The path taken by a request Loop detected, 482 (status code) For a response
482 ACK

p4

The 1st Via: header, Checked, Removed

Branch: used to distinguish between multiple responses to the same request/ to detect loop
39

Proxy server web service proxy request response , caller callee , caller proxy, callee proxy. proxy callee , Request-URI, ( proxy), INVITE callee. caller callee path machines Via ( ). Via transport protocol. Via loop. request, proxy via , a loop. 482 loop detected. , proxy 2 loop, via 482. caller ACK (by SIP-URI), proxy state . Callee Response , Via , proxy, . Via Branch .

Forking Proxy
Forking Proxy: Issue a single request to multiple destinations
A user is registered at several locations fork requests

Branch: used to distinguish between multiple responses to the same request


Ex: on Via: header ;branch=z9hG4bK123

In order to handle such forking, a proxy must be stateful.

40

RFC 2543, SIP request forking proxy multicast ( branch, fork request). response, branch . branch optional, transaction branch . forking proxy fork request proxy forking proxy, stateful , response . branched request, branch number (ex: step c z9hG4bK123 step d z9hG4bK456), . RFC 3261, branch ID transaction ID, loop. branch z9hG4bK, magic cookie, branch RFC 3261 . ( z9hG4bK RFC 2543) client, transaction, branch. 2xx response ACK, CANCEL, original request branch. ( CSeq )

Proxy State
Transaction stateless
Proxy server forwards all methods and responses without interaction

Transaction stateful
Maintains state for the transaction until the final response is received Transaction Control Block (TCB)

41

Proxy : stateless stateful. stateless proxy, , loop , . stateful proxy, , incoming request, outgoing request. proxy loop. Proxy server method, Transaction Control Block (TCB), transaction , final response. stateful proxy server, CANCEL method acknowledgement (ex: 100 Trying , . INVITE , callee , proxy fork INVITE response , , proxy CANCEL transaction).

Record-Route: and Route:


Record-Route:
Use Contact: the messages may not pass through the same proxy A stateful proxy might require that it remains in the signaling path Insert its address into the Record-Route: header The response includes the Record-Route: header The information contained in the Record-Route: header is used in the subsequent requests related to the same call.

The Route: header = the Record-Route: header in reverse order


42

stateful proxy, signaling path , . request via, () response originator. , Contact: header , , , proxy. (stateful) proxy , , Record-Route: header . Proxy Record-Route:, Record-Route: headers . Record-Route: (steps d, e) Response , originator. requests . Originator Record-Route: list of proxy request (step f) Route: header. Route: list proxy ( Request URI). proxy, Route: list , . list , Request-URI. loose routing (lr). Record-routing: lr loose routing. proxy message , Request-URI . (RFC 2543) SIP record-route strict routing. Route: , Record proxy (i.e., proxy ) Request-URI. proxy SIP Request-URI.

Strict Routing and Loose Routing


INVITE: U1->P1->P2->P3->P4->U2
INVITE sip:callee@u2.domain.com SIP/2.0 Contact: sip:caller@u1.example.com Record-Route: <sip:p4.domain.com;lr> Record-Route: <sip:p3.middle.com> Record-Route: <sip:p2.example.com;lr> Record-Route: <sip:p1.example.com;lr> BYE sip:sip:caller@u1.example.com> Route: <sip:p1.example.com;lr> BYE sip:p2.example.com;lr SIP/2.0 Route: <sip:p1.example.com;lr> Route: <sip:caller@u1.example.com>

BYE: U2->P4->P3->P2->P1->U1
BYE sip:caller@u1.example.com SIP/2.0 Route: <sip:p4.domain.com;lr> Route: <sip:p3.middle.com> Route: <sip:p2.example.com;lr> Route: <sip:p1.example.com;lr> BYE sip:p3.middle.com SIP/2.0 Route: <sip:p2.example.com;lr> Route: <sip:p1.example.com;lr> Route: <sip:caller@u1.example.com>
43

BYE sip:sip:caller@u1.example.com>

U1 INVITE U2, P3 strict router, proxy loose routing. U2 BYE U1 , P3 , Request-URI P3 URI, U1 URI Route. P4 Route: proxy, , P4 BYE P3. SIP lr, BYE Request-URI P3, caller Route: . P3 strict router, BYE P2. P3 , strict routing (RFC 2543), P3 Request-URI P2. P2 BYE Request-URI Record-Route: , Request-URI caller. caller Route: .

Through a Proxy (1/2)


Boss<sip:Manager@pc1.home.net> sip:Server.work.com Daniel<sip:Collins@station1.work.com>

INVITE sip:Collins@work.com SIP/2.0 Via: SIP/2.0/UDP pc1.home.net; branch=z9hG4bK7890 Max-Forwards: 70 From: Boss<sip:Manager@home.net>; tag=ab12 Contact: Boss<sip:manager@pc1.home.net> To: Daniel<sip:Collins@work.com> Call-ID: 123456@pc1.home.net CSeq: 1 INVITE SIP/2.0 100 Trying Via: SIP/2.0/UDP pc1.home.net; branch=z9hG4bK7890 From: Boss<sip:Manager@home.net>; tag=ab12 To: Daniel<sip:Collins@work.com> Call-ID: 123456@pc1.home.net CSeq: 1 INVITE

INVITE sip:Collins@station1.work.com SIP/2.0 Via: SIP/2.0/UDP server.work.com; branch=z9hG4bKxyz1 Via: SIP/2.0/UDP pc1.home.net; branch=z9hG4bK7890 Max-Forwards: 69 Record-route: <sip:server.work.com;lr> From: Boss<sip:Manager@home.net>; tag=ab12 Contact: Boss<sip:manager@pc1.work.com> To: Daniel<sip:Collins@work.com> Call-ID: 123456@pc1.home.net CSeq: 1 INVITE

e SIP/2.0 200 OK ...

SIP/2.0 200 OK Via: SIP/2.0/UDP server.work.com; branch=z9hG4bKxyz1 Via: SIP/2.0/UDP pc1.home.net; branch=z9hG4bK7890 Record-route: <sip:server.work.com;lr> From: Boss<sip:Manager@home.net>; tag=ab12 To: Daniel<sip:Collins@work.com>; tag=xyz45 Call-ID: 123456@pc1.home.net CSeq: 1 INVITE Contact: sip:Collins@station1.work.com

44

Daniel Boss . Boss Daniel. Proxy INVITE, proxy registrar, Daniel , Request-URI, INVITE . Step b , INVITE Collins@station1.wor.com, Max-Forward: , proxy Via ( proxy/client Via ) proxy registrar, proxy URI location function, . proxy INVITE URI, Daniel proxy, . path proxy Via. request, proxy via , a loop. 482 loop detected. , proxy via , request , , proxy . Step c: proxy 100 Trying response, Step d: Daniel 200 OK. message , path via. proxy response, via . . via , via next hop, . next hop, . Record-route proxy state. Note: Subject: message-body .

Through a Proxy (2/2)

Boss<sip:Manager@pc1.home.net>

sip:Server.work.com

Daniel<sip:Collins@station1.work.com>

e SIP/2.0 200 OK Via: SIP/2.0/UDP pc1.home.net; branch=z9hG4bK7890 Record-route: <sip:server.work.com;lr> From: Boss<sip:Manager@home.net>; tag=ab12 To: Daniel<sip:Collins@work.com>; tag=xyz45 Call-ID: 123456@pc1.home.net CSeq: 1 INVITE Contact: sip:Collins@station1.work.com f ACK sip:Collins@station1.work.com SIP/2.0 Via: SIP/2.0/UDP pc1.home.net; branch=z9hG4bK7891 Max-Forwards: 70 Route: <sip:server.work.com;lr> From: Boss<sip:Manager@home.net>; tag=ab12 To: Daniel<sip:Collins@work.com>; tag=xyz45 Call-ID: 123456@pc1.home.net CSeq: 1 ACK

ACK sip:Collins@station1.work.com SIP/2.0 Via: SIP/2.0/UDP server.work.com; branch=z9hG4bKxyz2 Via: SIP/2.0/UDP pc1.home.net; branch=z9hG4bK7891 Max-Forwards: 69 From: Boss<sip:Manager@home.net>; tag=ab12 To: Daniel<sip:Collins@work.com>; tag=xyz45 Call-ID: 123456@pc1.home.net CSeq: 1 ACK

45

Multiple Locations (1/2)


Boss<sip:Manager@pc1.home.net> sip:Server.work.com pc1 pc2

INVITE sip:Collins@work.com SIP/2.0 Via: SIP/2.0/UDP pc1.home.net; branch=z9hG4bK789 Max-Forwards: 70 From: Boss<sip:Manager@home.net>; tag=ab12 Contact: Boss<sip:manager@pc1.home.net> To: Daniel<sip:Collins@work.com> Call-ID: 123456@pc1.home.net CSeq: 1 INVITE SIP/2.0 100 Trying Via: SIP/2.0/UDP pc1.home.net; branch=z9hG4bK789 From: Boss<sip:Manager@home.net>; tag=ab12 To: Daniel<sip:Collins@work.com> Call-ID: 123456@pc1.home.net CSeq: 1 INVITE

b c

INVITE sip:Collins@pc1.work.com SIP/2.0 Via: SIP/2.0/UDP server.work.com; branch=z9hG4bK123 Via: SIP/2.0/UDP pc1.home.net; branch=z9hG4bK789 Max-Forwards: 69 Record-coute: <sip:server.work.com;lr> From: Boss<sip:Manager@home.net>; tag=ab12 Contact: Boss<sip:manager@pc1.work.com> To: Daniel<sip:Collins@work.com> Call-ID: 123456@pc1.home.net CSeq: 1 INVITE INVITE sip:Collins@pc2.work.com SIP/2.0 Via: SIP/2.0/UDP server.work.com; branch=z9hG4bK456 Via: SIP/2.0/UDP pc1.home.net; branch=z9hG4bK789 Max-Forwards: 69 Record-coute: <sip:server.work.com;lr> From: Boss<sip:Manager@home.net>; tag=ab12 Contact: Boss<sip:manager@pc1.work.com> To: Daniel<sip:Collins@work.com> Call-ID: 123456@pc1.home.net 46 CSeq: 1 INVITE

, Boss Daniel. Daniel pc1, pc2 server . proxy INVITE , step c, d pc1, pc2. branch number (ex: step c z9hG4bK123 step d z9hG4bK456), .

Multiple Locations (2/2)

Boss<sip:Manager@pc1.home.net>

sip:Server.work.com

pc1

pc2

e SIP/2.0 200 OK Via: SIP/2.0/UDP server.work.com; branch=z9hG4bK456 Via: SIP/2.0/UDP pc1.home.net; branch=z9hG4bK789 Record-coute: <sip:server.work.com;lr> From: Boss<sip:Manager@home.net>; tag=ab12 To: Daniel<sip:Collins@work.com>; tag=xyz45 Call-ID: 123456@pc1.home.net CSeq: 1 INVITE Contact: sip:Collins@pc2.work.com CANCEL sip:Collins@pc1.work.com SIP/2.0 Via: SIP/2.0/UDP server.work.com; branch=z9hG4bK456 Max-Forwards: 69 Record-coute: <sip:server.work.com;lr> From: Boss<sip:Manager@home.net>; tag=ab12 Contact: Boss<sip:manager@pc1.work.com> To: Daniel<sip:Collins@work.com> Call-ID: 123456@pc1.home.net CSeq: 1 CANCEL

f g

SIP/2.0 200 OK Via: SIP/2.0/UDP pc1.home.net; branch=z9hG4bK789 Record-coute: <sip:server.work.com;lr> From: Boss<sip:Manager@home.net>; tag=ab12 To: Daniel<sip:Collins@work.com>; tag=xyz45 Call-ID: 123456@pc1.home.net CSeq: 1 INVITE Contact: sip:Collins@pc2.work.com

47

Response pc2, proxy Boss. pc1, proxy CANCEL pc1. Note: CANCEL hop by hop , proxy, Via: originator . pc1 487 request cancelled proxy. Note: Subject: .

Session Description Protocol (SDP)

Introduction to SIP SIP Network Entities Simple Example

The Session Description Protocol


The Most Common Message Body
Be session information describing the media to be exchanged between the parties SDP, RFC 2327 (initial publication)

SDP simply provides a format for describing session information to potential session participants. RFC 3264 (An Offer/Answer Model with SDP)
SIP uses SDP in an answer/offer mode. An agreement between the two parties as to the types of media they are willing to share
49

VoIP SIP message-body SDP SDP session , . RFC 2327. SDP session , (ex: SIP) . Note: SIP SDP . RFC 3264, An Offer/Answer Model with SDP, SIP SDP . SDP answer/offer codec SDP codec codec media , offer. answer .

The Structure of SDP


Text-based Protocol The Structure of SDP
Session Level Information
Name of the session Originator of the session Time that the session is to be active
Session Description Session Level Information Protocol Version Originator and Session ID Session Name Session Time Media Description 1 Media Name and Transport Connection Information Media Description 2 Media Name and Transport Connection Information

Media Level Information


Media type Port number Transport protocol Media format

50

SDP , ISO 10646 character set. SDP (session name) ASCII, SDP . , , v version. offer/answer model SDP , session. RFC 2327 SDP multiple session description. SDP (Session description) session level information media level information. Session level information session , protocol version, session (originator), session ID, session name, session (session time). media-level information. session 0 media stream, session stream media description. media description media name, media type, media format, transport protocol, port number field. offer media description, modified offer media stream. media type audio, video . port number port. transport protocol RTP/AVP. AVP: audio/video profile. media format G.711, G.726 RTP payload type.

SDP Syntax
A number of lines of text In each line
field=value Ex: v=0 field=<value of subfield1> <value of subfield2> <value of subfield3> ... Ex: m=audio 45678 RTP/AVP 0 field is exactly one character (case-significant)

Session-level fields
Begin with version description field (v=)

Media-level fields
Begin with media description field (m=)
SDP . (description field). field=value. field , value endpoint . , , . field ; ; value (subfield) , space . m media . v version . Ex: m=audio 45678 RTP/AVP 0 media type, port number, protocol, media format. field , subfield. , value subfield . Subfield . Session-level information , v=... , session-level fields ; media-level information. media-level information media streams . media description m=... , session-level fields .
51

Mandatory Fields (1/3)


v, o, s, t, m are mandatory fields. v=(protocol version) (ex: v=0) s=(session name) (ex: s= )
A text string for multicast conference

t=(time of the session) (ex: t=0 0)


The start time and stop time for pre-arranged multicast conference

52

v, o, s, t, m session-level information fields: v protocol . s session , , multicast conference. SIP , , session name space (=0x20), s= dash s=-. t pre-arranged multicast conference, session . SIP , SIP session , time , time t=0 0 .

Mandatory Fields (2/3)


o=(session origin or creator)
Ex: o=collins 123456 001 IN IP4 s1.yy.com Username (ex: collins): the originators login id or - Session ID (ex: 123456)
Make use of NTP timestamp as a unique ID

Version (ex: 001) Network type (ex: IN)


IN refers to Internet

Address type (ex: IP4)


IP4, IP6

address (ex: s1.yy.com)


A fully-qualified domain name or the IP address
53

o session , . 6 subfields. Username , login ID, login, - . Session ID session , , SDP NTP (Network Time Protocol) timestamp unique ID. Version session , (ex: media type) . session, sender, Session ID subfields. Network type . IN Internet. Address type , IP4 IPv4 addressing, IP6 IPv6 addressing. Address media network address, s1.yy.com )

Mandatory Fields (3/3)


m=(media)
Ex: m=audio 45678 RTP/AVP 15 3 0 Media type (ex: audio)
Audio, video, application, data, control

The transport port (ex: 45678) The transport protocol (ex: RTP/AVP) The media format, an RTP payload format (ex: 15 3 0)
List the various types of media format that can be supported

54

m (media) media-level information fields: m media , media type, transport port, transport protocol, media format. Media type audio (), video, application, data, control. Transport port media stream port . port connection . VoIP UDP RTP, port 1024 65535 . Transport protocol media . RTP/AVP RTP. Media format media format, . transport protocol RTP, media format RTP payload type. G.728=15, GSM=3, G.711/u-law=0.

Optional Fields (1/4)


Some optional fields can be applied at both session and media levels. The value applied at the media level overrides that at the session level for that media instance. c=(connection data) (ex: c=IN IP4 s1.yy.com)
The network and address at which media data will be received Network type (ex: IN) Address type (ex: IP4) Connection address (ex: s1.yy.com) At session or media level

55

Note: session-level media-level information fields. , media stream, media description . media stream session-level information . optional fields: c connection , media Network type . IN Internet. Address type (ex: IPv4 ) Connection address ( media network address, s1.yy.com 140.138.137.224 IP address, full qualified domain name, . c session-level media-level information .

Optional Fields (2/4)


a=(attributes) (ex: a=sendonly)
Describe additional attributes Property attribute
Ex: a=sendonly / a=recvonly

Value attribute
Used in a shared whiteboard session Ex: a=orient:portrait / a=orient:landscape rtpmap provides additional information for dynamic payload type. Ex: m=video 54678 RTP/AVP 98 a=rtpmap:98 L16/16000/2
Dynamic RTP payload type=98 16-bit linear encoded stereo (2 channels) audio sampled at 16kHz
56

a session-level media-level . (ex: send only) SDP attributes, session-level medialevel information. Attributes : 1. property attribute: Ex: a=sendonly send only. SDP sender media stream, media stream. RTP , sender RTP , RTCP . Ex: a=reconly receive only. 2. value attribute: Ex: whiteboard session, attribute portrait () landscape (). media stream dynamic RTP payload type, , rtpmap : a=rtpmap:<payload type> <encoding name>/<clock rate> [/<encoding parameters>] encodling name . Ex: m=video 54678 RTP/AVP 98 a=rtpmap:98 L16/16000/2 dynamic RTP/AVP payload type=98, 16-bit linear encoded stereo (2 channels) audio sampled at 16kHz.

Optional Fields (2/4)


i=(session information)
A text description At both session and media levels It would be somewhat superfluous, since SIP already supports the Subject header.

u=(URI of description)
Where further session information can be obtained Only at session level

e=(e-mail address)
Who is responsible for the session Only at the session level
57

optional fields: i session , topic(), session . information session-level media-level information. SIP , SIP Subject header, information . u URI, Web site, session . pre-arranged conference . SIP , . session-level, session, URI. e session email address. session-level. , email , email .

Optional Fields (3/4)


p=(phone number)
Only at the session level

b=(bandwidth information)
In kilobits per second At session or media level

r=(repeat times)
For regularly scheduled session a session is to be repeated How often and how many times

58

optional fields: p session . session-level. , , . . b session , kilobits. b session-level (for conference) media-level (for media stream). regularly scheduled session, r session . SIP, r .

Optional Fields (4/4)


z=(timezone adjustments)
For regularly scheduled session Standard time and daylight savings time

k=(encryption key)
An encryption key or a mechanism to obtain it for the purposes of encrypting and decrypting the media At session or media level

59

optional fields: regularly scheduled session, z . , (daylight savings time), z . SIP, z . k media stream . k session-level media-level information.

Ordering of Fields
Session Level
Protocol version (v) Origin (o) Session name (s) Session information (i) URI (u) E-mail address (e) Phone number (p) Connection info (c) Bandwidth info (b) Time description (t) Repeat info (r) Time zone adjustments (z) Encryption key (k) Attributes (a)

Media level
Media description (m) Media info (i) Connection info (c)
Optional if specified at the session level

Bandwidth info (b) Encryption key (k) Attributes (a)

60

. .

Usage of SDP with SIP

Simple Example Negotiation of Media

SIP

Usage of SDP with SIP


SIP and SDP make a wonderful partnership for the transmission of session information. SIP provides the messaging mechanism for the establishment of multimedia sessions. SDP provides a structured language for describing the sessions. The entity headers identifies the message body.
Ex: Content-Type:application/sdp

62

SIP multimedia session . SDP session capabilities . Question: SIP SDP ? Answer: Entity header SIP message body , . Context-Length, Context-Type, Context-Encoding, Context-Disposition. SIP SDP .

Offer/Answer Model
Offer a selection of media formats Answer which the receiver is willing to accept
Supported media type: returned with a transport port Unsupported media type: also be returned with a port number of zero

Sender

(1) Offer (2) Answer

Receiver
63

SDP offer/answer . Sender offer, media format . Receiver sender , (accept), (reject) format. answer sender. SIP offer/answer: offer in INVITE, answer in 2XX () offer in 2XX, answer in ACK. INVITE offer .

SDP Inclusion in SIP Messages (1/2)


Daniel<sip:Collins@station1.work.com> Boss<sip:Manager@station2.work.com>

INVITE sip:Manager@station2.work.com SIP/2.0 From: Daniel<sip:Collins@station1.work.com>; tag = abcd1234 To: Boss<sip:Manager@station2.work.com> CSeq: 1 INVITE Content-Length: 213 Content-Type: application/sdp Content-Disposition: session v=0 o=collins 123456 001 IN IP4 station1.work.com s= c=IN IP4 station1.work.com t=0 0 m=audio 4444 RTP/AVP 2 a=rtpmap 2 G726-32/8000 m=audio 4666 RTP/AVP 4 a=rtpmap 4 G723/8000 m=audio 4888 RTP/AVP 15 a=rtpmap 15 G728/8000 SIP/2.0 200 OK

64

, Collins G.726, G.723.2, G.728 . Boss G.728. . INVITE message body , media format. media format Media information: m=audio (media type) 4444 (transport port number) RTP/AVP ( RTP) 2 ( RTP payload type=2) Attribute media type : a=rtpmap: 2 ( RTP payload type=2) G726-32/8000 (media name, bit rate) Note: Collins media type, port number, 4444 port G.726 media stream, 4666 port G.723 media stream, Collins media stream. Note: Via: headers, 180 Ring .

SDP Inclusion in SIP Messages (2/2)


Daniel<sip:Collins@station1.work.com> Boss<sip:Manager@station2.work.com>

SIP/2.0 200 OK From: Daniel<sip:Collins@station1.work.com>; tag = abcd1234 To: Boss<sip:Manager@station2.work.com>; tag = xyz789 CSeq: 1 INVITE Content-Length: 163 Content-Type: application/sdp Content-Disposition: session v=0 o=collins 45678 001 IN IP4 station2.work.com s= c=IN IP4 station2.work.com t=0 0 m=audio 0 RTP/AVP 2 m=audio 0 RTP/AVP 4 m=audio 6666 RTP/AVP 15 a=rtpmap 15 G728/8000 ACK sip:manager@station2.work.com SIP/2.0 From: Daniel<sip:Collins@station1.work.com>; tag = abcd1234 To: Boss<sip:Manager@station2.work.com>; tag = xyz789 CSeq: 1 ACK Content-Length: 0 Conversation

port=4888

port=6666
65

Step b: 200 OK message body INVITE message body . G.726, G.723.1 media type , port number 0 reject. attribute . G.728 media type , 6666 Boss port number, G.728 media stream. attribute . Step c: ACK, SDP, content-length=0. Step d: RTP G.728 , .

Alternative Ways
Offer
m=audio 4444 RTP/AVP 2 4 15 a=rtpmap 2 G726-32/8000 a=rtpmap 4 G723/8000 a=rtpmap 15 G728/8000

Answer
m=audio 6666 RTP/AVP 15 a=rtpmap 15 G728/8000

66

Collins media type, , port number, 4444 port . media type, m field : m=audio 4444 RTP/AVP 2 4 15. 3 attributes media type. Boss G.728, .

Negotiation of Media (1/3)


Re-INVITE is issued when the server replies with more than one codec.
With the same dialog identifier (To and From tag), Call-ID and Request-URI Session version in o field is increased by 1.

A mismatch
488 (Not acceptable here) or 606 (Not acceptable) A Warning header with warning code
304 (media type not available) 305 (incompatible media format)
67

media type , . sender media type, INVITE, . INVITE ( messages) INVITE dialog (in confirmed state). dialog identifier, Call-ID Request-URI. Dialog identifier = From tag + To tag + Call ID. offer media types receiver , receiver response: 488 (Not acceptable here) 606 (Not acceptable). response Warning: header, 3 warning code . Warning code=304 media type not available. session media types ( audio/video/app). Warning code =305 incompatible media format. session media format ( G.711 codec) . , caller INVITE.

Negotiation of Media (2/3)


Daniel<sip:Collins@station1.work.com> a Boss<sip:Manager@station2.work.com> INVITE sip:manager@station2.work.com SIP/2.0 CSeq: 1 INVITE Content-Length: 183 Content-Type: application/sdp Content-Disposition: session v=0 o=collins 123456 001 IN IP4 station1.work.com s= c=IN IP4 station1.work.com t=0 0 m=audio 4444 RTP/AVP 2 4 15 a=rtpmap 2 G726-32/8000 a=rtpmap 4 G723/8000 a=rtpmap 15 G728/8000 a=inactive
SIP/2.0 200 OK CSeq: 1 INVITE Content-Length: 157 Content-Type: application/sdp Content-Disposition: session v=0 o=collins 45678 001 IN IP4 station2.work.com s= c=IN IP4 station2.work.com t=0 0 m=audio 6666 RTP/AVP 4 15 a=rtpmap 4 G723/8000 a=rtpmap 15 G728/8000 a=inactive

68

, Collins G.726, G.723.2, G.728, Boss G.723 G.728. Step a: Collins offer, G.726, G.723.2, G.728, media stream, port=4444. Step b: Boss answer G.726, G.728, port=6666.

Negotiation of Media (3/3)


Daniel<sip:Collins@station1.work.com> Boss<sip:Manager@station2.work.com>

c ACK sip:manager@station2.work.com SIP/2.0 From: Daniel<sip:Collins@station1.work.com>; tag = abcd1234 To: Boss<sip:Manager@station2.work.com>; tag = xyz789 CSeq: 1 ACK Content-Length: 0 d INVITE sip:manager@station2.work.com SIP/2.0 CSeq: 2 INVITE Content-Length: 126 Content-Type: application/sdp Content-Disposition: session v=0 o=collins 123456 002 IN IP4 station1.work.com s= c=IN IP4 station1.work.com t=0 0 m=audio 4444 RTP/AVP 15 a=rtpmap 15 G728/8000

69

Step c: Collins ACK response 200 OK. ACK message body, ACK media type. Step d: Collins media types G.728, INVITE. CSeq 1. o field session version 1, subfield ( sender, session number=123456) , session . .

OPTIONS Method
Determine the capabilities of a potential called party Accept Header
Indicate the type of information that the sender hopes to receive

Allow Header
Indicate the SIP methods that it can handle

Supported Header
Indicate the SIP extensions that it can be supported
70

OPTIONS called party capabilities. , media type, methods, SIP extension, encoding (ex: gzip), encoding language (ex: en), content-type (ex: application/sdp),

Usage of the OPTIONS Method


Daniel<sip:Collins@station1.work.com> Boss<sip:Manager@station2.work.com>

OPTIONS sip:manager@station2.work.com SIP/2.0 Via: SIP/2.0/UDP Station1.work.com; branch=z9hG4bK7890123 From: Daniel<sip:Collins@work.com>; tag=lmnop123 To: Boss<sip:Manager@station2.work.com> Call-ID: 123456@station1.work.com Contact: Daniel<sip:Collins@station1.work.com> CSeq: 1 OPTIONS Accept: application/sdp Content-Length: 0

SIP/2.0 200 OK Via: SIP/2.0/UDP Station1.work.com; branch=z9hG4bK7890123 From: Daniel<sip:Collins@work.com>; tag=lmnop123 To: Boss<sip:Manager@station2.work.com>; tag=xyz5678 Call-ID: 123456@station1.work.com CSeq: 1 OPTIONS Allow: INVITE, ACK, CANCEL, OPTIONS, BYE Supported: newfield Content-Length: 146 Content-Type: application/sdp v=0 o=manager 45678 001 IN IP4 station2.work.com s= c=IN IP4 station2.work.com t=0 0 m=audio 0 RTP/AVP 4 15 a=rtpmap 4 G723/8000 a=rtpmap 15 G728/8000

71

Collins Boss media type. OPTIONS . Accept: header sender Boss SDP Boss capabilities. OPTIONS Accept: header, application/sdp. Boss 200 OK. SDP Boss . Allow: header Boss SIP methods, REGISTER, spec . Supported: header newfile SIP extension . extensions, . Content-type: message body codec. Response Accept:, Accept-Encoding:, AcceptLanguage:,

SIP Extensions and Enhancements


SIP INFO Method SIP Event Notification SIP for Instant Messaging SIP REFER Method Reliability of Provisional Responses SIP UPDATE Method Integration of SIP Signaling and Resource Management

SIP Extensions and Enhancements


RFC 2543, March 1999
SIP has attracted enormous interest. Traditional telecommunications companies, cable TV providers and ISP

A large number of extensions to SIP have been proposed.


SIP will be enhanced considerably before it becomes an Internet standard.

RFC 3261
183 Session Progress Supported header
73

1999 SIP RFC 2543, . , Cable TV , ISP SIP . , RFC 3261 proposed standard, extension , proposed standard. IETF SIP working group .

183 Session Progress


It has been included within the RFC 3261.
To open one-way audio path from called end to calling end
From the called party to calling party Enable in-band call progress information to be transmitted
Tones or announcements

Interworking with SS7 network


ACM (Address Complete Message) Ring back tone in 183 Session Progress

74

183 Session Progress response code RFC 3261 . 183 Session Progress response code callee caller , caller in-band call Tones announcement. SS7 caller callee IAM ( ), callee ACM message ( ring-back tone) caller, SIP ACM message, 183 SS7 .

The Supported Header


The Require Header (client server)
A client indicates that a server must support certain extension with Require header 420 bad extension with Unsupported header

The Supported header Way 1:


Options (client server) Response with Supported (server client)

Way 2:
Request with Supported (client server) 421 extension required with Require (server client)

75

Supported header RFC 3261 . RFC 2543 Require header client , servers ( proxy) extensions , Require: head server RFC 3261 Supported header field server client extension client server extension request Required Require option tags list. option tag extension, RFC (but ). server 420 Bad Extension , Unsupported header . Supported header : client server extension , OPTIONS request server. Sever Supported header , extensions client extensions request Supported header field sever client request, server extension Supported header , 421 extension required, Require header client extension Supported , extensions.

SIP INFO Method


Specified in RFC 2976
For transferring information during an ongoing session Application-layer information could be transferred in the middle of a call. A powerful, flexible tool to support new services

The transfer of DTMF digits The transfer of account balance information


Pre-paid service

The transfer of mid-call signaling information generated in another network and passed to the IP network via a gateway 76
SIP INFO method RFC 2976 The Session Initiation Protocol (SIP) INFO Method . session (), application-layer INFO , , message body . , INFO . Dual-Tone Multi-frequency (DTMF) digits .

SIP Event Notification


RFC 3265 has addressed the issue of event notification. SUBSCRIBE and NOTIFY Event header
Subscriber Notifier

SUBSCRIBE

b 200 OK c NOTIFY Current state information

d e

200 OK Updated state information

NOTIFY f

200 OK

77

SIP Event method RFC 3265 Session Initiation Protocol (SIP)Specific Event Notification . RFC 3265 general (), event (ex: instant message, presence, monitoring of calls), -. Ex 1: Instant Messaging buddy list , SUBSCRIBER Instant Messaging server. Event: header buddy . Server NOTIFY . Ex 2: () , SUBSCRIBER server. message body , Event: header server message body . Server authentication , 200 OK. server NOTIFY . , , ( Ex1 , buddy ), server NOTIFY, . NOTIFY 200 OK. SIP , Event Notification , . Event: header , message body , .

SIP for Instant Messaging (1/3)


The IETF working group SIP for Instant Messaging and Presence Leveraging Extensions (SIMPLE) RFC 3428 Session Initiation Protocol (SIP) Extension for Instant Messaging A new SIP method MESSAGE
This request carries the actual message in a message body. A MESSAGE request does not establish a SIP dialog.

78

IETF SIP for Instant Messaging and Presence Leveraging Extensions (SIMPLE) working group, instant messaging . RFC 3428 Session Initiation Protocol (SIP) Extension for Instant Messaging Instant messaging real-time . , , . , . session, message . INVITE session. SIP MESSAGE method . BYE session. MESSAGE , message body . text/plain, message/cpim. cpim common presence and instant message . MESSAGE SIP dialog. To: From: header tag.

SIP for Instant Messaging (2/3)


Boss<sip:Manager@pc1.home.com> sip:Server.work.com Daniel<sip:Collins@station1.work.com>

a b MESSAGE sip:Collins@work.com SIP/2.0 Via: SIP/2.0/UDP pc1.home.net; branch=z9hG4bK7890 Max-Forwards: 70 From: Boss<sip:Manager@home.net> To: Daniel<sip:Collins@work.com> Call-ID: 123456@pc1.home.net CSeq: 1 MESSAGE Content-Type: text/plain Content-Length: 19 Content-Disposition: render Hello. How are you?

MESSAGE sip:Collins@work.com SIP/2.0 Via: SIP/2.0/UDP server.work.com; branch=z9hG4bKxyz1 Via: SIP/2.0/UDP pc1.home.net; branch=z9hG4bK7890 Max-Forwards: 69 From: Boss<sip:Manager@home.net> To: Daniel<sip:Collins@work.com> Call-ID: 123456@pc1.home.net CSeq: 1 MESSAGE Content-Type: text/plain Content-Length: 19 Content-Disposition: render Hello. How are you?

c d

SIP/2.0 200 OK Via: SIP/2.0/UDP pc1.home.net; branch=z9hG4bK7890 From: Boss<sip:Manager@home.net> To: Daniel<sip:Collins@work.com> Call-ID: 123456@pc1.home.net CSeq: 1 MESSAGE Content-Length: 0

SIP/2.0 200 OK Via: SIP/2.0/UDP server.work.com; branch=z9hG4bKxyz1 Via: SIP/2.0/UDP pc1.home.net; branch=z9hG4bK7890 From: Boss<sip:Manager@home.net> To: Daniel<sip:Collins@work.com> Call-ID: 123456@pc1.home.net CSeq: 1 MESSAGE Content-Length: 0

79

Boss proxy MESSAGE Daniel. Daniel 200 OK.

SIP for Instant Messaging (3/3)


Boss<sip:Manager@pc1.home.com> sip:Server.work.com Daniel<sip:Collins@station1.work.com>

e f

MESSAGE sip:Manager@home.net SIP/2.0 Via: SIP/2.0/UDP server.work.com; branch=z9hG4bKabcd Via: SIP/2.0/UDP station1.work.com; branch=z9hG4bK123 Max-Forwards: 69 From: Daniel<sip:Collins@work.com> To: Boss<sip:Manager@home.net> Call-ID: 456789@station1.work.com CSeq: 1101 MESSAGE Content-Type: text/plain Content-Length: 22 Content-Disposition: render

MESSAGE sip:Manager@home.net SIP/2.0 Via: SIP/2.0/UDP station1.work.com; branch=z9hG4bK123 Max-Forwards: 70 From: Daniel<sip:Collins@work.com> To: Boss<sip:Manager@home.net> Call-ID: 456789@station1.work.com CSeq: 1101 MESSAGE Content-Type: text/plain Content-Length: 22 Content-Disposition: render Im fine. How are you?

Im fine. How are you? g h SIP/2.0 200 OK Via: SIP/2.0/UDP server.work.com; branch=z9hG4bKabcd Via: SIP/2.0/UDP station1.work.com; branch=z9hG4bK123 From: Daniel<sip:Collins@work.com> To: Boss<sip:Manager@home.net> Call-ID: 456789@station1.work.com CSeq: 1101 MESSAGE Content-Length: 0

SIP/2.0 200 OK Via: SIP/2.0/UDP station1.work.com; branch=z9hG4bK123 From: Daniel<sip:Collins@work.com> To: Boss<sip:Manager@home.net> Call-ID: 456789@station1.work.com CSeq: 1101 MESSAGE 80 Content-Length: 0

Daniel instant message , MESSAGE. proxy . protocol , MESSAGE . MESSAGE proxy . MESSAGE , Contact: header. why? dialog. MESSAGE , Record-Route: Route: ( SIP dialog, ). MESSAGE SIP dialog. Boss 200 OK.

SIP REFER Method


RFC 3515 The Session Initiation Protocol (SIP) Refer Method To enable the sender of the request to instruct the receiver to contact a third party
With the contact details for the third party included within the REFER request For Call Transfer applications

The Refer-to: and Refer-by: Headers The dialog between Mary and Joe remains established.
Joe could return to the dialog after consultation with Susan.
81

RFC 3515 - The Session Initiation Protocol (SIP) Refer Method REFER REFER sender, receiver . Call Transfer (). REFER message-body. Call Transfer . Refer-by: header REFER , INVITE (optional), . Joe Mary Susan , Susan 200 OK. Mary Joe dialog , Susan , Mary . Mary Joe dialog , BYE request , .

Call Transfer (1/2)


sip:Mary@station1.work.com sip:Joe@station2.work.com sip:Susan@station3.work.com

b SIP/2.0 202 Accepted c Via: SIP/2.0/UDP station1.work.com; branch=z9hG4bK789 From: Mary<sip:Mary@work.com>; tag=123456 To: Joe<sip:Joe@work.com>; tag=67890 Contact: Joe<Joe@station2.work.com> Call-ID: 123456@station1.work.com CSeq: 123 REFER Content-Length: 0

REFER sip:Joe@station2.work.com SIP/2.0 Via: SIP/2.0/UDP station1.work.com; branch=z9hG4bK789 Max-Forwards: 70 From: Mary<sip:Mary@work.com>; tag=123456 To: Joe<sip:Joe@work.com>; tag=67890 Contact: Mary<Mary@station1.work.com> Refer-To: Susan<sip:Susan@station3.work.com> Call-ID: 123456@station1.work.com CSeq: 123 REFER Content-Length: 0 INVITE sip:Susan@station3.work.com SIP/2.0 Via: SIP/2.0/UDP station2.work.com; branch=z9hG4bKxyz1 Max-Forwards: 70 From: Joe<sip:Joe@work.com>; tag=abcxyz To: Susan<sip:Susan@station3.work.com> Contact: Joe<Joe@station2.work.com> Call-ID: 67890@station2.work.com CSeq: 567 INVITE Content-Type: application/sdp Content-Length: xx Content-Disposition: session 82 {message body}

Mary Joe , , Joe Susan , Mary , Mary , Mary Call Transfer . , Mary . Mary Joe session Susan , Mary Susan. Call Transfer. Step a: Mary Susan, REFER Joe. ReferTo: header Susan . Step b: Joe 202 Accept Mary, . , Jeo NOTIFY (Step f) Mary, . Step c: Joe INVITE Susan.

Call Transfer (2/2)


e sip:Mary@station1.work.com

sip:Susan@station3.work.com

sip:Joe@station2.work.com SIP/2.0 200 OK Via: SIP/2.0/UDP station2.work.com; branch=z9hG4bKxyz1 From: Joe<sip:Joe@work.com>; tag=abcxyz To: Susan<sip:Susan@station3.work.com>; tag=123xyz Call-ID: 67890@station2.work.com CSeq: 567 INVITE Content-Type: application/sdp Content-Length: xx Content-Disposition: session {message body} ACK sip:Susan@station3.work.com SIP/2.0 Via: SIP/2.0/UDP station2.work.com; branch=z9hG4bKxyz1 Max-Forwards: 70 From: Joe<sip:Joe@work.com>; tag=abcxyz To: Susan<sip:Susan@station3.work.com>; tag=123xyz Call-ID: 67890@station2.work.com CSeq: 567 ACK Content-Length: 0

f g NOTIFY sip:Mary@station1.work.com SIP/2.0 Via: SIP/2.0/UDP station2.work.com; branch=z9hG4bK123 Max-Forwards: 70 To: Joe<sip:Joe@work.com>; tag=67890 From: Mary<sip:Mary@work.com>; tag=123456 Contact: Joe<Joe@station2.work.com> Call-ID: 123456@station1.work.com CSeq: 124 NOTIFY Content-Type: message/sipfrag;version=2.0 Content-Length: 15 h SIP/2.0 200 OK SIP/2.0 200 OK Via: SIP/2.0/UDP station2.work.com; branch=z9hG4bK123 To: Joe<sip:Joe@work.com>; tag=67890 From: Mary<sip:Mary@work.com>; tag=123456 Call-ID: 123456@station1.work.com CSeq: 124 NOTIFY Content-Length: 0

83

Step e, f: Susan Joe INVITE , 200 OK. Joe ACK. Step g: Joe NOTIFY Mary , message body Susan 200 OK message body, Content-type: message/sipfrag: verison 2.0 SIP (NOTIFY) SIP (200 OK), i.e., tunnel . Step h: Mary 200 OK Joe. Mary Joe BYE, dialog, Joe Susan session .

Reliability of Provisional Responses (1/2)


Provisional Responses
100 (trying), 180 (ringing), 183 (session in progress) Are not answered with an ACK

If the messages is sent over UDP


Unreliable

Lost provisional response may cause problems when interoperating with other network
180 (ring), 183 (session progress) Q931 alerting or ISUP ACM (Address Complete Message) These external networks need these information to drive a state machine.
84

100 Trying, 180 Ringing, 183 Session in Progress response provisional response SIP entities ACK caller provisional response 180, 183 Q.931 alerting, ISUP ACM, . (state machine) SIP extension provisional response RSeq, Rack, PRACK

Reliability of Provisional Responses (2/2)


E.g., a call to an unassigned number
ACM to create a one-way path to relay an announcement such as The number you have called has been changed If the provisional response is lost, the caller might left in the dark and not understand why the call did not connect.

RFC 3262 Reliability of Provisional Responses in SIP


Response sequence (RSeq): a request header Response ACK (RAck): a response header Option tag=100rel with supported:/unsupported: 85 Provisional Response ACK (PRACK) method
ISUP ACM callee caller . Caller , ACM , , *****. ACM provisional response , caller , . RFC 3262 Reliability of Provisional Responses in SIP headers option tag, PRACK method, end-to-end provisional response . response sequence (RSeq): request header server provisional response, provisional response . transaction, RSeq (i.e., RSeq scope transaction). transaction, RSeq . response ACK (RAck): response header caller PRACK , RAck RSeq, PRACK RSeq response. Supported: header option tag, 100rel, provisional responses . option tag=100rel Unsupported: header, server option tag, , RSeq, RAck extension. 100rel 100% reliability. Provisional Response ACK (PRACK) method caller

Provisional Response ACK (1/2)


ClientA@network.com ServerB@network.com

a INVITE sip:ServerB@network.com SIP/2.0 Via: SIP/2.0/UDP ClientA.network.com; branch=z9hG4bK7890123 Supported: 100rel Require: 100rel From: sip:ClientA@network.com; tag=lmnop123 To: sip:ServerB@network.com Call-ID: 123456@ClientA.network.com CSeq: 1 INVITE

??
SIP/2.0 180 Ringing Via: SIP/2.0/UDP ClientA.network.com; branch=z9hG4bK7890123 Require: 100rel RSeq: 567890 From: sip:ClientA@network.com; tag=lmnop123 To: sip:ServerB@network.com; tag = xyz123 Call-ID: 123456@ClientA.network.com CSeq: 1 INVITE SIP/2.0 180 Ringing Via: SIP/2.0/UDP ClientA.network.com; branch=z9hG4bK7890123 Require: 100rel

Start timer T1 default=0.5 sec


Response Retransmit

Response Lost

86

, Client A Server B, Sever B provisional response , , . Step a: Client A INVITE. Client A PRACK, INVITE Supported: 100rel . Client A , Required: 100rel. Step b: Sever B 180 Ringing, timer T1=0.5sec. 180 Ringing . RSeq, provisional response . Require: 100rel optional tag, caller PRACK. RSeq random number 567890. 32 bits, 1 4,294,967,295 . timer T1, 0.5 sec. Step c: Timeout , Sever B PRACK, 180 Ringing. RSeq, response, , RSeq 1. RSeq=567891. 64 . 64 PRACK, sever .

Provisional Response ACK (2/2)


ClientA@network.com ServerB@network.com

SIP/2.0 180 Ringing Via: SIP/2.0/UDP ClientA.network.com; branch=z9hG4bK7890123 Require: 100rel RSeq: 567891 From: sip:ClientA@network.com; tag=lmnop123 To: sip:ServerB@network.com; tag = xyz123 Call-ID: 123456@ClientA.network.com CSeq: 1 INVITE PRACK sip:ServerB@network.com SIP/2.0 Via: SIP/2.0/UDP ClientA.network.com; branch=z9hG4bK7890123 RAck: 567891 1 INVITE From: sip:ClientA@network.com; tag=lmnop123 To: sip:ServerB@network.com; tag=xyz123 Call-ID: 123456@ClientA.network.com CSeq: 2 PRACK SIP/2.0 200 OK Via: SIP/2.0/UDP ClientA.network.com; branch=z9hG4bK7890123 From: sip:ClientA@network.com; tag=lmnop123 To: sip:ServerB@network.com; tag=xyz123 Call-ID: 123456@ClientA.network.com CSeq: 2 PRACK

87

Step d: Client A 180 Ringing, PRACK callee. RAck: 3 subfields. RSeq , RSeq response. CSeq dialog, INVITE method . final response, CSeq 2 PRACK, transaction . Step e: sever B PRACK, 200 OK (for PRACK). 200 OK, INVITE. PRACK, reliable, call setup delay (PRACK 200 OK ). UDP unreliable transport protocol PRACK SIP , TCP . Application .

The SIP UPDATE Method


RFC 3311 The Session Initiation Protocol (SIP) UPDATE Method To enable the modification of session information before a final response to an INVITE is received
E.g., to change the codec

One important usage is when reserving network resources as part of a SIP session establishment

88

( 200 OK) session , codec, INVITE. INVITE , . (confirmed state) dialog , INVITE, dialog early state. Note: dialog early state. caller 2xx response, confirmed state, . early state dialog, . , session callee 183 session progress , message body ring tone music, early state. caller media , media , . ring tone . RFC3311 UPDATE method. caller INVITE, final response , UPDATE session . dialog , early confirmed state, caller callee, SDP offer UPDATE, session . UPDATE response (2XX), answer. network resource management , , media . INVITE Allow: header, UPDATE.

Integration of SIP Signaling and Resource Management (1/2)


Ensuring that sufficient resources are available to handle a media stream is a very important. The signaling might take a different path from the media. Assume resource-reservation mechanisms are available (Chapter 8)
End-to-end status
End-to-end network resources are reserved as part of session establishment.

Segmented status
A certain amount of network resources are reserved in advance for a certain type of usage. Policing functions at the edge of the network

89

carrier-grade , resource media streams . signaling voice , signaling . ? 8 : End-to-end status: session , end-to-end . (, ). , , . , , . RSVP . Segmented Status: UAs . an aggregate () basis. , (ex: voice, data, management traffic). UA ( link ) , . session , , , () , INVITE request. UAs , . SIP , session media

Integration of SIP Signaling and Resource Management (2/2)


Way I: A rejected Internet draft Way II: RFC 3312 Integration of Resource Management and Session Initiation Protocol (SIP)
By using and UPDATE method and the provisional responses By involving extensions to SDP By SIP extensions 580 precondition failure

90

, 1999 Internet draft, SIP header. INVITE , caller header callee . , INVITE , , . SIP , header, . callee header, , . SIP , extension rejected. , rfc3312: Integration of Resource Management and SIP , provisional response, UPDATE SDP, QoS SDP ( SIP ). SDP stream, , QoS . audio video QoS , . UPDATE 183 session progress SDP, . , PRACK/200 OK . , SIP extension 580 precondition failure. ( BYE CANCEL) session. , codec, . RFC precondition option tag, offer , SIP Require header precondition. RFC Supported header precondition. PRACK, UPDATE, 100rel. session , session , QoS , RFC 3312 . Ex1: media IP address, re-INVITE, SDP . . Ex2: codec, , .

End-to-end Resource Reservation


Reserving network resources in advance of altering the called user
b c d e f a

UserA@network.com

UserB@network.com

INVITE Session Description (with pre-condition attributes) SIP/2.0 183 Session Progress Session Description (with pre-condition attributes) PRACK SIP/2.0 200(OK) (for PRACK) Resource Reservation UPDATE Session Description (with updated pre-condition attributes) SIP/2.0 200 (OK) (for UPDATE) Session Description (with updated pre-condition attributes) SIP/2.0 180 (Ringing) (response to initial INVITE) PRACK (for 180 response) SIP/2.0 200(OK) (for PRACK) SIP/2.0 200(OK) (for INVITE) ACK

h i j k l

91

, User A User B. RSVP. Step a: User A INVITE, session description. User A (offer media), media streams, (preconditions), ex: end-to-end . User A User B , . Step b: User B 183 Session Progress. answer, User A , (B-toA , B ), User B User A A-to-B (B recv) stream resource . User B 183 Session Progress , B-to-A . Step c: User A PRACK response. (A A-to-B ) Step d: User B PRACK 200 OK. Step e: User A User B . Step f: User A , User A UPDATE, offer (A-to-B OK). Step g: User B 200 OK UPDATE, B-to-A . Step h: User B , 180 Ringing (for INVATE). Step i, j: PRACK 200 OK (for 180 Ringing) Ringing . Step k: User B , 200 OK (for INVATE). Step l: User A ACK. Note: A INVITE offer, B 1xx offer, A PRACK answer .

Media Level SDP Attributes


Precondition-type = qos | token Three status: des (desired) / curr (current) / conf (confirmed) Status type: e2e (end-to-end) / local / remote Direction tag: send (sending) / recv (receiving) / sendrecv (both) / none Strength tag: none / mandatory / optional / failure / unknown

92

SDP preconditions, media level SDP attributes: precondition-type qos, . SDP : desired/current/confirm Current . tag . Desired . Confirmed QoS , . , offer. (confirmed answer offer , answer ). media stream direction-tag: send/recv/senrecv/none. . send/recv SDP UA , media stream . User A SDP User A User B , send. User B SDP User A User B , recv. sendrecv media stream . send, recv streams, precondition , , sendrecv. none . status type: e2e/local/remote e2e end-to-end , end-to-end . segmented , SDP UA , local, remote. local, local network , . remote, . Strength tag , callee. none , . mandatory , session. optional optional, , , session . failure . 580 pre-condition failure , SDP , a=des:qos failure e2e send . unknown offer. mandatory , offer. ex: a=des:foo unknown e2e send

Example of e2e Resource Reservation (1/2)


SDP for initial INVITE
v=0 o=userA 45678 001 IN IP4 stationA.network.com s= c=IN IP4 stationA.nework.com t=0 0 m=audio 4444 RTP/AVP 0 a=curr: qos e2e none a=des: qos mandatory e2e sendrecv v=0 o=userB 12345 001 IN IP4 stationB.network.com s= c=IN IP4 stationB.nework.com t=0 0 m=audio 6666 RTP/AVP 0 a=curr: qos e2e none a=des: qos mandatory e2e sendrecv a=conf: qos e2e recv
93

SDP for 183 response

5-22 , SDP . SDP for initial INVITE (step a) m=audio 4444 RTP/AVP 0 A to B RTP type=0 audio , As port # =4444. media stream attributes: a=curr: qos e2e none end-to-end QoS a=des: qos mandatory e2e sendrecv User A sending receiving QoS. SDP for 183 Session Progress (step b) m=audio 6666 RTP/AVP 0 B to A RTP type=0 audio , Bs port # =6666. media stream attributes: a=curr: qos e2e none end-to-end QoS a=des: qos mandatory e2e sendrecv User B sending receiving QoS a=conf: qos e2e recv User B User A A-to-B , offer. User B B-to-A .

Example of e2e Resource Reservation (2/2)


SDP for UPDATE
v=0 o=userA 45678 001 IN IP4 stationA.network.com s= c=IN IP4 stationA.nework.com t=0 0 m=audio 4444 RTP/AVP 0 a=curr: qos e2e send a=des: qos mandatory e2e sendrecv v=0 o=userB 12345 001 IN IP4 stationB.network.com s= c=IN IP4 stationB.nework.com t=0 0 m=audio 6666 RTP/AVP 0 a=curr: qos e2e sendrecv a=des: qos mandatory e2e sendrecv
94

SDP for 200 response

5-22 , SDP . SDP for UPDATE (step f) a=curr: qos e2e send caller caller-to-callee , send end-to-end QoS a=des: qos mandatory e2e sendrecv caller sending receiving QoS SDP for 200 OK (for UPDATE) (step g) a=curr: qos e2e sendrecv end-to-end QoS a=des: qos mandatory e2e sendrecv callee sending receiving QoS

Segmented Status Reservation


Each participant deals with network access permission at its own end.

UserA@network.com

UserB@network.com

Local resource reservation

INVITE v=0 0=userA 45678 001 IN IP4 stationA.network.com s= c= IN IP4 stationA.network.com t=0 0 m=audio 4444 RTP/AVP 0 a=curr: qos local sendrecv a=curr: qos remote none a=des: qos mandatory local sendrecv a=des: qos mandatory remote sendrecv Local resource reservation

b
SIP/2.0 180 Ringing v=0 0=userB 12345 001 IN IP4 stationB.network.com s= c= IN IP4 stationB.network.com t=0 0 m=audio 6666 RTP/AVP 0 a=curr: qos local sendrecv a=curr: qos remote sendrecv a=des: qos mandatory local sendrecv a=des: qos mandatory remote sendrecv

c d e f

PRACK (for 180 response) SIP/2.0 200 (OK) (for PRACK) SIP/2.0 200 (OK) (for INVITE) ACK

95

, User A User B. segmented status (i.e., aggregate) local policing . Step a: User A local network , INVITE, session description: m=audio 4444 RTP/AVP 0 A-to-B RTP type=0 audio , As port # =4444. media stream attributes: a=curr: qos local sendrecv User A , . a=curr: qos remote none (User B) . a=des: qos mandatory local sendrecv User A sending receiving QoS. a=des: qos mandatory remote sendrecv User A sending receiving QoS Step b: User B User A , , 180 Ring (), session description: m=audio 6666 RTP/AVP 0 B-to-A RTP type=0 audio , Bs port # =6666. media stream attributes: a=curr: qos local sendrecv User B , . a=curr: qos remote sendrecv User A a=des: qos mandatory local sendrecv User B sending receiving QoS. a=des: qos mandatory remote sendrecv User B User A sending receiving QoS

Usage of SIP for Features and Services

Call Forwarding Consultation Hold

Usage of SIP for Features/Services (1/2)


Personal Mobility (Registrar) Call-transfer application (with REFER method) One number service through forking proxy Call-completion services (by Retry-After: header) Click-to-call applications or Web service (SIP address is a URL) Existing supplementary services in traditional telephony
Call waiting, call forwarding, multi-party calling, call screening
97

SIP SIP extension , . : SIP registrar personal mobility. REFER call transfer, Fig 5-20 forking proxy one-number service, Fig 5-7 Retry-After: header call-completion service, Fig 5-6 SIP Web URL, MIME content HTML document, image, click-to-call service. CLASS services, call waiting, call forwarding, multiparty calling, call screening.

Usage of SIP for Features/Services (2/2)


Proxy invokes various types of advanced feature logic.
Policy server (call-routing, QoS) Feature server (subscriber-specific feature data, ex: screening lists, forwarding information) Authentication server Use the services of an IN SCP over INAP Use Open Service Access (OSA)

98

Proxy , Proxy Policy server call-routing , QoS , . Proxy screening lists, forwarding , . (other example: pre-pay call). Proxy Authentication server, . proxy Intelligent network (IN) Service Control Point (SCP), IN . proxy IN Application Part . Open Service Access (OSA) , Application Programming Interfaces (API) proxy SCP .

Call Forwarding
User1

sip:Server.work.com

User2 User3

Call-forwardingon-busy Call-forwardingon-no-answer
Timeout CANCEL method

INVITE sip:user2@server.work.com SIP/2.0 From: sip:user1 To: sip:user2@work.com Contact: User1 CSeq: 1 INVITE SIP/2.0 100 Trying From: sip:user1 To: sip:user2@work.com CSeq: 1 INVITE INVITE sip:user2@server.work.com SIP/2.0 From: sip:user1 To: sip:user2@work.com Contact: User1 CSeq: 1 INVITE SIP/2.0 486 Busy Here From: sip:user1 To: sip:user2@work.com CSeq: 1 INVITE INVITE sip:user3@server.work.com SIP/2.0 From: sip:user1 To: sip:user2@work.com CSeq: 2 INVITE SIP/2.0 200 OK From: sip:user1 To: sip:user2@work.com Contact: sip:user3@work.com CSeq: 2 INVITE

Call-forwarding unconditional
SIP/2.0 200 OK From: sip:user1 To: sip:user2@work.com Contact: sip:user3@work.com CSeq: 1 INVITE

99

SIP call forwarding . : Call-forwarding-on-busy: callee , . Call-forwarding-on-no-answer: callee , . Call-forwarding- unconditional service: callee , . call-forwarding-on-busy . User 1 User 2. User 2 , User 3. User 1 INVITE, proxy User 2. User 2 , 486 busy here proxy. Proxy database , INVITE User 3. To: header User 2, User 3 call forwarding . 486 callee, , callee . response Retry-after: header, (ex: voice mail). callee callee , 600 busy everywhere. User 3 200 OK, . Contact: header User 3, User 1 User 3 trunk. proxy , , Recordroute: header . Call-forwarding-on-no-answer: proxy INVITE User 2 , timer. callee , proxy CANCEL User 2, INVITE User 3. Call-forwarding- unconditional service callee , proxy .

Consultation Hold
User A asks User B a question, and User B need to check with User C for the correct answer. User B could use the REFER method to transfer the call to User C. A SIP UPDATE

User A

User B

User C

INVITE sip:User A@there SIP/2.0 From: sip:User B@here Call-ID: 12345 SDP Description SIP/2.0 200 OK From: sip:User B@here Call-ID: 12345 SDP Description ACK sip:User A@there SIP/2.0 From: sip:User B@here Call-ID: 12345 Conversation UPDATE sip:User A@there SIP/2.0 From: sip:User B@here Call-ID: 12345 Session Description a=inactive

d e

SIP/2.0 200 OK From: sip:User B@here Call-ID: 12345 Session Description a=inactive On hold User B calls User C, speaks, then hangs up UPDATE sip:User A@there SIP/2.0 From: sip:User B@here Call-ID: 12345 Session Description a=sendrecv SIP/2.0 200 OK From: sip:User B@here Call-ID: 12345 Session Description a=sendrecv

g h i

100

User A B (ex: A B ), User B User A ( hold, ). User B User C (ex: B C ). , User B User C , User A (ex: B A , Consultation Hold). REFER , call waiting . Steps a-d: User A User B . Step e: User B UPDATE, inactive. UPDATE , hold , Call-ID: 123456 INVITE . SDP media attribute inactive, hold . , SDP media attribute sendonly. Steps f, g: 200 OK, media on hold . Step h: User B (INVITE - BYE) User C . Step i, j: User B UPDATE, active. UPDATE , Call-ID: 123456 , SDP media attribute sendrecv,,

Interworking

PSTN Interworking Interworking with H.323

SIP IP , . PSTN H.323 interworking .

SIP to PSTN Call


Manager@work.com Proxy.work.com NGW PSTN switch a b c d e f g h i j k l 200 (OK) Updated session description ACK ACK Two-way audio Two-way audio 183 (Session Progress) Session description

INVITE 100 (Trying) INVITE 100 (Trying) IAM ACM 183 (Session Progress) Session description One-way audio ANM 200 (OK) Updated session description

One-way audio

m n o

102

SIP PSTN : seamless interworking, SIP device PSTN . PSTN SS7 ISUP . gateway SIP ISUP. SIP-based , media gateway. signaling gateway SS7 . Boss SIP phone PSTN (Collins ), NGW (Network Gateway) , . NGW (network gateway) To: header PSTN , IAM (initial address message) calling party number. From: header SIP URI, Caller-ID . IAM INVITE, ACM (Address Complete Message) 183 Session Progress), ANM (Answer Message) 200 OK. parameters . PSTN SIP phone, Fig 5-28. SIP 180 ring PSTN phone ring tone. 183 session progress ring tone media . . , , PRACK .

PSTN Interworking
RFC 3372 - Session Initiation Protocol for Telephones (SIP-T): Context and Architectures PSTN SIP PSTN
RFC 3204 - MIME media types for ISUP and QSIG Objects MIME media types For ISUP

The whole issue of interworking with SS7 is fundamental to the success of VoIP in the real world.

103

PSTN SIP ISUP 1 1 , . RFC SIP-T (Session Initiation Protocol for Telephones (SIP-T):Context and Architectures). BCP (Best Current Practice), SIP extension, SIP PSTN . SIP-T SIP message body (multiparts), ISO-10646 MIME , ISUP QSIG . RFC 3204 - MIME media types for ISUP and QSIG Objects QSIG is the analogous signaling protocol used between PBXs to support calls within private telephony networks. SIP INFO PSTN . VoIP , SS7 .

Interworking with H.323


SIP-H.323 interworking gateway
Interworking Gateway H.323 endpoint H.323 Signaling H.323 gatekeeper H.323 Endpoint SIP User Agent SIP SIP SIP Client

SIP Server

H.323 Signaling

104

SIP-H.323 Interworking group standard draft draft-agrawalSIP-h323-interworking-reqs-07.txt, 2001 Feb. IESG, Information RFC. version 7, 2005 Jan 5 approvedannouncement sent RFC Ed Queue , RFC Editor State. Interworking gateway protocols . SIP , SIP registrar, proxy . H.323 , gatekeeper.

A Call from SIP to H.323 (1/2)


SIP Client Gateway H.323 Terminal

Fast connect is used.

a b

INVITE To: Terminal@H323.net c=IN IP4 123.45.6.7 m=audio 8000 RTP/AVP 0 Setup faststart [logical chan info = G711 Tx, G711 RX 123.45.6.7:8000

c d e f 200 (OK) To: Terminal@H323.net c=IN IP4 123.67.8.9 m=audio 2000 RTP/AVP 0 g h ACK Two-way voice Two-way voice

Alerting 180 (Ringing) Connect faststart [logical chan info = G711 Tx, G711 RX 123.67.8.9:2000

105

SIP caller H.323 . H.323 Fast Connect procedure, gatekeeper . gatekeeper , RAS , SIP . SDP Q.931 SETUP faststart logical channel information. RTP payload type=0 G.711 Tx (), G.711 Rx (), SIP client IP=123.45.6.7 8000 port, Rx . , H.323 terminal Connect logical channel , gateway 200 OK SIP client. H.323 terminal Altering Call Proceeding logical channel information, gateway , 200 OK SIP client. IP:port, RTP payload type, media Gateway .

A Call from SIP to H.323 (2/2)


SIP Client

Gateway

H.323 Terminal

Fast Connect is not used.

INVITE b To: Terminal@H323.net c=IN IP4 123.45.6.7 m=audio 8000 RTP/AVP 0

c d e f

Setup faststart [logical chan info = G711 TX, G711 RX 123.45.6.7:8000 Connect (no faststart) Terminal Capability Set G711 TX. G711 RX Terminal Capability Set Ack Terminal Capability Set G711 TX, G711 RX

g h i j 200 (OK) To: Terminal@H323.net c=IN IP4 123.67.8.9 m=audio 2000 RTP/AVP 0

Terminal Capability Set Ack Open Logical Channel Open Logical Channel Ack RX=123.67.8.9:2000

k l ACK m

H.225.0 Open Logical Channel Open Logical Channel Ack RX=123.45.6.7:8000 H.245 SIP

H.323 terminal H.323 Fast Connect procedure, . Q.931 SETUP faststart logical channel information. H.323 terminal , Connect . H.323 , Connect, H.254 capacity, H.323 terminal gateway media . Gateway 200 OK SIP client. gateway H.323 terminal media .

A Call from H.323 to SIP with Fast Connection


H.323 Terminal Gateway a Setup b faststart [logical chan info = G711 TX, G711 RX 123.67.8.9:2000

SIP Client

INVITE To: User@SIP.net c=IN IP4 123.67.8.9 m=audio 2000 RTP/AVP 0 180 (Ringing)

c d e Alerting

200 (OK) To: User@SIP.net Connect faststart [logical chan info - G711 TX G711 RX 123.45.6.7:800 c=IN IP4 123.45.6.7 m=audio 8000 RTP/AVP 0 ACK Two-way voice Two-way voice

g h

107

H.323 SIP . H.323 Fast Connect procedure, gatekeeper . Q.931 SETUP H.225 session SIP SDP. 180 Ring Alerting. SIP 200 OK . Connect. H.323 terminal H.323 Fast Connect procedure, . Q.931 SETUP faststart logical channel information. Gateway INVITE session capacity. H.245 , UPDATE SIP client media . 5-33.

Summary
The future for signaling in VoIP networks
Simple, yet flexible Easier to implement Fit well with the media gateway control protocols

SIP is the protocol of choice for the evolution of third-generation wireless networks.
SIP-based mobile devices will become available SIP-based network elements will be introduced within mobile networks.

108

You might also like