From owner-freebsd-net@freebsd.org Mon Mar 9 11:15:11 2020 Return-Path: Delivered-To: freebsd-net@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CD45D25F4FA for ; Mon, 9 Mar 2020 11:15:11 +0000 (UTC) (envelope-from SRS0=tAdi=42=mail.sermon-archive.info=doug@sermon-archive.info) Received: from mail.sermon-archive.info (sermon-archive.info [71.177.216.148]) by mx1.freebsd.org (Postfix) with ESMTP id 48bbH21blbz46VY for ; Mon, 9 Mar 2020 11:15:09 +0000 (UTC) (envelope-from SRS0=tAdi=42=mail.sermon-archive.info=doug@sermon-archive.info) Received: from [10.0.1.251] (mini [10.0.1.251]) by mail.sermon-archive.info (Postfix) with ESMTPSA id 48bbH060dbz2fjyf; Mon, 9 Mar 2020 04:15:08 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) Subject: Re: SCTP sendmsgx From: Doug Hardie In-Reply-To: Date: Mon, 9 Mar 2020 04:15:08 -0700 Cc: freebsd-net@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <446BD4C8-4FAA-4FE6-850A-02450C8E2658@mail.sermon-archive.info> References: <1C234055-9CDD-4A72-A027-1BD4F8A2FC71@mail.sermon-archive.info> <67FA10E2-9EB7-4BCC-8E1D-9F82C10447B8@mail.sermon-archive.info> To: Michael Tuexen X-Mailer: Apple Mail (2.3445.104.11) X-Virus-Scanned: clamav-milter 0.101.4 at mail X-Virus-Status: Clean X-Rspamd-Queue-Id: 48bbH21blbz46VY X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=none; spf=pass (mx1.freebsd.org: domain of SRS0=tAdi=42=mail.sermon-archive.info=doug@sermon-archive.info designates 71.177.216.148 as permitted sender) smtp.mailfrom=SRS0=tAdi=42=mail.sermon-archive.info=doug@sermon-archive.info X-Spamd-Result: default: False [0.36 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:71.177.216.148]; MV_CASE(0.50)[]; MIME_GOOD(-0.10)[text/plain]; IP_SCORE(0.03)[asn: 5650(0.20), country: US(-0.05)]; NEURAL_HAM_LONG(-0.94)[-0.940,0]; NEURAL_SPAM_MEDIUM(0.67)[0.673,0]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCPT_COUNT_TWO(0.00)[2]; RCVD_IN_DNSWL_NONE(0.00)[148.216.177.71.list.dnswl.org : 127.0.10.0]; FORGED_SENDER(0.30)[bc979@lafn.org,SRS0=tAdi=42=mail.sermon-archive.info=doug@sermon-archive.info]; RCVD_NO_TLS_LAST(0.10)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:5650, ipnet:71.177.216.0/23, country:US]; FROM_NEQ_ENVFROM(0.00)[bc979@lafn.org,SRS0=tAdi=42=mail.sermon-archive.info=doug@sermon-archive.info]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Mar 2020 11:15:11 -0000 > On 9 March 2020, at 04:11, Michael Tuexen = wrote: >=20 >> On 9. Mar 2020, at 11:55, Doug Hardie wrote: >>=20 >>>=20 >>>> On 9. Mar 2020, at 11:01, Doug Hardie wrote: >>>>=20 >>>>> I am trying to get sctp_sendmsgx to work and not having a lot of = success. I have not been able to find any examples on the web of using = it. I have a client using sctp_sendmsg working fine. I need to make = use of the multihoming feature which requires sctp_sendmsgx. I = changed the call to sctp_sendmsgx, and changed the address count to 2. = However, all I get is an EINVAL response. Looking through the code = there are at least 2 different possible causes, but I can't distinguish = between them. I do have two address structures in the address field. = Are there any examples of how to build a client with sctp_sendmsgx? >>>>=20 >>>> I am now making some progress. If you are using the sctp_sendmsg = function the sa_len or sin_len field is not used. However, sctp_sendx = does use it. Leaving it at zero causes >>> Yepp, filling out the sa_len field is important. >>>> the problem. sendx now sends a connection init to the remote host. = There is no server running there yet. It hangs for quite some time and = doesn't try the multihome address. I seem to recall reading something = about that so will investigate that tomorrow.=20 >>> What do you see on the wire? I would expect INIT chunks to be sent = to the two addresses you provided. >>=20 >> If I have both network connections working, there is an INIT chunk on = the primary network followed by a ABORT chunk response. Then the client = sits waiting for a response which=20 > When the INIT is received, the association is dead. Are you using a = one-to-many style socket (SOCK_SEQPACKET as the second parameter to = socket())? > Then you would need subscribe to notifications to get an indication = that the peer is not there. If you would use a one-to-one style > socket (using SOCK_STREAM as the second argument of socket()), you = could use the implicit or explicit connection setup and use > select() to figure out, that the peer has rejected the association. >> never comes. If I disconnect the primary network cable, then after = about 5 seconds of starting the client, I get the INIT and ABORT chunks = on the secondary network. I haven't=20 > The INIT retransmission timer is 3 seconds in 12.1, I guess. You can = change it using > https://tools.ietf.org/html/rfc6458#section-8.1.1 >> figured out how to control the time, or how to make it switch to the = secondary when the network connection is there, but the server is not = responding. > SCTP does failover automatically. Please note that receiving an ABORT = is a (final) response from the peer and no retransmissions > will happen. Retransmissions only happen, when there is no response. >>=20 >>>=20 >>> Please note that sctp_sendx() is deprecated (like sctp_sendmsg()). = Please consider using sctp_sendv(). >>> See https://tools.ietf.org/html/rfc6458#section-9.12 >>=20 >> Thats quite interesting. This must have occurred after the Steven's = book came out. There is no man entry for sctp_sendv in FBSD 12.1. = However, I do see it in sctp_sys_calls.c=20 > Yes, the RFC was finalised after the book chapters were written, I = think. >> so I will have to figure it out from there. Likewise there is no = indication those calls are depreciated in the man pages. > That is a good point. The man pages need some work. The BSD stack = should be pretty much supporting > the API described in the RFC. If something doesn't work as described = in the RFC, I consider it a bug. Thanks a lot. This is quite helpful. I was using a one to many client. = I'll have to rethink that. =20 -- Doug