940 likes | 1.05k Views
18th APAN Meetings QUESTnet 2004 Introduction to SIP Patrick Ferriter Vice President of Product Marketing. History and properties. SIP is an OSI Layer 7 protocol. SIP History. Internet Engineering Task Force (IETF) protocol Inventors: M. Handley, H. Schulzrinne, E. Schooler, and J. Rosenberg
E N D
18th APAN MeetingsQUESTnet 2004Introduction to SIPPatrick FerriterVice President of Product Marketing
History and properties • SIP is an OSI Layer 7 protocol
SIP History • Internet Engineering Task Force (IETF) protocol • Inventors: M. Handley, H. Schulzrinne, E. Schooler, and J. Rosenberg • Became “Proposed Standard” and RFC 2543 in March 1999. • SIPPING (applications) and SIMPLE (presence and instant messaging) WGs using SIP. • SIP is now specified in RFC 3261
SIP Properties, 1 • Web Integrated • SIP is a close relative of HTTP 1.1: • Similar spec outline • URI’s and URLs • Error messages • Similar parser • Adapted for session initiation • Makes real time, interactive communications just another web feature
SIP Properties, 2 • State Aware • Periodically refreshed state: • Robust against system crashes • Less state in the center • More state in periphery • State in client and server • Types of state • Transaction state • Dialogue state • Stateful or Stateless proxies
SIP Properties, 3 • Transport Independent • SIP is transport neutral • UDP is most popular today • simple, quick, efficient • TCP can be used for more persistent connections • TLS on top of TCP for hop-by-hop security • SIP is also media neutral • VoIP • Fax • Gaming
SIP Properties, 4 • SIP Authentication • Challenge/Response based on shared secret - SIP Digest • Mechanism also used by HTTP • Used for client devices • Encryption using private/public keys • Used between servers
SIP Properties, 5 • Privacy and security • SIP signaling can be encrypted • S/MIME (Secure/Multipurpose Internet Mail Extensions) • Defined in RFC 2633 • SIP can be transported over • IPSec • Defined in RFC 2401 • TLS (Transport Layer Security) • Defined in RFC 2246
SIP Properties, 5 • SIP can carry encryption key for media in SDP • Session Description Protocol (SDP) • Defined in RFC 2327 • “Anonymizer” service can be used to conceal identity
Session Description Protocol (SDP) • SIP carries (encapsulates) SDP messages • SDP specifies codecs and media termination points • Only one of many possible MIME attachments carried by SIP
SDP Properties • Defined in RFC 2327 • Is used to describe media session • Carried as a message body in SIP messages • Is a text-based protocol • Uses RTP/AVP Profiles for common media types • E.g. RFC 3551 “RTP Profile for Audio and Video Conferences with Minimal Control”
SDP Structure v=0 o=Tesla 289084 289041 IN IP4 lab.high-voltage.org s=- c=IN IP4 100.101.102.103 t=0 0 m=audio 49170 RTP/AVP 0 a=rtpmap:0 PCMU/8000 • v = Version number (ignored by SIP) • o = Origin (only 3rd field (version) used by SIP) • s = Subject (ignored by SIP) • c = Connection Data (IN =internet, IP4 = IPv4, IP Address) • t = Time (ignored by SIP) • m = Media (type, port, RTP/AVP Profile) • a = Attribute (profile, codec, sampling rate) Specifies IP address and port that this device would like to use to RECEIVE data
SIP Addressing • SIP Uses SIP URLs - Uniform Resource Locators • Can look like email address or contain phone numbers: • sip:John@doe.com • sip:+14085551212@company.com
SIP Request Methods, 1 • SIP used for Peer-to-Peer Communication though it uses a Client-Server model • Requests are called “methods” • Six methods are defined in base RFC 3261: • INVITE • ACK • OPTIONS • BYE • CANCEL • REGISTER
SIP Request Methods, 2 • REGISTER • Register contact with Registrar • INVITE/ACK/BYE/CANCEL/UPDATE • Creates, negotiates and tears down a call (dialogue) • MESSAGE • Creates an Instant Messaging session • SUBSCRIBE • Subscribe to a service (like message waiting indication) • NOTIFY • Notify a change in service state (new Voicemail)
SIP Methods - INVITE, 1 • INVITE requests the establishment of a session • Carried in Message Body (SDP) • Type of session • IP Address • Port • Codec
SIP Methods - INVITE, 2 • An INVITE during an existing session (dialogue) is called a re-INVITE • re-INVITEs can be used to • Place calls on or remove calls from hold • Change session parameters and codecs • The SIP UPDATE method is the proposed replacement for this technique
SIP Methods - ACK • ACK completes the three way session setup handshake (INVITE, final response, ACK) • Only used for INVITE • If INVITE did not contain media information • ACK must contain the media information
SIP Methods - OPTIONS • OPTIONS requests the capabilities of another User Agent • Response lists supported methods, extensions, codecs, etc. • User Agent responds to OPTIONS the same as if an INVITE (e.g. if Busy, returns 486 Busy Here)
SIP Methods – BYE and CANCEL • BYE terminates an established session • User Agents stop sending media packets (RTP) • CANCEL terminates a pending session. • INVITE sent but no final response (non-1xx) yet received. • User Agents and Proxies stop processing INVITE
SIP Methods - REGISTER • Registration allows a User Agent to upload current location and URLs to a Registrar • Registrar can upload into Location Service • Incoming requests can then be proxied or redirected to that location • Built in SIP support of mobility • UAs do not need static IP addresses • Obtain IP address via DHCP, REGISTER indicating new IP Address as contact
SIP Request URI • The Request-URI indicates the destination address of the request • Proxies and other servers route requests based on Request-URI. • The Request-URI is modified by proxies as the address is resolved.
SIP From and To Tags • Tags are pseudo-random numbers inserted in To or From headers to uniquely identify a call leg • INVITE request From header contains a tag • Any User Agent or Server generating a response adds a tag to the To header in the response • To: sip:john@company.com;tag=123456
SIP Method - INFO • Used to transport mid-call signaling information • Only one pending INFO at a time • Typical use - PSTN signaling message carried as MIME attachment • E.g. ISDN User-to-User information • Defined in RFC 2976
SIP Method - REFER • Indicates that recipient (identified by the Request-URI) should contact a third party using the contact information provided in the request • Typical Use: Call Transfer features • Allowed outside an established dialogue
SIP Method - PRACK • Provisional Response ACKnowlegement • Used to acknowledge receipt of provisional response • 183 Session Progress • Does not apply to 100 Trying responses • Only provisional responses 101-199 may be sent reliably and acknowledged with PRACK • If no PRACK sent, response retransmitted • Defined in RFC 3262
SIP Methods – SUBSCRIBE and NOTIFY • SUBSCRIBE requests notification of when a particular event occurs • Use Expires=0 to unsubscribe • A NOTIFY message is sent to indicate the event status • Sample Applications • Presence • Message waiting indication for voicemail • Defined in RFC 3265
SIP Method - MESSAGE • Extension to SIP for Instant Messaging (IM) • MESSAGE requests • carry the content in the form of MIME body parts • use the standard MIME headers to identify the content
SIP Responses, 1 • SIP Requests generate Responses with codes borrowed from HTTP • Classes: • 1xx Informational • 2xx Final • 3xx Redirection • 4xx Client Error • 5xx Server Error • 6xx Global Failure • Response example “404 Not Found”
SIP Responses, 2 • 1xx-3xx
SIP Responses, 3 • 4xx
SIP Responses, 4 • 5xx-6xx
Headers • Extensible flags • From: and To: URLs • From: John Smith <sip:jsmith@zultys.com> • To: Tony Warhurst <sip:twarhurst@beerdrinkers.org> • Contact: URL • Contact: Jane Doe <sip:jdoe@192.168.1.100> • Via: URL • Via: SIP/2.0/UDP 192.168.1.100:5060 • Call-ID: • Unique tag for this dialogue • CSeq: • Track how many messages for this request
SIP Headers, 1 • SIP Requests and Responses contain Headers (similar to Email headers) • Required Headers • To • From • Via • Call-ID • CSeq • Max-Forwards • Optional Headers: • Subject, Date, Authentication (and many others)
SIP Headers, 2 • Required (mandatory) header descriptions
SIP Message Body • A SIP Message • can have a message body similar to attachment in an email message • Message Body in an INVITE • contains a description of the media session in another protocol: • Usually SDP - Session Description Protocol (RFC 2327)
SIP Client and Server • SIP Elements are either • User Agents (end devices that initiate and terminate media sessions) • Servers (that assist in session setup) • Proxies • Registrars • Redirect servers • A User Agent acts as a • Client when it initiates a request (UAC) • Server when it responds to a request (UAS)
SIP User Agents • Capable of sending and receiving SIP requests • SIP end-devices • SIP phone • PC or laptop with a soft phone • PDA • mobile phone • A Gateway is a User Agent which serves many users
SIP UAC and UAS • SIP UAC • UA component that sends requests and receives responses • Example: UAC initiates a “call” by sending an INVITE • SIP UAS • Component of UA that receives requests and responds to them • Example: UAS receives a call request and “rings” phone
SIP B2BUA versus Proxy • B2BUA versus Proxy • SIP Proxies route SIP messages unchanged • Back to Back User Agents appear as just another SIP endpoint and can modify the message however they like. • B2BUA’s can act as gateway to the PSTN, a simple SIP filter or even a SIP Proxy • “B2BUAs can do whatever they want, only SIP Proxies have to follow the rules” – Dean Willis, SIP co-chair • Zultys provides a B2BUA that also has elements of the SIP Proxy and Registrar
SIP B2BUA Example • Defined as a virtual UAS/UAC connected back to back • Acts as a UAS on one call leg and a UAC on the other call leg • It may or may not terminate and bridge the RTP streams
SIP Registrar, 1 • SIP server that can receive and process REGISTER requests • A user has an account created which allows them to REGISTER contacts with a particular server • The account specifies a SIP “Address of Record (AOR)”
SIP Registrar, 2 • SIP Registrars store the location of SIP endpoints • Each SIP endpoint Registers • with a Registrar using it’s Address of Record and Contact address • Address of Record for John Smith in From: header From: John Smith <sip:jsmith@zultys.com • Contact: header tells Registrar where to send messages Contact: John Smith <sip:jsmith@192.168.1.100>
SIP Registrar, 3 • SIP Proxies • query SIP Registrars for routing information • Incoming calls addressed to sip:jsmith@zultys.com • now routed by the Proxy to the Contact: header URL sip:jsmith@192.168.1.100 • SIP Registrars • typically hold the list of devices registered for a particular domain
Proxy Server • SIP Proxy servers route SIP messages • Stateless Proxies use stateless protocols like UDP to talk to endpoints • Low Proxy overhead • Ephemeral connections, dropped as soon as message is forwarded • Stateful Proxies use TCP or other stateful protocols to set up a permanent connection • High Proxy overhead • Endpoint connection must be set up, maintained and torn down for the duration of the session
SIP Proxy Server • SIP Server which acts on behalf of User Agents • Receives a SIP request • Adds some headers • Modifies some of the headers • Forwards request to next hop server or client
Stateless Proxy • Forwards every request downstream • Forward every response upstream • Keeps no state • does not have any notion of a transaction • Never performs message retransmissions • Stateless proxies scale very well • can be very fast • good for network cores
Stateful Proxy • Maintains state information for the duration of either the: • Transaction (request) • Transaction Stateful • Dialogue (from INVITE to BYE) • Dialogue Stateful • Performs message retransmission
SIP Redirect Server • Receives a request and returns a redirection response (3xx) • Contact header in response indicates where request should be retried • Similar to database query • All Server types are logical NOT Physical
Protocol and media • SIP can carry many protocols using MIME standard • SDP • XML • JPEG/GIF • Tunnel your favourite protocol • SIP takes care of signalling on behalf of media • RTP • RTCP