Understanding SIP

Dorgham Sisalem Jiri Kuthan Mobile Integrated Services GMD Fokus Sisalem,[email protected]

Attention! a Update Notice

Authors are committed to ongoing improvement of this tutorial. Thus, this version may include updates and differ slightly from printed version. You can get the updated version at the following address: http://www.fokus.gmd.de/mobis/siptutorial/

a Frequent Misunderstandings

There are numerous issues that turned out to be difficult to understand. Such issues are labeled with the symbol bellow. Please, pay special attention to them. Frequently Misunderstood Issue

Outline a It’s IP Telephony a Who is who a IP Telephony Basics `Protocol ZOO `SIP Signaling `Multimedia Communication

a Advanced Signaling `Programmability `QoS Preconditions

a Mobility and 3gpp a SIP vs H.323 a Robustness a Security a Legacy a Political Issues a Status Update a Conclusions a References

The Big FAQ a Q: You are too IP-centric, aren’t you? a A: Of course, we are. a Internet telephony (which has Internet in its name) is about IP. `IP telephony runs on top of IP and utilizes the IP service model. `It is not about re-engineering PSTN -- PSTN is good enough.

a SIP is much more similar to HTTP rather than to legacy signaling both in terms of service model and protocol design.

Appeals of IP Telephony aSaving, but ... _lower QoS _Telcos lower prices (1998: Berlin-Prague, 99 Pf/Min, 1999: 39 Pf/Min, 2000: 32 Pf/Min call-by-call, 23 Pf/Min preselection)

aInternet Service integration `IP is the first true Integrated Services Digital Network `Major argument: convenience

aIn IP, you are your own master `Open service market: access providers located across the globe; even you can be a provider. `Programmability: programs by user as well as third parties.

Integrated Applications a Video conferencing a Instant Messaging

a Distributed games `SIP Quake sighted!

a Virtual reality a Web-pages and applets a Links in e-mails a Web-IVRs a Click-to-dial a Directory Services etc.

`voicemail notifications `stock notifications `callback notification

a Calendars `pre-setup conference calls

a Unified Messaging `voicemail2email

IP Service Model a Split of Transport and Application Services `these are different businesses run on top of different technologies `service promiscuity: anyone can access services brought by any providers `anyone with IP connectivity can become a provider `setting up a signaling service as easy setting up a web server ¿ service market is completely open

`Applications Are Split As Well `Example: `IP operated by UUNET `SIP signaling by WCOM `PSTN call termination by mypstn.com and another-pstn.xy `least-cost PSTN termination routing by yet another company

Example:

Trial Site

a Provides just signaling services ` gives users a unique globally reachable address ` resembles Web-hosting in IP world or NetCentrex in PSTN world ` no media transport -- only signaling relayed, media does not hit the server at all

a To set it up, we needed ` PC ` Freely available software ` IP access ` one part-time undergraduate student

a Users need ` IP phone (either in SW or HW)

a Complimentary services may be easily provided by other parties, users just need to set up their signaling preferences: ` bridging to PSTN, voicemail--2-email, etc.

IP Design Concepts a Distributed end-2-end design a Intelligence and states resides in end-devices a Network maintains almost zero intelligence (except routing) and state (except routing tables). a End-devices speak to each other using whatever applications they have. There is almost no logic in the network affecting this behavior. a Result: `Flexibility. Introducing new applications is easy. `Failure recovery. No state, no problem on failure. `Scalability. No state, no memory scalability issues.

Who is Who

Who Engineers the Internet aInternet Engineering Task Force (www.ietf.org) a“large open international community of network designers, operators, vendors, and researchers concerned with the evolution of the Internet architecture and the smooth operation of the Internet. It is open to any interested individual.” aIETF’s business: `Design and standardization of interoperable protocols `Almost anything else out of scope: deployment, promotion, API specification, etc.

IETF - Standardization Procedure (RFC 2026) a Much of the work is handled via mailing lists. The IETF holds meetings three times per year a Proposals submitted for discussion as Internet Drafts. If approved they are published as RFCs. a No formal voting -- rough consensus a RFC `Most of them are NOT standards - informational, experimental, historic, funny (Check April 1st ones (RFC 1149)). `Published RFCs never change. `multiple instances of running code required before standardizing

a New topic Î BOF

Concepts of the Internet Design (RFC 1958, 2775) a Single inter-networking protocol deployed end2end a State stored only in end-devices, no single point of failure, scalable core, higher message overhead ` example: TCP cb stored only in end-devices; no TCP state in routers (per-link reliability would not solve the e2e problem)

a a a a a a

Keep it simple and stupid (avoid options and parameters) Be conservative when sending and liberal when receiving. Performance and cost subject to consideration Modularity is good. (Puzzle/LEGO concept) Distributed design Some of current technical triggers: IPv4 scaling limits, gigabit speeds, QoS, security

Advantages of the IETF Standardization Process aAnyone can join both actively and passively and contribute to quality of standards. aStandards available for free. aLong years of Internet engineering practice.

Related IETF Working Groups a SIP: Session Initiation Protocol a IPTEL: Internet Telephony a AVT: Audio Video Transport a MIDCOM: Firewall/NAT Traversal a SIMPLE: SIP for Instant Messaging and Presence Leveraging a MMUSIC: Multiparty Multimedia Session Control a QoS Related: DiffServ, IntServ, RSVP a PSTN legacy: SigTran, Megaco a interaction of PSTN and IP services: PINT,SPIRITS

Other Related Bodies a Third Generation Partnership Project (3gpp) `creation of technical specifications for 3rd generation mobile systems `uses SIP as call signaling in IP networks

a ITU-T SG 16 `H.323 V1-V4 umbrella standard `H.248 (Megaco)

a ETSI Tiphon `concerned with IP/PSTN interoperability `analysis of security threats, Open Settlement Protocol

Other Related Bodies (cont.) aSIP Forum for promotion of SIP technology aIMTC concerned with interoperability aPacketCable established by CableLabs to look at cable technologies aTelecommunications Industry Association (TIA) involved in layers bellow IP aSoftswitch promoting IN replicas in IP

Other Related Bodies (cont.) a The list still goes on... aJAIN developing abstract APIs for developing service creations across PSTN, ATM, IP, etc. aTIPIA aTTL aVoiceXML Forum

Protocol ZOO

Internet Telephony aRouting a call over the Internet ™PC-to-PC (MS NetMeeting, appliances) Internet IP Phone

™PC-to-phone (net2phone.com) Internet IP Phone Egress PSTN Gateway PSTN Phone

™phone-to-phone (Paegas) Internet PSTN Phone

Ingress PSTN Gateway

™phone-to-PC as well

Egress PSTN Gateway

PSTN Phone

What Protocols Are Needed? aSignaling protocol to establish presence, locate users, set up, modify and tear down sessions aMedia Transport Protocols for transmission of packetized audio/video aSupporting Protocols `Gateway Location, QoS, interdomain AAA*, address translation, IP, etc. * AAA = Authentication, Authorization, Accounting

What Protocols Are There a Signaling: SIP/SDP (IETF), H.323 (ITU-T) ` Note: SIP adopted by 3gpp; lower production and operation costs reported

a Media: RTP (IETF’s, adopted by ITU-T) a Transport: UDP, TCP, (Stream Control Transmission Protocol - RFC 2960) a Supporting protocols: ` DNS ` TRIP - Telephony Routing over IP - discovery and exchange of IP telephony gateway routing tables between providers ` RSVP - Resource Reservation Setup Protocol ` COPS - Common Open Policy Service - protocol for for supporting policy control over QoS ` Diameter - Authentication, Accounting, Authorization

Protocol ZOO

Source: Henning Schulzrinne, http://www.cs.columbia.edu/~hgs/internet/

SIP Signaling

Session Initiation Protocol aSIP is end-to-end, client-server session signaling protocol `SIP’s primarily provides presence and mobility `Protocol primitives: Session setup, termination, changes

aArbitrary services built on top of SIP, e.g.: `Redirect calls from unknown callers to secretary `Reply with a webpage if unavailable `Send a JPEG on invitation

aFeatures: `Textual encoding (telnet, tcpdump compatible) `Programmability

SIP - General Purpose Presence Protocol a SIP is not limited to Internet telephony `SIP establishes user presence `SIP messages can convey arbitrary signaling payload: session description, instant messages, JPEGs, any MIME types a Suitable for applications having a notion of session `distributed virtual reality systems, `network games (Quake II/III implementations), `video conferencing, etc. a Applications may leverage SIP infrastructure (Call Processing, User Location, Authentication) `Instant Messaging and Presence `SIP for Appliances

SIP Is Not a Transport Protocol a QoS Reservation Protocol a Gateway Control Protocol a Some argue it may be used for accessing IP-enabled appliances ... a It does NOT dictate ... `Product features and services (color of your phone and distinctive ringing melodies, number of simultaneous calls your phone can handle, don’t disturb feature, ...) `network configuration

SIP History Work began in 1995 in IETF mmusic WG 02/1996: draft-ietf-mmusic-sip-00: 15 ASCII pages, one request type 12/1996: -01 30 ASCII pages, 2 request types 01/1999: -12 149 ASCII pages, 6 methods 03/1999: RFC 2543, 153 ASCII pages, 6 methods 11/1999: SIP WG formed 11/2000: draft-ietf-sip-rfc2543bis-02, 171 ASCII pages, 6 methods 12/2000: it was recognized that amount of work at SIP WG was becoming unmanageable; 1 RFC; 18 I-Ds on WG’s agenda; numerous individual submissions a 04/2001: proposal for splitting SIP WG into SIP and SIPPING announced a a a a a a a a

a 2001: SIP implementations widely available ` http://www.cs.columbia.edu/~hgs/sip/implementations.html ` http://www.pulver.com/sip/products.html

SIP End-devices a User Agent (user application) `UA Client (originates calls) `UA Server (listens for incoming calls) `both SW and HW available

SIP Workhorses a SIP Proxy Server `relays call signaling, i.e. acts as both client and server `operates in a transactional manner, i.e., it keeps no session state

a SIP Redirect Server `redirects callers to other servers

a SIP Registrar `accept registration requests from users `maintains user’s whereabouts at a Location Server (like GSM

HLR)

SIP Addresses a SIP gives you a globally reachable address. ` Callees bind to this address using SIP REGISTER method. ` Callers use this address to establish real-time communication with callees.

a URLs used as address data format; examples: `sip:[email protected] `sip:[email protected]?subject=callme `sip:[email protected]; geo.position:=48.54_-123.84_120 a must include host, may include user name, port number, parameters (e.g., transport), etc. a may be embedded in Webpages, email signatures, printed on your business card, etc. a address space unlimited a non-SIP URLs can be used as well (mailto:, http:, ...)

SIP Registration

#2

Jiri @ 195.37.78.173

Location Server

This registration example establishes presence of user with address [email protected] and binds this address to user’s current location 195.37.78.173.

REGISTER sip:iptel.org SIP/2.0 From: sip:[email protected] To: sip:[email protected] #1 Contact: Expires: 3600 #3

SIP Registrar (domain iptel.org)

SIP/2.0 200 OK

SIP Operation in Proxy Mode Location Server #0

#6

#7

jiri

INVITE sip:[email protected] From: sip:[email protected] To: sip: [email protected] Call-ID: [email protected]

#2

#1

OK 200 From: sip:[email protected] To: sip: [email protected] Call-ID: [email protected]

[email protected]

DNS SRV Query ? iptel.org Reply: IP Address of iptel.org SIP Server

#3

Proxy

INVITE sip:[email protected] From: sip:[email protected] To: sip: [email protected] #4 Call-ID: [email protected]

OK 200 From: sip:[email protected] #5 To: sip: [email protected] Call-ID: [email protected]

ACK sip:[email protected]

[email protected] Media streams #8

sip:[email protected]

Proxy Server Functionality a Serve as rendezvous point at which callees are globally reachable a Perform routing function, i.e., determine to which hop (UA/proxy/redirect) signaling should be relayed a Allow the routing function to be programmable. Arbitrary logic may be built on top of the protocol `user’s signaling preferences `AAA `firewall control `etc.

a Forking: Several destinations may be tried for a request sequentially or in parallel.

Proxy Chaining a There may be also cases when a local outbound proxy may be involved `provides locally important call processing logic (e.g., identifying nearest 911) `manages firewall `provides least-gateway-cost routing service `IP phones must know address of the proxy:may be configured manually or with a configuration protocol (DHCP, TFTP, ... )

a In general, servers may be arbitrarily chained `a central company’s server may distribute signaling to departmental servers `a user may want to forward incoming calls to her cell phone

a Servers have to avoid loops and recognize spirals

Proxy Chaining - an Example Caller’s administrative domain

Administrative domain of a PSTN gateway operator pstn.com

#2

asia.pstn.com

#3

gw01.asia.pstn.com

#4

#1 Caller’s outbound proxy accomplishes firewall traversal.

Destination’s Proxy in the target “first-hit proxy” area distributes load identifies a proxy in a gateway farm. serving dialed area. Note: signaling (in red) may take a completely different path from media (in blue).

“Stateful” Proxy Refers to Transactions SIP state forgotten as soon as transaction over

INVITE [email protected] OK Legend SIP signaling SIP state media

a If a proxy is stateful it keeps state during a SIP transaction and completely forgets it afterwards. a A SIP proxy is not aware of existing calls a Unless route recording is used, BYE may take a completely different path (I.e., cannot be expected to terminate the state.) a Theoretically, there may be session state as well. Unless there is a well defined use of it, it indicates unscalable implementation.

Frequently Misunderstood Issue

Subsequent Transactions Bypass Proxy a Unless route recording is used, BYE may take a completely different path to destination indicated in Contact: header field. INVITE

OK Contact: sip:[email protected]

BYE takes direct path Frequently Misunderstood Issue

SIP Operation in Redirect Mode Location Server Callee

[email protected] #1 INVITE [email protected]

#4

[email protected]

#2

#3

302 moved temporarily Contact: [email protected]

Proxy #5 ACK [email protected]

[email protected] #6 INVITE [email protected] #7 OK 200 #8 ACK [email protected]

SIP Server -- Proxy versus Redirection a A SIP server may either proxy or redirect a request a Which of the two method applies is a configuration issue. It may be statically configured or dynamically determined (CPL). a Redirection useful if a user moves or changes her provider (PSTN: “The number you have dialed is not available.”) -- caller does not need to try the original server next time. Stateless. a Proxy useful if forking, AAA, firewall control needed. In general, proxying grants more control to the server.

SIP RFC2543 Methods aINVITE initiates sessions `session description included in message body `re-INVITEs used to change session state

aACK confirms session establishment `can only be used with INVITE

aBYE terminates sessions aCANCEL cancels a pending INVITE aOPTIONS capability inquiry aREGISTER binds a permanent address to current location; may convey user data (CPL scripts)

SIP Extension Methods a INFO a COMET a PRACK

a SUBSCRIBE/ NOTIFY/ MESSAGE

mid-call signaling (RFC 2976) precondition met (draft-ietf-sip-manyfolks-resource) provisional reliable responses acknowledgement (draft-ietf-sip-100rel) instant messaging (draft-rosenberg-impp-*)

SIP Response Codes a Borrowed from HTTP: xyz explanatory text a Receivers need to understand x a x80 and higher codes avoid conflicts with future HTTP response codes a 1yz Informational `100 Trying `180 Ringing (processed locally) `181 Call is Being Forwarded

a 2yz Success `200 ok

a 3yz Redirection `300 Multiple Choices `301 Moved Permanently `302 Moved Temporarily

SIP Response Codes (cont.) a4yz Client error `400 `401 `482 `486

Bad Request Unauthorized Loop Detected Busy Here

a5yz Server failure `500 Server Internal Error

a6yz Global Failure `600 Busy Everywhere

SIP Message Structure Request Method

Response Status

INVITE sip:[email protected] SIP/2.0 Via: SIP/2.0/UDP here.com:5060 From: BigGuy To: LittleGuy Message Call-ID: [email protected] CSeq: 1 INVITE Header Subject: Happy Christmas Fields Contact: BigGuy Content-Type: application/sdp Content-Length: 147

SIP/2.0 200 OK Via: SIP/2.0/UDP here.com:5060 From: BigGuy To: LittleGuy ;tag=65a35 Call-ID: [email protected] CSeq: 1 INVITE Subject: Happy Christmas Contact: LittleGuy Content-Type: application/sdp Content-Length: 134

v=0 o=UserA 2890844526 2890844526 IN IP4 here.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

v=0 o=UserB 2890844527 2890844527 IN IP4 there.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

Payload

“receive RTP G.711-encoded audio at 100.101.102.103:49172”

Session Description Protocol (SDP) aConvey sufficient information to enable participation in a multimedia session aSDP includes description of: `Media to use (codec, sampling rate) `Media destination (IP address and port number) `Session name and purpose `Times the session is active `Contact information

aNote: indeed SDP is a data format rather than a protocol.

Session Description Protocol (SDP) v=0 o=sisalem 28908044538 289080890 IN IP4 193.175.132.118 s=SIP Tutorial [email protected] c=IN IP4 126.16.69.4 t=28908044900 28908045000 m=audio 49170 RTP/AVP 0 98 a=rtpmap:98 L16/11025/2

Address Header Fields a a a a

From: message originator To: final recipient Request-URI: current destination; may change along signaling path Contact: appears in INVITE / OPTIONS / ACK / REGISTER requests and in responses. It indicates direct response address to which subsequent transactions are sent. ` A UA may send subsequent BYE or ACK to Contact: address (unless configured to use an outbound proxy). ` It includes redirection address in 3xx and 485 responses. ` It includes additional error information in 4xx, 5xx, and 6xx responses. ` It may include preference weights. ` It includes current location in REGISTER requests. ` Multiple Contact: header fields may be included.

SIP Protocol Design a Infrastructure follows IP state model `Most intelligence and state in the end-devices `Network core maintains at most transactional state `Network edge may maintain session state `Benefits: memory and CPU consumption low in servers, reliability and scalability high (no single point of failure) a UDP Support `faster set-up, less state a Idempotent INVITEs (no collection of data spanning multiple requests)

Understanding SIP - Software Engineering Laboratory

IP telephony runs on top of IP and utilizes the IP service model. It is not about ... resembles Web-hosting in IP world or NetCentrex in PSTN world ... Page 10 ...

636KB Sizes 3 Downloads 119 Views

Recommend Documents

Understanding SIP
resembles Web-hosting in IP world or NetCentrex in PSTN world no media ... Standards available for free. .... Administrative domain of a PSTN gateway operator.

PdF Download Sip: Understanding the Session ...
signaling and IP Telephony. The fourth edition incorporates changes in SIP from the last five years with new chapters on internet threats and attacks, WebRTC.