np160

Upload: cpawan699508

Post on 02-Jun-2018

216 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/10/2019 np160

    1/36

    np160Dennis Baron, January 15, 2008

    Page 1

    SIP FundimentalsIAP 2008 VoIP Series

    Dennis Baron

    January 15, 2008

  • 8/10/2019 np160

    2/36

    np160Dennis Baron, January 15, 2008

    Page 2

    Outline

    What is SIP

    SIP system components

    SIP messages and responses

    SIP call flows

    SDP basics/CODECs

    IS&T Services

    Questions and answers

  • 8/10/2019 np160

    3/36

    np160Dennis Baron, January 15, 2008

    Page 3

    Whats SIP

    IETF Standard defined by RFC 3261

    The Session Initiation Protocol (SIP) is an application-layer

    control (signaling) protocol for creating, modifying and

    terminating sessions with one or more participants.

    Can be used for voice, video, instant messaging, gaming,etc., etc., etc.

    Uses URIs for addressingsingle communications identity

    mailto:[email protected] for email

    xmpp:[email protected] for instant messaging

    sip:[email protected] for voice and video

    Username replaced by numbers for telephone applications

  • 8/10/2019 np160

    4/36

    np160Dennis Baron, January 15, 2008

    Page 4

    Wheres SIP

    Application

    Transport

    Network

    Physical/Data Link Ethernet

    IP

    TCP UDP

    RTSP SIP

    SDP codecs

    RTP DNS(SRV)

  • 8/10/2019 np160

    5/36

    np160Dennis Baron, January 15, 2008

    Page 5

    SIP Components

    User Agents

    ClientsMake requests

    ServersAccept requests

    Server types

    Redirect Server

    Proxy Server

    Registrar Server

    Location Server

    Gateways

  • 8/10/2019 np160

    6/36

    np160Dennis Baron, January 15, 2008

    Page 6

    SIP Trapezoid

    DNS

    Server

    Location

    Server

    Terminating

    User Agent

    Outbound

    Proxy

    Originating

    User Agent

    DNS

    SIP

    SIP

    SIP SIP

    RTP

    Registrar

    Inbound

    Proxy

    SIP

  • 8/10/2019 np160

    7/36

    np160Dennis Baron, January 15, 2008

    Page 7

    SIP Triangle ?

    DNS

    Server

    Location

    Server

    Terminating

    User Agent

    Originating

    User Agent

    DNS

    SIP

    SIP SIP

    RTP

    Registrar

    Inbound

    Proxy

    SIP

  • 8/10/2019 np160

    8/36

    np160Dennis Baron, January 15, 2008

    Page 8

    Terminating

    User Agent

    Originating

    User Agent RTP

    SIP SIP

    B2BUA

    SIP Peer to Peer !

    Back-to-Back User Agent

    Terminating

    User Agent

    Originating

    User Agent

    SIP

    RTP

  • 8/10/2019 np160

    9/36

    np160Dennis Baron, January 15, 2008

    Page 9

    SIP Methods

    INVITE Requests a session

    ACK Final response to the INVITE

    OPTIONS Ask for server capabilities

    CANCEL Cancels a pending request

    BYE Terminates a session

    REGISTER Sends users address to server

  • 8/10/2019 np160

    10/36

    np160Dennis Baron, January 15, 2008

    Page 10

    SIP Responses

    1XX Provisional 100 Trying

    2XX Successful 200 OK

    3XX Redirection 302 Moved Temporarily

    4XX Client Error 404 Not Found

    5XX Server Error 504 Server Time-out

    6XX Global Failure 603 Decline

  • 8/10/2019 np160

    11/36

    np160Dennis Baron, January 15, 2008

    Page 11

    SIP Flows - Basic

    ACK

    200 - OK

    INVITE: sip:18.10.0.79Calls

    18.18.2.4

    180 - Ringing Rings

    200 - OK Answers

    BYEHangs up

    RTPTalking Talking

    UserA

    UserB

  • 8/10/2019 np160

    12/36

    np160Dennis Baron, January 15, 2008

    Page 12

    SIP INVITE

    INVITE joeuser.mit.edu SIP/2.0

    From: "Dennis Baron";tag=1c41

    To: sip:joeuser.mit.edu

    Call-Id: [email protected]

    Cseq: 1 INVITE

    Contact: "Dennis Baron"

    Content-Type: application/sdp

    Content-Length: 304

    Accept-Language: en

    Allow: INVITE, ACK, CANCEL, BYE, REFER, OPTIONS, NOTIFY, REGISTER,

    SUBSCRIBE

    Supported: sip-cc, sip-cc-01, timer, replacesUser-Agent: Pingtel/2.1.11 (WinNT)

    Date: Thu, 30 Sep 2004 00:28:42 GMT

    Via: SIP/2.0/UDP 18.10.0.79

  • 8/10/2019 np160

    13/36

    np160Dennis Baron, January 15, 2008Page 13

    Session Description Protocol

    IETF RFC 2327

    SDP is intended for describing multimedia sessions for the

    purposes of session announcement, session invitation, and

    other 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)

  • 8/10/2019 np160

    14/36

    np160Dennis Baron, January 15, 2008Page 14

    SDP

    v=0

    o=Pingtel 5 5 IN IP4 18.10.0.79

    s=phone-call

    c=IN IP4 18.10.0.79

    t=0 0

    m=audio 8766 RTP/AVP 96 97 0 8 18 98

    a=rtpmap:96 eg711u/8000/1

    a=rtpmap:97 eg711a/8000/1

    a=rtpmap:0 pcmu/8000/1

    a=rtpmap:8 pcma/8000/1

    a=rtpmap:18 g729/8000/1

    a=fmtp:18 annexb=no

    a=rtpmap:98 telephone-event/8000/1

  • 8/10/2019 np160

    15/36

    np160Dennis Baron, January 15, 2008Page 15

    CODECs

    Audio G.711

    8kHz sampling rate

    64kbps

    G.729

    8kHz sampling rate

    8kbps

    Voice Activity Detection

    Video H.264

    MPEG-4

    H.263

  • 8/10/2019 np160

    16/36

    np160Dennis Baron, January 15, 2008Page 16

    SIP Flows - Registration

    200 - OK

    REGISTER: sip:[email protected]

    401 - Unauthorized

    UserB MIT.EDU

    Registrar

    REGISTER: (add credentials)

    MIT.EDU

    Location

    sip:[email protected]

    Contact 18.10.0.79

  • 8/10/2019 np160

    17/36

    np160Dennis Baron, January 15, 2008Page 17

    SIP REGISTERREGISTER sip:mit.edu SIP/2.0

    From: "Dennis Baron";tag=4561c4561To: "Dennis Baron";tag=324591026

    Call-Id: 9ce902bd23b070ae0108b225b94ac7fa

    Cseq: 5 REGISTER

    Contact: "Dennis Baron"

    Expires: 3600

    Date: Thu, 30 Sep 2004 00:46:53 GMTAccept-Language: en

    Supported: sip-cc, sip-cc-01, timer, replaces

    User-Agent: Pingtel/2.1.11 (WinNT)

    Content-Length: 0

    Via: SIP/2.0/UDP 18.10.0.79

  • 8/10/2019 np160

    18/36

    np160Dennis Baron, January 15, 2008Page 18

    SIP REGISTER401 ResponseSIP/2.0 401 Unauthorized

    From: "Dennis Baron";tag=4561c4561To: "Dennis Baron";tag=324591026

    Call-Id: 9ce902bd23b070ae0108b225b94ac7fa

    Cseq: 5 REGISTER

    Via: SIP/2.0/UDP 18.10.0.79

    Www-Authenticate: Digest realm="mit.edu",nonce="f83234924b8ae841b9b0ae8a92dcf0b71096505216", opaque="reg:change4"

    Date: Thu, 30 Sep 2004 00:46:56 GMT

    Allow: INVITE, ACK, CANCEL, BYE, REFER, OPTIONS, REGISTER, NOTIFY, SUBSCRIBE, INFO

    User-Agent: Pingtel/2.2.0 (Linux)

    Accept-Language: en

    Supported: sip-cc-01, timer

    Content-Length: 0

  • 8/10/2019 np160

    19/36

    np160Dennis Baron, January 15, 2008Page 19

    SIP REGISTER with CredentialsREGISTER sip:mit.edu SIP/2.0

    From: "Dennis Baron";tag=4561c4561To: "Dennis Baron";tag=324591026

    Call-Id: 9ce902bd23b070ae0108b225b94ac7fa

    Cseq: 6 REGISTER

    Contact: "Dennis Baron"

    Expires: 3600

    Date: Thu, 30 Sep 2004 00:46:53 GMTAccept-Language: en

    Supported: sip-cc, sip-cc-01, timer, replaces

    User-Agent: Pingtel/2.1.11 (WinNT)

    Content-Length: 0

    Authorization: DIGEST [email protected]", REALM="mit.edu",

    NONCE="f83234924b8ae841b9b0ae8a92dcf0b71096505216", URI="sip:mit.edu",RESPONSE="ae064221a50668eaad1ff2741fa8df7d", OPAQUE="reg:change4"

    Via: SIP/2.0/UDP 18.10.0.79

  • 8/10/2019 np160

    20/36

    np160Dennis Baron, January 15, 2008Page 20

    SIP FlowsVia Proxy

    INVITE: sip:[email protected] dbaron

    @MIT.EDUINVITE:sip:[email protected]

    100 - Trying

    180 - Ringing

    Rings180 - Ringing

    200 - OK Answers

    200 - OK

    ACK

    BYEHangs up

    200 - OK

    UserA

    UserBMIT.EDU

    Proxy

    Talking TalkingRTP

  • 8/10/2019 np160

    21/36

    np160Dennis Baron, January 15, 2008Page 21

    SIP FlowsVia Gateway

    INVITE: sip:[email protected] joeuser

    @MIT.EDUINVITE: sip:[email protected]

    100 - Trying

    ACK

    ACK

    UserA MIT.EDU

    Proxy

    38400Gateway

    180 - Ringing

    180 - Ringing

    Rings

    200 - OK

    200 - OK

    Answers

    BYEHangs up

    BYE

    200 - OK

    200 - OK

    Talking TalkingRTP

  • 8/10/2019 np160

    22/36

    np160Dennis Baron, January 15, 2008Page 22

    SIP INVITE with Record-RouteINVITE sip:[email protected] SIP/2.0

    Record-Route: From: \"Dennis Baron\";tag=2c41

    To: sip:[email protected]

    Call-Id: [email protected]

    Cseq: 1 INVITE

    Contact: \"Dennis Baron\"

    Content-Type: application/sdpContent-Length: 304

    Accept-Language: en

    Allow: INVITE, ACK, CANCEL, BYE, REFER, OPTIONS, NOTIFY, REGISTER, SUBSCRIBE

    Supported: sip-cc, sip-cc-01, timer, replaces

    User-Agent: Pingtel/2.1.11 (WinNT)

    Date: Thu, 30 Sep 2004 00:44:30 GMT

    Via: SIP/2.0/UDP 18.7.21.118:5080;branch=z9hG4bK2cf12c563cec06fd1849ff799d069cc0

    Via: SIP/2.0/UDP 18.7.21.118;branch=z9hG4bKd26e44dfdc2567170d9d32a143a7f4d8

    Via: SIP/2.0/UDP 18.10.0.79

    Max-Forwards: 17

  • 8/10/2019 np160

    23/36

    np160Dennis Baron, January 15, 2008Page 23

    SIP Standards

    Just a sampling of IETF standards work

    IETF RFCs http://ietf.org/rfc.html

    RFC3261 Core SIP specificationobsoletes RFC2543

    RFC2327 SDPSession Description Protocol RFC1889 RTP - Real-time Transport Protocol

    RFC2326 RTSP - Real-Time Streaming Protocol

    RFC3262 SIP PRACK methodreliability for 1XX messages

    RFC3263 Locating SIP serversSRV and NAPTR

    RFC3264 Offer/answer model for SDP use with SIP

    http://ietf.org/rfc.htmlhttp://ietf.org/rfc.html
  • 8/10/2019 np160

    24/36

    np160 Dennis Baron, January 15, 2008Page 24

    SIP Standards (cont.)

    RFC3265 SIP event notificationSUBSCRIBE and NOTIFY

    RFC3266 IPv6 support in SDP

    RFC3311 SIP UPDATE methodeg. changing media

    RFC3325 Asserted identity in trusted networks

    RFC3361 Locating outbound SIP proxy with DHCP

    RFC3428 SIP extensions for Instant Messaging

    RFC3515 SIP REFER methodeg. call transfer

    RFC4474 Authenticated Identity Management

    SIMPLE IM/Presence - http://ietf.org/ids.by.wg/simple.html

    http://ietf.org/ids.by.wg/simple.htmlhttp://ietf.org/ids.by.wg/simple.html
  • 8/10/2019 np160

    25/36

    np160 Dennis Baron, January 15, 2008Page 25

    IS&T Services

    MITvoip

    Desktop VoIP telephones to replace traditional 5ESS

    telephones

    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 support

  • 8/10/2019 np160

    26/36

    np160 Dennis Baron, January 15, 2008Page 26

    Hard phones

    Soft phones

    Soft and Hard SIP Clients

  • 8/10/2019 np160

    27/36

    np160 Dennis Baron, January 15, 2008Page 27

    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?

  • 8/10/2019 np160

    28/36

    np160 Dennis Baron, January 15, 2008Page 28

    IAP 2008 - VoIP Series

    SIP Fundimentals

    Dennis Baron

    Tue Jan 15, 01-02:30pm, 4-149

    Personal SIP Account Workshop

    Dennis BaronTue Jan 22, 01-02:30pm, 4-231

    Build, Test, and Deploy VoIP Applications with Asterisk

    and other Open-Source Applications

    Elliot EichenTue Jan 29, 01-02:30pm, 4-231

  • 8/10/2019 np160

    29/36

    np160

    Dennis Baron, January 15, 2008

    Page 29

    Questions?

  • 8/10/2019 np160

    30/36

    np160

    Dennis Baron, January 15, 2008

    Page 30

    Abstract

    Until the 1990s, if you wanted to make telephone hardware do your bidding

    you had to do it at the level of signal processing, EE, and physical-layer

    analog protocols. Now MIT and the rest of the world are switching to

    Voice-over-IP, based on RFC-documented protocols on the familiar IETF

    stack, and the opportunity is opening for software hackers to work their

    magic on the oldest extant medium in telecommunications. A SIPB project

    in the scripts tradition aiming to provide infrastructure for members of the

    MIT community to serve up their own innovations, is still in the early stages

    and welcoming new participants. This cluedump will give a technical

    grounding in the architecture of the protocols governing voice-over-IP and

    in their implementation at MIT.

  • 8/10/2019 np160

    31/36

    np160

    Dennis Baron, January 15, 2008

    Page 31

    Outline

    Whats changed

    What is SIP

    MIT VoIP services

    Questions and answers

  • 8/10/2019 np160

    32/36

    np160

    Dennis Baron, January 15, 2008

    Page 32

    Whats Changed

    We used to send data over phone callsremember

    modems?

    A number defined who you wereand whereyou were

    The Phone Company defined the servicesand we used

    what they wanted to sell us

    Intelligent networksdumb phones

  • 8/10/2019 np160

    33/36

    np160

    Dennis Baron, January 15, 2008

    Page 33

    Why SIP

    Core protocol used for VoIP

    Except Skype!

    Used by

    Vonage, AT&T, and other VoIP service providers

    Free service providerseg. Free World Dialup

    Second Life

    MIT

    Open peering

    SIP.edu

    ISN

  • 8/10/2019 np160

    34/36

    np160

    Dennis Baron, January 15, 2008

    Page 34

    Personal SIP Accounts in Detail

    Uses your MIT SIP communications identity

    One account per person

    Allows you to use your own hardware or software for placing

    and receiving Internet calls

    Assigns a traditional telephone number for receiving calls Web interface for customizing your account

    Experimental service aimed at early technology adopters

    Not intended as a replacement for other telephone services

    IS&T support limited to activating accounts and web page

    No support at this time for clients

  • 8/10/2019 np160

    35/36

    np160

    Dennis Baron, January 15, 2008

    Page 35

    Personal SIP Support Model

    Self service account activation

    https://voip.mit.edu/cgi-bin/personal/sipmgr/

    IS&T Documentation

    http://mit.edu/ist/topics/telecommunications/psip/

    SIP Users at MIT Wiki https://wikis.mit.edu/confluence/display/SIP/SIP+Users+at+MIT

    Your contributions to the wiki are supported and encouraged!

    SIP Users Forum

    https://scripts-cert.mit.edu/~sip/sip-users/

    Not currently activemay replace with newer technology

    http://mit.edu/ist/topics/telecommunications/psip/https://wikis.mit.edu/confluence/display/SIP/SIP+Users+at+MIThttps://scripts-cert.mit.edu/~sip/sip-users/https://scripts-cert.mit.edu/~sip/sip-users/https://scripts-cert.mit.edu/~sip/sip-users/https://scripts-cert.mit.edu/~sip/sip-users/https://scripts-cert.mit.edu/~sip/sip-users/https://scripts-cert.mit.edu/~sip/sip-users/https://wikis.mit.edu/confluence/display/SIP/SIP+Users+at+MIThttp://mit.edu/ist/topics/telecommunications/psip/
  • 8/10/2019 np160

    36/36

    160

    Dennis Baron, January 15, 2008

    Page 36

    Whats Changed

    Plenty of bandwidthbroadband to the home

    Voice (and video) are just another data stream

    Everybody can be anywhereits the Internet

    Get a phone number from anywhere (optional)

    Anybody can provide services

    If you dont like what theyre selling build your own

    Anything can be an Internet phone

    Your laptop, your mobile phone, your