Subject: [Sip] What's the difference between session and dialog in SIP?

From: "孙宗君" <[email-masked]>
Date: Wed, 23 Apr 2008 14:00:47 +0800

Hi, all

I am confused about the conception of session and dialog in RFC 3261.
Although someone pointed out the dialog is a relationship between
peer-2-peer and session is a multimedia relative relation, I am still
not clear about that.

For my understanding,  the scope of session is wider than dialog
means. Dialog can only exists between two peers,  one-2-one, but
session can contain more than 2 participants, right? For example, one
INVITE from UAC can create more than one dialog because of the forked
2xx responses by the proxy server, but the session is determined by
session id in the SDP and all the 2xx responses contain the same
session id. All the participants belong to the same session. So my
conclusion is that one session can contain more than one dialog even
though they are created by same method. The relationship between
dialog and session is many-2-one, right?

If my understanding is right,  then comes another question. The
scenario is above, one INVITE created more than one dialog, the caller
will maintain more than one dialog, he can terminate one of them via
BYE method while keeping the other dialog. According to RFC3261, BYE
method can terminate a session and its relative dialog. From this
statement it seems that my conclusion is not exactly right.

Then what is the relationship between session and dialog, one-2-one
map or one-2-many map?

Your instructions are highly appreciated.

Thanks

BR

Zongjun
_______________________________________________
Sip mailing list  https://www.ietf.org/mailman/listinfo/sip
This list is for NEW development of the core SIP Protocol
Use [email-masked] for questions on current sip
Use [email-masked] for new developments on the application of sip

---

From: Paul Kyzivat <[email-masked]>
Date: Wed, 30 Apr 2008 08:57:15 -0400

gaurav katiyar wrote:
> Hi,
>    I am getting confused now. what session exactly is ? Why ACK is an 
> end to end request for 200 OK of INVITE request? does it relate to 
> session any where ??? :-). Is it right to generate ACK locally by any 
> proxy including B2BUA for 200 OK of initial INVITE request?

The ACK is part of the INVITE and hence to establishing an INVITE dialog 
  and usage. It also *may* be a carrier for an SDP answer that completes 
an o/a and thus supports the establishment of an sdp media "session".

It is not permissible for a proxy to generate an ACK, except in response 
to a failed invite. You should never write a statement like "proxy 
including B2BUA", because those are very different things, and have 
different rules. A B2BUA *is* a UA, and hence may/must follow UA rules. 
Only UAs (including B2BUAs) generate ACK for 2xx responses to INVITE.

I think for the questions you seem to be worried about you should stop 
worrying about the meaning of "session" - it has no pertinence to what 
you are doing. What you need to be concerned with is establishing an 
INVITE dialog. (Technically it is a dialog plus an invite dialog usage, 
but that may be more detail than you need.)

	Paul

> Gaurav
> 
> */Mahesh Anjanappa <[email-masked]>/* wrote:
> 
>     I'm surprised to see that a fundamental concept "SIP Session" does
>     not have
>     a clear definition documented anywhere. I was eagerly waiting for a
>     IETF
>     Guru
>     to clarify this. I wish somebody writes a draft clarifying all the
>     undocumented
>     fundamental concepts in SIP. If i knew it all, i would have done it :-)
> 
>     My 2 cents on it.
>     A Session is a Rendezvous Contract between 2 or more UA's for
>     communnicating
>     with some modality. SIP dialog is a context over which such a
>     Contract is
>     negotiated
>     decided, and upheld.
>     Normally the SDP Session Id should identify the Contract/Session.
>     But not
>     necessarily
>     always. If its a multiparty the Conference ID would serve such a
>     purpose.
>     I can get into a session with a non-INVITE dialog as well. Example:
>     SUBSCRIBE to
>     a specialized Event package. In this case some Identifier in the Event
>     package probably will
>     serve as the Session Id.
>     As you can see there can be more than 1 dialog related a Session.
>     But there is no documentation saying what exactly threads all the
>     dialogs to
>     a Session except
>     the mentioning of a ID in the SDP RFC to identify the session being
>     described in a SDP.
> 
>     My understanding is that a Session Identifier can take the form of
>     Conference ID or any
>     other depending on the method used to setup the rendezvoud/session.
> 
>     Well, the above is my understanding of it, not based on any existing
>     draft
>     or RFC, so i welcome
>     whatever corrections need be.
> 
>     regards
>     Mahesh
> 
>     ----- Original Message -----
>     From: "Paul Kyzivat"
>     To: "gaurav katiyar"
>     Cc: ; ;
>     Sent: Tuesday, April 29, 2008 10:32 PM
>     Subject: Re: [Sip] [SIPForum-discussion] What's the difference between
>     session and dialog in SIP?
> 
> 
>      >
>      >
>      > gaurav katiyar wrote:
>      >> Sip "Session Initiation Protocol". It talks about media session,
>     i mean
>      >> how to initiate, modify and terminate a session and Dialog
>     provides a
>      >> sort of context (like caller, callee, location, routing etc.) to
>     modify
>      >> this session. So dialog is more related to route the sip message to
>      >> right node and body (SDP) handles media session if present.
>     Dialogs may
>      >> have media sessions Or may not.
>      >>
>      >> Take an example of B2BUA. It is a type of statefull proxy having two
>      >> dialog and one media session if doing media routing.
>      >
>      > Maybe. IMO these concepts aren't sufficiently defined.
>      >
>      > One view is that a session is whatever SDP describes. Thus its one
>      > session regardless of how many media streams it contains. And in the
>      > case of an SDP containing multicast media addresses, and possibly
>      > advertised via SAP, there could be many participants in the same
>     session.
>      >
>      > But then in sip it takes a pair of SDPs to establish a call. Is
>     that one
>      > session, or two? And in your case above with the B2BUA, is it one
>      > session, or two, or four?
>      >
>      > Another view is that a session in the context of sip is whatever is
>      > established as a result of an INVITE. Then I guess the pair of SDPs
>      > together describe one session, regardless of how many media
>     streams. But
>      > in that case the B2BUA example would be two sessions.
>      >
>      > Then consider a more complex case:
>      >
>      > audio
>      > /-------- C
>      > /
>      > A ========== B
>      > audio \
>      > video \-------- D
>      > video
>      >
>      > Here B is a B2BUA and media relay as in your example, but one
>     stream is
>      > relayed to C and the other to D.
>      >
>      > In this case, how many sessions are there? A, C, and D each have one,
>      > but are any of those the same? Or are there three altogether?
>      >
>      > When I see "session" used, I just assume it means something
>     vague, and
>      > read on to see what is actually meant.
>      >
>      > Paul
>      >
>      >> */Donald Lee /* wrote:
>      >>
>      >> old good questions in sip, also add another "transaction".
>      >>
>      >>
>      >> On Fri, Apr 25, 2008 at 8:18 AM, 孙宗君
>      >> > wrote:
>      >>
>      >> Hi, Vijay
>      >>
>      >> Thanks very much for your timely answers.
>      >>
>      >> From this specification, session is a combination of signaling
>      >> plane
>      >> and media plane messages and processes that enable two or more
>      >> participants to communicate. I think session is a larger scope
>      >> than
>      >> dialog. In another word, one session can contain more than one
>      >> dialog.
>      >> Is what I understand right?
>      >>
>      >> Zongjun
>      >>
>      >>
>      >> 2008/4/24, Vijay K. Gurbani
>      >> >:
>      >> > There is some work progressing in the BMWG WG to create
>      >> performance
>      >> > metrics around SIP. One of the first tasks in such an
>      >> endeavor
>      >> > is to define the notion of dialogs and sessions. Please see
>      >> > Section 3.1.1 of
>      >> >
>      >>
>      >>
>     https://svn.resiprocate.org/rep/ietf-drafts/gurbani/bmwg-sip-bench-term/draft-ietf-bmwg-sip-term-00.txt
>      >> > of the above draft for some insight.
>      >> >
>      >> > Ëï×Ú¾ý wrote:
>      >> >
>      >> > > Hi, Lincoln
>      >> > >
>      >> > > thanks for your instructions.
>      >> > >
>      >> > > I know that dialog can exist without session since
>      >> SUBSCRIBE/REFER can
>      >> > > create dialog and without any media between communication
>      >> peers.
>      >> > >
>      >> > > What I want to know is the relationship of dialog and
>      >> session when
>      >> > > they both exist in one communication activity. Take a
>      >> example, when
>      >> > > there are 2 person participating talks with voice, we say
>      >> there is a
>      >> > > dialog and a session.
>      >> > >
>      >> > > But when one caller invites another callee and gets five
>      >> 200 final
>      >> > > responses from 5 UA every of which has its own session
>      >> description. We
>      >> > > can say that there are 5 dialogs between caller and the
>      >> other 5
>      >> > > callees, right? And then what is the exact number of
>      >> session in this
>      >> > > scenario? One session or five session? That is what I want
>      >> to know.
>      >> > >
>      >> > > Dialog is determined by dialogID (call-id, from/to tag) and
>      >> session id
>      >> > > is determined by session id given in the SDP message. My
>      >> answer is
>      >> > > there are 5 dialog and one session now, right?
>      >> > >
>      >> >
>      >> > - vijay
>      >> > --
>      >> > Vijay K. Gurbani, Bell Laboratories, Alcatel-Lucent
>      >> > 2701 Lucent Lane, Rm. 9F-546, Lisle, Illinois 60532 (USA)
>      >> > Email: vkg@{alcatel-lucent.com
>      >> ,bell-labs.com
>      >> ,acm.org }
>      >> > WWW: http://www.alcatel-lucent.com/bell-labs
>      >> >
>      >> Use [email-masked]
>      >> for questions on
>      >> current sip
>      >> --
>      >> Donald _______________________________________________
>      >> This is the SIP Forum discussion mailing list
>      >> TO UNSUBSCRIBE, or edit your delivery options, please visit
>      >> http://sipforum.org/mailman/listinfo/discussion
>      >> Post to the list at [email-masked]
>      >>
>      >>
>      >>
>      >>
>      >> Gaurav Katiyar
>      >> Induslogic india pvt. ltd
>      >> B-34/1 sector 59 NOIDA
>      >> Phone:9818381368
>      >>
>      >>
>      >>
>     ------------------------------------------------------------------------
>      >> Be a better friend, newshound, and know-it-all with Yahoo!
>     Mobile. Try
>      >> it now.
>      >> >> >
>      >>
>      >>
>      >>
>     ------------------------------------------------------------------------
>      >>
>     --------------------------------------------------------------------------------
> 
> 
> Gaurav Katiyar
> Induslogic india pvt. ltd
> B-34/1 sector 59 NOIDA
> Phone:9818381368
>  
> 
> ------------------------------------------------------------------------
> Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try 
> it now. 
> <http://us.rd.yahoo.com/evt=51733/*http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ 
>  >