Subject: RFC: Linger and Autoclose of associations

From: Vlad Yasevich <[email-masked]>
Date: Tue, 16 Aug 2005 11:24:46 -0400

Hi Folks

Something that came up in recent conversations between myself and a
collegue is whether the linger settings (specifically linger = 1 and
lingertime = 0), should affect autoclose associations.

If the user were to perform a close(), all the associations would be
aborted in this situation.  However, if the user were to do nothing,
the associations would be closed with a normal shutdown procedure.

I am thinking that it may be OK to abort associations when the autoclose
is enabled and linger settings are specified with lingertimer of 0.

What do others think?

Thanks
-vlad

---

From: "Peter Lei (peterlei)" <[email-masked]>
Date: Tue, 16 Aug 2005 12:49:20 -0500

The abortive close of all associations is what I interpret a
linger = 1, lingertime = 0 to mean, regardless of the autoclose
settings on that socket.

The close() call, with or without linger enabled and with or
without autoclose, would terminate all associations and free
the socket.  Using autoclose simply does a normal shutdown on
associations on a socket after some specified idle time, but
will leave the socket allocated.  There are uses for both,
and I don't see the conflict.

regards,
--peter

---

From: "Peter Lei (peterlei)" <[email-masked]>
Date: Tue, 16 Aug 2005 13:06:21 -0500

Anatoly Khusid wrote:
> I thought the default behavior for close() is to gracefully terminate SCTP
> association?

Yes, it should be...

> To change this behavior, linger=1 must be set through setsockopt().

linger.l_onoff = 1 and linger.linger = 0 in order to ABORT all
open associations.  A non-zero linger.l_linger value would cause
a graceful shutdown on open associations; the socket is not
closed for application use until the linger.linger value time
expires.

The original question below deals with what should the proper
behavior be when:
   linger.l_onoff = 1, linger.l_linger = 0, and autoclose is enabled.

Basically, the autoclose setting should NOT matter in this case
and all assocs should be abortively closed immediately.

regards,
--peter

> Is this a correct behavior, at least thats how I think LKSCTP behaves?
> 
> Thanks,
> 
> Anatoly
> 
> -----Original Message-----
> From: Peter Lei (peterlei) [mailto:[email-masked]]
> Sent: Tuesday, August 16, 2005 1:49 PM
> To: Vlad Yasevich
> Cc: [email-masked];
> [email-masked]
> Subject: Re: RFC: Linger and Autoclose of associations
> 
> 

-- 
Peter Lei
IP Technologies Engineering
Cisco Systems, Inc.
office: (773) 695-8201
mobile: (847) 830-8869
[email-masked]

---

From: "Anatoly Khusid" <[email-masked]>
Date: Tue, 16 Aug 2005 13:55:38 -0400

Thanks,

Anatoly

-----Original Message-----
From: Peter Lei (peterlei) [mailto:[email-masked]]
Sent: Tuesday, August 16, 2005 1:49 PM
To: Vlad Yasevich
Cc: [email-masked];

regards,
--peter

---

From: Randall Stewart <[email-masked]>
Date: Tue, 16 Aug 2005 14:23:23 -0400

>> I thought the default behavior for close() is to gracefully terminate 

I think this is true IF and ONLY IF the user has read
all the data. If the socket is closed with data still unread
then an ABORT is sent.. I believe this is true in TCP
as well.. aka a RST is set if you close and did not clear
your socket buffer... this is to alert the peer that you
did not read all the data that was acknowledged.

> and all assocs should be abortively closed immediately.

If and only if the user does do a close() after the linger settings
are as above.

In cases where you just set linger to what is shown above
and let auto-close work.. then graceful shutdown's will happen.

Now I think what Vlad is asking is would it be worthwhile to have
something like a set of linger() settings that would effect autoclose
to do an ABORT().

I don't think this is wise IMO since in theory the reason autoclose
happens is that you have sent all the data and the peer has
sent all the data.. and the association is just sitting there idle
heartbeatting...

So aborting makes no sense to me in this case... I don't think, in
any case (if it was a desired property), we would want to mix
linger with autoclose.. we would need some other settings LIKE linger
but not the same.

R

-- 
Randall Stewart
ITD - Cisco Systems Inc.
803-345-0369 <or> 815-342-5222 (cell)

---

From: "Peter Lei (peterlei)" <[email-masked]>
Date: Tue, 16 Aug 2005 13:36:19 -0500

> If and only if the user does do a close() after the linger settings

Yes...

> and let auto-close work.. then graceful shutdown's will happen.

Yup...

> something like a set of linger() settings that would effect autoclose

Ah... I read the original question incorrectly/differently...

> linger with autoclose.. we would need some other settings LIKE linger

Agreed.  We should not mix the linger and autoclose semantics.
Also, I don't think it makes sense to do an "abortive auto-close".

Vlad, what situations do you envision needing/wanting this type of
behavior?

--peter

---

From: Vlad Yasevich <[email-masked]>
Date: Tue, 16 Aug 2005 14:44:07 -0400

> something like a set of linger() settings that would effect autoclose

Yep.  That's exacltly what I am asking.

-vlad