25
SIP – The Key to VoIP 1/25 copyright © 2015 by schlager communications services GmbH SIP - The Key to VoIP ronaldschlager.com © Ronald Schlager

SIP - The Key to VoIP

Embed Size (px)

Citation preview

Page 1: SIP - The Key to VoIP

SIP – The Key to VoIP

1/25copyright © 2015 by schlager communications services GmbH

SIP - The Key to VoIP

ronaldschlager.com © Ronald Schlager

Page 2: SIP - The Key to VoIP

SIP – The Key to VoIP

2/25copyright © 2015 by schlager communications services GmbH

Overview

General

SIP Addresses

Message Elements

Transactions

Methods

Dialog

Use of DNS and Location Server

Page 3: SIP - The Key to VoIP

SIP – The Key to VoIP

3/25copyright © 2015 by schlager communications services GmbH

General

Design goals:

Distributed intelligence in different systems (end devices, servers, gateways,...)

Advantages:

CPU and memory consumtion in server are low

Reliability and scalability are high(no central device that may fail)

SIP protocol data units (PDU) use different routes than media streams

Page 4: SIP - The Key to VoIP

SIP – The Key to VoIP

4/25copyright © 2015 by schlager communications services GmbH

General

Runs over TLS (over TCP), TCP, UDP or SCTP: Selection of transport protocol is based on:

Indication in URI Selection by content in DNS record (NAPTR)

Following selection sequence has to be considered:

1. TLS over TCP („SIPS+D2T“)

2. TCP („SIP+D2T“)

3. UDP („SIP+D2U“)

4. SCTP („SIP+D2S“)Comment: D2x (x = T, U, S) names parts of DNS record entries

Page 5: SIP - The Key to VoIP

SIP – The Key to VoIP

5/25copyright © 2015 by schlager communications services GmbH

General

SIP solutions mostly use additional protocols:

Session Description Protocol (SDP)

To describe a session (by parameters)

See later

Stream Control Transmission Protocol (SCTP)

Reliable transport protocol similar to TCP

Originally developed for PSTN signalling over IP

Page 6: SIP - The Key to VoIP

SIP – The Key to VoIP

6/25copyright © 2015 by schlager communications services GmbH

General

Additional Protocols (cont.):

Real-time Transport Protocol (RTP) and Real-time Transport Control Protocol (RTCP)

To transport and to control media streams

Secure RTP and Secure RTCP

Encrypted transport of media streams

Domain Name Service (DNS), Dynamic Delegation Discovery System (DDDS)

For name resolution by means of links to lists of IP addresses

Page 7: SIP - The Key to VoIP

SIP – The Key to VoIP

7/25copyright © 2015 by schlager communications services GmbH

General

Additional Protocols (cont.):

Remote Authentication Dial In User Service (RADIUS)

For centralized authentification of users and devices

Lightweight Directory Access Protocol (LDAP)

Is directory service for centralized management of network and user objects

The coordination of all protocols allows the smooth operation of a SIP solution

Page 8: SIP - The Key to VoIP

SIP – The Key to VoIP

8/25copyright © 2015 by schlager communications services GmbH

SIP Addresses (URI)

Includes host address (is mandatory), optional user name, port number, different parameters

Can be used like web URL, with name resolution by Domain Name System (DNS)

Addressing concept very similar to

ITU-T E.164 calling numbers (tel:+432742319150)

Email addresses (mailto:...) or

HTTP URLs (http://...)

UA server registers address at Registrar (SIP REGISTER)

UA client uses address for session setup

Page 9: SIP - The Key to VoIP

SIP – The Key to VoIP

9/25copyright © 2015 by schlager communications services GmbH

SIP Addresses (URI)

Are globally defined (for global reachability)

General format scheme acc. RFC 3261:

sip:user:password@host:port;uri-parameters?headers

user:password: specific identification (user ID and password) of a user of a host

host: IPv4 or IPv6 address or (Fully Qualified) Domain Name

port: Port number where the request is to be sent

uri-parameters?headers: parameters affecting

a request constructed from the URI

Page 10: SIP - The Key to VoIP

SIP – The Key to VoIP

10/25copyright © 2015 by schlager communications services GmbH

SIP Addresses (URI)

Format Scheme acc. RFC 3986, Examples:

sip:[email protected] sip:[email protected]?

subject=call May also provide geo location information,

specifically interesting for e.g. emergency calls

<gml:coordinates>33.001111N 96.68142W</gml:coordinates>

Format scheme for secure signalling (lt. RFC 3261):

sips:[email protected] Requires Transport Layer Security (TLS) over TCP

for encrypted transport of SIP

Page 11: SIP - The Key to VoIP

SIP – The Key to VoIP

11/25copyright © 2015 by schlager communications services GmbH

SIP Addresses (URI)

2 Types of URI:

„Address of Record“ (AOR):

sip:[email protected] (requires SRV record in DNS server for address resolution to find SIP server in domain ronaldschlager.com)

„Fully Qualified Domain Name“ (FQDN) or „Contact“ (identifies a device within a domain)

sip:[email protected] or sip:[email protected] (unique server name)

No indication of a distinct server

Exact specification ofSIP server SIP1

Page 12: SIP - The Key to VoIP

SIP – The Key to VoIP

12/25copyright © 2015 by schlager communications services GmbH

Message Elements

Example for Message: INVITE sip:[email protected] SIP/2.0 Via: SIP/2.0/UDP SIP1.provider.at:5060;

branch=u4eF3o5g3Z9; Max-Forwards: 70 Contact: <sip:[email protected]> To: „Ronald“ <sip:[email protected]> From: „Peter“

<sip:[email protected];tag=3746528393 Call-ID: [email protected] Cseq: 1 INVITE Date: Wed, 30 April 2003 11:17:56 GMT Content-Type: application/sdp Content-Length: 132

Page 13: SIP - The Key to VoIP

SIP – The Key to VoIP

13/25copyright © 2015 by schlager communications services GmbH

Message Elements

Following information will be exchanged for each session:

Request line: “INVITE”: SIP method name or SIP request type (here: session setup request)

Request URI: sip:[email protected] Indicates the destination (called party)

“SIP/2.0”: SIP Version 2

“Via”: source or caller address (also: proxy address),optional port number where to send the responses

Additional “Via” lines may be inserted by each Proxy who wants to forward responses

Page 14: SIP - The Key to VoIP

SIP – The Key to VoIP

14/25copyright © 2015 by schlager communications services GmbH

Message Elements

Following information will be exchanged for each session (cont.):

“Max. Forwards”: limits the max. number of “hops” (Proxies), will be decremented (minus 1) by each forwarding Proxy (like “Time To Live” field in IP)

“Contact”: SIP or SIPS URI (as fully qualified domain name, FQDN)

Represents a direct route to a contact, use of an IP address allowed

Indicates where to send further requests

Exception: if Proxy indicates request to forward all messages (with “record route”)

Page 15: SIP - The Key to VoIP

SIP – The Key to VoIP

15/25copyright © 2015 by schlager communications services GmbH

Message Elements

Following information will be exchanged for each session (cont.):

“To”: display name (acc. RFC 2822) and SIP or SIPS URI of the original destination

“From”: display name and SIP or SIPS URI of the originator of the request

Tag parameter: is random string, used for identification purposes of end devices

“Call-ID”: globally unique identifier for this call, generated be combination of random number and IP address or hostname

Page 16: SIP - The Key to VoIP

SIP – The Key to VoIP

16/25copyright © 2015 by schlager communications services GmbH

Message Elements

Following information will be exchanged for each session (cont.):

“CSeq” (Command Sequence): integer and method name, is incremented for each new request and is a traditional sequence number, should prevent “replay”-attacks

“Content Type”: description of the message body (text, plain, application,...)

“Content Length”: octet count of the message body

Page 17: SIP - The Key to VoIP

SIP – The Key to VoIP

17/25copyright © 2015 by schlager communications services GmbH

Message Elements

Message body is separated from SIP header by CRLF

Message body may contain:

Description of media capabilities(Session Description Protocol)

Instant message (compare with ISDN User-to-User Signalling)

JPEG

MIME

Page 18: SIP - The Key to VoIP

SIP – The Key to VoIP

18/25copyright © 2015 by schlager communications services GmbH

Transactions

Basic principle:

A B

Provisional Response

RequestCreate Transaction Create

Transaction

Final ResponseDestroy

TransactionDestroy

Transaction

Page 19: SIP - The Key to VoIP

SIP – The Key to VoIP

19/25copyright © 2015 by schlager communications services GmbH

Transactions

Defined requests:

REGISTER Registrion at registrar

INVITE Initiates handshake

ACK Acknowledges sucessful handshake

BYE Terminates session

CANCEL Cancels previous, not closed request

Queries capabilities of peersOPTIONS

Page 20: SIP - The Key to VoIP

SIP – The Key to VoIP

20/25copyright © 2015 by schlager communications services GmbH

Transactions

Defined Message Codes (Response Classes): Codes „based“ on HTTP („xyz explanation“) Receiver must understand „x“

Provisional Status Code (100-199)

Final

Successful (200-299)

Redirection (300-399)

Request Failure (400-499)

Server Failure (500-599)

Global Failures (600-699)

Page 21: SIP - The Key to VoIP

SIP – The Key to VoIP

21/25copyright © 2015 by schlager communications services GmbH

Methods

Invite: invitation for session establishment with a UA

Invite re-invite: modifying an existing session

Register: registering a location to the registrar server

Ack: to confirm a request

Cancel: to cancel an invite

Bye: to terminate a session

Options: to request supported functions and features of partners without the need for session setup

Page 22: SIP - The Key to VoIP

SIP – The Key to VoIP

22/25copyright © 2015 by schlager communications services GmbH

Method Extensions (Examples)

Info: used for exchange of control information for a session (e.g. in ISDN signalling to control a set of telephony services)

Update: allows a client to modify session parameters, e.g. new codecs, stream formats,...)

Message: used for instant messaging beween clients

Refer: originator of a refer will be informed about availability of requested resources (devices, functions,...)

Prack: provisional acknowledgement, similar to ACK, passes proxys and is controlled by them

Message Waiting Indication

Page 23: SIP - The Key to VoIP

SIP – The Key to VoIP

23/25copyright © 2015 by schlager communications services GmbH

A B

Dialog

A BCreateDialog Create

DialogCreate

DestroyDialogDestroy

DialogDestroy

Update Update/ModifyDialog

Update/ModifyDialog

Update Update/ModifyDialog

Update/ModifyDialog

Page 24: SIP - The Key to VoIP

SIP – The Key to VoIP

24/25copyright © 2015 by schlager communications services GmbH

Use of DNS and Location Server

Location ServerDNS Server

Inboand Proxy Server Outboand Proxy Server

IP phoneUser A (Caller)

IP phoneUser B (Called)

SIP SIPSIP

Media stream

DNS ?