Top Banner
SIP Fundamentals VoiceCon Orlando 2010 Dan York, Director of Conversations, Voxeo March 23, 2010 With thanks to David Bryan of Cogent Force
100

Sip Fundamentals and Prospects Tutorial - VoiceCon Orlando 2010

Oct 21, 2014

Download

Technology

At VoiceCon Orlando 2010, Voxeo's Dan York taught a 3-hour tutorial about the Session Initiation Protocol (SIP) that was attended by over 200 people. The session explained the basics of SIP, walked through the message flow, discussed SIMPLE, SIP trunking and explored issues with distributed systems and federation.

http://blogs.voxeo.com/events/voicecon/

Please note that the slides were developed from a set of slides originally created by David Bryan of http://www.ethernot.org/ (used with his permission).
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Sip Fundamentals and Prospects Tutorial - VoiceCon Orlando 2010

SIP Fundamentals

VoiceCon Orlando 2010

Dan York, Director of Conversations, Voxeo

March 23, 2010

With thanks to David Bryan of Cogent Force

Page 2: Sip Fundamentals and Prospects Tutorial - VoiceCon Orlando 2010

© Voxeo Corporation © Voxeo Corporation (www.voxeo.com) and David Bryan (www.ethernot .org)

Quick Survey – Who Are You?

  Type of business: •  Enterprise?

•  System integrator? reseller?

•  Government? •  Other?

  Have a SIP system today? Considering one?

  SIP experience? •  I know how to spell it

•  Worked with it a bit

•  Wrote several of the SIP RFCs

Page 3: Sip Fundamentals and Prospects Tutorial - VoiceCon Orlando 2010

© Voxeo Corporation © Voxeo Corporation (www.voxeo.com) and David Bryan (www.ethernot .org)

www.7ducattacks.com

About Dan York

blogs.voxeo.com/speakingofstandards

www.ietf.org

www.voxeo.com www.sipforum.org

www.disruptivetelephony.com

Page 4: Sip Fundamentals and Prospects Tutorial - VoiceCon Orlando 2010

© Voxeo Corporation © Voxeo Corporation (www.voxeo.com) and David Bryan (www.ethernot .org)

About Voxeo

  Founded in 1999

  World’s largest hosted VoiceXML and CCXML platform – Over 82,000 hosted ports globally; hundreds of premise deployments

  Over 100,000 developers using Voxeo platforms

  The Voxeo difference: Unlocked Communications, Customer Obsession Teams, Communications Passion

  Services/software available for free: www.voxeo.com/free

Page 5: Sip Fundamentals and Prospects Tutorial - VoiceCon Orlando 2010

© Voxeo Corporation © Voxeo Corporation (www.voxeo.com) and David Bryan (www.ethernot .org)

Voxeo - Built for VoIP Since Day One

  100% SIP VOIP-based communications application platform •  Built from the ground up; natively

SIP-based •  Other XML IVR platforms were built

on a CT card-centric model with SIP added afterwards as a “virtual” or “emulated” CT card

  Works with the widest variety of SIP providers, gateways, softphones and adapters

  SIPMethod SIP Servlets Platform

•  IM, Presence, Session Border Controller

Page 6: Sip Fundamentals and Prospects Tutorial - VoiceCon Orlando 2010

© Voxeo Corporation © Voxeo Corporation (www.voxeo.com) and David Bryan (www.ethernot .org)

Voxeo: Design Once − Deploy Anywhere

Page 7: Sip Fundamentals and Prospects Tutorial - VoiceCon Orlando 2010

A Quick Background

Page 8: Sip Fundamentals and Prospects Tutorial - VoiceCon Orlando 2010

© Voxeo Corporation © Voxeo Corporation (www.voxeo.com) and David Bryan (www.ethernot .org)

Some (brief!) Background on VoIP

  Packet Switched, not Circuit switched •  There is no dedicated path that traffic follows

•  Segmented into IP packets, sent to target, particular path not specified

  Original telephone network was circuit switched (think of the operator w/wires) •  SS7, defined by the ITU (International

Telecommunications Union)

Page 9: Sip Fundamentals and Prospects Tutorial - VoiceCon Orlando 2010

© Voxeo Corporation © Voxeo Corporation (www.voxeo.com) and David Bryan (www.ethernot .org)

Circuit Switched Network

There is a dedicated, fixed line (usually physically connected) between parties, and

reserved for their use

Page 10: Sip Fundamentals and Prospects Tutorial - VoiceCon Orlando 2010

© Voxeo Corporation © Voxeo Corporation (www.voxeo.com) and David Bryan (www.ethernot .org)

Packet Switched Network

There is no physical connection. The call is chopped into packets, which are sent over

a network of devices, perhaps using different paths

Page 11: Sip Fundamentals and Prospects Tutorial - VoiceCon Orlando 2010

© Voxeo Corporation © Voxeo Corporation (www.voxeo.com) and David Bryan (www.ethernot .org)

Public Switched Telephone Network (PSTN)

Page 12: Sip Fundamentals and Prospects Tutorial - VoiceCon Orlando 2010

© Voxeo Corporation © Voxeo Corporation (www.voxeo.com) and David Bryan (www.ethernot .org)

ITSP

PSTN

Internet Telephony

Service Provider

ITSP ITSP

ITSP

ITSP ITSP ITSP

ITSP

ITSP

ITSP

ITSP

ITSP

ITSP

ITSP

ITSP

ITSP

ITSP

ITSP

ITSP

ITSP

ITSP

ITSP

ITSP

ITSP ITSP

ITSP

ITSP

ITSP

ITSP ITSP

ITSP ITSP

ITSP

ITSP

Today...

Page 13: Sip Fundamentals and Prospects Tutorial - VoiceCon Orlando 2010

© Voxeo Corporation © Voxeo Corporation (www.voxeo.com) and David Bryan (www.ethernot .org)

PBX

Voicemail Physical Wiring

PSTN Gateways

1.1 Traditional Telephony

Page 14: Sip Fundamentals and Prospects Tutorial - VoiceCon Orlando 2010

© Voxeo Corporation © Voxeo Corporation (www.voxeo.com) and David Bryan (www.ethernot .org)

Physical Wiring

IP Network

IP-PBX

Voicemail

PSTN Gateways

Mobile Devices

IM Networks

Web Servers

Email Servers

Desktop PCs

Operating Systems

Firewalls

Internet

Directory Servers

VoIP

CRM Systems

Social Networks

Database Servers

1.2 

Application Servers

VoIP and Unified Communications

Page 15: Sip Fundamentals and Prospects Tutorial - VoiceCon Orlando 2010

© Voxeo Corporation © Voxeo Corporation (www.voxeo.com) and David Bryan (www.ethernot .org)

VoIP Protocols

  H.323 •  ITU defined VoIP protocol

•  ITU is very formal, government oriented

•  More “telephony” in nature than Internet

  SIP •  IETF (Internet Engineering Task Force) defined

protocol for general multimedia session establishment •  IETF is much less formal, individual oriented

•  More “Internet” in nature than telephony

Page 16: Sip Fundamentals and Prospects Tutorial - VoiceCon Orlando 2010

© Voxeo Corporation © Voxeo Corporation (www.voxeo.com) and David Bryan (www.ethernot .org)

H.323 vs. SIP

Feature H.323 SIP Encoding Binary Text

Control Centralized server Endpoints (using proxy)

Intelligence Most in central server; core

Most in the endpoints; edge

Modularity Monolithic (all in one server)

Can be multiple servers

Defined by ITU IETF

Media RTP RTP

Page 17: Sip Fundamentals and Prospects Tutorial - VoiceCon Orlando 2010

SIP Basics

Page 18: Sip Fundamentals and Prospects Tutorial - VoiceCon Orlando 2010

© Voxeo Corporation © Voxeo Corporation (www.voxeo.com) and David Bryan (www.ethernot .org)

SIP

  Session Initiation Protocol

  Defined (mostly) in IETF RFCs 3261-3264 •  Many other drafts extend SIP and add new

features

  Text based, very similar to HTTP, mail protocols

  Establishes a media session between endpoints

  Allows mobility – locate users using a SIP URI (sip:[email protected]) •  Multiple endpoints can be associated with single SIP URI

  Usually runs on port 5060, using UDP or TCP

  Allows for IPv4 and IPv6 (Next generation mobile phones use SIP over TCP/IPv6)

Page 19: Sip Fundamentals and Prospects Tutorial - VoiceCon Orlando 2010

© Voxeo Corporation © Voxeo Corporation (www.voxeo.com) and David Bryan (www.ethernot .org)

SIP

  Offers Event management (Subscribe/Notify) for presence etc.

  Extended by SIMPLE to support IM (Instant Messaging)

  Designed to allow easy interoperation with other Internet features such as WWW and email

Page 20: Sip Fundamentals and Prospects Tutorial - VoiceCon Orlando 2010

© Voxeo Corporation © Voxeo Corporation (www.voxeo.com) and David Bryan (www.ethernot .org)

Why is SIP Important?

  It’s all about standards

  The promise of interoperable equipment •  A Nortel phone talking to a Cisco proxy to

reach another user with an Avaya phone

  Designed for the future •  Any media (voice, video, text, ???)

•  Internet/endpoint centric design

•  Easily extensible

  SIP has become the dominant VoIP protocol

Page 21: Sip Fundamentals and Prospects Tutorial - VoiceCon Orlando 2010

© Voxeo Corporation © Voxeo Corporation (www.voxeo.com) and David Bryan (www.ethernot .org)

Major Components of SIP

  SIP systems specify components logically

  There are several components specified •  UA (User-Agent, Endpoint) – the phone or application

•  Registrar – keeps track of where the user is within a system

•  Redirect Server – used to inform devices when they need to contact different locations

•  Proxy Server – used to relay messages back and forth within the system

  In practice, several logical functions may actually reside in the same physical server/program

Page 22: Sip Fundamentals and Prospects Tutorial - VoiceCon Orlando 2010

© Voxeo Corporation © Voxeo Corporation (www.voxeo.com) and David Bryan (www.ethernot .org)

User Agents

  A User Agent (also called a UA, Phone, or Endpoint) represents a user of a SIP system •  A particular user may have more than one UA

•  Can be hard device (fixed or mobile) or a “soft client” – an application running on a PC

Soft Client Hard Phone Mobile Hard Phone

Page 23: Sip Fundamentals and Prospects Tutorial - VoiceCon Orlando 2010

© Voxeo Corporation © Voxeo Corporation (www.voxeo.com) and David Bryan (www.ethernot .org)

UAs and Proxies

  Many things are really built on UAs •  Session Border Controllers are usually 2 UAs connected

•  B2BUA or “Back-to-Back User Agent” •  (sometimes also an ALG -- special kind of firewall)

•  Voice mail servers •  Interactive Voice Response systems

  SIP Proxy •  Often what is sold as a proxy is really a Proxy/Registrar/

Redirect server •  Proxy is often part of IP-PBX, “call server”, etc.

  “Softswitch” often incorporates all of this

Page 24: Sip Fundamentals and Prospects Tutorial - VoiceCon Orlando 2010

© Voxeo Corporation © Voxeo Corporation (www.voxeo.com) and David Bryan (www.ethernot .org)

Proxy

Alice

3.1 

Bob Media

SIP SIP

Basic SIP Call Flow

Page 25: Sip Fundamentals and Prospects Tutorial - VoiceCon Orlando 2010

© Voxeo Corporation © Voxeo Corporation (www.voxeo.com) and David Bryan (www.ethernot .org)

SIP Proxy

A

Alice Bob Media (RTP, MSRP, etc.)

SIP SIP

SIP Proxy

B SIP

SIP & Media Paths

Page 26: Sip Fundamentals and Prospects Tutorial - VoiceCon Orlando 2010

© Voxeo Corporation © Voxeo Corporation (www.voxeo.com) and David Bryan (www.ethernot .org)

Proxy

sip.bob-office.com

sip.bob-isp.com

“I need to call Bob!”

“Call here for Bob from Alice”

“Call for you from Alice!”

Bob is over at bob-isp.com. I’ll proxy the

call over there!

Page 27: Sip Fundamentals and Prospects Tutorial - VoiceCon Orlando 2010

© Voxeo Corporation © Voxeo Corporation (www.voxeo.com) and David Bryan (www.ethernot .org)

Registration

“I’m Alice, and I’ll be using a phone at 192.168.0.1 today!”

192.168.0.1 Registrar

sip.cogentforce.com

When I get a call for Alice, I’ll

know to contact her at 192.168.0.1!

Page 28: Sip Fundamentals and Prospects Tutorial - VoiceCon Orlando 2010

© Voxeo Corporation © Voxeo Corporation (www.voxeo.com) and David Bryan (www.ethernot .org)

SIP Proxy

A

Alice Bob Media (RTP, MSRP, etc.)

SIP SIP

SIP Proxy

B SIP

SIP Registrar

SIP 1

2

Registration

Page 29: Sip Fundamentals and Prospects Tutorial - VoiceCon Orlando 2010

© Voxeo Corporation © Voxeo Corporation (www.voxeo.com) and David Bryan (www.ethernot .org)

Redirection

sip.cogentforce.com

sip.bob-office.com

“I need to call Bob!”

“Call here for Bob from Alice”

“Call for you from Alice!”

sip.bob-isp.com “Try him at bob-isp.com”

“Call here for Bob from Alice”

Page 30: Sip Fundamentals and Prospects Tutorial - VoiceCon Orlando 2010

© Voxeo Corporation © Voxeo Corporation (www.voxeo.com) and David Bryan (www.ethernot .org)

SIP Proxy

A

Alice Bob Media (RTP, MSRP, etc.)

SIP SIP

SIP Proxy

B SIP

The Simple Picture

Page 31: Sip Fundamentals and Prospects Tutorial - VoiceCon Orlando 2010

© Voxeo Corporation © Voxeo Corporation (www.voxeo.com) and David Bryan (www.ethernot .org)

Internet (or WAN)

Alice Bob Media

SIP SIP

SIP Proxy

A SIP

SIP Proxy

B

SIP Proxy

N

SIP Proxy

D SIP

SIP Proxy

C SIP SIP

Media Proxy

A

Media Proxy

B Media Media

The Complex Reality

Page 32: Sip Fundamentals and Prospects Tutorial - VoiceCon Orlando 2010

© Voxeo Corporation © Voxeo Corporation (www.voxeo.com) and David Bryan (www.ethernot .org)

SIP Messages

  SIP messages fall into two types – requests and responses

  Requests include a method telling what it is they are doing.

•  REGISTER, to register where to contact a user •  INVITE, to start a new session (call) •  BYE, to end a session that is established •  CANCEL, to end a session that is still being set up (no

final response yet) •  ACK, part of the triple handshake

•  Several others

Page 33: Sip Fundamentals and Prospects Tutorial - VoiceCon Orlando 2010

© Voxeo Corporation © Voxeo Corporation (www.voxeo.com) and David Bryan (www.ethernot .org)

SIP Messages

  Responses are numeric, much like HTTP

•  1xx Provisional – 100 Trying, 180 Ringing

•  2xx Successful – 200 OK

•  3xx Redirection – 301 Moved Permanently, 302 Moved Temporarily

•  4xx Failure – 404 Not Found, 410 Gone, 403 Forbidden

•  5xx Server Failure – 503 Service Unavailable

•  6xx Global Failure – 600 Busy Everywhere

Page 34: Sip Fundamentals and Prospects Tutorial - VoiceCon Orlando 2010

© Voxeo Corporation © Voxeo Corporation (www.voxeo.com) and David Bryan (www.ethernot .org)

Registration Call Flow

SIP Server

REGISTER

401 Unauthorized

REGISTER

200 OK

Page 35: Sip Fundamentals and Prospects Tutorial - VoiceCon Orlando 2010

© Voxeo Corporation © Voxeo Corporation (www.voxeo.com) and David Bryan (www.ethernot .org)

Basic Call Flow SIP Server

INVITE INVITE

100 Trying

180 Ringing 180 Ringing

200 OK 200 OK

ACK ACK

BYE BYE

Bi-directional Media between endpoints

200 OK 200 OK

Page 36: Sip Fundamentals and Prospects Tutorial - VoiceCon Orlando 2010

© Voxeo Corporation © Voxeo Corporation (www.voxeo.com) and David Bryan (www.ethernot .org)

No-answer Call Flow SIP Server

INVITE INVITE

100 Trying

180 Ringing 180 Ringing

487 Request Terminated 487 Request Terminated

ACK ACK

CANCEL

200 OK

CANCEL

200 OK

Page 37: Sip Fundamentals and Prospects Tutorial - VoiceCon Orlando 2010

© Voxeo Corporation © Voxeo Corporation (www.voxeo.com) and David Bryan (www.ethernot .org)

AORs and Contacts

  In SIP, a registrar maps between an AoR and a contact

•  AoR: Address of Record •  Permanent, something on your business card •  Not tied to a specific device •  sip:[email protected]

•  Contact •  Ephemeral, tied to a device •  sip:[email protected]

•  Being able to change AoR→Contact mapping allows mobility

Page 38: Sip Fundamentals and Prospects Tutorial - VoiceCon Orlando 2010

© Voxeo Corporation © Voxeo Corporation (www.voxeo.com) and David Bryan (www.ethernot .org)

Registration, revisited

“I’m Alice ([email protected]), and I’ll be using a phone at 192.168.0.1 today!”

Registrar

AoR → Contact Map: [email protected][email protected]

192.168.0.1

Page 39: Sip Fundamentals and Prospects Tutorial - VoiceCon Orlando 2010

© Voxeo Corporation © Voxeo Corporation (www.voxeo.com) and David Bryan (www.ethernot .org)

Registration, revisited

Registrar

AoR → Contact Map: [email protected][email protected]

10.0.1.1

“Lunch time! Mobile Time! ([email protected]) will be using 10.0.1.1 now!”

Page 40: Sip Fundamentals and Prospects Tutorial - VoiceCon Orlando 2010

© Voxeo Corporation © Voxeo Corporation (www.voxeo.com) and David Bryan (www.ethernot .org)

INVITE message

INVITE sip:[email protected] SIP/2.0 Via: SIP/2.0/TCP aliceua.phonecompany.com:5060 From: Alice <sip:[email protected]>;tag=ss95cbav To: Bob <sip:[email protected]> Call-ID: [email protected] CSeq: 1 INVITE Max-Forwards: 10 Contact: <sip:[email protected];transport=tcp> …snip!...

(Alice is going to call Bob…)

Page 41: Sip Fundamentals and Prospects Tutorial - VoiceCon Orlando 2010

© Voxeo Corporation © Voxeo Corporation (www.voxeo.com) and David Bryan (www.ethernot .org)

INVITE message INVITE sip:[email protected] SIP/2.0

SIP request, method is INVITE, target is an AoR (for Bob) Via: SIP/2.0/TCP aliceua.phonecompany.com:5060

Via header tracks where it has been (more on this later) From: Alice <sip:[email protected]>; tag=ss95cbav

Message is from Alice, and this is the SIP URL for Alice. The tag is unique to this call and selected by Alice’s UA

To: Bob <sip:[email protected]> Alice is trying to contact Bob at his SIP URL (a tag will be selected by Bob’s UA later

Call-ID: [email protected] Call-ID is a unique ID to track this particular call (selected by Alice’s UA)

CSeq: 1 INVITE Used to track which responses go with which messages. Responses to this invite will also have a CSeq of 1 INVITE

Max-Forwards: 10 Used in routing (more on this later)

Contact: <sip:[email protected];transport=tcp> How to contact Alice directly. Notice this is a contact (has a host)

…snip…

Page 42: Sip Fundamentals and Prospects Tutorial - VoiceCon Orlando 2010

© Voxeo Corporation © Voxeo Corporation (www.voxeo.com) and David Bryan (www.ethernot .org)

Calls and Dialogs

  A call is an informal term for communication between two devices

  A dialog is a more specific term, which defines a relationship between two UAs for a duration •  In many ways, this is what most people would think

of as a call

•  Defined by Call-ID, To tag, and From tag

•  Sender selects Call-ID, and From tag

•  Reciever selects To tag

Page 43: Sip Fundamentals and Prospects Tutorial - VoiceCon Orlando 2010

© Voxeo Corporation © Voxeo Corporation (www.voxeo.com) and David Bryan (www.ethernot .org)

Transaction

  A transaction defines a particular operation that is carried out between the endpoints •  Example: (INVITE) Set up the call, (BYE) end the call

  Includes all responses (including the ACK)

  May be several transactions within a dialog

  Each transaction uses a new CSeq •  Command Sequence •  Chosen by the initiator of the transaction •  Each side must increase the CSeq for each new

transaction they initiate – no specified starting point •  But since some transactions are initiated by each side,

within a call it might look out of order

Page 44: Sip Fundamentals and Prospects Tutorial - VoiceCon Orlando 2010

© Voxeo Corporation © Voxeo Corporation (www.voxeo.com) and David Bryan (www.ethernot .org)

Dialogs and Transactions SIP Server

INVITE INVITE

100 Trying

180 Ringing 180 Ringing

200 OK 200 OK

ACK ACK

BYE BYE

Bi-directional Media between endpoints

200 OK 200 OK

Transaction 1 Transaction 2

Dialog/C

all

Page 45: Sip Fundamentals and Prospects Tutorial - VoiceCon Orlando 2010

Routing

Page 46: Sip Fundamentals and Prospects Tutorial - VoiceCon Orlando 2010

© Voxeo Corporation © Voxeo Corporation (www.voxeo.com) and David Bryan (www.ethernot .org)

Internet (or WAN)

Alice Bob Media

SIP SIP

SIP Proxy

A SIP

SIP Proxy

B

SIP Proxy

N

SIP Proxy

D SIP

SIP Proxy

C SIP SIP

Media Proxy

A

Media Proxy

B Media Media

The Complex Reality

Page 47: Sip Fundamentals and Prospects Tutorial - VoiceCon Orlando 2010

© Voxeo Corporation © Voxeo Corporation (www.voxeo.com) and David Bryan (www.ethernot .org)

Routing

  Each entity forwards message along path to reach destination •  Places next destination into Request-URI (top line)

•  Adds themselves as another Via

•  Max-Forwards is decremented to prevent loops and limit the length of path •  if it reaches 0, the message isn’t forwarded again

Page 48: Sip Fundamentals and Prospects Tutorial - VoiceCon Orlando 2010

© Voxeo Corporation © Voxeo Corporation (www.voxeo.com) and David Bryan (www.ethernot .org)

INVITE message

INVITE sip:[email protected] SIP/2.0 Via: SIP/2.0/TCP aliceua.phonecompany.com:5060 From: Alice <sip:[email protected]>;tag=ss95cbav To: Bob <sip:[email protected]> Call-ID: [email protected] CSeq: 1 INVITE Max-Forwards: 10 Contact: <sip:[email protected];transport=tcp> …snip!...

Let’s see what happens as this message passes through the big company proxy on the

way to Bob…

Page 49: Sip Fundamentals and Prospects Tutorial - VoiceCon Orlando 2010

© Voxeo Corporation © Voxeo Corporation (www.voxeo.com) and David Bryan (www.ethernot .org)

INVITE message

INVITE sip:[email protected] SIP/2.0 Via: SIP/2.0/TCP proxy.bigcompany.com:5060 Via: SIP/2.0/TCP aliceua.phonecompany.com:5060 From: Alice <sip:[email protected]>;tag=ss95cbav To: Bob <sip:[email protected]> Call-ID: [email protected] CSeq: 1 INVITE Record-Route: <sip:proxy.bigcompany.com;lr> Max-Forwards: 9 Contact: <sip:[email protected];transport=tcp> …snip!...

Notice the new URI, added VIA, and decremented Max-Forwards. This message is

forwarded to Bob’s UA.

Page 50: Sip Fundamentals and Prospects Tutorial - VoiceCon Orlando 2010

© Voxeo Corporation © Voxeo Corporation (www.voxeo.com) and David Bryan (www.ethernot .org)

Routing Responses

  When Bob’s UA responds, it “unrolls” the Via headers to decide where to route the responses

  The response traces the path back, sending the response to the Via address of the entity that sent the message (responding!)

  That entity removes itself from the Via and passes the message along, unrolling until it reaches the sender

  Notice that the proxy needs no state here

Page 51: Sip Fundamentals and Prospects Tutorial - VoiceCon Orlando 2010

© Voxeo Corporation © Voxeo Corporation (www.voxeo.com) and David Bryan (www.ethernot .org)

INVITE message

INVITE sip:[email protected] SIP/2.0 Via: SIP/2.0/TCP proxy.bigcompany.com:5060 Via: SIP/2.0/TCP aliceua.phonecompany.com:5060 From: Alice <sip:[email protected]>;tag=ss95cbav To: Bob <sip:[email protected]> Call-ID: [email protected] CSeq: 1 INVITE Record-Route: <sip:proxy.bigcompany.com;lr> Max-Forwards: 9 Contact: <sip:[email protected];transport=tcp> …snip!...

But one more here. What is record route?

Page 52: Sip Fundamentals and Prospects Tutorial - VoiceCon Orlando 2010

© Voxeo Corporation © Voxeo Corporation (www.voxeo.com) and David Bryan (www.ethernot .org)

Record Route

  Once a UA has the address of the other UA in the call, new messages can be sent directly between devices if they wish

  Record route is a way for a proxy to request “keep me in the loop” •  Ensures that future transactions include this proxy,

rather than going directly to the other UA

Page 53: Sip Fundamentals and Prospects Tutorial - VoiceCon Orlando 2010

Forking

Page 54: Sip Fundamentals and Prospects Tutorial - VoiceCon Orlando 2010

© Voxeo Corporation © Voxeo Corporation (www.voxeo.com) and David Bryan (www.ethernot .org)

Forking

  While somewhat complicated, many features require “forking” •  Send a message to more than one entity Need to

track (and manage both sides)

  Parallel forking (send to more than one at a time) •  Ring both desk and mobile at once, cancel the call

to whichever fails to pickup

  Can also use redirection (sequential) •  Ring desk phone, then try mobile if no answer

  Can combine •  Ring desk phone and mobile, then VM if no answer

Page 55: Sip Fundamentals and Prospects Tutorial - VoiceCon Orlando 2010

© Voxeo Corporation © Voxeo Corporation (www.voxeo.com) and David Bryan (www.ethernot .org)

Parallel Forking

SIP Server Desk Phone

Caller

Mobile

time a

time a

Two devices are tried at the same time, time a

Page 56: Sip Fundamentals and Prospects Tutorial - VoiceCon Orlando 2010

© Voxeo Corporation © Voxeo Corporation (www.voxeo.com) and David Bryan (www.ethernot .org)

Sequential Forking

SIP Server Desk Phone

Caller

Voice Mail

time a

time b

One device is tried at time a, then another at time b

Page 57: Sip Fundamentals and Prospects Tutorial - VoiceCon Orlando 2010

© Voxeo Corporation © Voxeo Corporation (www.voxeo.com) and David Bryan (www.ethernot .org)

Parallel & Sequential Forking

SIP Server

Desk Phone

Caller

Voice Mail

time a

time b

Several devices are tried in parallel at time a, then forked to another at time b

Mobile Phone

time a

Page 58: Sip Fundamentals and Prospects Tutorial - VoiceCon Orlando 2010

SIP Trunking & PSTN Interconnection

Page 59: Sip Fundamentals and Prospects Tutorial - VoiceCon Orlando 2010

© Voxeo Corporation © Voxeo Corporation (www.voxeo.com) and David Bryan (www.ethernot .org)

Gateways

  How about connecting to the outside world? •  If you want to talk to another SIP user, your proxy

may know how to contact that user’s proxy directly, and the call is all SIP

•  To call out to a regular phone (or to have calls come in) you use a gateway. It connects to one or more regular phone lines to let you receive and place calls to old fashioned “Plain Old Telephone Service” (POTS)

•  Can also gateway between SIP and other protocols such as H.323, or to networks such as Skype

Page 60: Sip Fundamentals and Prospects Tutorial - VoiceCon Orlando 2010

© Voxeo Corporation © Voxeo Corporation (www.voxeo.com) and David Bryan (www.ethernot .org)

Gateway example

SIP Server

Gateway

SIP/IP network POTS network

Page 61: Sip Fundamentals and Prospects Tutorial - VoiceCon Orlando 2010

© Voxeo Corporation © Voxeo Corporation (www.voxeo.com) and David Bryan (www.ethernot .org)

SIP Trunking

  Instead of using a local gateway, use SIP to connect to a remote gateway at a: •  Internet Telephony Service Provider (ITSP) •  SIP Service Provider •  (other names)

  Create a “SIP Trunk” out to remote system •  NOT a physical connection like a TDM trunk. Purely a

virtual connection from your premise system to the IP address of the ITSP.

  Can be over public Internet or over WAN, dedicated lines or VPN

Page 62: Sip Fundamentals and Prospects Tutorial - VoiceCon Orlando 2010

© Voxeo Corporation © Voxeo Corporation (www.voxeo.com) and David Bryan (www.ethernot .org)

PBX

Corp HQ 

Carrier PSTN

Internet

Trunking before SIP

Page 63: Sip Fundamentals and Prospects Tutorial - VoiceCon Orlando 2010

© Voxeo Corporation © Voxeo Corporation (www.voxeo.com) and David Bryan (www.ethernot .org)

PBX

Corp HQ 

ITSP

Internet

PSTN

SIP Trunking

Page 64: Sip Fundamentals and Prospects Tutorial - VoiceCon Orlando 2010

© Voxeo Corporation © Voxeo Corporation (www.voxeo.com) and David Bryan (www.ethernot .org)

PBX

Corp HQ 

PSTN

ITSP 1

Internet ITSP 2

ITSP 3

SIP Trunking – Multiple ITSPs

Page 65: Sip Fundamentals and Prospects Tutorial - VoiceCon Orlando 2010

© Voxeo Corporation © Voxeo Corporation (www.voxeo.com) and David Bryan (www.ethernot .org)

PBX

Corp HQ 

ITSP

Internet PSTN

PBX

Office A 

SIP Trunking - Failover

Page 66: Sip Fundamentals and Prospects Tutorial - VoiceCon Orlando 2010

© Voxeo Corporation © Voxeo Corporation (www.voxeo.com) and David Bryan (www.ethernot .org)

PBX

Corp HQ 

PSTN

ITSP (Boston)

Internet ITSP (Paris)

ITSP (Tokyo)

SIP Trunking - Geography

Page 67: Sip Fundamentals and Prospects Tutorial - VoiceCon Orlando 2010

© Voxeo Corporation © Voxeo Corporation (www.voxeo.com) and David Bryan (www.ethernot .org)

SIP Trunking - SIPconnect

  Initiative of the SIP Forum to increase interoperabilty between on-premise systems and SIP service providers

  Idea is that a “SIPconnect-compliant” IP-PBX will more easily be able to connect to a “SIPconnect-compliant” SIP service provider

  http://www.sipforum.org/sipconnect

Page 68: Sip Fundamentals and Prospects Tutorial - VoiceCon Orlando 2010

The Many Protocols Used In SIP

Page 69: Sip Fundamentals and Prospects Tutorial - VoiceCon Orlando 2010

© Voxeo Corporation © Voxeo Corporation (www.voxeo.com) and David Bryan (www.ethernot .org)

Media (RTP/RTCP)

The (Many) Protocols in a “SIP” Call

SIP Server SIP/SDP SIP/SDP

UA UA

Page 70: Sip Fundamentals and Prospects Tutorial - VoiceCon Orlando 2010

© Voxeo Corporation © Voxeo Corporation (www.voxeo.com) and David Bryan (www.ethernot .org)

SIP, SDP, and RTP

  SIP is only a part of the picture

  SIP is used to establish the multimedia session

  SIP messages don’t describe the type of media themselves •  Embed another protocol called SDP

  Yet another protocol, RTP (and RTCP), is used to actually stream the media between the devices

Page 71: Sip Fundamentals and Prospects Tutorial - VoiceCon Orlando 2010

© Voxeo Corporation © Voxeo Corporation (www.voxeo.com) and David Bryan (www.ethernot .org)

Codecs (encoding)

  The media that flows using RTP is encoded using a codec

  Codec is about how the audio has been converted to packets •  Example: g.711, g.729, GIPS

•  In general, higher quality = more network bandwidth

•  Codec to be used, and any parameters to be used are described in SDP

Page 72: Sip Fundamentals and Prospects Tutorial - VoiceCon Orlando 2010

© Voxeo Corporation © Voxeo Corporation (www.voxeo.com) and David Bryan (www.ethernot .org)

SDP/RTP

  Both of these are older IETF protocols used by SIP •  IETF tries to promote reuse whenever possible

  Session Description Protocol •  Used by SIP to describe the media format, encoding,

destination, etc.

•  Included in SIP message as a payload

  Real-time Transport Protocol •  Used to transport the encoded media across the wire

•  Can be used for media other than voice

Page 73: Sip Fundamentals and Prospects Tutorial - VoiceCon Orlando 2010

© Voxeo Corporation © Voxeo Corporation (www.voxeo.com) and David Bryan (www.ethernot .org)

INVITE message

INVITE sip:[email protected] SIP/2.0 Via: SIP/2.0/TCP aliceua.phonecompany.com:5060 From: Alice <sip:[email protected]>; tag=ss95cbav To: Bob <sip:[email protected]> Call-ID: [email protected] CSeq: 1 INVITE Contact: <sip:[email protected];transport=tcp> Content-Type: application/sdp Content-Length: 134

v=0 o=CogentForce-UA 10010 605 IN IP4 aliceua.phonecompany.com s=SIP Call c=IN IP4 192.0.1.1 t=0 0 m=audio 49172 RTP/AVP 0 8 16

Page 74: Sip Fundamentals and Prospects Tutorial - VoiceCon Orlando 2010

© Voxeo Corporation © Voxeo Corporation (www.voxeo.com) and David Bryan (www.ethernot .org)

INVITE message

<snip!> Content-Type: application/sdp Content-Length: 134

The content of the message is SDP – to describe the media of the call. We have 134 bytes of SDP

v=0 v is the SDP version number -- 0

o=CogentForce-UA 10010 605 IN IP4 aliceua.phonecompany.com o is a description of the UA and a session ID

s=SIP Call s is an string to encode a name for this session

c=IN IP4 192.0.1.1 c tells the other side what address to send the media to

t=0 0 t indicates start and end times. 0 and 0 don’t specify times in advance

m=audio 49172 RTP/AVP 0 8 16 m describes the media. We are listening for audio of type RTP/AVP on port 49172

Page 75: Sip Fundamentals and Prospects Tutorial - VoiceCon Orlando 2010

© Voxeo Corporation © Voxeo Corporation (www.voxeo.com) and David Bryan (www.ethernot .org)

Offer/Answer

  Different UAs may support different codecs

  Calling UA lists what it supports and is willing to use in the INVITE message SDP

  Called UA responds with the subset of that it is willing to use in the response SDP (200 OK)

  If nothing in common, can’t communicate and call is rejected

  Mechanisms exist to change this mid call (for example, switching from audio to video)

Page 76: Sip Fundamentals and Prospects Tutorial - VoiceCon Orlando 2010

Instant Messaging / SIMPLE

Page 77: Sip Fundamentals and Prospects Tutorial - VoiceCon Orlando 2010

© Voxeo Corporation © Voxeo Corporation (www.voxeo.com) and David Bryan (www.ethernot .org)

Instant Message and Presence

  SIP has a set of extensions called SIMPLE •  SIMPLE: SIP for Instant Messaging

(IM) and Presence Leveraging Extensions

•  Send text messages between devices

•  Can switch between text and voice

•  session is all SIP

•  Presence (ability to see “status” of other user) is also supported (and persistent on server)

•  Idle, Offline, Available, Busy, Offline till Monday…

Page 78: Sip Fundamentals and Prospects Tutorial - VoiceCon Orlando 2010

© Voxeo Corporation © Voxeo Corporation (www.voxeo.com) and David Bryan (www.ethernot .org)

Instant Message and Presence

  MESSAGE method used to send text messages

  SUBSCRIBE to express an interest, “subscribe” to someone’s status

  PUBLISH to change your status on the presence server

  NOTIFY is send from server to those who have subscribed

Page 79: Sip Fundamentals and Prospects Tutorial - VoiceCon Orlando 2010

© Voxeo Corporation © Voxeo Corporation (www.voxeo.com) and David Bryan (www.ethernot .org)

Extending SIP

  SIMPLE isn’t the only extension

  SIP was designed from the beginning to be highly extensible

  Can add new methods, new responses, headers

  Groups in the RAI (Realtime Applications and Infrastructure) area at IETF determine what is really an accepted “standard” extension •  SIPCORE, DISPATCH, SIMPLE, and others

  Many vendors add non-interoperable “extensions” to SIP •  These may not work across different vendor platforms

Page 80: Sip Fundamentals and Prospects Tutorial - VoiceCon Orlando 2010

NAT / Firewall Traversal

Page 81: Sip Fundamentals and Prospects Tutorial - VoiceCon Orlando 2010

© Voxeo Corporation © Voxeo Corporation (www.voxeo.com) and David Bryan (www.ethernot .org)

NAT/FW Traversal

  SIP has traditionally had some trouble getting through firewalls (FWs) and Network Address Translators (NATs)

  Two major causes •  NATs use “private” IP addresses, not routable from

the outside •  SIP embeds these, outside entity has no way to respond

•  SIP and RTP (the media) are on different “ports” •  Each requires a specific forwarding through the firewall to

work and must be opened separately

Page 82: Sip Fundamentals and Prospects Tutorial - VoiceCon Orlando 2010

© Voxeo Corporation © Voxeo Corporation (www.voxeo.com) and David Bryan (www.ethernot .org)

Firewalls and Media

A UA Contacts another UA (or a proxy), sending SIP messages.

The process of sending the message (on most NATs/FWs) creates a mapping that allows responses to reach the sender

SIP

Page 83: Sip Fundamentals and Prospects Tutorial - VoiceCon Orlando 2010

© Voxeo Corporation © Voxeo Corporation (www.voxeo.com) and David Bryan (www.ethernot .org)

Firewalls and Media

Media (RTP) is on a different port (different opening in the FW) than SIP

It is possible that at the time the media is sent, it is rejected by the firewall

RTP

Page 84: Sip Fundamentals and Prospects Tutorial - VoiceCon Orlando 2010

© Voxeo Corporation © Voxeo Corporation (www.voxeo.com) and David Bryan (www.ethernot .org)

NAT/FW Traversal

  Several Solutions •  IETF efforts

•  STUN, TURN and ICE •  Query outside servers to find out “public” address •  Can use media relays to help get media between two hosts

behind firewalls

•  Session Border Controllers (SBCs) •  Sit near (or in) the firewall/NAT, rewrite the internals of the

packets, work with firewall to open ports

Page 85: Sip Fundamentals and Prospects Tutorial - VoiceCon Orlando 2010

© Voxeo Corporation © Voxeo Corporation (www.voxeo.com) and David Bryan (www.ethernot .org)

Session Border Controllers

  Implemented either as special firewall/ALG that modify the packets (deep-packet inspection) or as a B2BUA •  B2BUA can be thought of as a special SIP-to-SIP gateway

or as two UAs “glued together”, where each side is a separate call

  Can be used for •  NAT Traversal •  Protocol “correction” •  Demarcation point •  Codec translation

  Generally handles both media and signalling

Page 86: Sip Fundamentals and Prospects Tutorial - VoiceCon Orlando 2010

© Voxeo Corporation © Voxeo Corporation (www.voxeo.com) and David Bryan (www.ethernot .org)

Session Border Controller

SIP Server

SIP/IP network

SIP Server

SIP/IP network

Session Border Controller (SBC)

Page 87: Sip Fundamentals and Prospects Tutorial - VoiceCon Orlando 2010

Peer-To-Peer SIP

Page 88: Sip Fundamentals and Prospects Tutorial - VoiceCon Orlando 2010

© Voxeo Corporation © Voxeo Corporation (www.voxeo.com) and David Bryan (www.ethernot .org)

Peer-to-Peer (P2P) SIP

  Alternate way to deliver SIP

  Basic idea – reduce or completely eliminate the central servers (proxy/softswitch)

  Most or all functionality is moved to the UA

  Highly scalable, so good for very small deployments (no infrastructure) and internet-wide deployments

Page 89: Sip Fundamentals and Prospects Tutorial - VoiceCon Orlando 2010

© Voxeo Corporation © Voxeo Corporation (www.voxeo.com) and David Bryan (www.ethernot .org)

Client/Server Session

In a Client/Server session, two nodes must use a central server to

communicate

Page 90: Sip Fundamentals and Prospects Tutorial - VoiceCon Orlando 2010

© Voxeo Corporation © Voxeo Corporation (www.voxeo.com) and David Bryan (www.ethernot .org)

P2P Session

In a Peer-to-Peer session, when two nodes communicate, a few other nodes,

rather than a central server, help complete the call

Page 91: Sip Fundamentals and Prospects Tutorial - VoiceCon Orlando 2010

Distributed Systems

Page 92: Sip Fundamentals and Prospects Tutorial - VoiceCon Orlando 2010

© Voxeo Corporation © Voxeo Corporation (www.voxeo.com) and David Bryan (www.ethernot .org)

7.1 

UC System

Corp HQ 

Internet Firewall Home Firewall

IP Phone

PC

Home 

Home Teleworkers

Page 93: Sip Fundamentals and Prospects Tutorial - VoiceCon Orlando 2010

© Voxeo Corporation © Voxeo Corporation (www.voxeo.com) and David Bryan (www.ethernot .org)

UC System

Corp HQ 

Internet Firewall WiFi Café

Router

Mobile UC

client

Laptop UC

client

Mobile Data

Network

Mobile Workers

Page 94: Sip Fundamentals and Prospects Tutorial - VoiceCon Orlando 2010

© Voxeo Corporation © Voxeo Corporation (www.voxeo.com) and David Bryan (www.ethernot .org)

IM

Corp HQ 

Corporate Network

Presence

Call Control

IVR IM

Office A 

Presence

Call Control

Voicemail IM

Office B 

Presence

Call Control

PSTN

Internet

Intra-company and Cloud

Page 95: Sip Fundamentals and Prospects Tutorial - VoiceCon Orlando 2010

© Voxeo Corporation © Voxeo Corporation (www.voxeo.com) and David Bryan (www.ethernot .org)

UC System

Corp HQ 

UC System

Office A 

Corporate Network

Company A 

UC System

Corp HQ 

UC System

Office A 

Corporate Network

Company B 

Internet

Inter-company Federation

Page 96: Sip Fundamentals and Prospects Tutorial - VoiceCon Orlando 2010

Resources

Page 97: Sip Fundamentals and Prospects Tutorial - VoiceCon Orlando 2010

© Voxeo Corporation © Voxeo Corporation (www.voxeo.com) and David Bryan (www.ethernot .org)

Some Good SIP Webpages

  Tech-Invite (www.tech-invite.com) is a great source for general SIP information with many beautiful color illustrations

  SIP Forum has many links to more info (www.sipforum.org)

  RFC 5411, “The Hitchhiker’s Guide to SIP” (tools.ietf.org/html/rfc5411)

  SIP Tutorial at iptel.org, (www.iptel.org/tutorial)

  IETF information can be found at www.ietf.org and www.softarmor.com

  P2PSIP.org (www.p2psip.org) is the community site for P2PSIP

  “Speaking of Standards” blog (blogs.voxeo.com/speakingofstandards)

Page 98: Sip Fundamentals and Prospects Tutorial - VoiceCon Orlando 2010

© Voxeo Corporation © Voxeo Corporation (www.voxeo.com) and David Bryan (www.ethernot .org)

Books on SIP

  Internet Communications Using SIP, Henry Sinnreich and Alan B. Johnston, Wiley Networking Council Series, 2006 (second edition)

  SIP: Understanding the Session Initiation Protocol, Alan B. Johnston, Artech House, 2004

  SIP Beyond VoIP, Henry Sinnreich, Alan B. Johnston and Robert J. Sparks, VON Publishing, 2005

  SIP Demystified, Gonzalo Camarillo, McGraw-Hill Telecom Series, 2002

Page 99: Sip Fundamentals and Prospects Tutorial - VoiceCon Orlando 2010

© Voxeo Corporation © Voxeo Corporation (www.voxeo.com) and David Bryan (www.ethernot .org)

Acknowledge/Thanks

  Thanks to those who have worked on SIP over the years, presented SIP tutorials, or written SIP books!

Page 100: Sip Fundamentals and Prospects Tutorial - VoiceCon Orlando 2010