390 likes | 762 Views
CISC 856: TCP/IP and Upper Layer Protocols. SIP:Session Initiation Protocol. Che-Yu Kuo Computer & Information Science Department University of Delaware May 11, 2010. What is SIP?. Proposed Standard described in IETF RFC 2543 Application-layer control protocol
E N D
CISC 856: TCP/IP and Upper Layer Protocols SIP:Session Initiation Protocol Che-Yu Kuo Computer & Information Science Department University of Delaware May 11, 2010
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
1.invitation 5.Acknowledge 6.Acknowledge 2.invitation 4. OK 3. OK 7. Audio/Video data 7. Audio/Video data SIP operation USER AGENT 1 USER AGENT2 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
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 • Client • Sending Request • Receiving Response • Server • Receiving Request • Sending Response • Framing • Error Handling SIP Protocol Structure From: http://docs.sun.com/app/docs/doc/821-0203/6nl988v7d
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 SDP SIP RTP RTCP TCP UDP IP Link and Physical Layers From: Thomas Doumas Next Generation Telephony: A Look at Session Initiation Protocol White Paper
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 “user @ host” form. • User: user name / telephone number • Host: domain name / host name/ numeric network address • Examples: • sip:graceland@ixlmemphis.com • sip:+1-800-555-1212@information.att.net
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 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)
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 SIP response examples
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 <type>=<value>
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:bob@acme.com SIP/2.0 Via: SIP/2.0/UDP alice_ws.radvision.com From: Alice A. <sip:alice@radvision.com> To: Bob B. <sip:bob@acme.com> Call-ID: 2388990012@alice_ws.radvision.com CSeq: 1 INVITE Subject: Lunch today. Content-Type: application/SDP Content-Length: 182 {BODY} v=0 o=Alice 53655765 2353687637 IN IP4 128.3.4.5 s=Call from Alice. c=IN IP4 alice_ws.radvision.com M=audio 3456 RTP/AVP 0 3 4 5
Response Message example SIP/2.0 200 OK Via: SIP/2.0/UDP alice_ws.radvision.com From: Alice A. <sip:alice@radvision.com> To: Bob B. <sip:bob@acme.com>;tag=17462311 Call-ID: 2388990012@alice_ws.radvision.com CSeq: 1 INVITE Content-Type: application/SDP Content-Length: 200 {BODY} v=0 o=Bob 4858949 4858949 IN IP4 192.1.2.3 s=Lunch c=IN IP4 machine1.acme.com m=audio 5004 RTP/AVP 0 3
1: INVITE bob@lab.acme.com 2. 100 Trying 3. 180 Ringing 4. 182 Queued, 2callers ahead 5. 182 Queued, 1callers ahead 6. 200 OK 7.ACK 1: BYE bob@lab.acme.com 2. 200 OK Session establishment and termination UAC UAS
Register 200 OK Registration Bob’s softphone Biloxi.com registrar REGISTER sip:registrar.biloxi.com SIP/2.0 Via: SIP/2.0/UDP bobspc.biloxi.com:5060;branch=z9hG4bKnashds7 Max-Forwards: 70 To: Bob <sip:bob@biloxi.com> From: Bob <sip:bob@biloxi.com>;tag=456248 Call-ID: 843817637684230@998sdasdh09 CSeq: 1826 REGISTER Contact: <sip:bob@192.0.2.4> Expires: 7200 Content-Length: 0 SIP/2.0 200 OK Via: SIP/2.0/UDP bobspc.biloxi.com:5060;branch=z9hG4bKnashds7 ;received=192.0.2.4 To: Bob <sip:bob@biloxi.com>;tag=2493k59kd From: Bob <sip:bob@biloxi.com>;tag=456248 Call-ID: 843817637684230@998sdasdh09 CSeq: 1826 REGISTER Contact: <sip:bob@192.0.2.4> Expires: 7200 Content-Length: 0
Location Service UAC 1. INVITE bob@ acme.com 2. bob@acme.com? 3. 35733572@ gw.telco.com 4. 302 Moved temporarily35733572@gw.telco.com 5.ACK 6. INVITE 35733572@gw.telco.com 7. 200 OK 8.ACK Call Redirection Redirect server sip.acme.com UAS gw.telco.com
1.INVITE 3..INVITE 2.100 Trying 5..INVITE 4.100 Trying 6.180 Ringing Call Proxy Bob’s softphone Atlanta.com Proxy Alice’s softphone Biloxi.com Proxy 1. INVITE Alice -> atlanta.com proxy INVITE sip:bob@biloxi.com SIP/2.0 Via: SIP/2.0/UDP pc33.atlanta.com;branch=z9hG4bKnashds8 Max-Forwards: 70 To: Bob <sip:bob@biloxi.com> From: Alice <sip:alice@atlanta.com>;tag=1928301774 Call-ID: a84b4c76e66710 CSeq: 314159 INVITE Contact: <sip:alice@pc33.atlanta.com> Content-Type: application/sdp Content-Length: 142 2. 100 Trying atlanta.com proxy -> Alice SIP/2.0 100 Trying Via: SIP/2.0/UDP pc33.atlanta.com;branch=z9hG4bKnashds8 ;received=192.0.2.1 To: Bob <sip:bob@biloxi.com> From: Alice <sip:alice@atlanta.com>;tag=1928301774 Call-ID: a84b4c76e66710 CSeq: 314159 INVITE Content-Length: 0 3 INVITE atlanta.com proxy -> biloxi.com proxy INVITE sip:bob@biloxi.com SIP/2.0 Via: SIP/2.0/UDP bigbox3.site3.atlanta.com;branch=z9hG4bK77ef4c2312983.1 Via: SIP/2.0/UDP pc33.atlanta.com;branch=z9hG4bKnashds8 ;received=192.0.2.1 Max-Forwards: 69 To: Bob <sip:bob@biloxi.com> From: Alice <sip:alice@atlanta.com>;tag=1928301774 Call-ID: a84b4c76e66710 CSeq: 314159 INVITE Contact: <sip:alice@pc33.atlanta.com> Content-Type: application/sdp Content-Length: 142 F4 100 Trying biloxi.com proxy -> atlanta.com proxy SIP/2.0 100 Trying Via: SIP/2.0/UDP bigbox3.site3.atlanta.com;branch=z9hG4bK77ef4c2312983.1 ;received=192.0.2.2 Via: SIP/2.0/UDP pc33.atlanta.com;branch=z9hG4bKnashds8 ;received=192.0.2.1 To: Bob <sip:bob@biloxi.com> From: Alice <sip:alice@atlanta.com>;tag=1928301774 Call-ID: a84b4c76e66710 CSeq: 314159 INVITE Content-Length: 0 5.INVITE biloxi.com proxy -> Bob INVITE sip:bob@192.0.2.4 SIP/2.0 Via: SIP/2.0/UDP server10.biloxi.com;branch=z9hG4bK4b43c2ff8.1 Via: SIP/2.0/UDP bigbox3.site3.atlanta.com;branch=z9hG4bK77ef4c2312983.1 ;received=192.0.2.2 Via: SIP/2.0/UDP pc33.atlanta.com;branch=z9hG4bKnashds8 ;received=192.0.2.1 Max-Forwards: 68 To: Bob <sip:bob@biloxi.com> From: Alice <sip:alice@atlanta.com>;tag=1928301774 Call-ID: a84b4c76e66710 CSeq: 314159 INVITE Contact: <sip:alice@pc33.atlanta.com> Content-Type: application/sdp Content-Length: 142 6.180 Ringing Bob -> biloxi.com proxy SIP/2.0 180 Ringing Via: SIP/2.0/UDP server10.biloxi.com;branch=z9hG4bK4b43c2ff8.1 ;received=192.0.2.3 Via: SIP/2.0/UDP bigbox3.site3.atlanta.com;branch=z9hG4bK77ef4c2312983.1 ;received=192.0.2.2 Via: SIP/2.0/UDP pc33.atlanta.com;branch=z9hG4bKnashds8 ;received=192.0.2.1 To: Bob <sip:bob@biloxi.com>;tag=a6c85cf From: Alice <sip:alice@atlanta.com>;tag=1928301774 Call-ID: a84b4c76e66710 Contact: <sip:bob@192.0.2.4> CSeq: 314159 INVITE Content-Length: 0
1.INVITE 3..INVITE 2.100 Trying 5..INVITE 4.100 Trying 6.180 Ringing 7.180 Ringing 9. 200 OK 8.180 Ringing 10. 200 OK 11. 200 OK 12. ACK Call Proxy Bob’s softphone Atlanta.com Proxy Alice’s softphone Biloxi.com Proxy 7.180 Ringing biloxi.com proxy -> atlanta.com proxy SIP/2.0 180 Ringing Via: SIP/2.0/UDP bigbox3.site3.atlanta.com;branch=z9hG4bK77ef4c2312983.1 ;received=192.0.2.2 Via: SIP/2.0/UDP pc33.atlanta.com;branch=z9hG4bKnashds8 ;received=192.0.2.1 To: Bob <sip:bob@biloxi.com>;tag=a6c85cf From: Alice <sip:alice@atlanta.com>;tag=1928301774 Call-ID: a84b4c76e66710 Contact: <sip:bob@192.0.2.4> CSeq: 314159 INVITE Content-Length: 0 8 180 Ringing atlanta.com proxy -> Alice SIP/2.0 180 Ringing Via: SIP/2.0/UDP pc33.atlanta.com;branch=z9hG4bKnashds8 ;received=192.0.2.1 To: Bob <sip:bob@biloxi.com>;tag=a6c85cf From: Alice <sip:alice@atlanta.com>;tag=1928301774 Call-ID: a84b4c76e66710 Contact: <sip:bob@192.0.2.4> CSeq: 314159 INVITE Content-Length: 0 9 200 OK Bob -> biloxi.com proxy SIP/2.0 200 OK Via: SIP/2.0/UDP server10.biloxi.com;branch=z9hG4bK4b43c2ff8.1 ;received=192.0.2.3 Via: SIP/2.0/UDP bigbox3.site3.atlanta.com;branch=z9hG4bK77ef4c2312983.1 ;received=192.0.2.2 Via: SIP/2.0/UDP pc33.atlanta.com;branch=z9hG4bKnashds8 ;received=192.0.2.1 To: Bob <sip:bob@biloxi.com>;tag=a6c85cf From: Alice <sip:alice@atlanta.com>;tag=1928301774 Call-ID: a84b4c76e66710 CSeq: 314159 INVITE Contact: <sip:bob@192.0.2.4> Content-Type: application/sdp Content-Length: 131 10. 200 OK biloxi.com proxy -> atlanta.com proxy SIP/2.0 200 OK Via: SIP/2.0/UDP bigbox3.site3.atlanta.com;branch=z9hG4bK77ef4c2312983.1 ;received=192.0.2.2 Via: SIP/2.0/UDP pc33.atlanta.com;branch=z9hG4bKnashds8 ;received=192.0.2.1 To: Bob <sip:bob@biloxi.com>;tag=a6c85cf From: Alice <sip:alice@atlanta.com>;tag=1928301774 Call-ID: a84b4c76e66710 CSeq: 314159 INVITE Contact: <sip:bob@192.0.2.4> Content-Type: application/sdp Content-Length: 131 11 200 OK atlanta.com proxy -> Alice SIP/2.0 200 OK Via: SIP/2.0/UDP pc33.atlanta.com;branch=z9hG4bKnashds8 ;received=192.0.2.1 To: Bob <sip:bob@biloxi.com>;tag=a6c85cf From: Alice <sip:alice@atlanta.com>;tag=1928301774 Call-ID: a84b4c76e66710 CSeq: 314159 INVITE Contact: <sip:bob@192.0.2.4> Content-Type: application/sdp Content-Length: 131 12 ACK Alice -> Bob ACK sip:bob@192.0.2.4 SIP/2.0 Via: SIP/2.0/UDP pc33.atlanta.com;branch=z9hG4bKnashds9 Max-Forwards: 70 To: Bob <sip:bob@biloxi.com>;tag=a6c85cf From: Alice <sip:alice@atlanta.com>;tag=1928301774 Call-ID: a84b4c76e66710 CSeq: 314159 ACK Content-Length: 0
1.INVITE 3..INVITE 2.100 Trying 5..INVITE 4.100 Trying 6.180 Ringing 7.180 Ringing 9. 200 OK 8.180 Ringing 10. 200 OK 11. 200 OK 12. ACK 13.BYE 14. 200 OK Call Proxy Bob’s softphone Atlanta.com Proxy Alice’s softphone Biloxi.com Proxy 13 BYE Bob -> Alice BYE sip:alice@pc33.atlanta.com SIP/2.0 Via: SIP/2.0/UDP 192.0.2.4;branch=z9hG4bKnashds10 Max-Forwards: 70 From: Bob <sip:bob@biloxi.com>;tag=a6c85cf To: Alice <sip:alice@atlanta.com>;tag=1928301774 Call-ID: a84b4c76e66710 CSeq: 231 BYE Content-Length: 0 14 200 OK Alice -> Bob SIP/2.0 200 OK Via: SIP/2.0/UDP 192.0.2.4;branch=z9hG4bKnashds10 From: Bob <sip:bob@biloxi.com>;tag=a6c85cf To: Alice <sip:alice@atlanta.com>;tag=1928301774 Call-ID: a84b4c76e66710 CSeq: 231 BYE Content-Length: 0 Media Session
SIP Protocol Structure From: http://docs.sun.com/app/docs/doc/821-0203/6nl988v7d
1.INVITE 3..INVITE 2.100 Trying 5..INVITE 4.100 Trying 6.180 Ringing 7.180 Ringing 9. 200 OK 8.180 Ringing 10. 200 OK 11. 200 OK SIP Protocol Structure Bob’s softphone Atlanta.com Proxy Alice’s softphone Biloxi.com Proxy
Open session UAC core Proxy core Proxy core UAS core 100 trying Invite request 1.Invite request Client Transaction Server Transaction Client Transaction Server Transaction Client Transaction Server Transaction Request 2.100 trying request Response Client Transport Server Transport Client Transport Server Transport Client Transport Server Transport send Receive Receive send SIP Protocol Structure Bob’s softphone Atlanta.com Proxy Alice’s softphone Biloxi.com Proxy
UAC core Proxy core Proxy core UAS core 100 trying Invite request 3.Invite request Client Transaction Server Transaction Client Transaction Server Transaction Client Transaction Server Transaction request Request 4.100 trying Response Client Transport Server Transport Client Transport Server Transport Client Transport Server Transport send Receive Receive send SIP Protocol Structure Bob’s softphone Atlanta.com Proxy Alice’s softphone Biloxi.com Proxy
UAC core Proxy core Proxy core UAS core 180 ringing 180 ringing 180 ringing Invite request 5.Invite request 6.180 ringing 7.180 ringing 8.180 ringing Client Transaction Server Transaction Client Transaction Server Transaction Client Transaction Server Transaction request Request Response Response Response Response Response Response Client Transport Server Transport Client Transport Server Transport Client Transport Server Transport send Receive Receive Receive Receive send send send SIP Protocol Structure Bob’s softphone Atlanta.com Proxy Alice’s softphone Biloxi.com Proxy
UAC core Proxy core Proxy core UAS core 200 OK 200 OK 200 OK 11. 200 OK 10.200 OK 9.200 OK Client Transaction Server Transaction Client Transaction Server Transaction Client Transaction Server Transaction Response Response Response Response Response Response Client Transport Server Transport Client Transport Server Transport Client Transport Server Transport Receive Receive Receive send send send SIP Protocol Structure Bob’s softphone Atlanta.com Proxy Alice’s softphone Biloxi.com Proxy
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 • http://www.tech-invite.com/Ti-sip-archi.html
Questions Thanks!