SIP Fundimentals - Information Systems & Technology

Transcription

SIP FundimentalsIAP 2008 VoIP SeriesDennis BaronJanuary 15, 2008np160Dennis Baron, January 15, 2008Page 1

Outline What is SIP SIP system components SIP messages and responses SIP call flows SDP basics/CODECs IS&T Services Questions and answersnp160Dennis Baron, January 15, 2008Page 2

What’s SIP IETF Standard defined by RFC 3261 “The Session Initiation Protocol (SIP) is an application-layercontrol (signaling) protocol for creating, modifying andterminating sessions with one or more participants.” Can be used for voice, video, instant messaging, gaming,etc., etc., etc. Uses URIs for addressing – single communications identity–mailto:dbaron@MIT.edu for email–xmpp:dbaron@MIT.EDU for instant messaging–sip:dbaron@MIT.EDU for voice and video Username replaced by numbers for telephone applicationsnp160Dennis Baron, January 15, 2008Page 3

Where’s SIPApplicationTransportNetworkPhysical/Data etDennis Baron, January 15, 2008Page 4

SIP Components User Agents– Clients – Make requests– Servers – Accept requests Server types– Redirect Server– Proxy Server– Registrar Server– Location Server Gatewaysnp160Dennis Baron, January 15, 2008Page 5

SIP boundProxyInboundProxySIPOriginatingUser Agentnp160SIPSIPSIPRTPTerminatingUser AgentDennis Baron, January 15, 2008Page 6

SIP Triangle POriginatingUser Agentnp160SIPSIPSIPRTPTerminatingUser AgentDennis Baron, January 15, 2008Page 7

SIP Peer to Peer !SIPOriginatingUser AgentTerminatingUser AgentRTPBack-to-Back User AgentB2BUASIPOriginatingUser Agentnp160SIPRTPTerminatingUser AgentDennis Baron, January 15, 2008Page 8

SIP Methods INVITERequests a session ACKFinal response to the INVITE OPTIONSAsk for server capabilities CANCELCancels a pending request BYETerminates a session REGISTERSends user’s address to servernp160Dennis Baron, January 15, 2008Page 9

SIP Responses 1XXProvisional100 Trying 2XXSuccessful200 OK 3XXRedirection302 Moved Temporarily 4XXClient Error404 Not Found 5XXServer Error504 Server Time-out 6XXGlobal Failure603 Declinenp160Dennis Baron, January 15, 2008Page 10

SIP Flows - BasicUserA“Calls”18.18.2.4UserBINVITE: sip:18.10.0.79180 - Ringing200 - OKRingsAnswersACKRTPTalkingHangs upTalkingBYE200 - OKnp160Dennis Baron, January 15, 2008Page 11

SIP INVITEINVITE joeuser.mit.edu SIP/2.0From: "Dennis Baron" sip:dbaron@mit.edu ;tag 1c41To: sip:joeuser.mit.eduCall-Id: call-1096504121-2@18.10.0.79Cseq: 1 INVITEContact: "Dennis Baron" sip:dbaron@18.10.0.79 Content-Type: application/sdpContent-Length: 304Accept-Language: enAllow: INVITE, ACK, CANCEL, BYE, REFER, OPTIONS, NOTIFY, REGISTER,SUBSCRIBESupported: sip-cc, sip-cc-01, timer, replacesUser-Agent: Pingtel/2.1.11 (WinNT)Date: Thu, 30 Sep 2004 00:28:42 GMTVia: SIP/2.0/UDP 18.10.0.79np160Dennis Baron, January 15, 2008Page 12

Session Description Protocol IETF RFC 2327 “SDP is intended for describing multimedia sessions for thepurposes of session announcement, session invitation, andother forms of multimedia session initiation.” SDP includes:– The type of media (video, audio, etc.)– The transport protocol (RTP/UDP/IP, H.320, etc.)– The format of the media (H.264 video, MPEG video,etc.)– Information to receive those media (addresses, ports,formats and so on)np160Dennis Baron, January 15, 2008Page 13

SDPv 0o Pingtel 5 5 IN IP4 18.10.0.79s phone-callc IN IP4 18.10.0.79t 0 0m audio 8766 RTP/AVP 96 97 0 8 18 98a rtpmap:96 eg711u/8000/1a rtpmap:97 eg711a/8000/1a rtpmap:0 pcmu/8000/1a rtpmap:8 pcma/8000/1a rtpmap:18 g729/8000/1a fmtp:18 annexb noa rtpmap:98 telephone-event/8000/1np160Dennis Baron, January 15, 2008Page 14

CODECs Audio– G.711 8kHz sampling rate 64kbps– G.729 8kHz sampling rate 8kbps Voice Activity Detection Video– H.264 MPEG-4– H.263np160Dennis Baron, January 15, 2008Page 15

SIP Flows - GISTER: sip:dbaron@MIT.EDU401 - UnauthorizedREGISTER: (add credentials)sip:dbaron@MIT.EDUContact 18.10.0.79200 - OKnp160Dennis Baron, January 15, 2008Page 16

SIP REGISTERREGISTER sip:mit.edu SIP/2.0From: "Dennis Baron" sip:dbaron@mit.edu ;tag 4561c4561To: "Dennis Baron" sip:dbaron@mit.edu ;tag 324591026Call-Id: 9ce902bd23b070ae0108b225b94ac7faCseq: 5 REGISTERContact: "Dennis Baron" sip:dbaron@18.10.0.79;LINEID 05523f7a97b54dfa3f0c0e3746d73a24 Expires: 3600Date: Thu, 30 Sep 2004 00:46:53 GMTAccept-Language: enSupported: sip-cc, sip-cc-01, timer, replacesUser-Agent: Pingtel/2.1.11 (WinNT)Content-Length: 0Via: SIP/2.0/UDP 18.10.0.79np160Dennis Baron, January 15, 2008Page 17

SIP REGISTER – 401 ResponseSIP/2.0 401 UnauthorizedFrom: "Dennis Baron" sip:dbaron@mit.edu ;tag 4561c4561To: "Dennis Baron" sip:dbaron@mit.edu ;tag 324591026Call-Id: 9ce902bd23b070ae0108b225b94ac7faCseq: 5 REGISTERVia: SIP/2.0/UDP 18.10.0.79Www-Authenticate: Digest realm "mit.edu",nonce "f83234924b8ae841b9b0ae8a92dcf0b71096505216", opaque "reg:change4"Date: Thu, 30 Sep 2004 00:46:56 GMTAllow: INVITE, ACK, CANCEL, BYE, REFER, OPTIONS, REGISTER, NOTIFY, SUBSCRIBE, INFOUser-Agent: Pingtel/2.2.0 (Linux)Accept-Language: enSupported: sip-cc-01, timerContent-Length: 0np160Dennis Baron, January 15, 2008Page 18

SIP REGISTER with CredentialsREGISTER sip:mit.edu SIP/2.0From: "Dennis Baron" sip:dbaron@mit.edu ;tag 4561c4561To: "Dennis Baron" sip:dbaron@mit.edu ;tag 324591026Call-Id: 9ce902bd23b070ae0108b225b94ac7faCseq: 6 REGISTERContact: "Dennis Baron" sip:dbaron@18.10.0.79;LINEID 05523f7a97b54dfa3f0c0e3746d73a24 Expires: 3600Date: Thu, 30 Sep 2004 00:46:53 GMTAccept-Language: enSupported: sip-cc, sip-cc-01, timer, replacesUser-Agent: Pingtel/2.1.11 (WinNT)Content-Length: 0Authorization: DIGEST USERNAME “dbaron@mit.edu", REALM "mit.edu",NONCE "f83234924b8ae841b9b0ae8a92dcf0b71096505216", URI "sip:mit.edu",RESPONSE "ae064221a50668eaad1ff2741fa8df7d", OPAQUE "reg:change4"Via: SIP/2.0/UDP 18.10.0.79np160Dennis Baron, January 15, 2008Page 19

SIP Flows – Via ProxyProxyUserA“Calls” dbaron@MIT.EDUUserBMIT.EDUINVITE: sip:dbaron@MIT.EDUINVITE:sip:dbaron@18.10.0.79100 - Trying180 - RingingRings180 - Ringing200 - OKAnswers200 - OKACKRTPTalkingHangs upTalkingBYE200 - OKnp160Dennis Baron, January 15, 2008Page 20

SIP Flows – Via GatewayProxyUserA“Calls” joeuser@MIT.EDUGatewayMIT.EDU38400INVITE: sip:joeuser@MIT.EDUINVITE: sip:38400@18.162.0.25100 - TryingRings180 - Ringing180 - RingingAnswers200 - OK200 - OKACKACKRTPTalkingHangs upTalkingBYEBYE200 - OK200 - OKnp160Dennis Baron, January 15, 2008Page 21

SIP INVITE with Record-RouteINVITE sip:37669@18.162.0.25 SIP/2.0Record-Route: sip:18.7.21.118:5080;lr;a;t 2c41;s b07e28aa8f94660e8545313a44b9ed50 From: \"Dennis Baron\" sip:6172531000@mit.edu ;tag 2c41To: sip:37669@mit.eduCall-Id: call-1096505069-3@18.10.0.79Cseq: 1 INVITEContact: \"Dennis Baron\" sip:6172531000@18.10.0.79 Content-Type: application/sdpContent-Length: 304Accept-Language: enAllow: INVITE, ACK, CANCEL, BYE, REFER, OPTIONS, NOTIFY, REGISTER, SUBSCRIBESupported: sip-cc, sip-cc-01, timer, replacesUser-Agent: Pingtel/2.1.11 (WinNT)Date: Thu, 30 Sep 2004 00:44:30 GMTVia: SIP/2.0/UDP 18.7.21.118:5080;branch z9hG4bK2cf12c563cec06fd1849ff799d069cc0Via: SIP/2.0/UDP 18.7.21.118;branch z9hG4bKd26e44dfdc2567170d9d32a143a7f4d8Via: SIP/2.0/UDP 18.10.0.79Max-Forwards: 17np160Dennis Baron, January 15, 2008Page 22

SIP StandardsJust a sampling of IETF standards work IETF RFCshttp://ietf.org/rfc.html RFC3261Core SIP specification – obsoletes RFC2543 RFC2327SDP – Session Description Protocol RFC1889RTP - Real-time Transport Protocol RFC2326RTSP - Real-Time Streaming Protocol RFC3262SIP PRACK method – reliability for 1XX messages RFC3263Locating SIP servers – SRV and NAPTR RFC3264Offer/answer model for SDP use with SIPnp160Dennis Baron, January 15, 2008Page 23

SIP Standards (cont.) RFC3265SIP event notification – SUBSCRIBE and NOTIFY RFC3266IPv6 support in SDP RFC3311SIP UPDATE method – eg. changing media RFC3325Asserted identity in trusted networks RFC3361Locating outbound SIP proxy with DHCP RFC3428SIP extensions for Instant Messaging RFC3515SIP REFER method – eg. call transfer RFC4474Authenticated Identity Management SIMPLEIM/Presence - http://ietf.org/ids.by.wg/simple.htmlnp160Dennis Baron, January 15, 2008Page 24

IS&T Services MITvoip– Desktop VoIP telephones to replace traditional 5ESStelephones– New voice mail system– Web interface for user control– Transition over 2 to 2.5 years Personal SIP accounts– Bring your own devices/software– Limited supportnp160Dennis Baron, January 15, 2008Page 25

Soft and Hard SIP Clients “Hard phones” “Soft phones”np160Dennis Baron, January 15, 2008Page 26

Asterisk Open source phone system Runs on Linux, Mac OS X, OpenBSD, FreeBSD and Solaris Supports SIP (and other VoIP protocols)– Cisco SCCP, H.323, IAX Highly customizable Hardware telephone interfaces available MIT applications– Shuttletrack IVR– Media Lab Owl Project– SIPB VoIP Scripts?np160Dennis Baron, January 15, 2008Page 27

IAP 2008 - VoIP Series SIP FundimentalsDennis BaronTue Jan 15, 01-02:30pm, 4-149 Personal SIP Account WorkshopDennis BaronTue Jan 22, 01-02:30pm, 4-231 Build, Test, and Deploy VoIP Applications with Asteriskand other Open-Source ApplicationsElliot EichenTue Jan 29, 01-02:30pm, 4-231np160Dennis Baron, January 15, 2008Page 28

Questions?np160Dennis Baron, January 15, 2008Page 29

"The Session Initiation Protocol (SIP) is an application-layer control (signaling) protocol for creating, modifying and . Supported: sip-cc-01, timer Content-Length: 0. Dennis Baron, January 15, 2008 np160 Page 19 SIP REGISTER with Credentials REGISTER sip:mit.edu SIP/2.0