Sie sind auf Seite 1von 21

http://www.tech-invite.

com

SIP Protocol Structure through an Example


Proxy 3 (Stateful) Responding UA
V2.2 Nov 26, 2007

Initiating UA
1 INVITE

Proxy 1 (Stateful)
407 Proxy Authorization Required

This example illustrates, as a slide show, the structure of the SIP protocol, as outlined in chapter 5 of RFC 3261: Proxy 2 (Stateless)
INVITE 4 INVITE 100 Trying 5 4 180 Ringing 6 180 Ringing 6 INVITE 180 Ringing 6

3 4

ACK INVITE 100 Trying 5 4

"The lowest layer is the transport layer. It defines how a client sends requests and receives responses and how a server receives requests and sends responses over the network. All SIP elements contain a transport layer. The second layer is the transaction layer. A transaction is a request sent by a client transaction (using the transport layer) to a server transaction, along with all responses to that request sent from the server transaction back to the client. Any task that a user agent client (UAC) accomplishes takes place using a series of transactions. Stateless proxies do not contain a transaction layer. The layer above the transaction layer is called the transaction user (TU). Each of the SIP entities, except the stateless proxy, is a transaction user."
ACK

180 Ringing

200 OK 8 ACK

7 8 ACK

200 OK

200 OK

200 OK

8 Media Session

Note: we set aside the syntax and encoding as the lowest layer. In this example, the rejection of the first INVITE request, followed by a valid INVITE request, enables the analysis of the processing of the ACK for these two situations. It is assumed that both Proxy 1 and Proxy 3 stateful proxy servers are in the final signalling path because they requested it in the INVITE requests they routed on.

BYE BYE BYE y 200 OK y 200 OK y


Copyright 2005-2008 Jol Repiquet. All Rights Reserved.

200 OK
21 pages

http://www.tech-invite.com Copyright 2005-2008 Jol Repiquet. All Rights Reserved.

SIP Protocol Structure through an Example

(1)

Initiating UA
SDP Offer

Open Session

Proxy 1 (Stateful)
SIP Transaction User (TU)
The UAC (User Agent Client) TU: - creates the initial INVITE request - creates a new client transaction (in the transaction layer) and passes it the INVITE message, plus the IP address, port and transport The proxy core TU first validates the INVITE request. It cannot authenticate the originator because no credentials are provided. It rejects the request by sending back (see next slide) a 407 (Proxy Authentication Required) response.

UAC core 1
INVITE request INV/br-a0

UAS core

proxy core

SIP Transaction Layer


The new "INVITE" client transaction (state="calling") is identified by the CSeq header field and the "branch" parameter of the Via header field. T1 timer is started (if UDP) before passing message request to transport. The new "INVITE" server transaction (state="proceeding") is created by the proxy core (not acting as TU). The server transaction transmits the INVITE request to the TU and somehow knows that this TU will generate a response within 200ms: it does not send back a 100 Trying response.

INVITE request INV/br-a1

client transaction

server transaction

request

SIP Transport Layer


Client Transport: - before sending the request: insert the 'sent-by' parameter in the Via header field Server Transport: - when receiving the request: by examining the 'sent-by' parameter in the top Via header field, match it to the relevant server transaction and add the "received" parameter

request

client transport

server transport

server transport

client transport

send

receive

TLS SCTP TCP IP

RTP UDP IP IP UDP TCP IP

TLS SCTP

http://www.tech-invite.com Copyright 2005-2008 Jol Repiquet. All Rights Reserved.

SIP Protocol Structure through an Example

(2)

Initiating UA

Proxy 1 (Stateful)
SIP Transaction User (TU)
The UAC analyses the response and prepares a new INVITE request. The proxy core TU: sends back a 407 (Proxy Authentication Required) response

UAC core

UAS core

proxy core 2

407 response INV/br-a0

SIP Transaction Layer


When receiving the 407 response, the client transitions to state="completed", passes the response up to the TU, generates an ACK, and passes it to transport. D timer started. When D timer fires, the client transaction is destroyed. The server transaction enters the "completed" state and passes the 407 response to transport. When ACK (request) is received: passes to "confirmed" state and starts I timer. When I timer fires, the server transaction is destroyed.

407 response

ACK

INV/br-a0

client transaction 3
ACK (request) response

server transaction

SIP Transport Layer


Client Transport: - when receiving the response: match it to the relevant client transaction by examining 'sent-by' parameter in top Via header field - before sending the (ACK) request: insert 'sent-by' parameter in Via header field Server Transport: - before sending the response: retrieve IP@ & port from 'sent-by' and "received" - when receiving the (ACK) request: by examining 'sent-by' parameter in top Via header field, match it to relevant server transaction + add "received" parameter

response

request

client transport

server transport

server transport

client transport

send

receive

send

receive

TLS SCTP TCP IP

RTP UDP IP IP UDP TCP IP

TLS SCTP

http://www.tech-invite.com Copyright 2005-2008 Jol Repiquet. All Rights Reserved.

SIP Protocol Structure through an Example

(3)

Initiating UA

Proxy 1 (Stateful)
SIP Transaction User (TU)
The UAC (User Agent Client) TU: (1) creates the new INVITE request containing the correct credentials (2) creates a new client transaction and passes it the INVITE message, plus the IP address, port and transport The proxy core TU: (1) validates the request (2) determines the target for the request (3) forwards the request (see next slide) towards the target

UAC core 4
INVITE request 100 (Trying)

UAS core

proxy core

SIP Transaction Layer


The new "INVITE" client transaction (state="calling") is identified by CSeq header field and "branch" parameter of Via header field. T1 timer started (if UDP) before passing message request to transport. When receiving 1xx response: state="proceeding" and T1 reset. The new "INVITE" server transaction (identified by CSeq header field and "branch" parameter of Via header field) is created by proxy core (not acting as TU). The server transaction sends back a 100 Trying response and transmits the INVITE request to proxy core (acting as TU).

INVITE request INV/br-a1

INV/br-a1

client transaction

server transaction 5
100 (Trying) response request

request

response

SIP Transport Layer


Client & Server Transport main behavior, whatever the system: Client: (1) before sending a request: insert 'sent-by' parameter in Via header field (2) when receiving a response: match it to relevant client transaction by examining 'sent-by' parameter in top Via header field Server: (1) when receiving a request: by examining 'sent-by' parameter in top Via header field, match it to relevant server transaction + add "received" parameter; (2) before sending a response: retrieve IP@ and port from 'sent-by' and "received"

client transport

server transport

server transport

client transport

send

receive

send

receive

TLS SCTP TCP IP

RTP UDP IP IP UDP TCP IP

TLS SCTP

http://www.tech-invite.com Copyright 2005-2008 Jol Repiquet. All Rights Reserved.

SIP Protocol Structure through an Example

(4)

Proxy 1 (Stateful)
The proxy core TU: (1) validates the request (2) determines the target for the request (3) forwards the request (see next slide) towards the target

Proxy 3 (Stateful)

proxy core 4
INVITE request INV/br-a1 INV/br-x10

For forwarding the INVITE request, the proxy core creates a new client transaction

There is no Transaction Management with a stateless proxy

proxy core

Proxy 2 (Stateless)
proxy core

INVITE request INV/br-x10

server transaction

client transaction

server transaction 5

request

request request response

100 (Trying) response

request

server transport

client transport

server transport

client transport

server transport

client transport

send

send receive receive

send

receive

TLS UDP TCP IP SCTP IP UDP TCP IP

TLS SCTP IP UDP TCP IP

TLS SCTP

http://www.tech-invite.com Copyright 2005-2008 Jol Repiquet. All Rights Reserved.

SIP Protocol Structure through an Example Responding UA


SDP Offer

(5)

Proxy 3 (Stateful)

proxy core 4
INVITE request INV/br-x10 180 (Ringing)

For forwarding the INVITE request, the proxy core creates a new client transaction

UAC core 6

UAS core

180 (Ringing) response

INVITE request

INV/br-x30

INV/br-x30

server transaction

client transaction

server transaction

request

response

response

request

server transport

client transport

client transport

server transport

send

receive

send

receive

TLS SCTP TCP IP UDP IP IP

RTP UDP TCP IP

TLS SCTP

http://www.tech-invite.com Copyright 2005-2008 Jol Repiquet. All Rights Reserved.

SIP Protocol Structure through an Example

(6)

Proxy 1 (Stateful)

Proxy 3 (Stateful)

proxy core 6
180 (Ringing) INV/br-a1 INV/br-x10

proxy core

Proxy 2 (Stateless)
proxy core 6

180 (Ringing) INV/br-x10 INV/br-x30

server transaction

client transaction

server transaction

client transaction

response

response response

response

server transport

client transport

server transport

client transport

server transport

client transport

receive

send receive

send

TLS UDP TCP IP SCTP IP UDP TCP IP

TLS SCTP IP UDP TCP IP

TLS SCTP

http://www.tech-invite.com Copyright 2005-2008 Jol Repiquet. All Rights Reserved.

SIP Protocol Structure through an Example

(7)

Initiating UA

Proxy 1 (Stateful)

UAC core

UAS core 6
180 (Ringing) 180 (Ringing)

proxy core

INV/br-a1

INV/br-a1

INV/br-x10

client transaction

server transaction

client transaction

response

response

client transport

server transport

server transport

client transport

receive

send

TLS SCTP TCP IP

RTP UDP IP IP UDP TCP IP

TLS SCTP

http://www.tech-invite.com Copyright 2005-2008 Jol Repiquet. All Rights Reserved.

SIP Protocol Structure through an Example Responding UA


SDP Answer

(8)

The callee answers the call, and an SDP answer is communicated to the UAS core

Proxy 3 (Stateful)
Retransmissions of 200 OK (whatever the UA transport protocol) are handled by the UAS core, not the transaction layer. The 200 OK response retransmission (if any) is passed to the transport with an interval that starts at T1 seconds and doubles for each retransmission until it reaches T2 seconds. 200 (OK) INV/br-x10 INV/br-x30 The INVITE client transaction is destroyed as soon as it receives the 200 (OK) response and passes it to the proxy core TU. The INVITE server transaction is destroyed as soon as it receives the 200 (OK) response and passes it to the transport.

proxy core

UAC core 7
200 (OK) response

UAS core

INV/br-x30

server transaction

client transaction

server transaction

response

response

server transport

client transport

client transport

server transport

receive

send

TLS SCTP TCP IP UDP IP IP

RTP UDP TCP IP

TLS SCTP

http://www.tech-invite.com Copyright 2005-2008 Jol Repiquet. All Rights Reserved.

SIP Protocol Structure through an Example

(9)

Proxy 1 (Stateful)

Proxy 3 (Stateful)

proxy core 7
200 (OK) INV/br-a1 INV/br-x10 The INVITE client transaction is destroyed as soon as it receives the 200 (OK) response and passes it to the proxy core TU.

proxy core

Proxy 2 (Stateless)
proxy core 7
response response The INVITE server transaction is destroyed as soon as it receives the 200 (OK) response and passes it to the transport.

200 (OK) INV/br-x10

server transaction

client transaction

server transaction

response

response

server transport

client transport

server transport

client transport

server transport

client transport

receive

send receive

send

TLS UDP TCP IP SCTP IP UDP TCP IP

TLS SCTP IP UDP TCP IP

TLS SCTP

http://www.tech-invite.com Copyright 2005-2008 Jol Repiquet. All Rights Reserved.

SIP Protocol Structure through an Example

(10)

Initiating UA
SDP Answer

Proxy 1 (Stateful)

UAC core

UAS core 7
200 (OK) 200 (OK) The INVITE client transaction is destroyed as soon as it receives the 200 (OK) response and passes it to the UAC core TU. The INVITE server transaction is destroyed as soon as it receives the 200 (OK) response and passes it to the transport.

proxy core

INV/br-a1

INV/br-a1

client transaction

server transaction

response

response

client transport

server transport

server transport

client transport

receive

send

TLS SCTP TCP IP

RTP UDP IP IP UDP TCP IP

TLS SCTP

http://www.tech-invite.com Copyright 2005-2008 Jol Repiquet. All Rights Reserved.

SIP Protocol Structure through an Example

(11)

Initiating UA

Proxy 1 (Stateful)
The ACK request (following a 2xx final response) is passed to the transport layer directly for transmission

UAC core 8
ACK request

UAS core

proxy core

ACK request

client transport

server transport

server transport

client transport

send

receive

TLS SCTP TCP IP

RTP UDP IP IP UDP TCP IP

TLS SCTP

http://www.tech-invite.com Copyright 2005-2008 Jol Repiquet. All Rights Reserved.

SIP Protocol Structure through an Example

(12)

Proxy 1 (Stateful)

Proxy 3 (Stateful)

proxy core 8
ACK request

proxy core

ACK request

Both Proxy 1 and Proxy 3 stateful proxy servers are in the final signalling path because they requested it in the INVITE request they routed on.

server transport

client transport

server transport

client transport

send

receive

TLS UDP TCP IP SCTP IP IP IP UDP TCP IP

TLS SCTP

http://www.tech-invite.com Copyright 2005-2008 Jol Repiquet. All Rights Reserved.

SIP Protocol Structure through an Example Responding UA

(13)

Proxy 3 (Stateful)

proxy core 8
ACK request

UAC core

UAS core

ACK request

server transport

client transport

client transport

server transport

send

receive

TLS SCTP TCP IP UDP IP IP

RTP UDP TCP IP

TLS SCTP

http://www.tech-invite.com Copyright 2005-2008 Jol Repiquet. All Rights Reserved.

SIP Protocol Structure through an Example Responding UA

(14)

Initiating UA

Media part

Media part

UAC core

UAS core

UAC core

UAS core

client transport

server transport

client transport

server transport

TLS SCTP TCP IP

RTP UDP IP IP

RTP UDP TCP IP

TLS SCTP

http://www.tech-invite.com Copyright 2005-2008 Jol Repiquet. All Rights Reserved.

SIP Protocol Structure through an Example Responding UA

(15)

Proxy 3 (Stateful)

proxy core x
BYE request BYE/br-b1 BYE request

UAC core

UAS core

BYE/br-b1

server transaction

client transaction

request

request

client transport

server transport

client transport

server transport

receive

send

TLS SCTP TCP IP UDP IP IP

RTP UDP TCP IP

TLS SCTP

http://www.tech-invite.com Copyright 2005-2008 Jol Repiquet. All Rights Reserved.

SIP Protocol Structure through an Example

(16)

Proxy 1 (Stateful)

Proxy 3 (Stateful)

proxy core x
BYE request BYE/br-b31 BYE request

proxy core

BYE/br-b31

BYE/br-b1

server transaction

client transaction

server transaction

request

request

client transport

server transport

client transport

server transport

receive

send

TLS UDP TCP IP SCTP IP IP IP UDP TCP IP

TLS SCTP

http://www.tech-invite.com Copyright 2005-2008 Jol Repiquet. All Rights Reserved.

SIP Protocol Structure through an Example

(17)

Initiating UA

Proxy 1 (Stateful)

UAC core

UAS core x
BYE request BYE/br-b11 BYE request

proxy core

BYE/br-b11

BYE/br-b31

server transaction

client transaction

server transaction

request

request

client transport

server transport

client transport

server transport

receive

send

TLS SCTP TCP IP

RTP UDP IP IP UDP TCP IP

TLS SCTP

http://www.tech-invite.com Copyright 2005-2008 Jol Repiquet. All Rights Reserved.

SIP Protocol Structure through an Example

(18)

Initiating UA

Proxy 1 (Stateful)

UAC core y
200 (OK)

UAS core

proxy core

200 (OK) The BYE server transaction is destroyed as soon as it receives the 200 (OK) response and passes it to the transport. The BYE client transaction is destroyed as soon as it receives the 200 (OK) response and passes it to the proxy core TU. BYE/br-b11 BYE/br-b31

BYE/br-b11

server transaction

client transaction

server transaction

response

response

client transport

server transport

client transport

server transport

send

receive

TLS SCTP TCP IP

RTP UDP IP IP UDP TCP IP

TLS SCTP

http://www.tech-invite.com Copyright 2005-2008 Jol Repiquet. All Rights Reserved.

SIP Protocol Structure through an Example

(19)

Proxy 1 (Stateful)

Proxy 3 (Stateful)

proxy core y
200 (OK) BYE/br-b31 The BYE server transaction is destroyed as soon as it receives the 200 (OK) response and passes it to the transport. The BYE client transaction is destroyed as soon as it receives the 200 (OK) response and passes it to the proxy core TU.

proxy core

200 (OK) BYE/br-b31 BYE/br-b1

server transaction

client transaction

server transaction

response

response

client transport

server transport

client transport

server transport

send

receive

TLS UDP TCP IP SCTP IP IP IP UDP TCP IP

TLS SCTP

http://www.tech-invite.com Copyright 2005-2008 Jol Repiquet. All Rights Reserved.

SIP Protocol Structure through an Example (end) Responding UA

Proxy 3 (Stateful)

proxy core y
200 (OK) BYE/br-b1 The BYE server transaction is destroyed as soon as it receives the 200 (OK) response and passes it to the transport. The BYE client transaction is destroyed as soon as it receives the 200 (OK) response and passes it to the UAC core TU.

UAC core

UAS core

200 (OK) BYE/br-b1

server transaction

client transaction

response

response

client transport

server transport

client transport

server transport

send

receive

TLS SCTP TCP IP UDP IP IP

RTP UDP TCP IP

TLS SCTP

Das könnte Ihnen auch gefallen