Session Initiation Protocol & SDP



Similar documents
Session Initiation Protocol (SIP) 陳 懷 恩 博 士 助 理 教 授 兼 計 算 機 中 心 資 訊 網 路 組 組 長 國 立 宜 蘭 大 學 資 工 系 TEL: # 340

Session Initiation Protocol (SIP) Chapter 5

Part II. Prof. Ai-Chun Pang Graduate Institute of Networking and Multimedia, Dept. of Comp. Sci. and Info. Engr., National Taiwan University

Session Initiation Protocol (SIP)

How To Send A Connection From A Proxy To A User Agent Server On A Web Browser On A Pc Or Mac Or Ipad (For A Mac) On A Network With A Webmail Web Browser (For Ipad) On An Ipad Or

3.1 SESSION INITIATION PROTOCOL (SIP) OVERVIEW

SIP Session Initiation Protocol

Multimedia & Protocols in the Internet - Introduction to SIP

Session Initiation Protocol (SIP) The Emerging System in IP Telephony

Media Gateway Controller RTP

SIP: Protocol Overview

Session Initiation Protocol

Voice over IP & Other Multimedia Protocols. SIP: Session Initiation Protocol. IETF service vision. Advanced Networking

SIP Session Initiation Protocol Nicolas Montavont

SIP : Session Initiation Protocol

Session Initiation Protocol (SIP)

VoIP Technology Overview. Ai-Chun Pang Grad. Ins. of Networking and Multimedia Dept. of Comp. Sci. and Info. Engr. National Taiwan University

SIP Basics. CSG VoIP Workshop. Dennis Baron January 5, Dennis Baron, January 5, 2005 Page 1. np119

VoIP. What s Voice over IP?

SIP Introduction. Jan Janak

SIP Trunking. Service Guide. Learn More: Call us at

EE4607 Session Initiation Protocol

SIP - QUICK GUIDE SESSION INITIATION PROTOCOL - INTRODUCTION

SIP Messages. 180 Ringing The UA receiving the INVITE is trying to alert the user. This response MAY be used to initiate local ringback.

Session Initiation Protocol and Services

SIP Trunking & Peering Operation Guide

IP-Telephony SIP & MEGACO

Request for Comments: August 2006

TSIN02 - Internetworking

3GPP TS V8.1.0 ( )

NTP VoIP Platform: A SIP VoIP Platform and Its Services

VoIP with SIP. Session Initiation Protocol RFC-3261/RFC

internet technologies and standards

Internet Telecom Dept. CCL/ITRI, Taiwan

For internal circulation of BSNL only

ARCHITECTURES TO SUPPORT PSTN SIP VOIP INTERCONNECTION

Three-Way Calling using the Conferencing-URI

AGILE SIP TRUNK IP-PBX Connection Manual (Asterisk)

Formación en Tecnologías Avanzadas

SIP for Voice, Video and Instant Messaging

Advanced Networking Voice over IP & Other Multimedia Protocols

Internet Multimedia (thanks to Henry Sinnreich, Alan Johnston, MCI WorldCom, Henning Schulzrinne) IP Communications

Telecommunication Services Engineering (TSE) Lab. Chapter V. SIP Technology For Value Added Services (VAS) in NGNs

SIP Essentials Training

Session Initiation Protocol (SIP)

Voice over IP (SIP) Milan Milinković

SIP RFC (3261) explained, LIGHT 3.2 (1/2011) -

NAT TCP SIP ALG Support

Multimedia Conferencing with SIP

The Session Initiation Protocol (SIP)

SIP-Based VoIP Network And Its Interworking With The PSTN

TECHNICAL SUPPORT NOTE. 3-Way Call Conferencing with Broadsoft - TA900 Series

VoIP 應 用 技 術 介 紹. Hsu, Hung-Chi ( 許 鴻 基 ) hchsu@itri.org.tw Internet Telecom Dept. CCL/ITRI, Taiwan

Chapter 10 Session Initiation Protocol. Prof. Yuh-Shyan Chen Department of Computer Science and Information Engineering National Taipei University

NGN NNI Signalling Profile

End-2-End QoS Provisioning in UMTS networks

FortiOS Handbook - VoIP Solutions: SIP VERSION 5.2.0

Grandstream Networks, Inc. GXP2130/2140/2160 Auto-configuration Plug and Play

White paper. SIP An introduction

SIP: Session Initiation Protocol

Internet Services & Protocols Multimedia Applications, Voice over IP

This specification this document to get an official version of this User Network Interface Specification

Application Notes for Configuring SIP Trunking between McLeodUSA SIP Trunking Solution and an Avaya IP Office Telephony Solution 1.

How To Write A Sip Message On A Microsoft Ipa (Sip) On A Pcode (Siph) On An Ipa Or Ipa On A Ipa 2 (Sips) On Pcode On A Webmail (

Firewall Support for SIP

Internet Services & Protocols Multimedia Applications, Voice over IP

BROADWORKS SIP ACCESS SIDE EXTENSIONS INTERFACE SPECIFICATIONS RELEASE Version 1

NTP VoIP Platform: A SIP VoIP Platform and Its Services 1

IxLoad: Advanced VoIP

SIP A Technology Deep Dive

SIP: Ringing Timer Support for INVITE Client Transaction

SIP and ENUM. Overview DENIC. Introduction to SIP. Addresses and Address Resolution in SIP ENUM & SIP

Technical Communication 1201 Norphonic emergency rugged telephone on Alcatel-Lucent OmniPCX Enterprise

TB640 SIP User's Guide

Session Initiation Protocol Gateway Call Flows and Compliance Information

AN IPTEL ARCHITECTURE BASED ON THE SIP PROTOCOL

IP Office Technical Tip

AGILE SIP TRUNK IP- PBX Connection Manual (Asterisk, Trixbox)

Alcatel OmniPCX Enterprise R11 Supported SIP RFCs

Chapter 2 Voice over Internet Protocol

802.11: Mobility Within Same Subnet

How To Understand The Purpose Of A Sip Aware Firewall/Alg (Sip) With An Alg (Sip) And An Algen (S Ip) (Alg) (Siph) (Network) (Ip) (Lib

Application Notes for IDT Net2Phone SIP Trunking Service with Avaya IP Office Issue 1.0

Lehrstuhl für Informatik 4 Kommunikation und verteilte Systeme

Internet Working 15th lecture (last but one) Chair of Communication Systems Department of Applied Sciences University of Freiburg 2005

How To Configure. VoIP Survival. with. Broadsoft Remote Survival

ETSI TS V8.2.0 ( ) Technical Specification

Session Announcement (SAP, RFC 2974) Session Description (SDP, RFC 2327) (SDP, draft-ietf-mmusic-sdp-new-11)

SIP OVER NAT. Pavel Segeč. University of Žilina, Faculty of Management Science and Informatics, Slovak Republic

FOSDEM 2007 Brussels, Belgium. Daniel Pocock B.CompSc(Melbourne)

Technical Manual 3CX Phone System for Windows

SIP: Session Initiation Protocol. Copyright by Elliot Eichen. All rights reserved.

EDA095 Audio and Video Streaming

The use of IP networks, namely the LAN and WAN, to carry voice. Voice was originally carried over circuit switched networks

Voice over IP Consortium

Test Cases - IMS Profile for Voice and SMS

Special Module on Media Processing and Communication

Transcription:

Session Initiation Protocol & SDP Chiang, Wei-Kuo ( 江 為 國 ) Assistant Professor Department of CSIE National Chung Cheng University Office : EA 311 Phone : 05-2720411~33126 Email : wkchiang@cs.ccu.edu.tw URL : http://www.cs.ccu.edu.tw/ ccu tw/~wkchiang/ wkchiang/ National Chung Cheng University Dept. Computer Science & Information Engineering

Outline Introduction SIP Network Entities SIP Architecture SIP Message Format SIP Communication SIP Extensions 2

Introduction ti Why SIP? A powerful alternative to H.323 More flexible, simpler Easier to implement advanced features Better to support of intelligent user devices Transport independence (UDP, TCP, or SCTP) What is bake-off or SIPIT? Various vendors come together and test their products against each other to ensure that they have implemented the specification correctly compatibility with other implementations 3

SIP Overview (1/2) Developed in SIP Working Group in IETF Proposed standard RFC 2543, February 1999 New Version of SIP - RFC 3261, June 2002 Work began 1995 Sep. 1999 split from MMUSIC Multiparty Multimedia Session Control SIP (Session Initiation Protocol) Application-Layer Control Protocol Text-based Encoding (ISO 10646 in UTF-8) SIP is HTTP-like, Request-Response establish, modify and terminate multimedia sessions 4

SIP Overview (2/2) A signaling protocol The setup, modification, and tear-down of multimedia sessions SIP + SDP Describe the session characteristics acte cs Separate signaling and media streams SIP Signaling IP Network RTP Media Stream SIP User 5 SIP User

SIP in IP Multimedia Applications R SDP/SDPng RTP/ S HTTP SMTP SIP RTSP SAP RTCP V P TCP/SCTP TCP/UDP UDP IPv4/IPv6 with Mobility, DiffServ and Multicast Common Addressing, user@domain (URI & URL) Text-based and Encoding Format Easy to Do Integrated t Services Same Request-Response Model, by Combining more than One and Response Codes Protocols MIME for Flexible Payload DNS for Address Mapping 6

SIP Network Entities (1/4) User Agent (UA) User Agent Client - Initiate SIP Request User Agent Server - Accepts or rejects call Server Registrar, Proxy, Redirect Server Location Server Registrar Proxy Servers Redirect Server REGISTER INVITE INVITE INVITE Client Server Client Response 3XX Server User Agent INVITE 7

SIP Network Entities (2/4) Proxy server 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 8

SIP Network Entities (3/4) Proxy Server + Location Server itri.org.tw location server e cs.ccu.edu.tw acer@cs.ccu.edu.tw (1) INVITE honda@itri.org.tw (2) honda (3) hon nda@aud DI (4) INVITE honda@audi AUDI BMW (6) 200 (5) 200 OK OK (7) ACK honda@itri.org.tw BENS (8) ACK honda@audi Honda@AUDI 9

SIP Network Entities (4/4) 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 5Response 5.Response Collins@home.net 10

SIP Architecture t SIP Request SIP Response RTP Media Stream Redirect Server Proxy Server Location Server Proxy Server Proxy Server User Agent Client (Caller) 11 User Agent Server (Callee)

Methods & Response Codes Methods (Commands) REGISTER INVITE,ACK BYE CANCEL OPTION INFO REFER SUBSCRIBE NOTIFY PRACK COMET Client 0REGISTER 0.REGISTER 2xx Redirect Server Location Server Proxy Servers Registrar 3_2.INVITE Response Status Code Informational 1xx Success 2xx Redirection i 3xx Client-Error 4xx Server-Error 5xx Global-Failure 6xx Proxy Servers 0.REGISTER 2xx 1.INVITE 2.3xx 3_3.INVITE 4.2xx 3_1.INVITE 12 5.ACK Server

SIP Extensions Method Extension Header Original Description INFO RFC 2976 Carry control information of a session. REFER Refer-To Referred-By Draft-ietf-sip-cctransfer-05 provide Call Transfer capabilities SUBSCRIBE NOTIFY Event Allow-Event Draft-roach-sipsubscribe-notify-03 Asynchronous request notification of events. Notify SIP events which has been requested by an earlier SUBSCRIBE method. PRACK RAck Rcseq draft-ietf-sip- 100rel-04.txt - Achieve reliability and in order for provisional responses. COMET draft-ietf-sipmanyfolksresource-02 The COMET method is used for communicating successful completion of preconditions between the user agents. UPDATE, MESSAGE,... 13

Outline Introduction SIP Message Format Message Header Message Body (SDP) SIP Communication SIP Extensions 14

SIP Messaging Syntax Text-based Similar to HTTP 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 The response line indicates the success or failure of a given request. 15

SIP Message Format (1/2) SIP Request Example SIP Response Example INVITE sip:pgn@example.se SIP/2.0 SIP/2.0 200 OK Via: SIP/2.0/UDP science.fiction.com Via: SIP/2.0/UDP science.fiction.com From: Fingal <sip:ffl@fiction.com> To: Patric <sip:pgn@example.se> From: Fingal <sip:ffl@fiction.com> SIP Call-ID: 1234567@science.fiction.com To: Patric <sip:pgn@example.se> Header Cseq: 1 INVITE Call-ID: 1234567@science.fiction.com Subject: lunch at La Empenada? Cseq: 1 INVITE Content-Type: application/sdp (mime) Content-Type: application/sdp Content-Length: Content-Length: v=0 o=ffl 53655765 2353687637 IN IP4 123.4.5.6 s=chorizo Payload: SDP c=in IP4 science.fiction.com (MIME type) m=audio 5004 RTP/AVP 0 3 5 a=rtpmap:0 PCMU/8000 16

SIP Message Format (2/2) Message headers Additional information of the request or response E.g., The originator and recipient Retry-after f 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 17

SIP Request Start-Line t (1/2) Method SP Request-URI SP SIP-version CRLF Methods 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 INVITE, ACK Initiate a session Information of the calling and called parties The type of media ~IAM (initial address message) of ISUP ACK only when receiving the final response 18

SIP Request Start-Line t (2/2) BYE Terminate a session Can be issued by either the calling or called party CANCEL Terminate a pending request E.g., an INVITE did not receive a final response OPTIONS Query a server as to its capabilities A particular type of media Request-URI The address of the destination SIP-Version: SIP/2.0 19

SIP Addressing & Naming The entities addressed by SIP are users at hosts (SIP URLs: Uniform Resource Locators) Augmented t d Backus-Naur k Form described d email-like identifier of the form user@host user: user name or telephones number host: domain name or a numeric network address Examples of SIP URLs user@host sip:collins@home.net sip:3344556789@telco.net sip:patrik@example.com sip:beagleboy@176.7.6.17 6 1 20

SIP Response Status-Line t SIP Version SP Status Code SP Reason-Phrase CRLF Status code (A three-digit number) 1XX Informational 2XX Success (only code 200 is defined) 3XX Redirection ect 4XX Request Failure 5XX Server Failure 6XX Global Failure All responses, except for 1XX, are considered final Should be ACKed Reason-Phrase A textual description of the outcome Could be presented to the user 21

SIP Server properties Property Redirect Proxy User agent registrar server server server Acts as a SIP No Yes No No client Returns 1xx status Yes Yes Yes Yes Returns 2xx status No Yes Yes Yes Returns 3xx status Returns 4xx status Yes Yes Yes Yes Returns 5xx status Returns 6xx status No Yes Yes Yes Inserts Via header No Yes No No Accepts ACK Yes Yes Yes No 22

Definition iti of Terms (1/2) Call Some communication between peers. Identified by a globally unique Call-ID Dialog (call leg) Peer-to-peer SIP relationship between two UAs. Combination with Call-ID, To and From SIP Transaction The first SIP request message to a final response. 1 INVITE request + a non-2xx response + ACK 1 INVITE request + a 2xx response 1 Non-INVITE request + 1 final response 23

Definition iti of Terms (2/2) Provisional response Indicate call progress Status t code = 1xx Final response A response terminates a SIP transaction. Status code = 2xx,3xx,4xx,5xx,6xx Session SDP specification: A multimedia session is a set of multimedia senders and receivers and the data streams flowing from senders to receivers. 24

Message Headers Provide further information about the message Example of headers To: The called party From: The calling party Call-ID Header: uniquely identifies a specific invitation to a session Four main categories General headers Request headers Response headers Entity headers 25

General Headers (1/6) Used in both requests and responses Call-ID Header uniquely identifies a specific invitation to a session Call-ID = ( Call-ID i ) : local-id @ host local-id = 1 *uric host SHOULD be a fully qualified domain name or a globally routable IP address. Call-IDs are case-sensitive All REGISTER requests issued by a single client SHOULD use the same Call-ID, at least within the same boot cycle. 26

General Headers (2/6) To Header To = ( To t ) : (name-addr addr-spec) * ( ; addr-params) To: The Operator <sip:operator@itri.org.tw>;tag=28722 To: sip:+12124441212@server.phone2net.comphone2net Requests and responses MUST contain To field. UAS or redirect server copies the To field to response. Add tag by UAS, registrars and redirect servers. Add a tag if request contained more than one Via. Since handled by at least one proxy server. 27

General Headers (3/6) Contact Header Provides a URL for use in future communication regarding a particular session Examples 1: In a SIP INVITE, the Contact header might be different from the From header. An third-party administrator initiates a multiparty session. Example 2: Used in response, it is useful for directing further requests directly to the called user. Example 3: It is used to indicate a more appropriate address if an INVITE issued to a given URI failed to reach the user. 28

General Headers (4/6) Appear in INVITE, OPTIONS, ACK, and REGISTER Provide a URL for further communications. INVITE and ACK request location the request is originating INVITE 2xx response reachable most directly for future SIP requests INVITE 1xx response same as 2xx response REGISTER request which locations the user is reachable REGISTER 2xx responses return all locations 29

General Headers (5/6) Via Header Prevent request looping. Ensure replies take the same path. Requests: Original request MUST insert Via field(host name, network address, port number). Subsequent proxy: add its own Via field before Proxy send a request to a multicast address add the maddr and ttl Proxy server receive a request containing i it s address. Response with a 482(loop detected) 30

General Headers (6/6) Receiver-tagged Via header Via: SIP/2.0/UDP erlang.bell-telephone.com:5060 Via: SIP/2.0/UDP 10.0.0.1:5060; received=199.172.136.3 Response First Via header indicate the proxy or client processing the response? Yes: remove this Via field No: discard d the message No second Via header Yes: this response is destined for this client No: processing depends on maddr or receiver-tag UAS or redirect server copies the Via into response. 31

Request/Response Header Request Headers Apply only to SIP requests Addition info. about the request or the client Subject: Priority: urgency of the request emergency, urgent, normal, or non-urgent Response Headers Further info about the response that cannot be included in the status line Unsupported Retry-After 32

Entity Headers Indicate the type and format of information included in the message body Content-Length: the length of message body Content-Type: the media type of message body E.g., application/sdp Content-Encoding: for message compression Content Disposition: how a message part should be interpreted session, icon (image), alert (audio), render (text) 33

SIP Request Example SIP Request Message Description INVITE sip:acer12345689@itri.org.tw SIP/2.0 Method type, request URI and SIP version Call-ID:123456789@itri.org.tw Globally unique ID for this call Content-Type:application/sdp The body type, an SDP message CSeq: 1 INVITE Command Sequence number and type From: sip:1732489@itri.org.tw;tag=c8f31453efad User originating the request To:sip:acer12345689@itri.org.tw User being invited into the call Via: SIP/2.0/UDP 140.96.200.1:8080 1 IP Address and port of previous hop Max-Forwards:80 Maximun Routing hubs Content-Type:application/sdp Content Type : using SDP Content-Length:133 Conthent length Blank line separates header from body v=0 SDP Version o=smayer 280932498 0 IN IP4 140.96.200.1 Owner/creator and session identifier s=incoming phone call from acer The name of the session p=+886 3 5914494 Phone number of caller c=in IP4 140.96.102.100 Connection information t=31289123980198230912 Time the session is active m=audio 492837 RTP/AVP 0 Media name and transport address 34

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) 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 RFC 3264 (An Offer/Answer Model with SDP) To describe how SDP and SIP should be used togetherth 35

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. 36

The Structure t of SDP Text-based Protocol The Structure of SDP Session Description Session Level Info Name of the session Originator of the session Time that the session is to be active Media Level Info Media type Port number Transport protocol Media format 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 37

SDP Syntax A number of lines of text In each line field=value field is exactly one character case-significant Session-level fields Media-level fields Begin with media description field (m=) 38

Mandatory Fields v=(protocol version) o=(session origin or creator) s=(session name), a text string For multicast conference t=(time of the session), start time & stop time For pre-arranged multicast conference m=(media) Media type The transport port The transport protocol The media format, an RTP payload format 39

Optional Fields (1/3) 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 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 40

Optional Fields (2/3) e=(e-mail address) Who is responsible for the session Only at the session level p=(phone number) Only at the session level c=(connection information) Network type, address type & connection address At session or media level b=(bandwidth information) In kilobits per second At session or media level 41

Optional Fields (3/3) r=(repeat times) For regularly scheduled session a session is to be repeated How often and how many times 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 a=(attributes) Describe additional attributes 42

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

Subfields (1/3) Field = <subfield1> <subfield2> <subfield3> Origin Username, the originator s login id or - session ID - A unique ID Make use of NTP timestamp version, a number for this particular session network type - A text string IN refers to Internet address type IP4, IP6 address, a fully-qualified domain name or the IP address 44

Subfields (2/3) Connection Data The network and address at which media data will be received Network type, Address type, Connection address Media Information Media type - Audio, video, data, or control Port Format List the types of media format to be supported According to the RTP audio/video profile m= audio 45678 RTP/AVP 15 3 0 G.728, GSM, G.711 45

Subfields (3/3) Attributes t To enable additional information to be included Property attribute a=sendonly a=recvonly value attribute a=orient:landscape used in a shared whiteboard session rtpmap attribute The use of dynamic payload type a=rtpmap:<payload type> <encoding name>/<clock rate> [/<encoding parameters>]. m=video 54678 RTP/AVP 98 a=rtpmap 98 L16/16000/2 16-bit linear encoded stereo (2 channels) audio sampled at 16kHz 46

SDP in SIP Messages INVITE with multiple media streams Unsupported should also be returned with a port number of zero An alternative INVITE m=audio 4444 RTP/AVP 2 4 15 a=rtpmap p 2 G726-32/8000 a=rtpmap 4 G723/8000 a=rtpmap 15 G728/8000 CONNECT m=audio 6666 RTP/AVP 15 a=rtpmap p 15 G728/8000 47

SDP in SIP Flow (1/2) Daniel<sip:Collins@station1.work.com> Boss<sip:Manager@station2.work.com> a 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 b SIP/2.0 200 OK 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 48

SDP in SIP Flow (2/2) Daniel<sip:Collins@station1.work.com> Boss<sip:Manager@station2.work.com> b c d 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 49

SIP&SDP Offer/Answer Model Re-INVITE is issued when the server replies with more than one codec. With the same dialog identifier (To and From headers, including tag values), Call-ID and Request-URI The session version is increased by 1 in o= line of message body. A mismatch 488 or 606 - Not Acceptable A Warning header with warning code 304 (media type not available) or 305 (incompatible media type) Then the caller issues a new INVITE request. 50

Offer/Answer Flow (1/2) Daniel<sip:Collins@station1.work.com> Boss<sip:Manager@station2.work.com> a b 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 51

Offer/Answer Flow (2/2) 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 52

Outline Introduction SIP Message Format SIP Communication SIP Message Flows SIP Entities Behavior SIP Extensions 53

Examples of Registration ti Registration Via: From: and To: Call-ID: host-specific Contact: (for future SIP message transmission) * Content-Length: Zero, no msg body CSeq: A response to any request must use the same value of CSeq as used in the request. Expires: TTL 0, unreg Collins@station1.work.com a b 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 Registrar 54

Client New Registration ti (1/2) client@user.com John Register F1 401 Unauthorized F2 SIP Server user.com REGISTER sip:register.com SIP/2.0 Via: SIP/2.0/UDP user.com:5060 From: John <sip:client@ register.com> To: John <sip:client@ register.com> Call-ID: 123456789@user.com CSeq: 1 REGISTER Contact: John <sip:client@user.com> F1 register.com SIP/2.0 401 Unauthorized Via: SIP/2.0/UDP user.com:5060 From: John <sip:client@ register.com> To: John <sip:client@ register.com> Call-ID: 123456789@user.com CSeq: 1 REGISTER Contact: <sip:+886-3-1234567@user.com;user=phone> WWW-Authenticate: Digest realm="mci WorldCom SIP", Contact: tel:+886-3-1234567 domain="wcom.com", Content-Length: 0 nonce="ea9c8e88df84f1cec4341ae6cbe5a359", opaque="", stale=false, algorithm=md5 Content-Length: 0 55 F2

Client New Registration ti (2/2) client@user.com Register F1 SIP Server John 401 Unauthorized F2 REGISTER F3 200 OK F4 user.com REGISTER sip:register.com SIP/2.0 register.com Via: SIP/2.0/UDP user.com:5060 F3 From: John <sip:client@ register.com > To: John <sip:client@ register.com > SIP/2.0 200 OK Call-ID: 123456789@user.com Via: SIP/2.0/UDP user.com:5060 F4 CSeq: 2 REGISTER From: John <sip:client@ register.com> Contact: John <sip:client@user.com> To: John <sip:client@ register.com> Contact: <sip:+886-3-1234567@user.com;user=phone> Call-ID: 123456789@user.com Contact: tel:+886-3-1234567 CSeq: 2 REGISTER Authorization:Digest username= John", realm="mci Contact: WorldCom John <sip:client@user.com> SIP", nonce="ea9c8e88df84f1cec4341ae6cbe5a359", Contact: opaque="", <sip:+886-3-1234567@user.com;user=phone> uri="sip:ss2.wcom.com", Contact: tel:+886-3-1234567 response="dfe56131d1958046689cd83306477ecc" Content-Length:0 t e Content-Length: 0 56

Updated d Registration ti (1/2) watson@saturn.bell-tel.com Register F1 (2hours) 200 OK REGISTER F2 (clear all) 200 OK SIP Server saturn.bell-tel.com tel bell-tel.com REGISTER sip:bell-tel.com SIP/2.0 Via: SIP/2.0/UDP saturn.bell-tel.com From: sip:watson@bell-tel.com To: sip:watson@bell-tel.com Call-ID: 70710@saturn.bell-tel.com CSeq: 1 REGISTER Contact: <sip:watson@saturn.belltel.com:3890;transport=udp> Expires: 7200 F1 REGISTER sip:bell-tel.com SIP/2.0 Via: SIP/2.0/UDP saturn.bell-tel.com From: sip:watson@bell-tel.com To: sip:watson@bell-tel.com Call-ID: 70710@saturn.bell-tel.com CSeq: 2 REGISTER Contact: * Expires: 0 F2 57

Updated d Registration ti (2/2) watson@saturn.bell-tel.com Register F1 (2hours) 200 OK REGISTER F2 (clear all) 200 OK Updated REGISTER F3 (register again,moved) 200 OK saturn.bell-tel.com tel.com sweet@pluto.bell-tel.com SIP Server bell-tel.com tawatson@example.comt REGISTER sip:bell-tel.com SIP/2.0 Via: SIP/2.0/UDP saturn.bell-tel.com tel F3 From: sip:watson@bell-tel.com To: sip:watson@bell-tel.com Call-ID: 70710@saturn.bell-tel.com CSeq: 3 REGISTER Contact: sip:tawatson@example.com pluto.bell-tel.com 58 REGISTER sip:bell-tel.com SIP/2.0 Via: SIP/2.0/UDP pluto.bell-tel.com From: sip:sweet@bell-tel.com To: sip:watson@bell-tel.com Call-ID: 17320@pluto.bell-tel.com CSeq: 1 REGISTER Contact: sip:tawatson@example2.com p F4

UA behavior (1/3) Caller issues initial INVITE Request Request-URI: address of the callee To: address of the callee From: address of caller contact: UAC MAY optionally add Callee Issues Response Callee can accept, redirect or reject Copy To, From, Call-ID, CSeq and Via from request If more than one Via header in request add the tag to the To field. 59

UA behavior (2/3) Caller receives Response to initial i i request ACK(acknowledge) or BYE(terminate) To and From field: copy all from 200 response Request-URI: copy Contact header from 200 response if no contact header: copy from To header Caller or Callee generate subsequence To: set the remote address From: set the local address Contact: MAY be different than the previous command Request-URI: set Contact header received previously 60

UA behavior (3/3) Receiving subsequent requests Call-ID is new, the request is for a new call. Call-ID exist: To, From, Call-ID and CSeq exactly match retransmission Request CSeq didn t match new transaction for an exiting call leg 61

Invitation ti A two-party call Subject: optional Content-Type: application/sdp A dialog ID To identify a peer-to-peer relationship between two user agents Tag in From Tag in To Call-ID CSeq: # unchanged in the same transaction ACK: no response for it 62

Termination of a Call Cseq: # Has changed Daniel<sip:Collins@work.com> Boss<sip:Manager@station2.work.com> ti a b 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>; ti tag=11222 Call-ID: 123456@station1.work.com CSeq: 2 BYE 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 Call-ID: 123456@station1.work.com CSeq: 2 BYE Content-Length: 0 63

CSeq Header (1/2) A general-header field to each request. CSeq = CSeq : 1*DIGIT SP Method 1*DIGIT : 32-bit unsigned integer Consecutive requests: same Call-ID, diff. Header.. Monotonically increasing and contiguous sequence number Retransmissions of the same request carry the same sequence number, but an INVITE with a different message body or different header fields (a re-invitation ) acquires a new, higher sequence number. 64

CSeq Header (2/2) A server MUST echo the CSeq value from request. If server missing the CSeq header field, then server fills it in appropriately. ACK and CANCEL contain the same CSeq value as the INVITE request. BYE request with higher CSeq value. User agent server Remember the highest CSeq with the same Call-ID. Discard a lower CSeq value. Parallel search: same CSeq value 65

UA to UA Call Flow (1/3) John job@today.com INVITE F1 100 Trying F2 180 Ringing F3 Idle@tomorrow.com Mary today.com INVITE sip:idle@tomorrow.com SIP/2.0 Via: SIP/2.0/UDP today.com:5060 From: John <sip:job@today.com> To: Mary <sip:idle@tomorrow.com> Call-ID: 12345601@today.com CSeq: 1 INVITE Contact: John <sip:job@today.com> Content-Type: application/sdp Content-Length: 147 v=0 o=john 2890844526 2890844526 IN IP4 today.com s=session SDP c=in IP4 100.101.102.103 t=0 0 m=audio 49172 RTP/AVP 0 a=rtpmap:0 PCMU/8000 F1 tomorrow.com SIP/2.0 100 Trying Via: SIP/2.0/UDP today.com:5060 From: John <sip:job@today.com> To: Mary <sip:idle@tomorrow.com> Call-ID: 12345601@today.com CSeq: 1 INVITE Content-Length: 0 SIP/2.0 180 Ringing Via: SIP/2.0/UDP today.com:5060 From: John <sip:job@today.com> To: Mary <sip:idle@tomorrow.com> Call-ID: 12345601@today.com CSeq: 1 INVITE Content-Length: 0 F2 F3 66

UA to UA Call Flow (2/3) John job@today.com today.com ACK sip:idle@tomorrow.com SIP/2.0 Via: SIP/2.0/UDP today.com:5060 From: John <sip:job@today.com> To: Mary <sip:idle@tomorrow.com> Call-ID: 12345601@today.com CSeq: 1 ACK Content-Length: 0 F5 INVITE F1 100 Trying F2 180 Ringing F3 200 OK F4 ACK F5 RTP Media SIP/2.0 200 OK Via: SIP/2.0/UDP today.com:5060 From: John <sip:job@today.com> To: Mary <sip:idle@tomorrow.com> Call-ID: 12345601@today.com CSeq: 1 INVITE Contact: Mary <sip:idle@tomorrow.com> Content-Type: application/sdp Content-Length: 147 Idle@tomorrow.com tomorrow.com Mary F4 v=0 o=mary 2890844527 2890844527 IN IP4 tomorrow.com s=session SDP c=in IP4 110.111.112.113 t=0 0 m=audio 3456 RTP/AVP 0 a=rtpmap:0 PCMU/8000 67

UA to UA Call Flow (3/3) job@today.com INVITE F1 100 Trying F2 Idle@tomorrow.com John today.com 180 Ringing F3 200 OK F4 ACK F5 RTP Media BYE F6 tomorrow.com Mary 200 OK F7 SIP/2.0 200 OK Via: SIP/2.0/UDP tomorrow.com:5060 From: Mary <sip:idle@tomorrow.com> To: John <sip:job@today.com> pj Call-ID: 12345601@today.com CSeq: 1 BYE Content-Length: 0 F7 BYE sip:job@today.com SIP/2.0 Via: SIP/2.0/UDP tomorrow.com:5060 From: Mary <sip:idle@tomorrow.com> To: John <sip:job@today.com> Call-ID: 12345601@today.com CSeq: 1 BYE Content-Length: 0 F6 68

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 t Boss can handle Supported Header Indicate the SIP extensions that can be supported 69

OPTION Flow Daniel<sip:Collins@station1.work.com> i lli ti Boss<sip:Manager@station2.work.com> ti a 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 b 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 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 70

The Supported Header The Require Header In request A A client indicates that t a server must support certain extension. In response 421, extension required The Supported header RFC 2543 Require: header (client -> server) 420 (bad extension) server -> client Can be included in both requests and responses 71

Require Header Client uses it to tell Server about options. If Server not understand the option, MUST return 420(Bad Extension) and list those options in the Unsupported header. Example: C S INVITE sip:watson@bell-telephone.com SIP/2.0 Require: com.example.billing Payment: sheep_skins, conch_shells S C SIP/2.0 420 Bad Extension Unsupported: com.example.billing 72

Redirect Servers An alternative address 302, Moved temporarily Contact header Another INVITE Same Call-ID, Same To CSeq ++ Daniel<sip:Collins@work.com> a b c 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 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 Redirect Server Boss<sip:Manager@pc1.home.net> net> 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) 73

Proxy Servers Numerous proxies can reside in a chain between caller & callee. The last proxy may change the Request-URI. Via: Record the path taken by a request Loop detected, 482 (status code) For a response The 1 st Via: header, Checked, and Removed Branch: used to distinguish between multiple responses to the same request Forking Proxy: Issue a single request to multiple destinations 74

Proxy Call Flow (1/2) 75

Proxy Call Flow (2/2) Boss<sip:Manager@pc1.home.net> sip:server.work.com Daniel<sip:Collins@station1.work.com> e f g SIP/2.0 200 OK Via: SIP/2.0/UDP pc1.home.net; branch=z9hg4bk7890 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@station1.work.com ACK sip:collins@station1.work.com i 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 76

Loop detect t UA1 Proxy1 Request message 482 Loop detect Proxy4 loop detect Proxy2 Proxy3 77

Spiral ua2@proxy1;transport=tcp ua2@prxoy2;transport=tcp ua2@proxy1 ua2@prxoy2 UA2 Proxy1 ua2@proxy4;transport=tcp ua2@useragent2;transport=tcp ua2@proxy4 ua2@prxoy1;transport=tcp Proxy4 Request message UA1 spiral Proxy2 ua2@proxy2 ua2@prxoy3 ua2@proxy2;transport=tcp ua2@prxoy3;transport=tcp Proxy3 ua2@proxy3 ua2@prxoy4 ua2@proxy3;transport=tcp ua2@prxoy4;transport=tcp 78

2 Kinds of Proxy Servers A logic role for SIP environment Stateless Proxy Act as a simple forwarding element. Forward each request downstream to a single element base on the request. Forward every response upstream. Stateful Proxy It is a SIP transaction processing engine. May fork a request and route it to multiple destinations. 79

Stateful t Proxy Behavior For all new request A.Validate the request Reasonable ab e syntax Max-Forwards Loop detection Proxy-Require Proxy-Authorization B.Make a routing decision C.Forward the request to each chosen destination D.Request Processing 1. Make a copy of the received request 2. Update the Request-URI 3. Add a Via header 80 4. Update the Max-Forwards, Route headers 5. Optionally add Recordroute or additional headers 6. Send new request E.Process all responses 1. Find the appropriate p response context 2. Remove the topmost Via 3. Add the response to the response context 4. Check to see if this response should be forward

Proxy Statet Can be either stateless or stateful Record-Route: Two consecutive requests may not pass through the same proxy Use Contact: A Proxy might require that it remains in the signaling path In particular, for a stateful proxy Insert its address into the Record-Route The response includes the Record-Route The info in the Record-Route is used in subsequent requests related to the same call. The Route = the Record-Route Route in reverse order 81

Route Header Determine the request route. Each host removes the first entry Entry: Use it as Request-URI. Proxy the request to the host. 82

Record-Route R Header Each proxy server adds its SIP-URI to the beginning of the list. UAS copies the Record-Route header field unchanged into the response. UAC copies the Record-Route header into a Route header field of subsequent requests within the same call leg, reversing the order. If the request featured a Contact header, appended d to the Route Header list. 83

Forking Proxy fork requests A user is registered at several locations ;branch=xxx In order to handle such forking, a proxy must be stateful. 84

Forking Proxy Flow (1/2) 85

Forking Proxy Flow (2/2) 86

Retransmit Request get request Compare Call-ID not found New Request found Compare To (tag values) not match match Compare From (tag values) not match Compare CSeq more match less or equal Retransmitting Request 87

Response Behavior Before final response one or more provisional responses no final within 200 ms: sent provisional i response 100 response SHOULD NOT be forwarded 32 seconds - maximum retransmission duration After received the first definitive iti non-200 response, in order to handle retransmissions of the response. 88

SIP using TCP A TCP connection servers one or more transactions. ti (1 request + *provisional response + 1*final response) Client keep the connection open until first final response. No keep connection: server treat as a CANCEL. Server should not close connection until sent final response. Server MAY close connection. Normally, it is client s duty to close connection. TCP Must NOT retransmit requests, but uses the same algorithm as for UDP. 89

Reliability (BYE, CANCEL, OPTIONS, REGISTER Requests) TCP: using TCP do not need retransmission. UDP: default: T1=500ms, T2=4 seconds Starting at a T1 interval retransmitting 2*T1 interval retransmitting 4*T1 interval retransmitting T2 interval (when n*t1 > T2) T1 2*T1 4*T1 T2. T2 retransmitting 2*T1 interval 90

Transaction Relationships Request Request Request Response Response Response UAC Outbound Proxy Inbound Proxy UAS Client Tx Server Tx 91

State Transition for INVITE National Chung Cheng University Method (RFC2543) T1 * 2 n INVITE status ACK Initial Calling - INVITE 1xx - Call Proceeding status ACK Completed status ACK 7 INVITE sent CANCEL/BYE failure >=300 INVITE 1xx CANCEL/BYE 487 Initial INVITE 1xx Proceeding event request sent Status change 1xx Callee picks up 2xx 1xx Failure Min(T1*2 n,t2) status Success - INVITE INVITE status 2xx ACK - 92 ACK - Completed

State Transition for BYE,CANCEL/OPTIONS/REGISTER / Methods (client) (RFC2543) Min(T1 * 2 n, T2)or n * T2 REQUEST Initial - REQUEST Calling event request sent status - n * T2 Request 1xx - Call Proceeding Status - 1xx - 11 REQUEST sent Completed status t - 93

State Transition For BYE,CANCEL/OPTIONS/REGISTER / methods (server) (RFC2543) request 1xx Initial request 1xx Proceeding Status t change 1xx Event Message sent failure terminated >=300 487 success 2xx request status Failure Success request 2xx 32s - 10 * T2 Confirmed 32s - Completed 32s - 94

INVITE Client Transaction 300 ~ 699 ACK sent resp. to TU Timer A fires Reset A, INVITE sent 1xx 1xx to TU 300 699 ACK SENT Calling Proceeding Completed INVITE from TU INVITE sent 1xx 1xx to TU 300 699 ACK SENT, resp. To TU Timer D fires - 2xx 2xx to TU 2xx 2xx to TU Transport Err. Inform TU Timer B fires or Transport Err. Inform TU Terminated 95

INVITE Server Transaction INVITE send response Timer G fires send response INVITE send response INVITE pass INV to TU send 100 if TU won t in 200ms 101 ~ 199 from TU send response Transport Err. Proceeding Inform TU 2xx from TU 300 ~ 699 from TU send response send response Completed ACK - Timer H fires or Transport Err. Inform TU Confirmed Terminated Timer I fires - Transport Err. Inform TU 96

Outline Introduction SIP Message Format SIP Communication SIP Extensions 97

SIP Extensions Method Extension Header Original Description INFO RFC 2976 Carry control information of a session REFER Refer-To Referred-By Draft-ietf-sip-cctransfer-05 provide Call Transfer capabilities SUBSCRIBE NOTIFY Event Allow-Event Draft-roach-sip- roach subscribe-notify-03 Asynchronous request notification of events. Notify SIP events which has been requested by an earlier SUBSCRIBE method. PRACK RAck Rcseq draft-ietf-sip- 100rel-04.txt - Achieve reliability and in order for provisional responses. COMET draft-ietf-sipmanyfolksresource-02 The COMET method is used for communicating successful completion of preconditions between the user agents. UPDATE, MESSAGE,... 98

SIP INFO Method Specified in RFC 2976 For transferring information during an ongoing session DTMF digits, account-balance information, mid-call signaling information (from PSTN) 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 99

SIP Event Notification Several SIP-based applications have been devised based on the concept of a user being informed of some event. E.g., Instant messaging RFC 3265 has addressed the issue of event notification. SUBSCRIBE and NOTIFY The Event header Subscriber a SUBSCRIBE b c d 200 OK e f 200 OK 200 OK NOTIFY NOTIFY Notifier Current state information Updated state information 100

SIP Presence (1/3) A asks to be told when B registers Registrar, Presence Server, 101

SIP Presence (2/3) NOTIFY A that B has <Not Signed In> Registrar, Presence Server, 102

SIP Presence (3/3) NOTIFY A that B has <Signed In> Registrar, Presence Server, 103

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

Instant t Messaging (1/2) Boss<sip:Manager@pc1.home.com> sip:server.work.com Daniel<sip:Collins@station1.work.com> a b c d 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? 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 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? 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 105

Instant t Messaging (2/2) 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 I m fine. How are you? I m fine. How are you? g h SIP/2.0 200 OK Via: SIP/2.0/UDP server.work.com; branch=z9hg4bkabcd SIP/2.0 200 OK Via: SIP/2.0/UDP station1.work.com; ti branch=z9hg4bk123 Via: SIP/2.0/UDP station1.work.com; branch=z9hg4bk123 From: Daniel<sip:Collins@work.com> From: Daniel<sip:Collins@work.com> To: Boss<sip:Manager@home.net> To: Boss<sip:Manager@home.net> Call-ID: 456789@station1.work.com Call-ID: 456789@station1.work.com CSeq: 1101 MESSAGE CSeq: 1101 MESSAGE Content-Length: 0 Content-Length: 0 106

Usage of SIP for Features Call-transfer application i (with REFER method) Personal mobility through the use of registration One number service through forking proxy Call-completion services by using Retry-After: header To carry MIME content as well as an SDP description SIP address is a URL Click-to-call applications Existing supplementary services in traditional PSTN Call waiting/ forwarding/ screening, multi-party calling Proxy invokes various types of advanced feature logic. Policy server (call-routing, QoS) Authentication server 107 U th i f IN SCP INAP

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. 108

Call Transfer (1/2) sip:mary@station1.work.com ti sip:joe@station2.work.com ti sip:susan@station3.work.com ti a 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: Sussan<sip:Sussan@station3.work.com> Call-ID: 123456@station1.work.com CSeq: 123 REFER Content-Length: 0 b SIP/2.0 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 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 {message body} 109

Call Transfer (2/2) e f g h sip:mary@station1.work.com sip:joe@station2.work.com sip:susan@station3.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} NOTIFY sip:mary@station1.work.com SIP/2.0 ACK sip:susan@station3.work.com SIP/2.0 Via: SIP/2.0/UDP station2.work.com; branch=z9hg4bk123 Via: SIP/2.0/UDP station2.work.com; branch=z9hg4bkxyz1 Max-Forwards: 70 Max-Forwards: 70 To: Joe<sip:Joe@work.com>; tag=67890 From: Joe<sip:Joe@work.com>; tag=abcxyz From: Mary<sip:Mary@work.com>; tag=123456 To: Susan<sip:Susan@station3.work.com>; tag=123xyz 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 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 110 Call-ID: 67890@station2.work.com CSeq: 567 ACK Content-Length: 0

Multi-registration i t Example One number service 111

Using Retry-After Header 112

Call Forwarding On busy 486, busy here With the same To, User 3 can recognize that this call is a forwarded call, originally sent to User 2. Contact: header in 200 response Call-forwarding-on-noanswer Timeout CANCEL method 113

Consultation ti Hold A SIP UPDATE 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. 114

PSTN Interworking PSTN Interworking A SIP URL to a telephone number A network gateway PSTN SIP PSTN MIME media types For ISUP SIP for Telephony (SIP-T) The whole issue of interworking with SS7 is fundamental to the success of VoIP in the real world. 115

SIP Related Standards d RFC 2543 - SIP, March 1999 RFC3261- SIP Protocol, June 2002 RFC 2616 HTTP/1.1, June 1999 RFC 2617 HTTP Authentication, June 1999 RFC 2327 SDP, April 1998 RFC 2976 SIP INFO Method, Oct. 2000 RFC 2396 SIP URL, Aug. 1998 RFC 3372 (SIP-T), Sep 2002 RFC 3361 DHCP-for-IPv4, Aug 2002 RFC 3351 User Requirements for the Session Initiation Protocol (SIP) in Support of Deaf, Hard of Hearing and Speech-impaired Individuals, June 2002 RFC 3262 Reliability of Provisional Responses in SIP, June 2002 RFC 3263 SIP: Locating SIP Servers, June 2002 RFC 3264 An Offer/Answer Model with SDP, June 2002 RFC 3265 SIP-Specific Event Notification, June 2002 Related Internet drafts (Call Flow, Supplementary service ) RFC 3311 UPDATE Method, Oct 2002 RFC 3312 Integration of Resource Management and SIP, Oct 2002 116

New RFCs Published RFC 3319 - DHCPv6 for SIP automatic outbound proxy configuration RFC 3603 - Proxy-to-proxy extensions for PacketCable RFC 3485/3486 - SIP and SDP compression compress SIP headers and body via dynamic dictionary RFC 3665/3666 - Call flows explain behavior by example useful for testing common cases not a spec replacement 117

Any yq Question? Mobile All-IP Networking Laboratory Department of Computer Science & Information Engineering