SIP:Session Initiation Protocol Che-Yu Kuo Computer & Information Science Department University of Delaware May 11, 2010 CISC 856: TCP/IP and Upper Layer Protocols
What is SIP? Proposed Standard described in IETF RFC 2543 Application-layer control protocol A signaling protocol for initiating, managing and terminating voice and audio session across packet networks with one or more participants. Text-based protocol with highly extensible
SIP Functionality User location User availability User Capabilities Session setup Session Management
SIP basic services Call forwarding Call diversion Personal mobility Calling and called party authentication Terminal capabilities negotiation Multicast conferencing
SIP operation USER AGENT 1 USER AGENT2 1.invitation2.invitation 3. OK4. OK 5.Acknowledge6.Acknowledge 7. Audio/Video data From: Thomas Doumas Next Generation Telephony: A Look at Session Initiation Protocol White Paper
SIP entities User Agent (UA) User agent client (UAC) User agent server (UAS) Proxy server Stateless proxy server Stateful proxy server Redirect server Registrar
SIP Protocol Structure From: Client Sending Request Receiving Response Server Receiving Request Sending Response Framing Error Handling Client INVITE Transaction ACK Non INVITE Transaction Matching Requests to Client Transactions Server INVITE Transaction Non INVITE Transaction Matching Requests to Server Transactions Error Handling
SIP Protocols SIP provides basic elements of telephony SIP: Call setup and termination SDP: Describe call configuation RTP: data transfer RTCP: data stream management
SIP Protocol stack TCP From: Thomas Doumas Next Generation Telephony: A Look at Session Initiation Protocol White Paper UDP SDPSIPRTPRTCP IP Link and Physical Layers
SIP on TCP / UDP SIP can run over any datagram or stream protocol. Why UDP is default protocol?? Performance Scalability
SIP addressing SIP clients are identified by a SIP URL which follows the host” form. User: user name / telephone number Host: domain name / host name/ numeric network address Examples:
SIP Messages SIP Requests Sent from the client to the server SIP Responses Sent from the server to the client Message parts Start line Headers Body(content)
SIP request methods MethodDescription INVITE Initiates a call, changes call parameters ACK Confirms a final response for INVITE BYE Terminates a call CANCEL Cancel searches and “ringing” OPTIONS Queries the capabilities of the other side REGISTER Registers with the Location Service INFO Sends mid-session information that does not modify the session state.
Invite message ParameterDescription Call-ID Uniquely identifies a particular session Cseq A monotonically increasing sequence number used to indetify the sequence of requests associated with a given Call-ID From A SIP URL that identifies the initiator of the request. May include a “friendly name” (e.q. John) To A SIP URL that identifies the recipient of the request. May include a “friendly name” Via Indicates the path taken by the request.
SIP response types Provisional 1xx = provisional, searching, ringing, queuing etc. Final 2xx = success 3xx = redirection, forwarding 4xx = request failure(client mistakes) 5xx = server failure 6xx = global failure (busy, refusal, not available anywhere)
SIP response examples 100 trying 180 ringing 200 OK 300 Multiple choices 301 Moved permanently 302 Moved temporarily 400 Bad request 401 Unauthorized 403 forbidden 408 Request time-out 480 Unavailable 481 Call-leg/Transaction does not exist 482 Loop detected 5xx Server error 600 Busy 603 decline 604 Does not exist 606 Not acceptable
SDP: session description protocol Used to described the attributes of SIP sessions SDP parameters are encapsulated as the message body of a SIP request Encoded with ASCII text Simple form =
Information in SDP Session Information Session name and purpose Time(s) the session is active Information about the bandwidth Contact information for the person responsible for this session Media Information Type of media(audio/video) Type of Transport protocol(UDP/TCP/RTP) Media Format(H.261/Mpeg) Multicast address and Transport Port for media Remote address for media and Transport Port for contact address
Request Message example INVITE SIP/2.0 Via: SIP/2.0/UDP alice_ws.radvision.com From: Alice A. To: Bob B. Call-ID: CSeq: 1 INVITE Subject: Lunch today. Content-Type: application/SDP Content-Length: 182 {BODY} v=0 o=Alice IN IP s=Call from Alice. c=IN IP4 alice_ws.radvision.com M=audio 3456 RTP/AVP
Response Message example SIP/ OK Via: SIP/2.0/UDP alice_ws.radvision.com From: Alice A. To: Bob B. ;tag= Call-ID: CSeq: 1 INVITE Content-Type: application/SDP Content-Length: 200 {BODY} v=0 o=Bob IN IP s=Lunch c=IN IP4 machine1.acme.com m=audio 5004 RTP/AVP 0 3
Session establishment and termination UACUAS 1: INVITE Trying Ringing Queued, 2callers ahead Queued, 1callers ahead OK 7.ACK 1: BYE OK
Registration Bob’s softphone Biloxi.com registrar Register 200 OK REGISTER sip:registrar.biloxi.com SIP/2.0 Via: SIP/2.0/UDP bobspc.biloxi.com:5060;branch=z9hG4bKnashds7 Max-Forwards: 70 To: Bob From: Bob ;tag= Call-ID: CSeq: 1826 REGISTER Contact: Expires: 7200 Content-Length: 0 SIP/ OK Via: SIP/2.0/UDP bobspc.biloxi.com:5060;branch=z9hG4bKnashds7 ;received= To: Bob ;tag=2493k59kd From: Bob ;tag= Call-ID: CSeq: 1826 REGISTER Contact: Expires: 7200 Content-Length: 0
Call Redirection UAC Redirect server sip.acme.com Location Service UAS gw.telco.com 1. INVITE acme.com gw.telco.com Moved temporarily 5.ACK 6. INVITE OK 8.ACK
Call Proxy Bob’s softphone Biloxi.com Proxy Atlanta.com Proxy Alice’s softphone 1.INVITE 3..INVITE 5..INVITE Trying Trying Ringing 1. INVITE Alice -> atlanta.com proxy INVITE SIP/2.0 Via: SIP/2.0/UDP pc33.atlanta.com;branch=z9hG4bKnashds8 Max-Forwards: 70 To: Bob From: Alice ;tag= Call-ID: a84b4c76e66710 CSeq: INVITE Contact: Content-Type: application/sdp Content-Length: Trying atlanta.com proxy -> Alice SIP/ Trying Via: SIP/2.0/UDP pc33.atlanta.com;branch=z9hG4bKnashds8 ;received= To: Bob From: Alice ;tag= Call-ID: a84b4c76e66710 CSeq: INVITE Content-Length: 0 3 INVITE atlanta.com proxy -> biloxi.com proxy INVITE SIP/2.0 Via: SIP/2.0/UDP bigbox3.site3.atlanta.com;branch=z9hG4bK77ef4c Via: SIP/2.0/UDP pc33.atlanta.com;branch=z9hG4bKnashds8 ;received= Max-Forwards: 69 To: Bob From: Alice ;tag= Call-ID: a84b4c76e66710 CSeq: INVITE Contact: Content-Type: application/sdp Content-Length: 142 F4 100 Trying biloxi.com proxy -> atlanta.com proxy SIP/ Trying Via: SIP/2.0/UDP bigbox3.site3.atlanta.com;branch=z9hG4bK77ef4c ;received= Via: SIP/2.0/UDP pc33.atlanta.com;branch=z9hG4bKnashds8 ;received= To: Bob From: Alice ;tag= Call-ID: a84b4c76e66710 CSeq: INVITE Content-Length: 0 5.INVITE biloxi.com proxy -> Bob INVITE SIP/2.0 Via: SIP/2.0/UDP server10.biloxi.com;branch=z9hG4bK4b43c2ff8.1 Via: SIP/2.0/UDP bigbox3.site3.atlanta.com;branch=z9hG4bK77ef4c ;received= Via: SIP/2.0/UDP pc33.atlanta.com;branch=z9hG4bKnashds8 ;received= Max-Forwards: 68 To: Bob From: Alice ;tag= Call-ID: a84b4c76e66710 CSeq: INVITE Contact: Content-Type: application/sdp Content-Length: Ringing Bob -> biloxi.com proxy SIP/ Ringing Via: SIP/2.0/UDP server10.biloxi.com;branch=z9hG4bK4b43c2ff8.1 ;received= Via: SIP/2.0/UDP bigbox3.site3.atlanta.com;branch=z9hG4bK77ef4c ;received= Via: SIP/2.0/UDP pc33.atlanta.com;branch=z9hG4bKnashds8 ;received= To: Bob ;tag=a6c85cf From: Alice ;tag= Call-ID: a84b4c76e66710 Contact: CSeq: INVITE Content-Length: 0
Call Proxy Bob’s softphone Biloxi.com Proxy Atlanta.com Proxy Alice’s softphone 1.INVITE 3..INVITE 5..INVITE Trying Trying Ringing Ringing Ringing OK OK OK 12. ACK Ringing biloxi.com proxy -> atlanta.com proxy SIP/ Ringing Via: SIP/2.0/UDP bigbox3.site3.atlanta.com;branch=z9hG4bK77ef4c ;received= Via: SIP/2.0/UDP pc33.atlanta.com;branch=z9hG4bKnashds8 ;received= To: Bob ;tag=a6c85cf From: Alice ;tag= Call-ID: a84b4c76e66710 Contact: CSeq: INVITE Content-Length: Ringing atlanta.com proxy -> Alice SIP/ Ringing Via: SIP/2.0/UDP pc33.atlanta.com;branch=z9hG4bKnashds8 ;received= To: Bob ;tag=a6c85cf From: Alice ;tag= Call-ID: a84b4c76e66710 Contact: CSeq: INVITE Content-Length: OK Bob -> biloxi.com proxy SIP/ OK Via: SIP/2.0/UDP server10.biloxi.com;branch=z9hG4bK4b43c2ff8.1 ;received= Via: SIP/2.0/UDP bigbox3.site3.atlanta.com;branch=z9hG4bK77ef4c ;received= Via: SIP/2.0/UDP pc33.atlanta.com;branch=z9hG4bKnashds8 ;received= To: Bob ;tag=a6c85cf From: Alice ;tag= Call-ID: a84b4c76e66710 CSeq: INVITE Contact: Content-Type: application/sdp Content-Length: OK biloxi.com proxy -> atlanta.com proxy SIP/ OK Via: SIP/2.0/UDP bigbox3.site3.atlanta.com;branch=z9hG4bK77ef4c ;received= Via: SIP/2.0/UDP pc33.atlanta.com;branch=z9hG4bKnashds8 ;received= To: Bob ;tag=a6c85cf From: Alice ;tag= Call-ID: a84b4c76e66710 CSeq: INVITE Contact: Content-Type: application/sdp Content-Length: OK atlanta.com proxy -> Alice SIP/ OK Via: SIP/2.0/UDP pc33.atlanta.com;branch=z9hG4bKnashds8 ;received= To: Bob ;tag=a6c85cf From: Alice ;tag= Call-ID: a84b4c76e66710 CSeq: INVITE Contact: Content-Type: application/sdp Content-Length: ACK Alice -> Bob ACK SIP/2.0 Via: SIP/2.0/UDP pc33.atlanta.com;branch=z9hG4bKnashds9 Max-Forwards: 70 To: Bob ;tag=a6c85cf From: Alice ;tag= Call-ID: a84b4c76e66710 CSeq: ACK Content-Length: 0
Call Proxy Bob’s softphone Biloxi.com Proxy Atlanta.com Proxy Alice’s softphone 1.INVITE 3..INVITE 5..INVITE Trying Trying Ringing Ringing Ringing OK OK OK 12. ACK Media Session 13.BYE OK 13 BYE Bob -> Alice BYE SIP/2.0 Via: SIP/2.0/UDP ;branch=z9hG4bKnashds10 Max-Forwards: 70 From: Bob ;tag=a6c85cf To: Alice ;tag= Call-ID: a84b4c76e66710 CSeq: 231 BYE Content-Length: OK Alice -> Bob SIP/ OK Via: SIP/2.0/UDP ;branch=z9hG4bKnashds10 From: Bob ;tag=a6c85cf To: Alice ;tag= Call-ID: a84b4c76e66710 CSeq: 231 BYE Content-Length: 0
SIP Protocol Structure From:
SIP Protocol Structure Bob’s softphone Biloxi.com Proxy Atlanta.com Proxy Alice’s softphone 1.INVITE 3..INVITE 5..INVITE Trying Trying Ringing Ringing Ringing OK OK OK
SIP Protocol Structure Bob’s softphone Biloxi.com Proxy Atlanta.com Proxy Alice’s softphone Client Transaction UAC core Client Transport Server Transaction Proxy core Server Transport Client Transaction Client Transport Server Transaction Proxy core Server Transport Client Transaction Client Transport Server Transaction UAS core Server Transport trying sendReceive Response 100 trying 1.Invite request request sendReceive Request Invite request Open session
SIP Protocol Structure Bob’s softphone Biloxi.com Proxy Atlanta.com Proxy Alice’s softphone Client Transaction UAC core Client Transport Server Transaction Proxy core Server Transport Client Transaction Client Transport Server Transaction Proxy core Server Transport Client Transaction Client Transport Server Transaction UAS core Server Transport 3.Invite request request sendReceive Request Invite request trying sendReceive Response 100 trying
SIP Protocol Structure Bob’s softphone Biloxi.com Proxy Atlanta.com Proxy Alice’s softphone Client Transaction UAC core Client Transport Server Transaction Proxy core Server Transport Client Transaction Client Transport Server Transaction Proxy core Server Transport Client Transaction Client Transport Server Transaction UAS core Server Transport 5.Invite request request sendReceive Request Invite request Response sendReceive Response 180 ringing ringing Response sendReceive Response 180 ringing ringing Response sendReceive Response 180 ringing ringing
SIP Protocol Structure Bob’s softphone Biloxi.com Proxy Atlanta.com Proxy Alice’s softphone Client Transaction UAC core Client Transport Server Transaction Proxy core Server Transport Client Transaction Client Transport Server Transaction Proxy core Server Transport Client Transaction Client Transport Server Transaction UAS core Server Transport Response sendReceive Response 200 OK OK Response sendReceive Response 200 OK OK Response sendReceive Response 200 OK OK
References T. Doumas, Next Generation Telephony: A Look at Session Initiation Protocol White Paper Radvision SIP Overview P. Stalvig, Session Initiated Protocol(SIP): A Five-Function Protocol, 2008/07
Questions Thanks!