Documente Academic
Documente Profesional
Documente Cultură
SIP
Session Initiation Protocol
CIRCUIT SWITCHING
PSTN Telephony switch
321
switch 54
67890
321
54
67890
switch
PACKET SWITCHING
IP Telephony
router
router
router
router
ITU-T IETF ITU-T and IETF ITU and ANSI ITU and ANSI
Standard Standard Standard Standard Standard
References Description
SDP
SESSION
ITU
- H323 –Multimedia transmission (Voice, Data, Video) over packet switched network
- H248- Inter-operability between Packet switched and Circuit switched networks
- H.245 – Media and Bearer Channel creation
- H.225 – Address Resolution & Access Authorization (Call Signaling)
IETF
IPv4/IPv6 - Internet Protocol version 4 & 6
SI P- Session Initiation Protocol (alternate to H323 of ITU)
MGCP – Media Gateway Control Protocol
RSVP – Resource Reservation Protocol (Integrated Services)
RTP – Real Time Protocol
SIP H.323
Range Carrier-class solution Addressing the Based on the LAN focusing on
wide area application enterprise client tele
Characteristics Messages are formatted as text- Fit Binary format- Unsuitable for the
for Internet Internet
Allows for standards-based Extensions are added by using
extensions to perform specific vendor-specific software
functions
Hierarchical, URL style addressing Addressing scheme doesn’t scale
scheme that scales well well
Minimal delay Possibilities of delay up to 7-8 sec
SIP H.323
Services Ability to ‘fork’ calls ‘Forking’ not possible in the
existing standard
Unique ability to mix media Cannot mix media within a session
• There are several different SIP servers, each with their own
purpose
• There are:
User agent servers
Proxy servers
Redirect servers
Registrars
• There is also something called a location server running a
location service which may be co-located with a SIP server
SIP SIP
SIP SIP
LAN A LAN B
• Client—Server model
• User Agent Client (UAC)—Initiates sessions
• User Agent Server (UAS)—Responds to session requests
• User Agent = UAC + UAS
Originates SIP
Requests
Proxy User
Server Agent X
Responds for 1 and X
Answers on behalf
of users.
• Transaction stateless
Proxy server forwards all methods and responses without
interaction
• Transaction Stateful
Proxy server opens a Transaction Control Block (TCB) when a
method is received,
maintains state for the transaction until the final response is
received
a stateful server is required to originate a CANCEL method, or
an acknowledgement
Method Description
INVITE Initiates a call, changes call parameters (re-INVITE).
ACK Confirms a final response for INVITE.
BYE Terminates a call.
CANCEL Cancels searches and “ringing”.
OPTIONS Queries the capabilities of the other side.
REGISTER Registers with the Location Service.
INFO Sends mid-session information that does not modify
the session state.
Code Reason
100 Trying
180 Ringing
183 Session Progress
2XX Success
Code Reason
200 OK
202 Accepted
3XX Redirection
Code Reason
300 Multiple Choices
301 Moved Permanently
302 Moved Temporarily
Code Reason
400 Bad request
401 Unauthorized
403 Forbidden
Code Reason
404 Not Found
407 Proxy Authentication required
408 Request Timeout
480 Temporarily Unavailable
482 Loop Detected
486 Busy Here
487 Request Terminated
488 Not Acceptable Here
Code Reason
500 Server Internal Error
503 Service Unavailable
505 Version Not Supported
Code Reason
600 Busy Everywhere
606 Not Acceptable
Start Line:
Every SIP message begins with a Start Line. The Start Line conveys the
message type (method type in requests, and response code in responses)
and the protocol version.
The Start Line may be either a Request-line (requests) or a Status-line
(responses),as follows:
• The Request-line includes a Request-URI, which indicates the user or
service to which this request is being addressed.
• The Status-line holds the numeric Status-code and its associated textual
phrase.
Headers
• SIP header fields convey message attributes that provide additional
information about the message.
• They are similar in syntax and semantics to HTTP header fields
• Headers can span multiple lines.
Message Body
• A message body is used to describe the session to be initiated (for example, in
a multimedia session this may include audio and video codec types and
sampling rates), or alternatively it may be used to contain opaque textual or
binary data of any type which relates in some way to the session.
• Message bodies can appear both in request and in response messages.
• SIP makes a clear distinction between signaling information, conveyed in the
SIP Start Line and headers, and the session description information.
Message body
Session Description Protocol
Session Description Protocol Version (v): 0
Owner/Creator, Session Id (o): - 4 2 IN IP4 164.164.58.14
Session Name (s): CounterPath X-Lite 3.0
Connection Information (c): IN IP4 164.164.58.14
Time Description, active time (t): 0 0
Media Description, name and address (m): audio 55792 RTP/AVP 107 98 3 101
Media Attribute (a): alt:1 1 : VNOnzyTb FFFh7Pnp 164.164.58.14 55792
Media Attribute (a): fmtp:101 0-15
Media Attribute (a): rtpmap:107 BV32/16000
Media Attribute (a): rtpmap:98 iLBC/8000
Media Attribute (a): rtpmap:101 telephone-event/8000
Media Attribute (a): sendrecv
B is RINGING
A ACKnowledges B
CONVERSATION
OK
Contact: UserAgent@domain.com;
REGISTER
Expires: 3600
Contact: UserAgent@domain.com;
Expires: 3600
200 OK
Expires: 0
401 Unauthorized
Expires: 0
200 OK
User Agent A Proxy Server Location/Redirect Server Proxy Server User Agent B
INVITE INVITE
100 Trying 302
(Moved Temporarily)
ACK
Call
Setup INVITE
INVITE
100 Trying
180 (Ringing)
180 (Ringing)
180 (Ringing)
Ringing Ringing
Ringing
CANCEL
CANCEL
CANCEL
200 OK
200 OK 200 OK
ACK
487 Req Term 487 Req Term
ACK ACK
Ringing Ringing
Ringing
ACK
408 Req Timeout
ACK
ACK
486 Busy Here
ACK
486 Busy Here
ACK
SUBSCRIBE
202 Accepted
202 Accepted
NOTIFY
NOTIFY
200 OK
200 OK
• Replay Attacks
• Registration Hijacking
• Request Spoofing
• Impersonating a Server
• Chosen Plaintext Attack
Authentication
Authentication
Digest S / MIME
D S
Basic
B A I A /
A U G U Application
M
S T E T
Layer
I Mechanisms
I H S H M
C T E
username/password
combination is used.
WWW-Authenticate: digest
realm="164.164.57.187",
qop="auth",
nonce="9e0962d5e57c4c5dbaa63dbcbe965d19",
opaque="5ccc069c403ebaf9f0171e9517f40e41“
algorithm=MD5
Parameter Description
Digest Indicator of authentication scheme.
Realm Associated protection domain
Qop Specifying “ Quality of Protection” that the server supports. It’s
value can be either”auth” for authentication, or “auth-int” for
authentication and integrity.
Nonce Unique string specified by the server.
Opaque String specified by the server for the client to return in the
subsequent requests.
Algorithm The algorithm to be used for checksum calculation. Default is
MD5
stale A flag indicating if the nonce value in the previous request is
stale.
Authorization: Digest
username=“student",
realm="164.164.57.187",
nonce="9e0962d5e57c4c5dbaa63dbcbe965d19",
uri="sip:164.164.57.187:5061",
response="47255c75f12faa78d699965c4325dab0",
cnonce="ed1ed6a122e4647b",
nc=00000001,
qop = auth,
Algorithm = MD5,
opaque="5ccc069c403ebaf9f0171e9517f40e41"
Parameter Description
Username The user’s name in the specifies realm
Nc Count of the number of requests that the client has sent
with the nonce value
Cnonce If a qop value is specified, the client must specify cnonce
value
Response The string of 32 Hex digits calculated checksum.
Expires: 3600
401 Unauthorized
Expires: 3600
200 OK
INVITE
100 Trying
ACK
INVITE
180 Ringing
180 Ringing
200 OK
200 OK
200 OK
200 OK
BYE
BYE
200 OK
200 OK
200 OK / SDP
200 OK
Message body
Session Description Protocol
00
01
10
11
20
21
30
31
Note: Each packet holds 10 seconds of audio/video information. Assumption: transfer delay is
constant and equal 1 second (exaggerated).The receiver sees the audio/ video with the same
speed as it is created, the constant transfer delay is immaterial.
20
15
30
27
37
Send Time (Sec)
Arrival & Play Time (Sec)
Application
G.711 G.729 H.261 H.263
Layer
RTP
Transport
Layer
UDP
Network
Layer IP
PHY &
Datalink Layer 1 & 2
Layer
Payload
V P X CC M Sequence Number
Type
Time Stamp
SSRC
CSRC list
.
.
.
.
CSRC list
Timestamp: 32 bits
The timestamp reflects the sampling instant of the first octet in the RTP data
packet. The sampling instant must be derived from a clock that increments
monotonically and linearly in time to allow synchronization and jitter
calculations.
SSRC: 32 bits
The SSRC field identifies the synchronization source. This identifier is chosen
randomly, with the intent that no two synchronization sources within the same
RTP session will have the same SSRC identifier.
Timestamp: 263020
Payload: 77B7F3537F80F01104A163350854F2FAADE50EBE66BAA1AE...
Audio:
Timestamp clock rate for audio 8000 Hz (= 125 μs) & for video is 90,000Hz.
One RTP packet caries 20 ms of audio samples, each RTP packet is sent by a
separate UDP datagram to avoid packetization delay.
Timestamp increments by 20 ms/125 μs = 160 .
Packet rate = 1 sec/20 ms = 50 Hz
Number of bits per RTP payload for uncompressed audio = 160*8 = 1280
Sequence number increments by one for each RTP packet.
TS = X TS = X+160
Audio Stream Audio Stream
SN = Y SN = Y+1
RECEIVER 2
SENDER
RECEIVER 1