0% found this document useful (0 votes)
288 views174 pages

SIP and VoIP Protocols Overview

The document discusses Session Initiation Protocol (SIP) and Voice over IP (VoIP). It provides an overview of SIP components and operations, including registration with a location service, basic call flows using SIP signaling, transport protocols used with SIP and RTP, and purposes of RTCP. Interactive polls are included to quiz the reader on topics covered.

Uploaded by

Arad Reza
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
288 views174 pages

SIP and VoIP Protocols Overview

The document discusses Session Initiation Protocol (SIP) and Voice over IP (VoIP). It provides an overview of SIP components and operations, including registration with a location service, basic call flows using SIP signaling, transport protocols used with SIP and RTP, and purposes of RTCP. Interactive polls are included to quiz the reader on topics covered.

Uploaded by

Arad Reza
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Page 1

SIP Advanced
Page 2
Pressing Buttons Is Fun!

http://apis-ms.participoll.com/
Page 3
Answer on the Poll!
Apis-ms.participoll.com

Are you a good driver?

A. Yes, a lot better than the average

B. Slightly above the average

C. About average

D. Slightly below average

E. I suck at driving

F. I don’t have a driver’s license

A B C D E F 0
Page 4
Answer on the Poll!
Apis-ms.participoll.com

How well do you know SIP?

A. I have worked with it for years!

B. I see it regularly

C. I have seen it a few times

D. I have heard of it

E. This is basically the first I hear about it!


50% 50%

(2) (2)

A B C D E 4
Page 5

What VoIP Really Does


Page 6
VoIP One-domain solution

1.1.1.1 2.2.2.2
Page 7
VoIP One-domain solution
Applications
TCP UDP
IP
L2 / L1

Alice1.1.1.1
Bob  2.2.2.2
Alice one.com
Bob

1.1.1.1 2.2.2.2

IP address
Port number
Codec information
Page 8
VoIP Multi-domain solution

Standardised protocol needed!


E.g: SIP, H.323

Alice  1.1.1.1 Bob  2.2.2.2


[email protected]
alice aye.net bee.net
[email protected]
bob

1.1.1.1 2.2.2.2

IP address
Port number
Codec information
Page 9
The Actual Audio Packet

10 ms voice in every packet


Voice data
80 bytes

Voice G.711

RTP-header
min 12 bytes

RTP Voice G.711

UDP-
header
8 bytes

U RTP Voice G.711


IP-header
20 bytes

IP U RTP Voice G.711


ETH- ETH-
header trailer
14 bytes 4 bytes

ETH IP U RTP Voice G.711


14 20 8 12 80 4
Page 10
Answer on the Poll!
Apis-ms.participoll.com

Which transport protocol is usually used


with RTP?

A. TCP

B. UDP

C. SCTP

D. RTCP

A B C D 0
Page 11
Answer on the Poll!
Apis-ms.participoll.com

What is the purpose of RTCP?

A. To control session setup

B. To carry media packets

C. To give information about the RTP link quality

D. To enforce policies, e.g. billing

A B C D 0
Page 12
Answer on the Poll!
Apis-ms.participoll.com

Which transport protocol is usually used


with SIP?

A. TCP

B. UDP

C. SCTP

D. All of the above

A B C D 0
Page 13

The Beginning of SIP


Page 14
The Internet Engineering Task Force
- IETF

Creating standards applying to the internet to


improve internet usability
Page 15
The Birth of SIP

• We only had SAP


– Couldn’t Invite!
• Early 1990
– INRIA Videoconferencing system
– Real-time Transport Protocol
• Initial IETF draft proposals
– SIPv1 (M.Handly, E.Schooler)
• Session Invitation Protocol
– SCIP (H. Schulzrinne) Protocol!
• Simple Conference Invitation Protocol
• December –99
– RFC2543, Session Initiation Protocol
is released
– Proposed Standard
• June 2002
– 3261 (SIP Itself)
– 3262 (PRACK, Reliability)
– 3263 (DNS, Locating Servers)
– 3264 (SDP Usage)
– 3265 (Events)
Page 16
Answer on the Poll!
Apis-ms.participoll.com

What does the C in RFC stand for?

A. Code

B. Comment

C. Configuration

D. Change

A B C D 0
Page 17
SIP - Components

Location
Service

DNS

Proxy Proxy Registrar

Dialog
Session
UAC UAS
Page 18
Registration to a Location Service

 What is our current IP-address?


◦ We must register with the network
LS
Bob = 10.1.2.4

Bob
I´m Bob’s phone and I am located at IP address 10.1.2.4

Hi, Bob’s phone. Now I know that you are at IP address 10.1.2.4

10.1.2.4
SIP Registrar
Page 19
SIP Basic Call
telenor.com=1.1.1.1
telia.com=2.2.2.2

Location
Location Service
Service DNS
Where is Where is bob?
bob=1.2.3.4
telia.com?
alice=5.6.7.8
2.2.2.2!

SIP
”REGISTRATION”
SIP
Proxy Proxy
IP: 1.1.1.1 SIP IP:2.2.2.2
Signalling
telenor.com telia.com
Calling ”[email protected]
Bob Hanging up
sip:[email protected] sip:[email protected]
IP: 5.6.7.8 IP: 1.2.3.4
Media (e.g. Audio/Video)

This This can


doesn’t change
change overnight
Page 20
Answer on the Poll!
Apis-ms.participoll.com

What does a “VoIP session” usually mean?

A. VoIP media (RTP)

B. VoIP signalling (SIP)

C. VoIP signalling & media (SIP + RTP)

D. A series of phone calls

A B C D 0
Page 21
SIP Requests and Responses
Location
Service

SIP
Registrar
SIP SIP
Proxy Proxy

200 OK

REGISTER
200 OK

INVITE
ACK

Media (e.g. Audio/Video)


BYE
200 OK
Page 22
SIP Requests

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)

• Several others
Page 23
ACK requests

Alice Bob
• ACK – A three way handshake INVITE

• ACK is sent on a final response 180 Ringing


only (2xx-6xx)

• Only INVITE responses are ACKed 200 OK

ACK

Conversation
Page 24
SIP Response Codes

 Basic Methods
◦ INVITE UAC Proxy Proxy UAS
◦ ACK INVITE
INVITE
◦ BYE
INVITE
◦ OPTIONS
◦ REGISTER
◦ CANCEL 180 Ringing
180 Ringing
 Response Codes 180 Ringing
◦ 1xx, Provisional
200 OK
◦ 2xx, Success 200 OK
200 OK
◦ 3xx, Redirect
◦ 4xx, Client mistake ACK
◦ 5xx, Server Failure
◦ 6xx, Global Failure
Page 25
Transactions

• A transaction defines a particular


operation that is carried out between
the endpoints

• Includes all responses until final UAC UAS


response BYE

200 OK
• May be several transactions within a
dialog
Page 26
Dialog and Transactions

UAC UAS
INVITE
One request
100 Trying
Transaction
Any number of provisional
180 Ringing responses

200 OK
One final response
Dialog ACK
-Call-ID

Exchange
Transaction

BYE

200 OK
Page 27
The Inheritance

 Example of email (with MIME) and HTTP

Received: from smtp2.home.se [195.66.35.201] GET /images/blue-line.jpg HTTP/1.1


by moby.myownemail.com with ESMTP Accept: */*
Tue, 27 Mar 2001 09:23:12 -0600 Referer: http://www.ietf.org/
Received: from raistlin [212.112.190.154] by smtp1.home.se
Accept-Language: sv
with Novonyx SMTP Server $Revision:2.74 $;
Tue, 27 Mar 2001 17:18:43 +0100 (ECTD) Accept-Encoding: gzip, deflate
From: "Taisto Qvist" <[email protected]> User-Agent: Mozilla/4.0 (compatible; MSIE 5.5;)
Organization: IP Solutions AB Host: www.ietf.org
To: [email protected] Connection: Keep-Alive
Date: Tue, 27 Mar 2001 17:25:57 +0200
MIME-Version: 1.0
HTTP/1.1 200 OK
Content-type: text/plain; charset=ISO-8859-1
Content-transfer-encoding: 8BIT Date: Tue, 27 Mar 2001 15:14:58 GMT
Subject: Example of rfc822 formatting Server: Apache/1.3.11 (Unix)
Return-receipt-to: "Taisto Qvist" <[email protected]> Last-Modified: Mon, 22 Jan 2001 22:39:01 GMT
Priority: normal Accept-Ranges: bytes
Message-Id: <[email protected]> Content-Length: 3154
Resent-From: <[email protected]>
Keep-Alive: timeout=15, max=100
Resent-Date: Tue, 27 Mar 101 09:23:14 CST
Resent-To: [email protected] Connection: Keep-Alive
Content-Type: image/jpeg
Short email, showing the mail headers in an rfc822 email
message. <DATA>
Page 28
SIP Addressing

 SIP URI = SIP address


◦ sip:[email protected]
◦ sip:[email protected]
Page 29
SIP Addresses and URI

Request-URI
o INVITE <sip:[email protected]> PSTN

o OPTIONS <sip:[email protected]>
Address-of-Record
o To: Paul <sip:[email protected]>
o From: Isac <sip:[email protected]>
SIP-URI
o sip:100.1.2.3
o sip:[email protected];transport=tcp
o sip:[email protected]?subject=SipCourse
o sip:ip-s.se;method=REGISTER?to=taisto%40ip-s.se IP
o sip:[email protected];user=phone
o sips:[email protected]
o sip:user:password@host:port;uri-parameters?headers
Page 30
Answer on the Poll!
Apis-ms.participoll.com

Which of these is NOT a valid SIP URI?

A. sip:10.0.120.15

B. sip:[email protected];user=phone

C. [email protected]

D. sip:[email protected]
h46h.bw446y466y567bjvbj5bw75bj5wv5.sl 60%
(3)

20% 20%
(1) (1)

A B C D 5
Page 31
Simplified SIP Message Syntax

Request-URI
“METHOD” In a Request In a response

INVITE sip:[email protected]
SIP/2.0 200 OK
SIP/2.0

Via: SIP/2.0/UDP workstation1000.aye.net


From: sip:[email protected]
To: sip:[email protected]
6
Call-ID: [email protected]
Mandatory
CSeq: 42 INVITE
headers
Max-Forwards: 70

SDP
Page 32
Message Headers
Request-Line and Status-Line

INVITE sip:[email protected] SIP/2.0

All requests contains a request-line that


consists of:
- Method name
- Request URI, that is the routing information.
Where are we heading?
- SIP-version

SIP/2.0 200 OK

All responses contains a status-line that


consists of:
- SIP-version
- Status-Code
- Reason-Phrase
Page 33
Message headers - Via:

Via: headers are used to route


responses and each hop adds itself
in a Via: header in the Request

Proxy Request
Alice Request Via: Proxy Bob
Via: Alice Via: Alice

Response
Via: Alice Response
Via: Proxy
Via: Alice

The Via: headers are copied in to the


response and the response is sent to the
top most Via: header. Each hop pops its
own Via: header
Page 34
Message headers - To: and From: headers

From: “Alice” <sip:[email protected]>


To: “Bob” <sip:[email protected]>

The To: and From: headers have the same syntax that consists of
- Display name (optional)
- URI that identifies the caller in the From: header
- URI that identifies the callee in the To: header
Page 35
Message Headers: Call-ID

Globally unique identifier for each Call

Alice Bob
Call-ID: X

Alice Charlie
Call-ID: Y
Page 36
Message headers - CSeq:

Command Sequence
- Sequence number for requests
- Contains a CSeq number and CSeq method
eg. CSeq: 1 INVITE

Alice Bob

1st request to Bob, CSeq: 1 method

2nd request to Bob, CSeq: 2 method

1st request to Alice, CSeq: 1 method


Page 37
Message headers-
Max-Forwards:

• Max-Forwards:
INVITE
– Starts at 70 INVITE
MaxF:70 INVITE
– Reduce by one for each proxy MaxF: 69
MaxF: 0
• Via header checking 483 Too Many Hops
483
– Each hop MUST add its own via 483
on top of the previous.
– If it does it might be a loop!
Page 38
Basic Call Handling
[email protected]
192.1.2.3

 User Agent (Client)


Local
◦ Sends INVITE to local proxy Proxy bee.net Location
UAC Proxy Service UAS
◦ sip:[email protected]
INVITE DNS
 Local SIP Proxy
◦ DNS lookup for destination, and Lookup

proxies the request


INVITE
 Remote SIP Proxy bob?

◦ Location service lookup


[email protected]
◦ Proxy request to destination
 Remote User Agent (Server) INVITE [email protected]
◦ Receives INVITE
◦ answers with 200 OK 200 OK
200 OK
200 OK
 User Agent Client
◦ Completes negotiation with ACK ACK
Page 39
Basic Call Handling - Redirect

Location Service SIP Proxy Location Service


SIP Proxy
@lab2.sip @lab2.sip @home.se @home.se UAS
UAC

INVITE Bob?

[email protected]!

302 Moved tmp

ACK

INVITE [email protected] bob ?


[email protected]

INVITE [email protected]

200 OK
200 OK

ACK
Page 40
Answer on the Poll!
Apis-ms.participoll.com

What is the purpose of the Max-Forwards


header?

A. To ensure user ID integrity

B. To enable call forwarding

C. To prevent signalling loops

D. To retransmit lost packets

67%
(4)

33%
(2)

A B C D 6
Page 41
The Invite Dialog
Caller Callee

INVITE
• Call–ID
• From–tag
• Record–Route

Start of (Confirmed) Dialog 200 OK


• Call–ID
• From–tag
• To–tag
• Record–Route

ACK
• Route

MESSAGE/200 OK
In–Dialog • Route
Requests
Re–INVITE/200 OK/ACK
• Route

UPDATE/200 OK
• Route

BYE
• Route

End of Dialog 200 OK


Page 42
Dialog Creation – Early and Established

INVITE

100 Trying

181 Call is being forwarded

Early Dialog
180 Ringing

200 OK

Confirmed Dialog
Page 43
Answer on the Poll!
Apis-ms.participoll.com

When is a SIP dialog confirmed?

A. After the first 100 Trying

B. After the first 183 Session Progress

C. After the first 180 Ringing

D. After the first 200 OK

A B C D 0
Page 44

Adressing and Registration


Page 45
Registration

 What is our current IP-address?


◦ Calls are addressed to the logical sip-address: [email protected]
◦ We must register with the network

REGISTER sip:lab2.sip SIP/2.0


Via: SIP/2.0/UDP 10.1.2.3:5060
From: Bob <sip:[email protected]>;tag=9832198 REGISTER
To: Bob <sip:[email protected]>
Max-Forward: 70
Call-ID: [email protected] SIP Registrar
CSeq: 1 REGISTER
10.1.2.4 Contact: <sip:[email protected]>
Expires: 7200
Content-Length: 0
SIP/2.0 200 OK
Via: SIP/2.0/UDP 10.1.2.3:5060
From: Bob <sip:[email protected]>;tag=9832198
To: Bob <sip:[email protected]>;tag=29139218
Call-ID: [email protected]
CSeq: 1 REGISTER
Contact: <sip:[email protected]>;expires=7200
Content-Length: 0

If ”Expires: 0”, then the user is de-registered


Page 46
Multiple Registrations

 Available at multiple UAs


◦ Register multiple contacts!
 Where do we call first?
◦ Highest q-value
REGISTER sip:lab1.sip SIP/2.0
Via: SIP/2.0/UDP pc12.lab1.sip:5060
From: Alice <sip:[email protected]> ;tag=X
To: Alice <sip:[email protected]>
Call-ID: [email protected]
CSeq: 1 REGISTER
Contact: <sip:[email protected]> ;expires=7200 ;q=0.7
Contact: <sip:[email protected]> ;expires=86400 ;q=1.0
Expire: <time in seconds>
Content-Length: 0

SIP/2.0 200 OK
Via: SIP/2.0/UDP pc12.lab1.sip:5060
From: Alice <sip:[email protected]>;tag=X
To: Alice <sip:[email protected]>;tag=Y
Call-ID: [email protected]
CSeq: 1 REGISTER
Contact: <sip:[email protected]> ;expires=86400 ;q=1.0
Contact: <sip:[email protected]> ;expires=7200 ;q=0.7
Content-Length: 0
Page 47
Answer on the Poll!
Apis-ms.participoll.com

Which two headers are the most


important in a REGISTER, carrying the
public ID and the contact address?

A. To and From

B. Request-URI and Contact

C. From and Address

D. Contact and To

A B C D 0
Page 48

Message Forwarding
Page 49
Reaching the Destination

Location
DNS Service
Policy Routing

Policy Routing

INVITE [email protected] INVITE [email protected] INVITE [email protected]

INVITE [email protected]

INVITE sip:11.12.13.14

zee.com
Page 50
DNS searching

• How should proxies use DNS?


- RFC 3263 has all the details
• DNS Records for SIP Servers $ORIGIN ip-solutions.se
_sip._udp SRV 0 3 5060 bigserver. ip-s.se
- SRV (RFC 2782) SRV 0 1 5060 smallserver.ip-s.se
- NAPTR (RFC 2915) _sip._tcp SRV 0 3 5060 bigserver.ip-s.se
SRV 0 1 5060 smallserver.ip-s.se
bigserver A 172.30.79.11
smallserver A 172.30.79.13
sip A 172.30.79.11

DNS
smallserver.ip-s.se

Proxy.caller.se
Bigserver.ip-s.se
Page 51
Selecting Transport Protocol

• Which transport protocol?


- NAPTR will give us the transport protocol preferences
of the destination domain

; order pref flags service regexp replacement


ip-solutions.se IN NAPTR 50 50 "s” "SIPS+D2T” "" _sips._tcp.ips.com.
ip-solutions.se IN NAPTR 90 50 "s” "SIP+D2T” ”" _sip._tcp.ips.com
ip-solutions.se IN NAPTR 100 50 ”s” "SIP+D2U” “” _sip._udp.ips.com.
Page 52
Step One - Selecting Transport Protocol

yes**
MUST use
reliable proto size > 1300?

Retry with UDP no


(rfc2543 compliance)
sip: <uri;transport=tcp>
fail?
yes SHOULD
;transport-param?
use <proto>

Only use TCP or SCTP* no


sip: 10.1.2.3:<maybe>
(+ additional rules)

yes sip:  UDP


IP-Addr in URI?
sips:  TCP

yes Tcp, Udp, Sctp no


sip: sip.lab1.sip:5062

yes, SHOULD sip:  UDP


<PortNr> in URI?
sips? sips:  TCP
no

No NAPTR lookup!

no
Follow NAPTR data Example address
sip: sip.lab1.sip
Page 53
Step Two - Selecting IP Address

sip: sip.lab1.sip:<maybe>
IP-Address in URI
no yes

sip: sip.lab1.sip
PortNr in URI?
no
yes

yes sip: sip.lab1.sip:5064


Did we do NAPTR* in (1)

Get AAAA or A
sip: 10.1.2.3:<maybe>
no for <host>

Use that IP
Get SRV for
;transport=<proto>
Use IP:Port

NAPTR result
sip: 10.1.2.3: 5064
name:port x n PortNr in URI?
yes
no
sip:
sip.lab1.sip;transport=<proto>
sip: <10.1.2.3>

Get SRV for chosen


protocol in NAPTR

Get A or AAAA for Use Default Port


SRV result (5060, 5061)
Page 54
SIP Transport Issues

• Which protocol do we use?


– Each hop can use a different protocol

A B

INVITE
UDP INVITE
TLS INVITE
TCP

200 OK
200 OK
200 OK TCP
TLS
UDP

INVITE
TCP

BYE
UDP
200 OK
UDP
Page 55
The Via Header – Sent-By

INVITE
INVITE
Via: Pc12 INVITE
Via: Proxy1 INVITE
Via: Pc12 Via: Proxy2
Via: Proxy1 Via: Proxy3
Via: Pc12 Via: Proxy2
Via: Proxy1
Via: Pc12

200 OK
200 OK 200 OK
200 OK Via: Proxy3
Via: Proxy2 Via: Proxy2
Via: Proxy1
Via: Pc12 Via: Proxy1 Via: Proxy1
Via: Pc12
Via: Pc12 Via: Pc12
Page 56
The Via header – ;received
Good for NAT traversal
Proxy1 Proxy3
Proxy2

INVITE
Via: 10.2.1.19:5060 INVITE
Via: Proxy1 INVITE
Via: 10.2.1.19:5060 Via: Proxy2 INVITE
Via: Proxy1;recv=IP1 Via: Proxy3
Via: 10.2.1.19:5060 Via: Proxy2; recv=IP2
Via: Proxy1;recv=IP1
Via: 10.2.1.19:5060
Page 57
Answer on the Poll!
Apis-ms.participoll.com

Which is NOT a method to determine


transport protocol for SIP?

A. Call-ID

B. DNS

C. Packet size

D. URI parameters

A B C D 0
Page 58
Simple Loop Detection

INVITE
INVITE
MaxF:70 INVITE
MaxF: 69
MaxF: 0
483 Too Many Hops
483
483
Page 59
Special Loops

INVITE bob INVITE bob

INVITE carol

INVITE carol
INVITE carol

INVITE bob
INVITE bob1
INVITE bob1
.........
INVITE bob2
INVITE bob2

482 Loop
482 Loop

.........
Page 60
Forcing traffic a certain way

Proxy1.lab1.sip Log-server Sip Fw

INVITE bob
Route: Proxy1 INVITE bob
INVITE bob
Route: log.lab1.sip, INVITE bob
sipfw.lab1.sip Route: sipfw.lab1.sip

200 OK
200 OK
200 OK
200 OK
Page 61
Recording PATHs

fw.lab2.sip fw.lab1 lab1.sip

[email protected]

REGISTER
Contact: IP:Port REGISTER
REGISTER lab1.sip
Contact: IP:Port
Path: lab2.sip;lr Contact: IP:Port
Path: <fw.lab1;lr>
Path: <lab2.sip;lr>

INVITE sip:IP:Port INVITE

200 OK
200 OK
200 OK Path: <fw.lab1;lr>
Path: <fw.lab1;lr> Path: <lab2.sip;lr>
Path: <fw.lab1;lr> Path: <lab2.sip;lr>
Path: <lab2.sip;lr>
INVITE
INVITE sip:IP:Port
INVITE
Route: <fw.lab1;lr>
INVITE Route: <lab2.sip;lr> Route: <lab2.sip;lr>
Page 62
Forced Routing: Recording Routes

UAC-A PA PB UAS-B

• Record-Route:
INVITE INVITE INVITE
Record-Route: Record-Route:
<PA;lr> <PB;lr>,<PA;lr>
• Route:
200 OK 200 OK 200 OK
Record-Route: Record-Route: Record-Route:
<PB;lr>,<PA;lr> <PB;lr>,<PA;lr> <PB;lr>,<PA;lr>

ACK ACK ACK


Route: Route:<PB;lr>
<PA;lr>,<PB;lr>

BYE BYE BYE


Route:<PA;lr> Route:
<PB;lr>,<PA;lr>
Page 63
Recording Routes – Strict or Loose

ACK sip:[email protected] SIP/2.0


Via: SIP/2.0/UDP alicepc.lab1.sip:5060;
branch=z9hG4bK87
From: sip:[email protected];tag=55a66b
To: sip:[email protected]
Call-ID: [email protected]
Route: <sip:pa.carrier.se;lr>,<sip:pb.carrier.se;lr>
CSeq: 1 ACK

Loose Routing, according to RFC 3261


(Request-URI points to destination-UAS)

ACK sip:pa.carrier.se
Via: SIP/2.0/UDP alicepc.lab1.sip:5060; branch=z9hG4bK87
From: sip:[email protected];tag=55a66b
To: sip:[email protected]
Call-ID: [email protected]
Route: <sip:pb.carrier.se>, <sip:[email protected]>
CSeq: 1 ACK

Strict Routing, according to RFC 2543.


(Note: Destination UAS is in end of the Route:-list)
Page 64
Answer on the Poll!
Apis-ms.participoll.com

Which of these SIP messages is more


likely to contain a “Record-Route”
header?

A. REGISTER

B. BYE

C. CANCEL

D. INVITE
100%

(5)

A B C D 5
Page 65

Session Management
Page 66
Session setup - SDP Usage

Caller SIP server network Callee

INVITE (with SDP)

180 Ringing

200 OK (with SDP)

ACK

Audio Exchange
Page 67
Session setup - SDP Usage

Caller SIP server network Callee

INVITE ()

180 Ringing

200 OK (with SDP)

ACK (with SDP)

Audio Exchange
Page 68
An Offer/Answer Model with the SDP

Initial SDP #1 “The Offer”

SDP #2, “The Answer”

SDP #3, “Offer a=sendonly”

SDP #4 “Answer a=recvonly”

SDP #5 “Offer a=sendrecv”

SDP #6, “Answer a=sendrecv”


Page 69
Modifying the session

Caller SIP server network Callee

INVITE

200 OK

ACK

Media Exchange

INVITE (Updated SDP)

200 OK (Updated SDP)

ACK

Renegotiated media exchange

INVITE (Updated SDP)


488 Not Acceptable
ACK
Page 70
More in detail
UAS UAC

SIP/2.0 200 OK
Via: SIP/2.0/UDP proxy12.lab2.sip
UACUAS ;branch=z9hG4bKnashds8;received=192.0.2.3
Via: SIP/2.0/UDP proxy42.sip.lab1.sip
INVITE sip:[email protected] SIP/2.0
;branch=z9hG4bK77ef4c2312983.1;received=192.0.2.2
Via: SIP/2.0/UDP pc33.lab1.sip;branch=z9hG4bKabcde
Via: SIP/2.0/UDP pc33.lab1.sip
Max-Forwards: 70
;branch=z9hG4bKabcde ;received=128.3.4.5
From: Alice <sip:[email protected]>;tag=1921111774
From: Alice <sip:[email protected]>;tag=1921111774
To: Bob <sip:[email protected]>
To: Bob <sip:[email protected]>;tag=a6c85cf
Call-ID: [email protected]
CSeq: 314159 INVITE Call-ID: [email protected]
Contact: <sip:[email protected]> CSeq: 314159 INVITE
Content-Type: application/sdp Contact: <sip:[email protected]>
Content-Length: 142 Content-Type: application/sdp
Content-Length: 131

v=0 v=0
o=alice 53655765 2353687637 IN IP4 128.3.4.5 o=bob 4858949 4858949 IN IP4 192.1.2.3
c=IN IP4 128.3.4.5 c=IN IP4 192.1.2.3
m=audio 3456 RTP/AVP 0 3 4 5 m=audio 5004 RTP/AVP 0 3

ACK sip:[email protected] SIP/2.0


Via: SIP/2.0/UDP pc33.lab1.sip;branch=z9hG4bKedcba
From: Alice <sip:[email protected]>;tag=1921111774
To: Bob <sip:[email protected]>;tag=a6c85cf The ACK is sent DIRECTLY to the UAS!
Call-ID: [email protected]
CSeq: 314159 ACK
Max-Forwards: 70
Page 71
Answer on the Poll!
Apis-ms.participoll.com

Which of these messages can NOT carry


SDP?

A. 200 OK

B. ACK

C. 100 Trying

D. 180 Ringing

E. 183 Session Progress


60%

(3)

20% 20%

(1) (1)

A B C D E 5
Page 72
Session Description Protocol

• Session Description
Terve? Guten tag?
How should we communicate?
Negotiates/describes media sessions

• Information Exchanged:
IP Address
Media information
Etc.

• Needs a transport protocol


SAP
RTSP
SIP
H.248
Etc.
Page 73
SIP and SDP Attachment
Location
Service

DNS

Proxy Proxy Registrar


SDP SIP

Dialog
Session
UAC UAS
Page 74
Session Description Protocol

• Generic Info
- Title
SDP “Text file”
- Contact info, and similar
• Type of Media
- Audio, Video, Data v=0
o=
Session Description
• Transport protocol
c=IN IP4 1.1.1.1

- RTP
- H.320/3 t=
r= Timing Description
- ATM
• Media Format m=audio
Media Description
- mpeg, gsm, anything
• Transport addresses m=video
- Multi/Unicast, Ports Media Description
• Start and stop times
- Reoccurring sessions m=application
c=IN IP4 1.1.1.2
Media Description
Page 75
Session Description Protocol

v=0
o=mhandley 2890844526 2890842807 IN IP4 212.112.175.4
s=SDP Seminar
i=A Seminar on the session description protocol
t=2873397496 2873404696
r=7d 1h 0 25h
u=http://www.cs.ucl.ac.uk/staff/M.Handley/sdp.03.ps
[email protected] (John Doe)
p=+46-8-244266
c=IN IP4 239.1.1.24/15
m=audio 49170 RTP/AVP 0
m=video 51372 RTP/AVP 31
Page 76
Session Description Protocol

• Example phone session


– m= -line contains multiple codec numbers
– Multiple choices, remove those you dont want
• Extending SDP v=0
o=John 2890844526 2890842807 IN IP4 212.112.175.4
– (a)ttribute lines
s=Standard Phonecall
– Adds an attribute to the entire session or just the
previous media line
[email protected] (John Doe)
p=+46-8-244266
– a=rtpmap
c=IN IP4 212.112.175.4
– Mapping dynamic payloads to actual codecs
m=audio 12346 RTP/AVP 0 8 96 97 98
– a=foo:bar a=rtpmap:96 L8/8000
– Any unknown attribute is just ignored a=rtpmap:97 L16/8000
– a= sendonly, recvonly, sendrecv a=rtpmap:98 X-GSMLPC/8000
– Directional streams a=foo:bar
– Call-hold, streaming media m=application 32416 udp wb
– a=ptime a=orient:portrait
– Packetization time, milliseconds of samples in packet
– a=fmtp
– Media format specific parameters.
Page 77
SDP – Offer / Answer Model

Alice wants to communicate with Bob and sends an SDP


offer including her desired media


m=audio 12346 RTP/AVP 0 8 96
a=rtpmap:96 AMR

Alice Bob
a=fmtp:96 mode-set=0,2,5,7
m=video 9006 RTP/AVP 97 98
a=rtpmap:97 H263
a=fmtp:97 profile-level-id=0
a=rtpmap:98 MP4V-ES

Bob returns the answer that will be the valid SDP for this media session.
• In his answer Bob may remove codecs he does not like or support.
• He is not allowed to remove “m=“ lines, but he may set the media port to “0”
for media lines he does not like or support.

m=audio 22446 RTP/AVP 96
a=rtpmap:96 AMR
a=fmtp:96 mode-set=0,2,5,7
m=video 0 RTP/AVP 97 98
a=rtpmap:97 H263
a=fmtp:97 profile-level-id=0
a=rtpmap:98 MP4V-ES
Page 78
Answer on the Poll!
Apis-ms.participoll.com

What does the attribute “rtpmap” mean?

A. It helps out identifying codecs

B. It activates RTP as transport protocol

C. It indicates which IP and port to use for RTP

D. It connects a SIP dialog with an RTP media session

A B C D 0
Page 79

State Handling
Page 80
Stateful or Stateless
Stateless Proxy

INVITE
Lost
INVITE
Lost
T1x64
INVITE
Lost

Give up!

Stateful Proxy

INVITE
Lost
500ms 100 Trying

Lost
T1x64
Lost

408 Timeout
Give up!
ACK
Page 81
Dialogs and Transactions

• SIP Dialog
– A “session” established by a INVITE- From: Alice <sip:[email protected]>;tag=1921111774
similar METHOD, creating an active
To: Bob <sip:[email protected]>;tag=a6c85cf
Call-ID: [email protected]
“dialog” between to endpoints
– Defined by Call-ID, and To: & From: -tags
SIP Core Layer
• SIP transaction
– Request and response SIP Transaction Layer
– Stateless proxies haven’t got a
Transaction Layer SIP Transport Layer
– We have INVITE and non-INVITE
transactions
• ACK-handling is a little tricky

INVITE
200 OK

Transaction State
Page 82
Transaction Lifetime

• What is a transaction
Start Line

SIP Headers
1 Request
– A request and all the associated SDP Payload
Copy Mandatory
Headers
responses
– And maybe the ACK
• Depends on the INVITE response
• Different kinds of transactions ~Txn Multiple Provisionals Response Line

– Invite and Non-Invite transactions SIP Headers

– Server and Client Transactions SDP Payload

StartLine or ResponseLine
1 Final Response
Via: SIP/2.0/TCP Host:portnr
From: sip:[email protected] ;tag=X
To: sip:[email protected] ;tag=Y
Max-Forwards: 70
Call-ID: <random>@Ipaddr ACK ?
CSeq: <Counter> METHOD

SDP Payload Optional

SIP Message Structure


Page 83
SIP Servers and Call State

“Dynamic Database”

• Transaction Stateful Servers


(~Anything)

– Has state for the current "transaction"


– Once the transaction is terminated,
everything is forgotten again.
CT Client Transaction
• SIP Proxy Proxy
– Connects server-transactions for Server Transaction ST SIP
incoming requests, with outgoing Core
client-transactions CT Client Transaction

Client And Server Transactions

INVITE

200 OK

Transaction Stateful Servers


Page 84
Transaction Identification

• The Branch parameter


– Each via-header has a transaction-id
– ;branch=z9hG4bKabcd1234
• In RFC 3261 CT branch=z9hG4bK<random>
– Must be globally unique
branch=z9hG4bK<random> ST
– Starts with z9hG4bK
– Used as transaction-id for CT branch=z9hG4bK<random>
incoming and outgoing Requests

Client And Server Transactions

These better have


different branch-
values, or we’re in
trouble 
Page 85
SIP Servers and Call State

• Call/Dialog Stateful Servers


– Complete Dialog-state, from
Initiation with INVITE/200 OK/ACK,
until disconnection
– Often needed for billing and An INVITE Message!
• I better remember
controlling firewalls this, so I can charge
for this call later
A BYE Message!
• Which call was this,
now again?

INVITE/200 OK

BYE/200 OK

Call Stateful Servers


Page 86
Answer on the Poll!
Apis-ms.participoll.com

If you only say “A stateful SIP proxy”,


what is it stateful about?

A. Dialogs

B. Sessions

C. Calls

D. Transactions

A B C D 0
Page 87
Request retransmission

A PB B
• UDP
– SIP layer uses exponential backoff
when retransmitting
– Default start at 500 ms
INVITE
• TCP or TLS
500ms INVITE
– Connection setup and reliable
transport, 1 sec
so NO sip-level retransmissions INVITE
– Performance, security
and redundancy issues?
2 sec
• SCTP
INVITE
– Performance-, security-, and
INVITE
redundancy improvements 100 Trying
• Mandatory support INVITE
– UDP and TCP
– Proxies “SHOULD” support TLS INVITE
• Detecting retransmissions
– SIP CSeq counter
Page 88
2xx Responses to INVITE

INVITE

100 Trying
INVITE
100 Trying

182 Queued (1)


182 Queued (1)
180 Ringing
180 Ringing
200 OK
Lost 500ms
200 OK
Lost
1 sec
200 OK
Lost 2 sec
200 OK

ACK
Page 89
Proxy Core - Response processing

UAC Proxy Proxy UAS

INVITE

100 Trying
INVITE

100 Trying
INVITE

180 Ringing
180 Ringing
180 Ringing
200 OK
200 OK
200 OK

ACK
ERR

200 OK
200 OK
200 OK

ACK
Page 90
CANCEL

How do we stop ringing? Alice Bob


– CANCEL
• Is only an attempt to
CANCEL INVITE

• Call may be answered INVITE


INVITE
Lost
anyway INVITE
– We can’t send CANCEL 180 Ringing
180 Ringing
until we know the request
CANCEL
has been received by CANCEL
next-hop! 200 OK(CANCEL)
200 OK(CANCEL)
• Otherwise, cancel might be
recieved before INVITE
487 Call cancelled 487 Call cancelled
– An unmatched CANCEL is
rejected with 481 ACK
ACK
Page 91
Multiple Registrations

REGISTER sip:registrar.bob.net SIP/2.0


• Available at multiple UA's Via: SIP/2.0/UDP bee.net:5060
– Register multiple contacts! From: Bob <sip:[email protected]>
To: Bob <sip:[email protected]>
• Where do we call first? Call-ID: [email protected]
CSeq: 1 REGISTER
– Highest q-value
Contact: <sip:[email protected]> ;expires=86400 ;q=1.0
• How do we DeRegister Expire: <time in seconds>
Content-Length: 0
– Re-register with expire-time 0

– The response to the REGISTER


request contains all current SIP/2.0 200 OK
registrations Via: SIP/2.0/UDP bee.net:5060
From: Bob <sip:[email protected]>
To: Bob <sip:[email protected]>
Call-ID: [email protected]
CSeq: 1 REGISTER
Contact: <sip:[email protected]> ;expires=86400 ;q=1.0
Contact: <sip:[email protected]> ;expires=7200 ;q=1.0
Content-Length: 0
Page 92
Forking Proxies (1)

SIP Proxy
Alice ericsson.se Bob Carol

INVITE
sip:[email protected]
INVITE
[email protected]

INVITE [email protected]

200 OK
200 OK
CANCEL

200 OK(CANCEL)

487 Call cancelled

ACK

ACK
Page 93
Forking Proxies (2)

SIP Proxy
Bob Carol
Alice ericsson.se at sales at sales

INVITE
sip:[email protected]
INVITE [email protected]

INVITE [email protected]

200 OK
200 OK
CANCEL

200 OK(CANCEL)

487 Call cancelled

ACK

ACK
Page 94
Forking Proxies

SIP Proxy SIP Proxy SIP Proxy


UAC Ericsson.com Stockholm Gothenburg Alice@Sthlm Bob@Gbg

INVITE
sip:[email protected] INVITE
sip:[email protected]

INVITE sip:[email protected]
INVITE
sip:[email protected]
INVITE sip:[email protected]

200 OK
200 OK

200 OK CANCEL
CANCEL
200 OK (CANCEL)
200 OK (CANCEL)

487 Call cancelled


487 Call cancelled
ACK
ACK

ACK sip:[email protected]
Page 95
Responses and Call state

• Before any final response*


– Forward all 101++ immediately while
UAC SIP server network
waiting
for final responses INVITE
– Forward all 2xx responses
100 Trying INVITE
• CANCEL any outstanding transaction

100 Trying

180 Ringing 180 Ringing

200 OK
200 OK

CANCEL
200 OK (CANCEL)
ACK

200 OK (INVITE)
200 OK

ACK
BYE
Page 96
Stateful Cancel and 3++

Stateful Stateless Stateful

INVITE
INVITE
INVITE
100 Trying
100 Trying 100 Trying
CANCEL
CANCEL
CANCEL
200 OK
200 OK
487 Cancelled
487 Cancelled
ACK
487 Cancelled
200 OK
ACK
ACK
Page 97
Waiting and Selecting

• When do we stop ringing?


– The proxy doesn’t want to wait for
UAC SIP server network
final response for ever!
– For every INVITE transaction we have INVITE
a timer to tell us when to give up
100 Trying INVITE
• Timer C, normally 3 minutes
• Restarted when we get more 1xx
100 Trying
• We have to find “The Best”
180 Ringing
response 180 Ringing

– Preferably the lowest 486 Busy

– Must wait for all client transactions to


end Timer C

CANCEL
200 OK (CANCEL)

487 Cancelled
486 Busy
ACK
ACK
Page 98
INVITE Transactions
SUCCESSFUL INVITE
UAC UAS

INVITE
INVITE
INVITE from TU 1 •Pass INVITE to TU
•send INVITE
100
2 •Send 100 if TU won’t in 200 ms
Timer A
•Reset A 101-199 from TU
•Send INVITE Timer B 3 or INVITE
1 1 •Inform TU 2xx •Send 101-199
2 2 2xx from TU
CALLING •Send 2xx
4 PROCEEDING
3++ 5 ACK
3++ from TU
•Send ACK 1xx (Another transaction) •Send 3++
•3++ to TU •1xx to TU
2xx UNSUCCESSFUL INVITE Timer G
1xx 3 3 •2xx to TU UAC UAS
INVITE
•Send 3++ 4 •Send 3++
•1xx to TU
PROCEEDING INVITE COMPLETED
1
3++
•Send ACK 100
2
3++ ACK Timer H
•Send ACK •3++ to TU
•Inform TU
5 3 3++
6
COMPLETED 4 CONFIRMED
5 ACK

Timer D
6 Timer I
7
7 5 8
TERMINATED
Application Logic
EVENT
TERMINATED
Transaction User
Transaction Layer
•Action 8 4
Client Transport Server
Page 99
Non-INVITE Transactions
SUCCESSFUL non-INVITE
UAC UAS
Non-INVITE

Request received
Request from TU 1 •Pass request to TU
•send request 100 2
Timer E Timer F or
•Send request Transport Error 3
•Inform TU
1 1 4 2
2xx
2 2++ from TU
•Send 2++
TRYING TRYING
5
2++ 6
•2++ to TU
1xx
•1xx to TU
7 1xx from TU
Timer F or 8 •Send 1xx Request or
Timer E Transport Error 1xx from TU
•Send request 4 4 •Inform TU
3 •Send 1xx
UNSUCCESSFUL non-INVITE 3
PROCEEDING UAC Non-INVITE UAS PROCEEDING
1xx

2++
•1xx to TU 1 2++ from TU
•2++ to TU 100 2 •Send 2++

6 6 4 3 5 5
COMPLETED 3++ COMPLETED

5 Request
Timer K
6 •Send 2++
Timer J
7
8 8 8
7
TERMINATED Application Logic TERMINATED
EVENT
Transaction User
•Action 7
Transaction Layer
Client Transport Server
Page 100
SIP Timers
Timer F Timer E non-INV Timer K non-INV non-INV Timer J There are 3 timer start values: Default
T1 Estimated round-trip-time 500 ms
0.5s
non-INV 2++ 2++ T2 Max retransmit interval for non-Invite 4 seconds
requests and Invite responses
1s
non-INV 2++ non-INV
5s 32s T4 Max duration a message will remain in
2s the network 5 seconds
non-INV 2++ 2++
32s Timer Value for UDP Value for TCP/SCTP
4s A initially T1 Not used
non-INV B 64*T1 64*T1
Terminate Terminate
Non-INVITE Transaction Transaction C > 3min > 3min
Transactions 4s D > 32s 0s
non-INV
non-INV E initially T1 Not used
F 64*T1 64*T1
481 G initially T1 initially T1
H 64*T1 64*T1
I T4 0s
INVITE J 64*T1 0s
Transactions Timeout K T4 0s

Transaction layer timers Transaction user timers

Timer B Timer A Timer I x


INVITE Timer D INVITE INVITE INVITE Timer G Timer H INVITE T1*2 Timer C INVITE
(3 min)
0.5s
INVITE 3++ 3++ 3++ 2xx 100

1s 0.5s 0.5s
INVITE ACK 3++ <Timer C
ACK 2xx 1xx

2s 1s 1s
INVITE 3++ 3++ <Timer C
ACK 2xx 1xx
32s >32s 5s
4s 2s 2s
INVITE ACK 3++ Timer C
ACK 2xx
32s 64*T1
8s 4s 4s (T2)
INVITE 3++ 3++ 2xx Timeout
Terminate
Transaction
16s 4s 4s
INVITE Discarded 3++ 2xx
Response

Timeout

Timeout Timeout

BYE
Page 101
NIT Problem #1 – Usefulness of 408 Responses

MESSAGE
MESSAGE
MESSAGE
MESSAGE

Timeout
Timeout
408 Timeout Timeout
408 Timeout •
Timeout •

408 Timeout •
408 Timeout Timeout
408 Timeout 408 Timeout
408 Timeout 408 Timeout
408 Timeout

408 Timeout
Page 102
NIT Problem #2 – Recovering from packet loss

 Retransmission
UAC NextHop UAC NextHop
 Destination Blacklisting
MESSAGE MESSAGE
200 OK 1xx SomeThing
500ms Lost
200 OK
MESSAGE 4s Lost

200 OK MESSAGE
1s Lost
200 OK
MESSAGE 4s Lost

200 OK MESSAGE
2s Lost
200 OK
MESSAGE 4s Lost

200 OK MESSAGE
4s Lost
200 OK
MESSAGE 4s Lost

200 OK MESSAGE
4s Lost
200 OK
MESSAGE 4s Lost

MESSAGE

Retransmission with or without 1xx


Page 103
Rules and Exceptions
- ACK, which is a request that
All communication in will never receive a response
SIP is based on - 2xx to INVITE
One REQUEST –
One final INVITE may receive
RESPONSE multiple 2xx

All provisional 100 Trying, which is a hop-


responses (1xx) shall by-hop acknowledgement,
be immediately and shall never be
forwarded by a SIP forwarded (by a stateful

…except for…
proxy SIP proxy)

A proxy shall practise


wait-and-select for all Successful (2xx)
answers to an INVITE answers, that will
transaction, and only always be forwarded
forward one response immediately upstream
upstream

A CANCEL
All transactions carry
transaction, which
their own unique
carries the branch
transaction ID in the
value of the
branch header
transaction it is
attempting to cancel
Page 104
Answer on the Poll!
Apis-ms.participoll.com

If a proxy forks a request, what will it do


if it gets a 200 OK from the first forked
branch?

A. Send the 200 OK to the UAC (The Alice side)

B. Send CANCEL to UAC

C. Wait until all branches have answered and select the best response

D. Send ACK to UAS (The Bob side)

0
A B C D
Page 105

Protocol Extensions and Updates


Page 106
Extending the Protocol

• SIP OPTIONS OPTIONS sip:[email protected] SIP/2.0


Via: SIP/2.0/UDP pc12.aye.net;
– Ability to query new capabilities branch=z9hG4Kabc
– Should be answered as an INVITE From: sip:[email protected];tag=55a66b
To: sip:[email protected]
• Supported - header Call-ID: 1fba35bfa4e5e050fc343b3de932a
– Indicate supported extensions CSeq: 1 OPTIONS
– Tag MUST be defined in standards
track RFC
• Accept SIP/2.0 200 OK
Via: SIP/2.0/UDP pc12.aye.net; branch=zmdK7218
– Different kinds of body-data From: sip:[email protected];tag=55a66b
• Accept-Encoding To: sip:[email protected] ; tag=987238
Call-ID: 1fba35bfa4e5e050fc343b3de932a
– How body-data can be encoded CSeq: 1 OPTIONS
• Allow Accept-Encoding: gzip
Supported: prefs
– What METHODs are supported Accept: application/sdp, text/html, image/jpg
• Allow events Allow: INVITE, ACK, CANCEL, OPTIONS, MESSAGE, BYE
Allow-Events: presence
– Which events are supported
Page 107
Adding New Methods

 What should the Proxy do?


◦ Route it like any other request
◦ Enables new methods to seamlessly integrate NewCoolFeature
and route properly through old servers

 What should UAS do?


◦ Respond with:
 405 Method Unsupported
 501 Method Unknown
SIP server network
Page 108
Callee Capabilities

INVITE ?

SIP Proxy

REGISTER sip:lab1.sip SIP/2.0


Via: SIP/2.0/UDP pc24.lab1.sip;branch=z9hG4bKabcde
From: sip:[email protected];tag=asd98
To: sip:[email protected]
Call-ID: [email protected]
CSeq: 9987 REGISTER
Max-Forwards: 70
Contact: <sip:[email protected]>;audio;video
;actor="msg-taker";automata;mobility="fixed"
;methods="INVITE,BYE,OPTIONS,ACK,CANCEL"
Content-Length: 0

Adding User Agent Capabilities to a SIP REGISTER Message


Page 109
Caller Preferences

Contact: sip:[email protected];audio; methods="REFER“


;q=0.8;class=“business”
Contact: sip:[email protected];audio; video=“false”; ;q=0.6
;language=“en,se,fi,de,fr”;actor="msg-taker“
Contact: sip:[email protected];audio; mobility=“mobile”
;video;methods=“UPDATE, PRACK";q=0.7
Contact: sip:[email protected];audio;video;message
;methods=“MESSAGE";q=0.1
Contact: sip:[email protected];q=1.0

Example of registered Contact-values in a location server


(Only “new” methods shown)

Reject-Contact: *;actor="msg-taker"
Accept-Contact: *;audio;require
Accept-Contact: *;video;explicit
Accept-Contact: *;methods=“MESSAGE";class=“business "
Example of incoming caller preferences, specified in a Request
Page 110
Requiring Extensions

INVITE
• What if we require a certain
extension? INVITE sip:[email protected] SIP/2.0
– Require - header Via: SIP/2.0/UDP pc12.aye.net; branch=z9hG4Kabc
From: sip:[email protected];tag=55a66b
– Proxy-Require – header To: sip:[email protected]
Require: refer, prefs
• So the rule is: Proxy-Require: sec-agree
Call-ID: 1fba35bfa4e5e050fc343b3de932a
– Ignore headers we don’t understand CSeq: 1 INVITE
– Unless there is a Require-header with
an option tag we don’t understand
420 Extension not supported

SIP/2.0 420 Extension not supported


Unsupported: sec-agree

421 Extension required

SIP/2.0 421 Extension required


Require: 100rel
Page 111
Reliability for provisional responses

SIP server network


• New Requirements on SIP/SDP
- Early Media
PSTN
- Media before 200 OK
- Quality of service assurance
- Before callee is alerted
INVITE
• Qos Extensions
- Not reserving QoS, just indicating I want Quality of Service!!
our requirements
• We need to negotiate more Ok, I’ll see what I can do!
- During the Early Dialog, with SDP
Reservation
- But SDP messages need to be reliable I’m ready now, hurry up!

Yeah, Yeah, keep your pants on!

Reservation
Hey, I’ve got a reservation now!

Good, Finally! 

180 Ringing, and 200 OK


Page 112
Reliable Provisional Responses

SIP server network


 Offers/Answers only allowed in:
◦ INVITE-request
◦ First reliable non-failure
response,
and subsequent INVITE
acknowledgement
183 Session Progress (SDP)
◦ ACK
PRACK

 Provisional Response ACK 200 OK


◦ Makes any 1xx reliable
◦ Reliable 1xx are retransmitted 180 Ringing

PRACK

200 OK
Page 113
Provisional Response ACK
Alice Bob
 Negotiated with
◦ Require: 100rel
INVITE
◦ Supported:100rel Require: 100rel
INVITE INVITE

RSeq header
Supported: 100rel
 Cseq: 8 INVITE
182 Queued
182 Queued

RAck header
RSeq: 1
 182 Queued Require:100rel 500
182 Queue millisec

182 Queue RSeq: 1


Require:100rel
182 Queue

PRACK PRACK
RAck: 1 8 INVITE
PRACK

200 OK
200 OK
200 OK
180 Ringing
180 Ringing RSeq: 2
180 Ringing Require:100rel

PRACK/200 PRACK/200
RAck: 2 8 INVITE PRACK/200
Page 114
Quality of Service in SDP
m= audio 9054 RTP/AVP 0 8 18 101
a=rtpmap: 0 PCMU
a=rtpmap: 8 PCMA
a=rtpmap: 101 telephone-event
a=des: qos mandatory local sendrecv

SENDRECV
CURR: MANDATORY LOCAL

a=
SEND

DES: QOS REMOTE

RECV

OPTIONAL
CONF:
E2E
NONE
Page 115
UEs Exchange QoS Information

Networks

a: curr:qos local none


a: curr:qos remote none
INVITE a: des:qos mandatory local sendrecv
a: des:qos mandatory remote sendrecv

a: curr:qos local none


a: curr:qos remote none 183 Session Progress
a: des:qos mandatory local sendrecv
a: des:qos mandatory remote sendrecv
a: conf:qos remote sendrecv

a: curr:qos local sendrecv


PRACK a: curr:qos remote none
a: des:qos mandatory local sendrecv
a: des:qos mandatory remote sendrecv

a: curr:qos local sendrecv


a: curr:qos remote sendrecv 200 OK (PRACK)
a: des:qos mandatory local sendrecv
a: des:qos mandatory remote sendrecv

180 Ringing
Page 116
Early Media

INVITE (SDP)

100 Trying

182 Queued

183 Session Progress (SDP)

PRACK
200 OK

Early Dialog

200 OK

Confirmed Dialog
Page 117
Session Timer
Alice PA PB Bob

INVITE Bob@ips
Session-Exp: 1800
422 Too Small
Min-SE:3600

INVITE Bob@ips INVITE Bob@ips INVITE Bob@ips


Session-Exp: 3600 Session-Exp: 3600 Session-Exp: 3600
200 OK 200 OK 200 OK
Session-Exp: 3600 Session-Exp: 3600 Session-Exp: 3600
;refresher=uac ;refresher=uac ;refresher=uac

UPDATE Bob@IP UPDATE Bob@IP UPDATE Bob@IP

200 OK 200 OK 200 OK

.........

UPDATE Bob@IP UPDATE Bob@IP UPDATE Bob@IP

200 OK 200 OK 200 OK

• Require: timer
• Session-Expires header
Page 118
Answer on the Poll!
Apis-ms.participoll.com

What is the name of the extension that


enables the use of PRACK?

A. prack

B. 100rel

C. session

D. timer

A B C D 0
Page 119

Security
Page 120
Adding SIP Intelligence to the Net

• Configuring the Firewall


- TCP, TLS, UDP, SCTP?
- Port 5060/5061
• Making the firewall into a SIP-telephone
- Firewall needs to understand SIP
- m= audio 5004 RTP/AVP <codecs>
• Additional NAT issues SIP
Dst IP = 130.237.71.122
- c=IN IP4 10.9.24.1 IP Dst Port = ???
- NAT has to modify SDP for it to work
R
- Application Layer Gateway
- Modifying will break integrity-protected
SIP messages
Page 121
N.A.T or P.A.T Basics

The client is handled with dynamic


NAT, or PAT, since the port number is
also changed.

Source Inside Source Outside


10.1.1.42:1025 212.112.175.5:61443
10.1.1.100:* 212.112.175.20:*

10.1.1.42:1025 INVITE 212.112.175.5:61443

INVITE 212.112.175.20:5060

Dyn. State

10.1.1.100:5060
Static State

The server is statically NAT:ed, causing


port numbers to remain the same.
Page 122
Implementation issues

 Who can send traffic TO the outside address?


◦ It depends 
 Different Kinds of NAT
◦ Full Cone
◦ Restricted Cone and Port Restricted Cone
◦ Symmetric NAT 

Going To Coming From


IP:3030 X
Mapped to Inside
10.1.1.42:1025 SIP 1

Src: IP:3030

NAT(Network Address Translation) Mapping


10.1.1.42:1025 Table 100.1.1.10
Page 123
NAT - Nightmare Addressing Technology?

 I.C.E - Interactive Connectivity


Establishment
◦ A combination of STUN, TURN and other STUN or TURN
clever ideas Server

 STUN and TURN


◦ STUN - Session Traversal Utilities for
NAT
◦ TURN - Traversal Using Relays around
NAT
Page 124
STUN and TURN

• Session Traversal Utilities for NAT


- Detect which mappings are used by the NAT
- Only works perfectly for full-cone NATs
- Initially seen as a stand-alone protocol
- Redefined as one tool in the I.C.E protocol TURN

• Traversal Using Relays around NAT


- Extensions to the STUN-protocol
- When STUN doesn’t work, TURN will 
- But, all media goes through the TURN-servers
STUN
Page 125
TURNing to STUN?

TURN Server
STUN Server

10.1.1.10:1025 5.6.7.8:3478
1.2.3.4:3478
STUN-Request :<Port1>

STUN-Response

63.1.2.3:<Port1>
“I got this from: 63.1.2.3:<Port1>”

“Reflexive Address”

TURN - Request :<Port2>


“I need to borrow an IP and Port number”
TURN - Response
“Use: 5.6.7.8:3366”

63.1.2.3:<Port2> 5.6.7.8:3366

“Relayed Address”

10.1.1.1 63.1.2.3

Simplified scenario. A full STUN/TURN scenario uses more requests and responses.
NOTE: Depending on the NAT, Port1 could be equal to Port2.
Page 126
Interactive Connectivity Establishment

 Interactive Connectivity FW/NAT STUN/TURN


Bob
Establishment
◦ A combination of all available
tools/protocols
◦ And some clever extensions
 In SIP we need to express the need STUN/TURN
for ICE. STUN/TURN

◦ Require: ice
◦ Contact: INVITE / SDP
<sip:[email protected]>;sip.ice a=candidate:1
 SDP needs to be updated a=candidate:2

◦ Which addresses MIGHT WORK for


a=candidate:3

media 183 Session Progress


◦ a=candidate:1 <ip1:port1>... a=candidate:1
a=candidate:2
◦ a=candidate:2 <ip2:port2>... a=candidate:3
◦ a=candidate:3 <ip3:port3>... STUN
Page 127
Symmetrical (SIP) Responses

INVITE sip:[email protected] SIP/2.0


Via: SIP/2.0/UDP 10.1.2.10:3040 ; branch=z9hG4bKabc
To: Bob <sip:[email protected]>
From: Alice <sip:[email protected]>;tag=1921111774
Content-Type: application/sdp

INVITE

NAT

INVITE

INVITE sip:[email protected] SIP/2.0


Via: SIP/2.0/UDP bigbox3.site3.lab2.sip ;branch=z9hG4bK77ef4ksjdak
Via: SIP/2.0/UDP 10.1.2.10:3040 ;branch=z9hG4bKabc ;received=128.3.4.5 ;rport=<42006>
To: Bob <sip:[email protected]>
From: Alice <sip:[email protected]>;tag=1921111774
Content-Type: application/sdp
Page 128
Managing Client Initiated Connections in SIP

Outbound Proxy/
 Incoming connections through FW/NAT
Proxy(s) Registrar
NAT
◦ NAT only allow new connections
InsideOut.
◦ UA will register its internal
address 
◦ Traffic must be sent to the NAT’s REGISTER
REGISTER
outside address and port! Contact: 10.1.2.3

 The SIP “outbound” extension 200 OK


200 OK
◦ Tells the receiver to remember
the transport-channel used for Contact: 10.1.2.3
the message
◦ New parameters to the Contact:
REGISTER sip:lab2.sip SIP/2.0
 Instance => Unique id of a From: <sip:[email protected]>
specific UA. To: Bob <sip:[email protected]>
 reg-id => “registration session Call-ID: 16CB75F21C70
id” CSeq: 2 REGISTER
Supported: path, outbound
Route: <sip:outbound.lab2.sip;lr>
Contact: <sip:[email protected]>;reg-id=1
;+sip.instance="<urn:uuid:<ua-unique-id>>"

http://tools.ietf.org/html/rfc5626
Page 129
Managing Client Initiated Connections in SIP

Outgoing Proxies
Authoritative
OP1 OP2 Proxy/ Registrar

10.1.1.10

REGISTER
State REGISTER
Contact:10.1.1.10 Location Server
;reg-id=1 Path: <sip:[keyX]@op1;lr>
AoR Contact Instance-Id Reg-Id Path: .
200 OK
200 OK Bob 10.1.1.10 <Instance-1> 1 sip:[keyX]@op1;lr
State Bob 10.1.1.10 <Instance-1> 2 sip:[keyY]@op2;lr

REGISTER
State REGISTER
Contact:10.1.1.10
;reg-id=2 Path: <sip:[keyY]@op2;lr>

200 OK 200 OK
State
INVITE [email protected]

INVITE 10.1.1.10 INVITE 10.1.1.10 INVITE 10.1.1.10


State Route: <keyY@op2;lr> LS lookup chooses
any one of the two
10.1.1.1 2.2.2.2 registered contacts
Page 130
Answer on the Poll!
Apis-ms.participoll.com

What is true of I.C.E.?

A. It makes use of STUN and TURN

B. It replaces STUN and TURN

C. It competes with STUN and TURN

D. It is not related to STUN and TURN

A B C D 0
Page 131
Securing SIP signalling

• IPSEC
- Ipsec & IKE
• SSL/TLS
- Same as web browsers
• Authentication users
- Who is sending what?
- HTTP Basic
- Simple plain text
- HTTP Digest
- MD5, SHA-1
• End to End
- Secure Mime
- Secures email, ergo it secures SIP
Page 132
Security - Authentication Digest

SIP/2.0 401 Unauthorized


REGISTER sip:gatekeeper.lab1.sip SIP/2.0 Via: SIP/2.0/UDP lab1.sip:5060
Via: SIP/2.0/UDP lab1.sip:5060 From: Alice <sip:[email protected]>
From: Alice <sip:[email protected]> To: Alice <sip:[email protected]>
To: Alice <sip:[email protected]> Call-ID: [email protected]
Call-ID: [email protected] CSeq: 1 REGISTER
CSeq: 1 REGISTER WWW-Authenticate: Digest realm=“lab1.sip",
Contact: Alice <sip:[email protected]> domain=“sip:lab1.sip", qop="auth, auth-int“,
Contact: Alice <sips:[email protected]> nonce="ea9c8e88df84f1cec4341ae6",
Contact: <sip:[email protected];user=phone> opaque="5ccc069c403ebaf9f0171e9517f40e41",
Contact: tel:+1-972-555-2222 algorithm=MD5
Content-Length: 0 Content-Length: 0

REGISTER sip:gatekeeper.lab1.sip SIP/2.0


Via: SIP/2.0/UDP lab1.sip:5060
From: Alice <sip:[email protected]>
To: Alice <sip:[email protected]>
Call-ID: [email protected]
CSeq: 2 REGISTER 401 Unauthorized
Contact: Alice <sip:[email protected]>
Contact: Alice <sips:[email protected]>
Contact: <sip:[email protected];user=phone>
Contact: tel:+1-972-555-2222 407 Proxy Auth Required
Authorization: Digest username="Alice", realm=“lab1.sip",
nc=0000001, cnonce=5D796FC7” nonce="ea9c8e88df84f1cec4341ae6",
opaque="5ccc069c403ebaf9f0171e9517f40e41",qop=auth
uri="sip:gatekeeper.lab1.sip",
response="dfe56131d195804477ecc"
Content-Length: 0

For simplicity, irrelevant details have been remove from the signalling examples. (ACK, 2xx, etc)
Page 133
Security – Privacy and Identification

• Privacy & Identification


• Network asserted Identity
- P-Asserted-Identity
- P-Preferred-Identity
• Requesting identity-privacy of SIP-signaling
- Privacy: user | session | none | critical | id
- From: "Anonymous" sip:[email protected]>;tag=<random>

RFC 3323, 3324, 3325


Page 134
Security – S/MIME

INVITE sip:[email protected] SIP/2.0


Via: SIP/2.0/UDP pc33.lab1.sip;branch=z9hG4bKnads8
 S/MIME From: Alice <sip:[email protected]>;tag=1928301774
◦ SIP uses MIME To: Bob <sip:[email protected]>
Call-ID: a84b4c76e66710
◦ S/MIME secures MIME CSeq: 314159 INVITE
◦ Ergo, S/MIME secures SIP Max-Forwards: 70
Contact: <sip:[email protected]>
Content-Type: application/pkcs7-mime;
smime-type=enveloped-data;name=smime.p7m
Content-Disposition: attachment; filename=smime.p7m
handling=required

*******************************************************
* Content-Type: application/sdp *
* *
* v=0 *
* o=alice 53655765 2353687637 IN IP4 pc33.lab1.sip *
* s=- *
* t=0 0 *
* a=key-mgmt:mikey <key-exch-crypto-parameters> *
* c=IN IP4 pc33.lab1.sip *
* m=audio 3456 RTP/SAVP 0 *
* a=rtpmap:0 PCMU/8000 *
*******************************************************

*The example message is also using feature for Secure RTP, RFC3711
Page 135
Security – S/MIME

--boundary42
 Protecting SIP headers Content-Type: message/sip
◦ Digest only protects the URI and SIP-Body INVITE sip:[email protected] SIP/2.0
◦ SIP headers are unprotected Via: SIP/2.0/UDP pc33.lab1.sip ;branch=z9hG4bKnas
To: Bob <[email protected]>
 S/MIME Encapsulation From: Alice <[email protected]>;tag=1928301774
◦ Add a copy of the important headers in a Call-ID: a84b4c76e66710
S/MIME protected “attachment” with CSeq: 314159 INVITE
Max-Forwards: 70
integrity protection and sender Date: Thu, 21 Feb 2002 13:02:03 GMT
authentication Contact: <sip:[email protected]>
Content-Type: application/sdp
Content-Length: 147

<<< Session Description Protocol >>>

INVITE sip:[email protected] SIP/2.0 --boundary42


Via: SIP/2.0/UDP Content-Type: application/pkcs7-signature;
pc33.lab1.sip;branch=z9hG4bKnas name=smime.p7s
To: Bob <sip:[email protected]> Content-Transfer-Encoding: base64
From: Alice <sip:[email protected]>;tag=1928301774 Content-Disposition: attachment;
Call-ID: a84b4c76e66710 filename=smime.p7s; handling=required
CSeq: 314159 INVITE
Max-Forwards: 70 <<< SMIME – SHA1 – CRYPTOGRAPHIC HASH >>>
Date: Thu, 21 Feb 2002 13:02:03 GMT --boundary42-
Contact: <sip:[email protected]>
Content-Type: multipart/signed;
protocol="application/pkcs7-signature";
micalg=sha1; boundary=boundary42
Content-Length: 568
Page 136
Secure RTP for Media Level Security

v=0
o=jdoe 1 2 IN IP4 10.47.16.5
c=IN IP4 161.44.17.12
m=audio 49170 RTP/SAVP 0
a=crypto:1 <SUITE_NAME> inline:<key-data>

SDP using SDES for plain-text keys

v=0
o=- 1181923068 1181923196 IN IP4 1.1.1.1
c=IN IP4 1.1.1.1
a=setup:actpass
a=fingerprint: SHA-1 <fingerPrint>
m=audio 6056 RTP/AVP 0
a=sendrecv
a=tcap:1 UDP/TLS/RTP/SAVP RTP/AVP
a=pcfg:1 t=1

SDP indicating SRTP using DTLS for negitiation

IP UDP RTP SRTP Encrypted Media


Page 137
Answer on the Poll!
Apis-ms.participoll.com

Which message would a SIP server send


to the UA to authenticate its identity?

A. Authenticate

B. 183 Session Progress

C. 401 Unauthorized

D. INVITE

80%

(4)

20%

(1)

A B C D 5
Page 138

Services and Applications


Page 139
SIP - Service Creation

• SIP CGI
- Just like the web
- Perl, ActiveX..
- RFC3050

• XML Scripts
- Call Processing Language
- Voice XML

• Servlets
- Java server-side framework,
with SIP support

• Open Service Access(OSA), Parlay and Jain


- JAIN – A multitude of Java API definitions for telecom protocols
- OSA and Parlay - High level API’s for abstract telecom services
- Parlay X, One API
Page 140
Call Processing Language Example

• Examples
- Rejecting calls
<cpl (With Lots of XML-parameters here) >
<incoming>
- Proxy and redirects <location url="sip:[email protected]">
<proxy>
<redirection>
<redirect/>
</redirection>
<default>
<location url="sip:[email protected]">
<proxy/>
</location>
</default>
</proxy>
</location>
</incoming>
</cpl>

<cpl (With Lots of XML-parameters here) >


<incoming>
<address-switch field="origin" subfield="user">
<address is="anonymous">
<reject status="reject" reason="I reject anonymous calls"/>
</address>
</address-switch>
</incoming>
</cpl>
Page 141
SIP and Call-Transfer

Just a moment please A Call for you Sir,


its Miss Alice

Hi, I’d like to speak 1


to Bob, please
2 3

5 4
7
OK, patch her through
8

6
INVITE/200OK/ACK

BYE/200OK 9

Alice Bob

In a more detailed example, additional NOTIFYs are usually sent


Page 142
GRUU

 Firewalls and NAT ≠ End2End


 REFER need a SIP URI to a specific UA REGISTER

 We need a Globally Routable User-Agent URI Supported: gruu


Contact: <[email protected]>
;+sip.instance=<urn:uuid=<rand>

200 OK
Contact: <[email protected]>
;+sip.instance=<urn:uuid=<rand>
;temp-gruu=“sip:aor<keyZ>@lab2.sip;gr”
;pub-gruu=“[email protected];gr=<keyX>

Alice Carol

Bob
Existing Call
Get Contact: !

REFER
Refer-To:
[email protected]
aor<KeyZ>@lab2.sip;gr
INVITE sip:aor<keyZ>@lab2.sip;gr
INVITE sip:[email protected]

10.1.1.10
Page 143
SIP 3rd Party Call Control

• External Call control A B


- Controlling the mobile, from the PDA @
- Establishing calls from the computers
address book
• How?
- Call both parties and “switch” the SDPs
- This scenario most suitable when B is a
quick answering “automata” INVITE (No SDP!)

200 OK (SDP A)

INVITE (SDP A)

200 OK (SDP B)

ACK (SDP B)

ACK

RFC3725
Page 144
SIP 3rd Party Call Control

• Another option A B
- Different scenarios have different @
problems
- We would like the controller to be as
simple and media-ignorant as possible

INVITE (SDP w/o media)

200 OK (SDP w/o media)

ACK

INVITE (No SDP)


200 OK (SDP X)

reINVITE (with X)
200 OK (SDP Y)
ACK (SDP Y)
ACK
Page 145
SIP Services – Replacing sessions

• Replacing Calls
Parking Place
- Often used with REFER
Alice
• Replace with? Bob
- This new INVITE-session
• Replace what? Current Call
- How do we identify the session we
which to replace? REFER

- Replaces: “Dialog-ID”

INVITE

200 OK

ACK

NOTIFY’s, 200 OKs and BYE

INVITE
Replaces: <Dialog-ID>
200 OK

ACK

BYE, etc

RFC3891
Page 146
Call transfer - Attended
Just a A Call for
moment Carol you, Bob
Alice please its Alice

INVITE
200 OK
OK, patch her
ACK through

INVITE (hold)
Hi, I’d like to
speak 200 OK
to Bob, please
ACK
INVITE

200 OK

ACK
REFER
Refer-To: <Bob?Replaces=Dialog-ID>

202 Accepted

INVITE sip: bob


Replaces=Dialog-ID
200 OK
ACK
BYE
NOTIFY’s and BYE’s
Page 147
SIP for Events

• SIP - Event Framework


SUBSCRIBE [email protected]
• SUBSCRIBE
200 OK
• NOTIFY
NOTIFY [email protected]
200 OK

INVITE [email protected]

NOTIFY sip:[email protected] SIP/2.0


Via: SIP/2.0/UDP alicepc.lab1.sip;branch=z9hG4bK987238321
To: <sip:[email protected]>;tag=123139
From: <sip:[email protected]>;tag=23456769
Call-ID: [email protected]
CSeq: 1993404 NOTIFY
Max-Forwards: 70
Event: refer
Subscription-State: active;expires=(depends on subscription)
Contact: sip:[email protected]
Content-Type: message/sipfrag;version=2.0
Content-Length: 20
Page 148
Answer on the Poll!
Apis-ms.participoll.com

Which of these is not a real SIP event?

A. presence

B. message-summary

C. call-completion

D. app-activation

0
A B C D
Page 149
SIP for Presence
SUBSCRIBE sip:[email protected] SIP/2.0
Via: SIP/2.0/UDP phone42.lab1.sip;branch=z9hGk
To: <sip:[email protected]>
From: <sip:[email protected]>;tag=xfg9
Call-ID: [email protected]
CSeq: 1 SUBSCRIBE
Max-Forwards: 70
Event: presence
Accept: application/cpim-pidf+xml
Contact: <sip:[email protected]>
Expires: 600
NOTIFY sip:[email protected] SIP/2.0
Content-Length:0
Via: SIP/2.0/UDP server.lab1.sip;branch=z9hGk
From: <sip:[email protected]>;tag=ffd2
To: <sip:[email protected]>;tag=xfg9
Call-ID: [email protected]
Event: presence
Subscription-State: active;expires=599
Max-Forwards: 70
CSeq: 1 NOTIFY
Content-Type: application/cpim-pidf+xml
Content-Length: ..

Application Data – Presence Info - Xml


Page 150
Presence Architecture
Presence
“Watchers” Application Server Proxy Presence
Proxy
User Agent

SUBSCRIBE
SUBSCRIBE
Route: <presence;lr>

202 Success
202 Success

NOTIFY

200 OK

PUBLISH
PUBLISH
NOTIFY
200 OK
200 OK
200 OK
Page 151
Presence Dialogs – Record Routing

Proxy Presence AS

SUBSCRIBE
SUBSCRIBE
SUBSCRIBE
Route: Presence;lr 200 OK
Record-Route: P1;lr
202 Success
202 Success Record-Route: P1;lr

NOTIFY
One more
NOTIFY subscriber!!
NOTIFY
Route: P1;lr
Record-Route: P1;lr 200 OK
200 OK
200 OK

SUBSCRIBE
Route: P1;lr

200 OK
Page 152
Authorization and other events

• Authorization Presence
- Who should see what? Server
- Presence Policy Friend Boss
- Xml data
• Other Events
- REFER
My Policy
- Registration-event SUBSCRIBE

- Message Waiting Indication 202 Accepted


- Dialog-State NOTIFY (Join me at the PUB  )

200 OK

SUBSCRIBE

202 Accepted

NOTIFY (Working Hard, BUSY)

200 OK
Page 153
Answer on the Poll!
Apis-ms.participoll.com

Which SIP method can be used to provide


a SIP server with information about a SIP
event?

A. PUBLISH

B. SUBSCRIBE

C. UPDATE

D. PUSH

0
A B C D
Page 154
SIP for Instant Messaging

• Instant Messaging, IM SIP server network


- SIP MESSAGE (RFC3428)
- An “SMS” -like service
• Remember proxy rules
- Even if forking, UAC will only receive
MESSAGE
ONE 200 OK.
• Payload data
- “Media” is sent through the entire 200 OK, 202 Accepted, 6xx refused
signaling path!
- Increases security requirements

MESSAGE sip:[email protected] SIP/2.0


Via: SIP/2.0/UDP alicepc.lab1.sip
From: sip:[email protected]
To: sip:[email protected]
Call-ID: [email protected]
CSeq: 1 MESSAGE
Content-Type: text/plain
Content-Length: <bytes>
Alice, would you like to play some chess later today?
Page 155
SIP for Instant Messaging

INVITE( m=message 9999 msrp/tcp *)

200 OK
ACK

SEND

200 OK

SEND

200 OK

REPORT

200 OK
Page 156
SIP for Instant Messaging
INVITE sip:[email protected] SIP/2.0
To: <sip:[email protected]>
MSRP KjaHG1a SEND
From: <sip:[email protected]>;tag=12345
To-Path: msrp://pc42.lab2.sip:5445/<randB>;tcp
Call-ID: y32432h223 From-Path: msrp://pc24.lab1.sip:3113/<randA>;tcp
Content-Type: application/sdp Message-ID: 78273871123
Byte-Range: 1-*/81
c=IN IP4 pc24.lab1.sip Success-Report: yes
m=audio 1234 RTP/AVP 0 3 4 5 Content-Type: text/plain
m=message 3113 TCP/MSRP *
a=accept-types:text/plain text/html Hey Bob, I’ve just found this incredible...
a=path:msrp://pc24.lab1.sip:3113/<randA>;tcp -------KjaHG1a+

MSRP KjaHG1a 200 OK


SIP/2.0 200 OK To-Path: msrp://pc24.lab1.sip:3113/<randB>;tcp
To: <sip:[email protected]>;tag=abcde From-Path: msrp://pc42.lab2.sip:5445/<randA>;tcp
From: <sip:[email protected]>;tag=12345 -------KjaHG1a$
Call-ID: y32432h223
Content-Type: application/sdp
MSRP KjaHG1B SEND
To-Path: msrp://pc42.lab2.sip:5445/<randB>;tcp
c=IN IP4 pc42.lab2.sip
From-Path: msrp://pc24.lab1.sip:3113/<randA>;tcp
m=audio 0 RTP/AVP
Message-ID: 78273871123
m=message 5445 TCP/MSRP * Byte-Range: 45-81/81
a=accept-types:text/plain Success-Report: yes
a=path:msrp://pc42.lab2.sip:5445/<randB>;tcp Content-Type: text/plain

website, and its just totally amazing!


-------KjaHG1B$

MSRP KjaHG1B 200 OK


To-Path: msrp://pc24.lab1.sip:3113/<randB>;tcp
From-Path: msrp://pc42.lab2.sip:5445/<randA>;tcp
-------KjaHG1B$
Page 157
Uri Lists

• Addressing multiple destinations


• Sending to multiple destinations
• RLS
- Resource List Server

UAC

UAC
UAS

UAC

Resource List Server


Page 158
Supplementary Services

P-CSCF S-CSCF S-CSCF P-CSCF

INVITE

INVITE

INVITE


INVITE
INVITE

486 Busy Here


486 Busy Here
486 Busy Here

486 Busy Here


486 Busy Here
Where is Call
Forwarding done?
Page 159
Back-to-Back User Agents (B2BUA)

SIP SIP
Proxy Proxy

One dialog

B2BUA B2BUA

UA ? UA UA ? UA

Three dialogs
Page 160
Back 2 Back User Agent
Proxy or B2B IVR Server Media Server

• Application needs to modify payload


- Proxies aren't allowed to do this!
- We must behave as an endpoint to both sides INVITE
180 Hello
INVITE
• What is allowed to do in a B2B? 180 Ringing

- Anything that an UA can do! 486 Busy


INVITE
- As long as we do ALL a UA MUST do
180 Ringing

Early Media
• Common usages
- Getting service control back in the network SUBSCRIBE

- Call-interception BYE

- Conferencing 183
INVITE

Lawful interception,
Session
- Progress
200 OK

- Privacy
Audio/Video Media

NOTIFY
BYE

INVITE
200 OK
200 OK
Page 161
Supplementary Services
A HNW B HNW

AS AS AS AS AS AS

S-CSCF S-CSCF

HSS HSS

I-CSCF I-CSCF

A VNW B VNW

P-CSCF P-CSCF

Access Access
Page 162
Answer on the Poll!
Apis-ms.participoll.com

Which of these is a popular messaging


protocol?

A. MSNBC

B. RTCP

C. MSRP

D. RTSP

0
A B C D
Page 163

Classic Telephony Using SIP


Page 164
Handling DTMF in SIP
B2B IVR Server Media Server

 Dual Tone Multiple Frequency


 Sending DTMF as RTP
INVITE
 The INFO Method - The “black sheep” INVITE

 SUBSCRIBE and NOTIFY 180 Ringing


486 Busy
182 Queued

“User is busy. Wait?”

RTP: YES!
INVITE
180 Ringing

“Would you like to 1) See a movie 2) Listen to music?

SUBSCRIBE

NOTIFY “2“
INVITE
200 OK
183 Sess…
A/V Media “Press 5 to pause the movie”

INFO “signal=5, duration=200”

Signalling has been reduced to focus on core info


Page 165
Basics of Facsimile

 Classic Fax
◦ Group 1 & 2 - Analog Fax PSTN
◦ Group 3 – PSTN Digital Fax
◦ Group 4 – ISDN Digital Fax
 ITU T.30 – Fax Control Protocol Establish Call
◦ Uses V.21 modem signaling at 300 Baud
◦ Control signals CNG
 CNG – Calling Signal, 1100 Hz
 CED – Answering Fax Tone, 2100 Hz
 DIS – Indicating capabilities CED

 DCS – Indicating transmission mode


 CFG - Confirm to Receive
DIS
 TCF - Training Check Sequence
TCF - Modem Training
 V.21 - Preamble - HDLC Flags and framing
 Sending the fax page
◦ Fax Image sent at 2400->14 000 bps CFR

◦ V.34 support enables max 33600 bps TCF - Modem Training

Fax page(s) transfer

EOP

DCN
Page 166
Fax and SIP Interworking – Fax over IP

 T.37 - Store and Forward


◦ SMTP / Email relay SIP HEADER
v=0
 T.38 – Real-time Fax o=sauron 1359825552 1359826343 IN IP4 10.10.0.134
c=IN IP4 10.10.0.134
◦ SIP, H.323, H.248 m=audio 0 RTP/AVP 0 13 8 101
◦ Emulate T.30 over a VoIP channel <audio-attributes>
m=image 5120 udptl t38
a=T38FaxVersion:0
a=T38MaxBitRate:14400
a=T38FaxFillBitRemoval:0
a=T38FaxTranscodingMMR:0
a=T38FaxTranscodingJBIG:0
a=T38FaxMaxBuffer:200
a=T38FaxMaxDatagram:72
a=T38FaxUdpEC:t38UDPRedundancy
a=T38FaxRateManagement:transferredTCF

PSTN

IP
Page 167
Answer on the Poll!
Apis-ms.participoll.com

Which of these is not a suggested


method to transmit DTMF in SIP?

A. In RTP

B. NOTIFY

C. INFO

D. INVITE

0
A B C D
Page 168
SIP and PSTN

 How do we call the PSTN?


◦ We'll still use phone numbers for years…
 sip:[email protected];user=phone
◦ Just put the phone number in the beginning
◦ Then add the domain where the gateways are
 tel: +46855235926
◦ Don’t know the gateway domain?
◦ Just send to proxy, let him route

PSTN
IP

INVITE tel: +46… MEGACO


H.248
INVITE [email protected]

PSTN
Page 169
Phone numbers vs. Sip-URIs

 Need to translate from E.164 to SIP


◦ We need a global, hierarchical database?
 Domain Name System

DNS
 ENUM
◦ Translate: tel:  <tel, sip, h323, mailto>
◦ Using domain e164.arpa and NAPTR
◦ +46708880263  sip:teacher@ip- +46708880263
solutions.se
◦ 3.6.2.0.8.8.8.0.7.6.4.e164.arpa
PSTN
IP
Media Gateway

INVITE
sip:[email protected]

H.248

PSTN
Media Gateway Controller
Page 170
Merging SIP and PSTN

ENUM

 There is a lot of SS7 in use


◦ Carriers may need ISUP
information on INVITE Start Line

each end of the SIP-network


SIP Headers
IP
SIP ISUP IAM

SDP Payload

 SIP for Telephones (SIP-T) IAM

 SIP-I (ITU Q.1912.5, Profile C)


PSTN PSTN

Tunneling or Translation?
IAM  INVITE
ACM  180 Ringing or 183
ANM  200 OK
REL  CANCEL or BYE
Page 171
Merging SIP and PSTN

PSTN
SIP PSTN

IAM INVITE
IAM
100 Trying
ACM*
18x*
ACM

200 OK ANM
ANM
ACK

INVITE ISUP IAM

From:  Calling Nr
To:  Orig Called Nr?*
RequestUri  Called Party Nr?*
Page 172
A First Glance

IP
SIP

IP
R
Multimedia
R Subsystem
Mobile Network

A SIP
R R server

IP
SIP
Page 173
Answer on the Poll!
Apis-ms.participoll.com

What protocol does ENUM use to


translate phone numbers into SIP
addresses?

A. DNS

B. SIP

C. DIAMETER

D. LDAP

0
A B C D
Page 174

Thank You for Listening!

You might also like