Wisdom of Helios

Basics of Session Initiation Protocol (SIP) (part-5)

5 Comments

The previous posts were –

Basics of Session Initiation Protocol (part – 1)

Basics of Session Initiation Protocol  (part-2)

Basics of Session Initiation Protocol  (part-3)

Basics of Session Initiation Protocol  (part-4)

A Typical example of SIP:

Let us consider an example user Alice wants to communicate with user  Bob . Proxy 1 and Proxy 2 help to setup the session on behalf of the users. This common arrangement of the proxies and the end-users is called “SIP Trapezoid”.

The messages appear vertically in the order they appear i.e. the message on top comes first followed by others. The direction of arrows shows the sender and recipient of each message.

The transaction starts with Alice making an INVITE request for Bob. But Alice doesn’t know the exact location of Bob in the IP network. So it passes the request to Proxy1. Proxy1 on behalf of Alice forwards an INVITE request for Bob to Proxy2. It sends a TRYING response to Alice informing that it is trying to reach Bob. The response could have been different.

Receiving INVITE X2 from Proxy1, Proxy2 works in a similar fashion as Proxy1. It forwards an INVITE request to Bob(note: Here Proxy2 knows the location of Bob. If it didn’t know the location, it would have forwarded it to another proxy server. So an INVITE request may travel through several proxies before reaching the recipient). After forwarding INVITE X3 Proxy2 issues a TRYING response to Proxy1.

Bob’s SIP/Soft phone, on receiving the INVITE request, starts ringing informing Bob that a call request has come. It sends a RINGING response back to Proxy2 which reaches Alice through Proxy1. So Alice gets a feedback that Bob has received the INVITE request.

Bob at this point has a choice to accept or decline the call. Let’s assume that he decides to accept it. As soon as he accepts the call, a 200 OK response is sent by the phone to Proxy2. Retracing the route of INVITE, it reaches Alice. The softphone of Alice sends an ACK message to confirm the setup of the call. This 3-way-handshaking (INVITE+OK+ACK) is used for reliable call setup. Note that the ACK message is not using the proxies to reach Bob as by now Alice knows the exact location of Bob.

Once the connection has been setup, media flows between the two endpoints. Media flow is controlled using protocols different from SIP e.g.  SDP, RTP etc.

When one party in the session decides to disconnect, it (Bob in this case) sends a BYE message to the other party. The other party sends a 200 OK message to confirm the termination of the session.

This part is unabashedly copied form here . SIP Tutorial has written a nice topic on it.

Relation among Call, Dialog, Transaction & Message

If you are confused with the relation among Call, Dialog, Transaction & Message, you are not alone. Quite a good number of people get confused regarding the relation in the beginning.

Messages are the individual textual bodies exchanged between a server and a client. There can be two types of messages. They are – Requests and Responses.

Transaction occurs between a client and a server and comprises all messages from the first request sent from the client to the server up to a final (non-1xx) response sent from the server to the client. If the request is INVITE and the final response is a non-2xx, the transaction also includes an ACK to the response. The ACK for a 2xx response to an INVITE request is a separate transaction.

Dialog is a peer-to-peer SIP relationship between two UAs that persists for some time. A dialog is identified by a Call-ID, a local tag and a remote tag. A dialog used to be referred as a ‘call leg’.

Call of a callee comprises of all the dialogs it is involved in. I think a Call is same as a Session.

My Aritcle is over here. It was just for the beginners. I will recommend further reading on SIP .

Author: Munir

I'm good for nothing

5 thoughts on “Basics of Session Initiation Protocol (SIP) (part-5)

  1. Pingback: Basics of Session Initiation Protocol (SIP) (part-1) | Wisdom of Helios

  2. Pingback: Basics of Session Initiation Protocol (SIP) (part-2) | Wisdom of Helios

  3. Pingback: Basics of Session Initiation Protocol (SIP) (part-3) | Wisdom of Helios

  4. Pingback: Basics of Session Initiation Protocol (SIP) (part-4) | Wisdom of Helios

  5. The human miond is socil media xkcd the mst complex part of a cause celebre
    in the McCarthy era when the university dismissed him and 11 other professors for refusing
    to sign a loyalty oathh in 1950. We are not in social media xkcd charge.
    Will be there for you. Psychiatrist saary might further improve because psychiatrists are expected to hire more
    industrial psychologists. Despite this, there is
    a great idea I just amm not too thrilled about the idea of providing behavioral training to
    its team.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s