Vous êtes sur la page 1sur 30

Reference VoIP

I. IETF RFC 3261 SIP (Session Initiation Protocol)


II. IETF RFC 4566 SDP (Session Description Protocol)
III. RTP (Real-time Transport Protocol)
IV. RTCP (RTP Control Protocol)
V. Basic Call flow

2013-02-27
TS Korea
Daniel Yoo
What is SIP?
SIP : Session Initiation Protocol

IEFT designed signaling protocol

SIP is used for creating, modifying and terminating two-party or multiparty sessions.

It can run on TCP, UDP and SCTP

It is a text-based protocol, incorporating many elements of the HTTP and the SMTP.
SIP Method
Request name Description Defined in
INVITE Indicates a client is being invited to participate in a call session. RFC 3261

ACK Confirms that the client has received a final response to an INVITE request. RFC 3261

BYE Terminates a call and can be sent by either the caller or the callee. RFC 3261
CANCEL Cancels any pending request. RFC 3261
OPTIONS Queries the capabilities of servers. RFC 3261
REGISTER Registers the address listed in the To header field with a SIP server. RFC 3261
PRACK Provisional acknowledgement. RFC 3262
SUBSCRIBE Subscribes for an Event of Notification from the Notifier. RFC 3265
NOTIFY Notify the subscriber of a new Event. RFC 3265
PUBLISH Publishes an event to the Server. RFC 3903
INFO Sends mid-session information that does not modify the session state. RFC 6086
REFER Asks recipient to issue SIP request (call transfer.) RFC 3515
MESSAGE Transports instant messages using SIP. RFC 3428
UPDATE Modifies the state of a session without changing the state of the dialog. RFC 3311
SIP Response

Provisional (1xx): Request received and being processed.

Success (2xx): The action was successfully received, understood, and accepted.

Redirection (3xx): Further action needs to be taken (typically by sender) to complete the request.

Client Error (4xx): The request contains bad syntax or cannot be fulfilled at the server.

Server Error (5xx): The server failed to fulfill an apparently valid request.

Global Failure (6xx): The request cannot be fulfilled at any server.

The response message is same with HTTP


SIP Response 1xx and 2xx
100 Trying
This response indicates that the request has been received by the next-hop server (Proxy or CSCF).
This message is always gone to the client. (it is never forwarded upstream) .

180 Ringing
This message is trying to alert what the target UE is received the INVITE message.
This response may be used to initiate local ringback.

181 Call is Being Forwarded


The call is being forwarded to a different set of destination.

182 Queued
The called party is temporarily unavailable, but the server has decided to queue the call rather than reject it.

183 Session Progress


The 183 (Session Progress) response is used to convey information about the progress of the call that is not
otherwise classified. The Reason-Phrase, header fields, or message body MAY be used to convey more details about
the call progress.

200 OK
The request has succeeded.
SIP Response 3xx
300 Multiple Choices
The address in the request resolved to several choices, each with its own specific location, and the user (or UA) can
select a preferred communication end point and redirect its request to that location. The response MAY include a
message body containing a list of resource characteristics and location(s) from which the user or UA can choose the
one most appropriate, if allowed by the Accept request header field.

301 Moved Permanently


The user can no longer be found at the address in the Request-URI, and the requesting client SHOULD retry at the
new address given by the Contact header field . The requestor SHOULD update any local directories, address books,
and user location caches with this new value and redirect future requests to the address(es) listed.

302 Moved Temporarily


The requesting client SHOULD retry the request at the new address(es) given by the Contact header field. The
Request-URI of the new request uses the value of the Contact header field in the response.

305 Use Proxy


he requested resource MUST be accessed through the proxy given by the Contact field. The Contact field gives the
URI of the proxy. The recipient is expected to repeat this single request via the proxy. 305 (Use Proxy) responses
MUST only be generated by UASs.

380 Alternative Service


The call was not successful, but alternative services are possible. The alternative services are described in the
message body of the response. Formats for such bodies are not defined here, and may be the subject of future
standardization.
SIP Response 4xx (1)
400 Bad Request
The request could not be understood due to malformed syntax.

401 Unauthorized
The request requires user authentication.

402 Payment Required


Reserved for future use.

403 Forbidden
The server understood the request, but is refusing to fulfill it.

404 Not Found


The server has definitive information that the user does not exist at the domain specified in the Request-URI.

405 Method Not Allowed


The method specified in the Request-Line is understood, but not allowed for the address identified by the Request-
URI.

406 Not Acceptable


The resource identified by the request is only capable of generating response entities that have content
characteristics not acceptable according to the Accept header field sent in the request.
SIP Response 4xx (2)
407 Proxy Authentication Required
This code is similar to 401 (Unauthorized), but indicates that the client MUST first authenticate itself with the proxy.

408 Request Timeout


The server could not produce a response within a suitable amount of time, for example, if it could not determine the
location of the user in time. The client MAY repeat the request without modifications at any later time.

410 Gone
The requested resource is no longer available at the server and no forwarding address is known. This condition is
expected to be considered permanent. If the server does not know, or has no facility to determine, whether or not
the condition is permanent, the status code 404 (Not Found) SHOULD be used instead.

413 Request Entity Too Large


The server is refusing to process a request because the request entity-body is larger than the server is willing or able
to process.

414 Request-URI Too Large


The server is refusing to service the request because the Request-URI is longer than the server is willing to interpret.

415 Unsupported Media Type


The server is refusing to service the request because the message body of the request is in a format not supported
by the server for the requested method. The server MUST return a list of acceptable formats using the Accept,
Accept-Encoding, or Accept-Language header field, depending on the specific problem with the content.
SIP Response 4xx (3)
416 Unsupported URI Scheme
The server cannot process the request because the scheme of the URI in the Request-URI is unknown to the server.

420 Bad Extension


The server did not understand the protocol extension specified in a Proxy-Require or Require header field.

421 Extension Required


The UAS needs a particular extension to process the request, but this extension is not listed in a Supported header
field in the request. Responses with this status code MUST contain a Require header field listing the required
extensions.

423 Interval Too Brief


The server is rejecting the request because the expiration time of the resource refreshed by the request is too short.
This response can be used by a registrar to reject a registration whose Contact header field expiration time was too
small.

480 Temporarily Unavailable


The callee's end system was contacted successfully but the callee is currently unavailable (for example, is not logged
in, logged in but in a state that precludes communication with the callee, or has activated the "do not disturb"
feature). The response MAY indicate a better time to call in the Retry-After header field.
SIP Response 4xx (4)
481 Call/Transaction Does Not Exist
This status indicates that the UAS received a request that does not match any existing dialog or transaction.

482 Loop Detected


The server has detected a loop.

483 Too Many Hops


The server received a request that contains a Max-Forwards header field with the value zero.
484 Address Incomplete
The server received a request with a Request-URI that was incomplete.

485 Ambiguous
The Request-URI was ambiguous. The response MAY contain a listing of possible unambiguous addresses in Contact
header fields.

486 Busy Here


The callee's end system was contacted successfully, but the callee is currently not willing or able to take additional
calls at this end system. The response MAY indicate a better time to call in the Retry-After header field.
SIP Response 4xx (5)
487 Request Terminated
The request was terminated by a BYE or CANCEL request.

488 Not Acceptable Here


The response has the same meaning as 606 (Not Acceptable), but only applies to the specific resource addressed by
the Request-URI and the request may succeed elsewhere.

491 Request Pending


The request was received by a UAS that had a pending request within the same dialog.

493 Undecipherable
The request was received by a UAS that contained an encrypted MIME body for which the recipient does not possess
or will not provide an appropriate decryption key. This response MAY have a single body containing an appropriate
public key that should be used to encrypt MIME bodies sent to this UA.
SIP Response 5xx
501 Not Implemented
The server does not support the functionality required to fulfill the request. This is the appropriate response when a
UAS does not recognize the request method and is not capable of supporting it for any user.

502 Bad Gateway


The server, while acting as a gateway or proxy, received an invalid response from the downstream server it accessed
in attempting to fulfill the request.

503 Service Unavailable


he server is temporarily unable to process the request due to a temporary overloading or maintenance of the server.
The server MAY indicate when the client should retry the request in a Retry-After header field.

504 Server Time-out


The server did not receive a timely response from an external server it accessed in attempting to process the request.

505 Version Not Supported


he server does not support, or refuses to support, the SIP protocol version that was used in the request. The server is
indicating that it is unable or unwilling to complete the request using the same major version as the client, other
than with this error message.

513 Message Too Large


The server was unable to process the request since the message length exceeded its capabilities.
SIP Response 6xx
600 Busy Everywhere
he callee's end system was contacted successfully but the callee is busy and does not wish to take the call at this time.

603 Decline
The callee's machine was successfully contacted but the user explicitly does not wish to or cannot participate.

604 Dose Not Exist Anywhere


The server has authoritative information that the user indicated in the Request-URI does not exist anywhere.

606 Not Acceptable


The user's agent was contacted successfully but some aspects of the session description such as the requested media,
bandwidth, or addressing style were not acceptable.
What is SDP?
SDP : Session Description Protocol

It is a format for describing streaming media initialization parameters.

IETF proposed Standard. (RFC 4566)

It is used for association of media type between each end-point.

- Media type
- type of codec
- transport information (ex : RTP and port)
- sampling information of codec
- etc
What is RTP & RTCP?
RTP : Real-time Transport Protocol (RFC 3550)

RTCP : RTP Control Protocol (RFC 3550)

RTP is a standardization packet format for delivering Audio and Video over IP network.

RTP is used in conjunction with the RTCP.

While RTP carries the media streams (e.g., audio and video), RTCP is used to monitor
transmission statistics and quality of service (QoS) and aids synchronization of multiple streams.
RTP QoS (1)
1) Delta delay & Jitter

T1 S1
S2
T2 S3
T3 S4
T4 S5 D(i, j ) = (T j Ti ) ( S j S i )

T5 J = J + (| D(i 1, i ) | J ) / 16

2) Packet loss / Duplicated / out of order

Sn - Sn-1 = 1 normal
Sn - Sn-1 > 1 packet loss
Sn - Sn-1 < 1 out of order
Sn - Sn-1 = 0 duplication

Sn : RTP sequence number (value is n)


Sn-1 : RTP sequence number (value is n-1)
RTP QoS (2)
3) E2E Delay

T1 S1
S2
T2 S3
T3 S4
T4 S5 D(i, j ) = (T j Ti ) ( S j S i )

T5 J = J + (| D(i 1, i ) | J ) / 16

2) Packet loss / Duplicated / out of order

Sn - Sn-1 = 1 normal
Sn - Sn-1 > 1 packet loss
Sn - Sn-1 < 1 out of order
Sn - Sn-1 = 0 duplication

Sn : RTP sequence number (value is n)


Sn-1 : RTP sequence number (value is n-1)
RTP QoS (3)

R = Ro Is Id Ie + A

Advantage factor
Base R value
- Noise level

Impairments that Impairments that


occur simultaneously are delayed with
with speech respect to speech Equipment Impairment
- received speech level - talker echo Factor
- sidetone level - listener echo - CODEC
- quantization noise - round trip delay - multiplexing effects

Range of R-factor
R-Factor MOS User Experience
90 43 (4.3) Excellent
80 40 (4.0) Good
70 36 (3.6) Fair
60 31 (3.1) Poor
50 26 (2.6) Bad
RTCP QoS (1)
RTCP RR(Receiver Report) report about statistics of QoS .

It is QoS until when mobile received RTP from started sequence number to 30654
Lost, Jitter are calculated and reported by RR report

Last SR timestamp (LSR) and Delay since last SR timestamp (DLSR) are used for calculating of RTT.
RTCP QoS (2)

LSR = T1

R1

DLSR = R2 R1

R2

T2

RTT = T2 LSR - DLSR


Basic Call flow - Registration

Mobile send a SIP RRQ message after attach.


QCI 5

Authorization the 1st RRQ message


- Authentication Scheme : Digest some parameters of authentication are null.
- username = 4500811111111@nsn.com
- realm = nsn.com
- nonce = Authorization
- uri = sip:nsn.com - Authentication Scheme : Digest
- response = - realm = nsn.com
- nonce = oWPXNSwX51qgWo1
- algorithm = AKAv1-MD5

Authorization CSCF send a 401 unauthorized message


- Authentication Scheme : Digest with some information which is related with authentication.
- username = 4500811111111@nsn.com
- realm = nsn.com
- nonce = oWPXNSwX51qgWo1
- uri = sip:nsn.com the 2nd RRA message with adding information of authentication.
- response = 1681babe authentication information is referred by 401 Unauthorized message.
- algorithm = AKAv1-MD5
Basic Call flow Call
SIP INVITE message
Session Initiation Protocol
Request-Line: INVITE tel:+821085780503 SIP/2.0 callee information (dialing number or ID)
Method: INVITE
Request-URI: tel:+821085780503
Request-URI Host Part: \n
Resent Packet: False
Message Header
Max-Forwards: 70
Route: sip:10.113.13.250:5060;lr CSCF IP address
Via: SIP/2.0/UDP 10.174.21.60:5060;branch=z9hG4bK0001b83b-206fabe2
Transport: UDP
Sent-by Address: 10.174.21.60 caller mobile IP address
Sent-by port: 5060
Branch: z9hG4bK0001b83b-206fabe2
CSeq: 1 INVITE
Sequence Number: 1
Method: INVITE
From: <sip:01037791618@lte-nsn.com>;tag=54467_0001b94e-43d9c569 Caller information
SIP from address: sip:01037791618@lte-nsn.com
SIP from address User Part: 01037791618
SIP from address Host Part: lte-nsn.com
SIP tag: 54467_0001b94e-43d9c569
To: tel:+821085780503 callee information
Allow: INVITE,BYE,CANCEL,ACK,PRACK,UPDATE,INFO,REFER,NOTIFY,MESSAGE,OPTIONS
P-Preferred-Identity: <sip:01037791618@lte-nsn.com>
SIP PPI Address: sip:01037791618@lte-nsn.com
SIP PPI User Part: 01037791618
SIP PPI Host Part: lte-nsn.com
P-Access-Network-Info: 3GPP-E-UTRAN-FDD;utran-cell-id-3gpp=45006204a112ee01
Contact: <sip:01037791618@10.174.21.60:5060>;nsn-vt
Contact-URI: sip:01037791618@10.174.21.60:5060
Contactt-URI User Part: 01037791618
Contact-URI Host Part: 10.174.21.60
Contact-URI Host Port: 5060
Contact parameter: nsn-vt LTE call type
Privacy: none
Accept-Contact: *;description="AT"
Supported: timer
Session-Expires: 90;refresher=uac
Content-Length: 485
User-Agent: nsn-client/LTE_AT1.0+LTE_VT2.0;LG-F160L;Device_Type=Android_Phone;305_use-proxy;md=1;Net_Type=LTE device information
Content-Type: application/sdp
Call-ID: 0001b92f-2490b232@10.174.21.60 permanent ID until closing this call
Message Body
Session Description Protocol
SDP message in the SIP INVITE

Media list which is supported by caller

Callee (or MG) chose one in this list.


The chosen media type is in the SIP 180 Ringing
or 200 OK
SIP 100 Trying
Session Initiation Protocol
Status-Line: SIP/2.0 100 TRYING
Status-Code: 100
Resent Packet: False
Message Header
To: <tel:+821085780503>
From: <sip:01037791618@lte-nsn.co.kr>;tag=54467_0001b94e-43d9c569
SIP from address: sip:01037791618@lte-nsn.co.kr
SIP from address User Part: 01037791618
SIP from address Host Part: lte-nsn.co.kr
SIP tag: 54467_0001b94e-43d9c569
Call-ID: 0001b92f-2490b232@10.174.21.60
CSeq: 1 INVITE
Sequence Number: 1
Method: INVITE
Via: SIP/2.0/UDP 10.174.21.60:5060;branch=z9hG4bK0001b83b-206fabe2
Transport: UDP
Sent-by Address: 10.174.21.60
Sent-by port: 5060
Branch: z9hG4bK0001b83b-206fabe2
Content-Length: 0
SIP 183 Session Progress
Session Initiation Protocol
Status-Line: SIP/2.0 183 Session Progress
Status-Code: 183
Resent Packet: False
Message Header
Allow: ACK,BYE,CANCEL,INFO,INVITE,MESSAGE,NOTIFY,OPTIONS,REGISTER,REFER,SUBSCRIBE,UPDATE
CSeq: 1 INVITE
Sequence Number: 1
Method: INVITE
Call-ID: 0001b92f-2490b232@10.174.21.60
Contact: sip:10.113.16.11:5067 callee IP address and port
Contact-URI: sip:10.113.16.11:5067
Contact-URI Host Part: 10.113.16.11
Contact-URI Host Port: 5067
Content-Length: 246
Content-Type: application/sdp
From: <sip:01037791618@lte-nsn.co.kr>;tag=54467_0001b94e-43d9c569
SIP from address: sip:01037791618@lte-nsn.co.kr
SIP from address User Part: 01037791618
SIP from address Host Part: lte-nsn.co.kr
SIP tag: 54467_0001b94e-43d9c569
Record-Route: <sip:orig@10.113.13.250:5060;lr>
To: <tel:+821085780503>;tag=JAUMD63E5E05ac32de030753
SIP tag: JAUMD63E5E05ac32de030753
Via: SIP/2.0/UDP 10.174.21.60:5060;branch=z9hG4bK0001b83b-206fabe2
Transport: UDP
Sent-by Address: 10.174.21.60
Sent-by port: 5060
Branch: z9hG4bK0001b83b-206fabe2
SDP message in the SIP 183 Session Progress

Selected media information by callee


SIP 200 OK
Session Initiation Protocol
Status-Line: SIP/2.0 200 OK
Status-Code: 200
Resent Packet: False
Message Header
Allow: ACK,BYE,CANCEL,INFO,INVITE,MESSAGE,NOTIFY,OPTIONS,REGISTER,REFER,SUBSCRIBE,UPDATE
CSeq: 1 INVITE
Sequence Number: 1
Method: INVITE
Call-ID: 0001b92f-2490b232@10.174.21.60
Contact: <sip:10.113.16.11:5067>
Contact-URI: sip:10.113.16.11:5067
Contact-URI Host Part: 10.113.16.11
Contact-URI Host Port: 5067
Content-Length: 246
Content-Type: application/sdp
From: <sip:01037791618@lte-nsn.co.kr>;tag=54467_0001b94e-43d9c569
SIP from address: sip:01037791618@lte-nsn.co.kr
SIP from address User Part: 01037791618
SIP from address Host Part: lte-nsn.co.kr
SIP tag: 54467_0001b94e-43d9c569
Record-Route: <sip:orig@10.113.13.250:5060;lr>
Require: timer
Session-Expires: 90;refresher=uac
Supported: timer
To: <tel:+821085780503>;tag=JAUMD63E5E05ac32de030674
SIP tag: JAUMD63E5E05ac32de030674
Via: SIP/2.0/UDP 10.174.21.60:5060;branch=z9hG4bK0001b83b-206fabe2
Transport: UDP
Sent-by Address: 10.174.21.60
Sent-by port: 5060
Branch: z9hG4bK0001b83b-206fabe2
SDP message in the SIP 200 OK

Selected media information by callee


SIP Bye
Session Initiation Protocol
Request-Line: BYE sip:10.113.16.11:5067 SIP/2.0
Method: BYE
Request-URI: sip:10.113.16.11:5067
Request-URI Host Part: 10.113.16.11
Request-URI Host Port: 5067
Resent Packet: False
Message Header
Max-Forwards: 70
Route: <sip:orig@10.113.13.250:5060;lr>
Via: SIP/2.0/UDP 10.174.21.60:5060;branch=z9hG4bK0002e430-2ef74625
Transport: UDP
Release reason is in the reason field.
Sent-by Address: 10.174.21.60
Sent-by port: 5060 We can find why this call is released.
Branch: z9hG4bK0002e430-2ef74625
CSeq: 3 BYE Reason is specified in RFC3326
Sequence Number: 3 (Example)
Method: BYE
From: <sip:01037791618@lte-nsn.co.kr>;tag=54467_0001b94e-43d9c569
Reason: SIP ;cause=200 ;text="Call completed elsewhere"
SIP from address: sip:01037791618@lte-nsn.co.kr Reason: Q.850 ;cause=16 ;text="Terminated"
SIP from address User Part: 01037791618 Reason: SIP ;cause=600 ;text="Busy Everywhere"
SIP from address Host Part: lte-nsn.co.kr Reason: SIP ;cause=580 ;text="Precondition Failure
SIP tag: 54467_0001b94e-43d9c569
To: <tel:+821085780503>;tag=JAUMD63E5E05ac32de030674
SIP tag: JAUMD63E5E05ac32de030674
Call-ID: 0001b92f-2490b232@10.174.21.60
Allow: INVITE,BYE,CANCEL,ACK,PRACK,UPDATE,INFO,REFER,NOTIFY,MESSAGE,OPTIONS
P-Preferred-Identity: <sip:01037791618@lte-nsn.co.kr>
SIP PPI Address: sip:01037791618@lte-nsn.co.kr
SIP PPI User Part: 01037791618
SIP PPI Host Part: lte-nsn.co.kr
P-Access-Network-Info: 3GPP-E-UTRAN-FDD;utran-cell-id-3gpp=45006204a112ee01
Accept-Contact: *;description="AT"
Reason: USER;cause=101;text="USER triggered"
Reason Protocols: USER
User-Agent: nsn-client/LTE_AT1.0+LTE_VT2.0;LG-F160L;Device_Type=Android_Phone;305_use-proxy;md=1;Net_Type=LTE
Content-Length: 0

Vous aimerez peut-être aussi