From: Vlad Yasevich <vyasevich@gmail.com>
To: David Laight <David.Laight@ACULAB.COM>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>
Subject: Re: SCTP's processing of unexpected COOKIE_ECHO doesn't seem useful.
Date: Tue, 10 Jun 2014 09:44:19 -0400 [thread overview]
Message-ID: <53970BB3.5010909@gmail.com> (raw)
In-Reply-To: <063D6719AE5E284EB5DD2968C1650D6D17259B99@AcuExch.aculab.com>
On 06/10/2014 05:52 AM, David Laight wrote:
> I'm seeing some unexpected (to me) behaviour of the SCTP stack
> when the remote system restarts.
>
> I've a socket that has a single association, and I'm rather
> expecting TCP-like behaviour.
> So I'd expect some kind of failure condition on my existing
> connection, and then a new connection be established on a
> different socket - eg though a listening socket.
> This would then go through all my code for correctly
> initialising a new connection.
>
> What happens is rather different.
>
> The remote sends an INIT with the same port numbers as the
> previous connection, AFAICT the code sends an INIT_ACK with
> some numbers taken from the existing TCB.
>
> When the COOKIE_ECHO is received sctp_sf_do_5_2_4_dupcook()
> is called, condition 'A' is detected and sctp_sf_do_dupcook_a()
> called.
>
> RFC 2960 says that this should be treated as a received ABORT
> followed by a COOKIE echo - this sounds fine, I want the ABORT
> processing to kill the existing connection.
> However it then says that 'RESTART' should be indicated to the ULP
> rather than 'COMMUNICATION LOST'.
>
> AFAICT this is just silently ignored by the socket layer.
> I've a process sleeping in recv() (actually a kernel thread in
> sock_recvmsg()) and it is not woken up at all.
You haven't subscribed to receive notifications and as a result
you haven't been woken up.
The ABORT treatment above simply resets the state of the original
connection, thus simulating the ABORT and a new connection all
in one.
This is where an application really needs to utilize and process
SCTP notifications. You can also collect data like which messages
have not been send to the remote, so that you can re-queue them.
>
> This leaves the 'application' code in completely the wrong state for
> the SCTP connection.
>
I can understand where you are coming from. There are some useful
cases for association restart, but it could also be turned off
without much adverse effect to the applications.
May be a sysctl or a socket option that allows you control whether you
want association restart or not might be nice to have.
-vlad
> ISTM that the mapping of SCTP to connection-mode sockets should be
> treating this as a disconnect.
>
> This scenario can be reproduced by disconnecting with ABORT and
> getting iptables to discard the ABORT.
> It can happen with some connection retry algorithms if there is
> message loss.
>
> David
>
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
next prev parent reply other threads:[~2014-06-10 13:44 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-10 9:52 SCTP's processing of unexpected COOKIE_ECHO doesn't seem useful David Laight
2014-06-10 13:44 ` Vlad Yasevich [this message]
2014-06-10 14:09 ` David Laight
2014-06-10 18:16 ` Vlad Yasevich
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=53970BB3.5010909@gmail.com \
--to=vyasevich@gmail.com \
--cc=David.Laight@ACULAB.COM \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).