Subject: [Simple] The "both" timer

From: "David Partain (LI/EAB)" <[email-masked]>
Date: Tue, 2 Dec 2003 17:49:42 +0100

Greetings,

I don't understand the timer associated with the both direction
attribute (page 11 in the -02 version).  I'd be really grateful
if someone could explain to me how it works.

The text says that this timer specifies how long the "answerer"
should wait before giving up on the connection and trying to
take over has host for the session.

If I send an INVITE with "both" and set the timer to 45 seconds,
I've also supplied an MSRP URL that the answerer can use to
VISIT me.  Does the timer start when the answerer sends the
VISIT to the offerer at the MSRP URL?  It doesn't make much
sense to me that the offerer should tell the answerer to wait
after sending the VISIT, but I'm probably missing something.

And if the answerer doesn't get an OK for the VISIT within
the alloted 45 seconds, what then?  How is it expected to take
over as host?

Is "answerer" above really supposed to be "offerer"?  I don't
see how that works either, though, since the offerer has no
URL to VISIT.

I'm just generally confused and don't understand the timer.
Would some kind soul please enlighten me?

Thanks much.

David

_______________________________________________
Simple mailing list
[email-masked]
https://www1.ietf.org/mailman/listinfo/simple

---

From: "Miguel A. Garcia" <[email-masked]>
Date: Mon, 08 Dec 2003 13:57:28 +0200

Ben:

I think there is something unclear with the management of the timeout 
value that we can find in the direction attribute when the direction is 
set to "both", as David is suggesting below.

According to the spec, I got the impression that the timer is only 
applicable to the ***answerer***, i.e., that the offerer cannot use it.

    both: The endpoint is willing to act as either host or visitor. If
       "both" is selected, it may contain an optional timeout value. This
       timeout specifies how much time the answerer should wait before
       giving up on a connection and attempting to take over as host
       device.  If the timeout value is not specified, it defaults to 30
       seconds.

However, later in the spec, I found out that the answerer cannot use 
"both" at all:

    The SDP answer also MUST contain a direction attribute, but its value
    choices are limited based on the value in the offer....

    If the offer contained "both", the answerer SHOULD select "active",
    but MAY select"passive" if it is unable to reach the host device,
    or if local policy requires it to act as host.

And then later, when the spec indicates how the offerer builds the offer:

    4.  Insert a direction attribute. This value SHOULD be "both",
        indicating that the offerer will allow the answerer to override
        the offerer's decision to host. If "both" is selected, the
        offerer SHOULD leave the timeout at the default value (by leaving
        out the value entirely. However, the offerer MAY select a
        different timeout if circumstances warrant it. The direction
        value MAY be "passive" if the offerer is prevented from allowing
        the answerer override this choice.

So the questions to solve are:

1) What is the purpose of this timer? An scenario where it is used will 
help to understand it.

2) Is it possible to use it in offers or answers or both?

3) How does the offerer use this timer? In most circumstances the 
answers will reply with an "active" direction, so what are the actions 
at the offerer?

Any light to solve these questions is appreciated.

Regards,

           Miguel

-- 
Miguel-Angel Garcia                     Oy LM Ericsson AB
                                         Jorvas, Finland
mailto:[email-masked]     Phone:  +358 9 299 3553
mailto:[email-masked]        Mobile: +358 40 514 0002

---

From: "Miguel A. Garcia" <[email-masked]>
Date: Mon, 08 Dec 2003 13:57:28 +0200

Ben:

Regards,

           Miguel

---

From: Ben Campbell <[email-masked]>
Date: Mon, 08 Dec 2003 14:00:08 -0600

Sorry, I somehow missed the original note in my usual deluge of mail.

Comments inline to both emails inline:

> applicable to the ***answerer***, i.e., that the offerer cannot use it.

It depends on what you man by use it. Only the offerer can create an SDP 
document with direction=both, so only the offerer can select this value. 
But it only useful in the situation where an endpoint attempts to act as 
a visitor (i.e. active), is unable to connect, and then attempts to act 
as host (i.e. passive).

>    or if local policy requires it to act as host.

That is correct--the answerer will never insert direction=both in the 
SDP answer. We allow the offerer to tell the answerer "You decide." But 
we do not allow the answerer to come back and say, "No, you decide." 
(Believe me, watching my wife and I try to select a restaurant would 
offer an example of why this is not a good idea :-)  )

> 1) What is the purpose of this timer? An scenario where it is used will 

The general idea was to improve session setup time when an answerer is 
unable to connect to the host device. Assume A is the offerer and B is 
the answerer. B attempts a TCP connection to A, which fails. B then 
sends an SDP response instructing A to connect to B instead. Since it 
can take some time for a TCP connectin attempt to fail, and since if it 
takes a real long time to connect, it is likely that network conditions 
are not particularly good along that path, we specify a shorter time 
limit after which B should give up. We give A the ability to modify that 
limit from the default if A knows something about the network conditions 
that make the default inappropriate.

> 2) Is it possible to use it in offers or answers or both?

What do you mean by "use"? It is only specified by the offerer, but it 
is only acted upon by the answerer.

> answers will reply with an "active" direction, so what are the actions 

If the answer contains "active", the offerer does nothing with this 
timer value. Keep in mind, B does not return a response until _after_ it 
successfully visits the host, or fails to do so. If it succeeded in 
visiting, it returns active. If it fails, and wants to let A attempt to 
connect to it, it returns passive.

>> after sending the VISIT, but I'm probably missing something.

The timer starts when the answerer attempts to open a TCP connection to 
the host device. If the connection attempt has not completed in 45 
seconds, it may abandon the connection and assume a passive role by 
returning a response with direction=passive.

>> the alloted 45 seconds, what then?  How is it expected to take

The timer does not apply to the VISIT transaction. It only applies to 
the attempt to open the TCP connection.

>> see how that works either, though, since the offerer has no

No, the offerer never acts upon this timer value. It may select a value 
for the answerer to use.

---

From: Ben Campbell <[email-masked]>
Date: Mon, 08 Dec 2003 14:00:08 -0600

---

From: "Miguel A. Garcia" <[email-masked]>
Date: Tue, 09 Dec 2003 23:57:37 +0200

Ben:

Thanks for your answers, they are crystal clear, and I think I got the 
idea. Just a couple of minor comments.

Is the default timer (30 seconds) a realistic one. I mean, if the idea 
is to improve the session setup time, I believe 30 seconds is beyond the 
user expectations. It should be something shorter, IMHO. But anyway, the 
offerer can always indicate another shorter timer.

Second, you may improve the readability of the text by indicating that 
the timer affects to the *TCP establishment* as opposed to the VISIT/200 
ok timer, or the time the offerer waits for a VISIT. And also highlight 
that (yes, a bit more) that only the offerer is able to set the value 
"both". May I suggest something on a similar wording to:

    both: The *offerer* is willing to act as either host or visitor. If
        the *offerer selects* "both", it may *add an* optional timeout
        value. This timeout specifies how much time the answerer should
        wait, *when establishing the TCP connection*, before
        giving up *it* on and attempting to take over as host
        device.  If the timeout value is not specified, it defaults to 30
        seconds.

Thanks,

        Miguel

Ben Campbell wrote:

>> value that we can find in the direction attribute when the direction 
>> is set to "both", as David is suggesting below.
>>
>> 1) What is the purpose of this timer? An scenario where it is used 
>> will help to understand it.
> 
>

---

From: "Miguel A. Garcia" <[email-masked]>
Date: Tue, 09 Dec 2003 23:57:37 +0200

Ben:

Thanks,

        Miguel