SIP, SDP and VoIP David A. Bryan CSCI 434/534 December 6, 2003.
Transcript of SIP, SDP and VoIP David A. Bryan CSCI 434/534 December 6, 2003.
VoIP
• VoIP – Voice over IP (Internet Protocol)• Basic idea is to run telephone type
services (and sometimes video) over IP– Cost savings (administration, arbitrage)– Tax/tariff avoidance– Security (internal, encryption)– Advanced features
• Next generation (3G and later) cellular phones run over IP networks
Telephony Protocols
• Original phone network is circuit switched– SS7 is the protocol used for this – NOT a
computer standard– Defined by ITU – International
Telecommunication Union
• VoIP is packet switched – uses computer networks– H.323 is also an ITU standard, but designed
to work over packet switched networks
Telephony Protocols
• SIP– IETF defined a protocol for VoIP, called SIP– Designed for packet networks, useful for any
sort of multimedia session establishment– Support for integration with email/web
services– SIMPLE is a set of extensions to SIP to
support instant messaging
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
Media RTP RTP
SIP
• Session Initiation Protocol• Defined (mostly) in IETF RFC 3261
– Many other drafts extend SIP and add new features
• Text based, very similar to HTTP• Sets up a multimedia session between endpoints• Allows mobility – locate users using a URL
(sip:[email protected])• Usually runs on port 5060• Can use either UDP or TCP as transport• Allows for IPv4 and IPv6. Next generation cellular
phones (Europe) use SIP over TCP/IPv6
SDP
• Session Description Protocol• SIP doesn’t try to describe the media stream• Defined in IETF RFC 2327• This is used by SIP to actually describe the type
of media being used, where to send it, etc. – Included in SIP message as a payload
• This is an older IETF protocol– IETF tries to promote reuse whenever possible
• Yet another protocol, RTP, is used for the actual media
SIP
• Logically, there are several parts to a SIP system– UA (User-Agent, Endpoint) – the phone itself – can
also be a softphone – computer software– 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 functions may actually be in
the same server/program
Registration
“I’m Alice, and I’ll be using aphone at 192.168.0.1 today!”
192.168.0.1 SIP Server
sip.phonecompany.com
When I get a call for Alice, I’ll know to
contact her at 192.168.0.1!
10.0.1.1
“Lunch time! Use my mobileat 10.0.1.1”
Ah, now I will have to use 10.0.1.1 to reach Alice.
Proxy
sip.phonecompany.com
sip.quickmart.com
“I need to call Bob!”
“Call here for Bob from Alice”
“Call for youfrom Alice!”
Bob is over at quickmart.com. I’ll proxy the
call over there!
Redirection
sip.phonecompany.com
sip.quickmart.com
“I need to call Bob!”
“Call here for Bob from Alice”
“Call for youfrom Alice!”
sip.diveapartment.com“Try him at diveapartment.com”
“Call here for Bob from Alice”
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 a phone or device– 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
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
Basic CallSIP Server
INVITEINVITE
100 Trying
180 Ringing180 Ringing
200 OK200 OK
ACKACK
BYEBYE
Bi-directional Media between endpoints
200 OK200 OK
No answerSIP Server
INVITEINVITE
100 Trying
180 Ringing180 Ringing
487 Request Terminated487 Request Terminated
200 OK200 OK
CANCEL
200 OK
CANCEL
200 OK
INVITE messageINVITE sip:[email protected] SIP/2.0 Via: SIP/2.0/TCP aliceua.phonecompany.com:5060From: Alice <sip:[email protected]> To: Bob <sip:[email protected]> Call-ID: [email protected] CSeq: 1 INVITE Contact: <sip:[email protected];transport=tcp> Content-Type: application/sdp Content-Length: 151
v=0 o=Cisco-UserAgent 10010 605 IN IP4 aliceua.phonecompany.com s=SIP Callc=IN IP4 192.0.1.1 t=0 0 m=audio 49172 RTP/AVP 0 8 16
INVITE messageINVITE sip:[email protected] SIP/2.0
SIP request, method is INVITE – this message will start a new callVia: SIP/2.0/TCP aliceua.phonecompany.com:5060
Via header tracks where it has been – so far just Alice’s UAFrom: Alice <sip:[email protected]>
Message is from Alice, and this is the SIP URL for AliceTo: Bob <sip:[email protected]>
Alice is trying to contact Bob at his SIP URLCall-ID: [email protected]
Call-ID is a (hopefully) unique ID to track this particular call. Alice’s UA generated this
CSeq: 1 INVITE We also count messages within a call to see what responses gowith what messages. This first exchange is an INVITE exchange.The response to this will also have a CSeq of 1 INVITE
Contact: <sip:[email protected];transport=tcp> How to contact Alice directly – you can sometimes “skip” the proxy.
<snip!>
INVITE message<snip!> Content-Type: application/sdp Content-Length: 151
The content of the message is SDP – to describe the media of thecall. We have 151 bytes of SDP
v=0 v is the SDP version number -- 0
o=Cisco-UserAgent 10010 605 IN IP4 aliceua.phonecompany.com o is a description of the UA and a session ID
s=SIP Calls 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 16m describes the media. We are listening for audio of type RTP/AVP on port 49172
Network Architecture
• Several ways to have a device that connects to an IP network– True IP endpoint – a phone w/an ethernet connection
– often quite expensive– ATA – Analog Telephone Adaptor (this is what you
get if you sign up with Vonage) – plugs into the ethernet, and you plug a phone into it
– IP enabled PBX (make an existing office phone system speak SIP)
– Soft Client – program that runs on a computer and is used with microphone and speakers
Network Architecture
• How about connecting to the outside world?– If you want to talk to another SIP user, your
proxy may know how to contact that proxy directly
– To call out (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”, or POTS
Problems with VoIP
• Cost of entrance– while the maintenance and operating costs are low,
equipment can be expensive
• Reliability– Still issues with reliability of systems
• Safety/Security– 911 is a large issue, particularly routing to the right
place– Interception is difficult, and encryption is easy with
softphones – possibly a national security issue
Problems with VoIP
• NAT and firewall traversal– Media and signaling on different ports leads to
issues with media not being able traverse firewalls
– Imbedded addresses within SIP messages are a problem for NATs
• Taxes/regulation– Remove some incentive for VoIP
Open Source SIP projects
• Several good open source SIP projects– VOCAL
• Full SIP “softswitch” – includes proxy, softclient, voice mail, etc.
– ReSIProcate• Newer, much nicer stack than VOCAL, but few
applications so far
– IPTel Sip Express Router• High performance Proxy. Less full featured than
VOCAL, but faster and more robust
References
[1] SIP versus H.323, iptel.org, (http://www.iptel.org/info/trends/sip.html)
[2] SIP Tutorial, iptel.org, (http://www.iptel.org/sip/siptutorial.pdf)
[3] SIP RFC, RFC-3261, IETF, (http://www.ietf.org/rfc/rfc3261.txt)
[4] SDP RFC, RFC-2327, IETF, (http://www.ietf.org/rfc/rfc2327.txt)
[5] VOCAL Project, (http://www.vovida.org)[6] ReSIProcate Project, (http://www.resiprocate.org)[7] Vonage, (http://www.vonage.com)