8/2/2019 SIP-SDP-2
1/37
1
Lecture No.9
SIP - requests and responses,header fields and extensions
8/2/2019 SIP-SDP-2
2/37
2
Methods
INVITE :Establishes a session
ACK :Confirms an INVITE request, 3-way hand-shaking
BYE :Ends a established session
CANCEL :Cancels establishing of a session
REGISTER :Communicates user location (host name, IP)
OPTIONS :Communicates information about thecapabilities of the calling and receiving SIP phones
8/2/2019 SIP-SDP-2
3/37
Miroslav Voznak, lecture on SIP 3
Methods extension
8/2/2019 SIP-SDP-2
4/37
4
Responses 1xx informational responses, such as 180, which means
ringing 200 - 699 final response
2xx success responses, such as 200 OK
3xx redirection responses
8/2/2019 SIP-SDP-2
5/37
5
Responses
4xx request failures 5xx server errors
6xx global failures
8/2/2019 SIP-SDP-2
6/37
6
TransactionTransaction
a request and all responses
old type hash To,From,RURI, CSeq
new parameter branchinVia
z9hG4bK is beginning of astring branch(new way oftransaction determination)
8/2/2019 SIP-SDP-2
7/37
7
Dialog
Dialog
Call-ID, From tag, To tag
CSeq identifies atransaction in dialog
8/2/2019 SIP-SDP-2
8/37
Miroslav Voznak, lecture on SIP 8
Registration
8/2/2019 SIP-SDP-2
9/37
Miroslav Voznak, lecture on SIP 9
Registration- bundling of user URI and device URI (From and Contact)
- Expires is a time period of registration (Expires=0 , cancellation)
8/2/2019 SIP-SDP-2
10/37
Miroslav Voznak, lecture on SIP 10
Redirection
8/2/2019 SIP-SDP-2
11/37
Miroslav Voznak, lecture on SIP 11
SIP message
8/2/2019 SIP-SDP-2
12/37
Miroslav Voznak, lecture on SIP 12
Session Description Protocolv=0o=ja 987504994 987504994 IN IP4 1.2.3.4s=Hovor 1c=IN IP4 1.2.3.4t=3196493794 3196497394m=audio 10000 RTP/AVP 0 22a=rtpmap:0 aplication/g711a=rtpmap:22 aplication/g723.1
SDP
v = Version number (ignored by SIP)o = Session Origin used by SIP
s = Subjectc = Connection Data (IN =internet, IP4 = IPv4, IP Address)t = Time (ignored by SIP)m = Media (type, port, RTP/AVP Profile)a = Attribute (profile, codec, sampling rate)
8/2/2019 SIP-SDP-2
13/37
13
INVITEINVITE sip:[email protected] SIP/2.0
Via: SIP/2.0/UDP pc33.atlanta.com:5060;branch=z9hG4bK776asdhdsTo: Bob
From: Alice ;tag=1928301774
Call-ID: a84b4c76e66710
CSeq: 314159 INVITE
Contact:
Content-Type: application/sdpContent-Length: 142
(SDP part)
the first line contains :
method name: INVITE
Request-URI (next hope is sip:[email protected])
SIP version number: SIP/2.0
8/2/2019 SIP-SDP-2
14/37
14
SIP viaINVITE sip:[email protected] SIP/2.0
Via: SIP/2.0/UDP proxy.stockholm.se:5060;branch=82.1
Via: SIP/2.0/UDP pc33.atlanta.com:5060;branch=z9hG4bK776asdhds
To: Bob
From: Alice ;tag=1928301774
Call-ID: a84b4c76e66710
CSeq: 314159 INVITE
Contact:
Content-Type: application/sdp
Content-Length: 142
(SDP part)
Via field:
insterted records point to the used route, Proxy serversinsert next records
response should use the same route as a request
branch enables to detect the loops
8/2/2019 SIP-SDP-2
15/37
15
Dialog (Call-leg)INVITE sip:[email protected] SIP/2.0
Via: SIP/2.0/UDP pc33.atlanta.com:5060;branch=z9hG4bK776asdhds
To: Bob From: Alice ;tag=1928301774
Call-ID: a84b4c76e66710
CSeq: 314159 INVITE
Contact:
Content-Type: application/sdp
Content-Length: 142
(SDP part)
Dialog the same information during the same call-leg are in therecords:
To , From a Call-ID To a From specifies logical address of endpoints of connection
Call-ID unique identifier during the dialog
8/2/2019 SIP-SDP-2
16/37
16
CSeqINVITE sip:[email protected] SIP/2.0
Via: SIP/2.0/UDP pc33.atlanta.com:5060;branch=z9hG4bK776asdhds
To: Bob
From: Alice ;tag=1928301774
Call-ID: a84b4c76e66710
CSeq: 314159 INVITE
Contact:
Content-Type: application/sdp
Content-Length: 142
(SDP part)
CSeq
every new request increments CSeq repeated request has the sameCSeq
all responses regarding the one request has the same CSeq
8/2/2019 SIP-SDP-2
17/37
17
ContactINVITE sip:[email protected] SIP/2.0
Via: SIP/2.0/UDP pc33.atlanta.com:5060;branch=z9hG4bK776asdhds
To: Bob
From: Alice ;tag=1928301774
Call-ID: a84b4c76e66710
CSeq: 314159 INVITE
Contact:
Content-Type: application/sdp
Content-Length: 142
Contact
contains SIP URI for direct communication, if SIP Proxy
doesnt insertRecord-Route field than nexttransctions can be routed directly
field Contact is also stated in response 200 OK
8/2/2019 SIP-SDP-2
18/37
18
Content type, LengthINVITE sip:[email protected] SIP/2.0
Via: SIP/2.0/UDP pc33.atlanta.com:5060;branch=z9hG4bK776asdhdsTo: Bob
From: Alice ;tag=1928301774
Call-ID: a84b4c76e66710
CSeq: 314159 INVITE
Contact:
Content-Type: application/sdpContent-Length: 142
Content-Type describes the type of body (SDP)
Content-Length includes the size of content (in bytes), thevalue 0means without content
8/2/2019 SIP-SDP-2
19/37
19
Max ForwardsINVITE sip:[email protected] SIP/2.0
Via: SIP/2.0/UDP pc33.atlanta.com:5060;branch=z9hG4bK776asdhds
Max-Forwards: 30To: Bob
From: Alice ;tag=1928301774
Call-ID: a84b4c76e66710
CSeq: 314159 INVITE
Contact:
Content-Type: application/sdpContent-Length: 142
Max-Forwards
decreases with every forwarded request at the Proxy
if its value is 0 than is sent 483 Too Many Hops
stateless Proxy detects a loop by field Max-Forwards
8/2/2019 SIP-SDP-2
20/37
20
INVITE and response 200 OK
8/2/2019 SIP-SDP-2
21/37
21
Tagging
in the case of forking there would be difficult to resolve whoanswered
UAS adds a tag into the response
To: sip:[email protected];tag=a48s
next request contains tag inserted into field To
8/2/2019 SIP-SDP-2
22/37
Miroslav Voznak, lecture on SIP 22
Response routing the reguests are routed according to Request URI (RURI)
and the responses according to field Via
8/2/2019 SIP-SDP-2
23/37
23
Forking
the first 200 OK
confirmed by ACK
the rest obtains487 CancelledINVITE
R d R ti
8/2/2019 SIP-SDP-2
24/37
Miroslav Voznak, lecture on SIP 24
Record Routing- Record route field is inserted by SIP Proxy not only intothe header of method (request) but into the final responseas well- a next transaction is routed via the elements stated in therecord route
SIP t id
8/2/2019 SIP-SDP-2
25/37
25
SIP trapezoid
- Outbound Proxy has to find a SIP Proxy which is able toserve the request
- SIP Proxy serves one or more domains (multidomain Proxy)- destination SIP Proxy can be find via DNS (SRV record in
DNS resolves serving SIP Proxy) or by static mapping
ENUM
8/2/2019 SIP-SDP-2
26/37
26
ENUM
- SIP addressing is based on SIP URI
- the number (E.164) can be resolved via DNS whereinNAPTR record contains a regular expression which is appliedto ENUM query and the result of this operation is SIP URI (ora list of URIs)
- SIP URI contains a host (users domain), via SRV recordis resolved serving SIP Proxy
- IP address of SIP proxy is resolved via A record in DNS
8/2/2019 SIP-SDP-2
27/37
27
Call Setup
Termination of established session
8/2/2019 SIP-SDP-2
28/37
28
Termination of established session- Bye
d bli hi i
8/2/2019 SIP-SDP-2
29/37
29
and establishing session Cancel
- two requests INVITE and CANCEL open two transactions
8/2/2019 SIP-SDP-2
30/37
30
SIP and PSTN Interworking
8/2/2019 SIP-SDP-2
31/37
31
Presence
UA gets status and presence
information which correspondsto users of server
Users are subscribed to users
presence
NOTIFY is sent on an event (achange of the state)
SUBCRIBE creates a dialogwherein the NOTIFY is sent ona change of the state
8/2/2019 SIP-SDP-2
32/37
32
Subscribe a Notify
8/2/2019 SIP-SDP-2
33/37
33
Instant Messaging
Method MESSAGE isused for IM
text is in body ofmessage
request Messagedoesnt create a dialog
8/2/2019 SIP-SDP-2
34/37
Miroslav Voznak, lecture on SIP 34
NAT Issue: clients behind NAT insert private IP
into signaling in SIP fields Via, From,Contact and SDP c-line (contact)
NAT
8/2/2019 SIP-SDP-2
35/37
Miroslav Voznak, lecture on SIP 35
NAT Solution: an intervention on application layer
ALG (Application Layer Gateway), ALG workstogether with NAT and makes rewriting inapplication layer
NAT s pport
8/2/2019 SIP-SDP-2
36/37
36
NAT support STUN, TURN, ICE help on the Client Side
(these protocols help to find out public IP)
Session Border Controller (SBC) help on
the Provider Side, clients behind NATcommunicate through a border device
SIP Proxy with s Media Relay support (RTPProxy) in order to ensure signaling and mediarouting on the same IP
8/2/2019 SIP-SDP-2
37/37
37
Thank you for your attention
mailto:[email protected]:[email protected]:[email protected]:[email protected]