Sie sind auf Seite 1von 37

Lecture No.

9 SIP - requests and responses, header fields and extensions

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 the capabilities of the calling and receiving SIP phones

Methods extension

Miroslav Voznak, lecture on SIP

Responses
1xx informational responses, such as 180, which means ringing 200 - 699 final response
2xx success responses, such as 200 OK 3xx redirection responses

Responses
4xx request failures 5xx server errors 6xx global failures

Transaction
Transaction a request and all responses old type hash To, From,RURI, CSeq

new parameter branch in Via


z9hG4bK is beginning of a string branch (new way of transaction determination)

Dialog
Dialog
Call-ID, From tag, To tag

CSeq identifies a transaction in dialog

Registration

Miroslav Voznak, lecture on SIP

Registration
- bundling of user URI and device URI (From and Contact) - Expires is a time period of registration (Expires=0 , cancellation)

Miroslav Voznak, lecture on SIP

Redirection

Miroslav Voznak, lecture on SIP

10

SIP message

Miroslav Voznak, lecture on SIP

11

Session Description Protocol


v=0 o=ja 987504994 987504994 IN IP4 1.2.3.4 s=Hovor 1 c=IN IP4 1.2.3.4 t=3196493794 3196497394 m=audio 10000 RTP/AVP 0 22 a=rtpmap:0 aplication/g711 a=rtpmap:22 aplication/g723.1

SDP
v = Version number (ignored by SIP) o = Session Origin used by SIP s = Subject c = 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)
Miroslav Voznak, lecture on SIP 12

INVITE
INVITE sip:bob@biloxi.com SIP/2.0 Via: SIP/2.0/UDP pc33.atlanta.com:5060;branch=z9hG4bK776asdhds To: Bob <sip:bob@biloxi.com> From: Alice <sip:alice@atlanta.com>;tag=1928301774 Call-ID: a84b4c76e66710 CSeq: 314159 INVITE Contact: <sip:alice@pc33.atlanta.com> Content-Type: application/sdp Content-Length: 142 (SDP part)

the first line contains : method name: INVITE Request-URI (next hope is sip:bob@biloxi.com) SIP version number: SIP/2.0
13

SIP via
INVITE sip:bob@biloxi.com 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 <sip:bob@biloxi.com> From: Alice <sip:alice@atlanta.com>;tag=1928301774 Call-ID: a84b4c76e66710 CSeq: 314159 INVITE Contact: <sip:alice@pc33.atlanta.com> Content-Type: application/sdp Content-Length: 142 (SDP part)

Via field: insterted records point to the used route, Proxy servers insert next records response should use the same route as a request branch enables to detect the loops
14

Dialog (Call-leg)
INVITE sip:bob@biloxi.com SIP/2.0 Via: SIP/2.0/UDP pc33.atlanta.com:5060;branch=z9hG4bK776asdhds To: Bob <sip:bob@biloxi.com> From: Alice <sip:alice@atlanta.com>;tag=1928301774 Call-ID: a84b4c76e66710 CSeq: 314159 INVITE Contact: <sip:alice@pc33.atlanta.com> Content-Type: application/sdp Content-Length: 142
(SDP part)

Dialog the same information during the same call-leg are in the records: To , From a Call-ID To a From specifies logical address of endpoints of connection Call-ID unique identifier during the dialog
15

CSeq
INVITE sip:bob@biloxi.com SIP/2.0 Via: SIP/2.0/UDP pc33.atlanta.com:5060;branch=z9hG4bK776asdhds To: Bob <sip:bob@biloxi.com> From: Alice <sip:alice@atlanta.com>;tag=1928301774 Call-ID: a84b4c76e66710 CSeq: 314159 INVITE Contact: <sip:alice@pc33.atlanta.com> 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
16

Contact
INVITE sip:bob@biloxi.com SIP/2.0 Via: SIP/2.0/UDP pc33.atlanta.com:5060;branch=z9hG4bK776asdhds To: Bob <sip:bob@biloxi.com> From: Alice <sip:alice@atlanta.com>;tag=1928301774 Call-ID: a84b4c76e66710 CSeq: 314159 INVITE Contact: <sip:alice@pc33.atlanta.com> Content-Type: application/sdp Content-Length: 142

Contact contains SIP URI for direct communication, if SIP Proxy

doesnt insert Record-Route field than next transctions can be routed directly field Contact is also stated in response 200 OK
17

Content type, Length


INVITE sip:bob@biloxi.com SIP/2.0 Via: SIP/2.0/UDP pc33.atlanta.com:5060;branch=z9hG4bK776asdhds To: Bob <sip:bob@biloxi.com> From: Alice <sip:alice@atlanta.com>;tag=1928301774 Call-ID: a84b4c76e66710 CSeq: 314159 INVITE Contact: <sip:alice@pc33.atlanta.com> Content-Type: application/sdp Content-Length: 142

Content-Type describes the type of body (SDP) Content-Length includes the size of content (in bytes), the value 0 means without content

18

Max Forwards
INVITE sip:bob@biloxi.com SIP/2.0 Via: SIP/2.0/UDP pc33.atlanta.com:5060;branch=z9hG4bK776asdhds Max-Forwards: 30 To: Bob <sip:bob@biloxi.com> From: Alice <sip:alice@atlanta.com>;tag=1928301774 Call-ID: a84b4c76e66710 CSeq: 314159 INVITE Contact: <sip:alice@pc33.atlanta.com> Content-Type: application/sdp Content-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

19

INVITE and response 200 OK

20

Tagging
in the case of forking there would be difficult to resolve who answered UAS adds a tag into the response

To: sip:bob@macrosoft.com;tag=a48s

next request contains tag inserted into field To


21

Response routing
the reguests are routed according to Request URI (RURI)
and the responses according to field Via

Miroslav Voznak, lecture on SIP

22

Forking
the first 200 OK confirmed by ACK

the rest obtains 487 Cancelled INVITE

23

Record Routing
- Record route field is inserted by SIP Proxy not only into the header of method (request) but into the final response as well - a next transaction is routed via the elements stated in the record route

Miroslav Voznak, lecture on SIP

24

SIP trapezoid
- Outbound Proxy has to find a SIP Proxy which is able to serve 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

25

ENUM
- SIP addressing is based on SIP URI - the number (E.164) can be resolved via DNS wherein NAPTR record contains a regular expression which is applied to ENUM query and the result of this operation is SIP URI (or a list of URIs)

- SIP URI contains a host (users domain), via SRV record is resolved serving SIP Proxy
- IP address of SIP proxy is resolved via A record in DNS

26

Call Setup

27

Termination of established session - Bye

28

and establishing session Cancel


- two requests INVITE and CANCEL open two transactions

29

SIP and PSTN Interworking

30

Presence
UA gets status and presence information which corresponds to users of server Users are subscribed to users presence NOTIFY is sent on an event (a change of the state)

SUBCRIBE creates a dialog wherein the NOTIFY is sent on a change of the state
31

Subscribe a Notify

32

Instant Messaging

Method MESSAGE is used for IM text is in body of message request Message doesnt create a dialog

33

NAT
Issue: clients behind NAT insert private IP into signaling in SIP fields Via, From, Contact and SDP c-line (contact)

Miroslav Voznak, lecture on SIP

34

NAT
Solution: an intervention on application layer ALG (Application Layer Gateway), ALG works together with NAT and makes rewriting in application layer

Miroslav Voznak, lecture on SIP

35

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 NAT communicate through a border device SIP Proxy with s Media Relay support (RTP Proxy) in order to ensure signaling and media routing on the same IP
36

Thank you for your attention


hungtai-fet@mail.hut.edu.vn

37

Das könnte Ihnen auch gefallen