Re: [Taps] New Transport Networking APIs in iOS 12 beta

Michael Welzl <michawe@ifi.uio.no> Fri, 15 June 2018 08:00 UTC

Return-Path: <michawe@ifi.uio.no>
X-Original-To: taps@ietfa.amsl.com
Delivered-To: taps@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 00413130DC2 for <taps@ietfa.amsl.com>; Fri, 15 Jun 2018 01:00:54 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -4.2
X-Spam-Level:
X-Spam-Status: No, score=-4.2 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_MED=-2.3, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 1PnFMRLgapLg for <taps@ietfa.amsl.com>; Fri, 15 Jun 2018 01:00:51 -0700 (PDT)
Received: from mail-out02.uio.no (mail-out02.uio.no [IPv6:2001:700:100:8210::71]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 1F41D130DDC for <taps@ietf.org>; Fri, 15 Jun 2018 01:00:50 -0700 (PDT)
Received: from mail-mx04.uio.no ([129.240.10.25]) by mail-out02.uio.no with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.91) (envelope-from <michawe@ifi.uio.no>) id 1fTjf3-000GUD-1t; Fri, 15 Jun 2018 10:00:45 +0200
Received: from 93-58-133-64.ip158.fastwebnet.it ([93.58.133.64] helo=[10.0.0.2]) by mail-mx04.uio.no with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) user michawe (Exim 4.91) (envelope-from <michawe@ifi.uio.no>) id 1fTjf2-0007BR-27; Fri, 15 Jun 2018 10:00:44 +0200
From: Michael Welzl <michawe@ifi.uio.no>
Message-Id: <D75972DB-3F06-4955-8E78-1BD86992E5D7@ifi.uio.no>
Content-Type: multipart/alternative; boundary="Apple-Mail=_B87F5668-94E3-4424-9E6B-90B6CEE5E8A7"
Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\))
Date: Fri, 15 Jun 2018 10:00:30 +0200
In-Reply-To: <5A1D9981-B8C1-46C3-99AD-7F6C89C8B918@vidyo.com>
Cc: Tommy Pauly <tpauly@apple.com>, "taps@ietf.org" <taps@ietf.org>
To: Jonathan Lennox <jonathan@vidyo.com>
References: <1C14F32A-3ADC-4D35-B800-091697E83AD6@apple.com> <63A71B2E-96E4-402A-89E2-667DDF8B1D08@lurchi.franken.de> <268D7E06-1D1D-4F70-9336-98EAF1BB5605@apple.com> <3EEFA4C8-D9D2-45E8-98FD-55BEA12706E9@ifi.uio.no> <5A1D9981-B8C1-46C3-99AD-7F6C89C8B918@vidyo.com>
X-Mailer: Apple Mail (2.3273)
X-UiO-SPF-Received: Received-SPF: neutral (mail-mx04.uio.no: 93.58.133.64 is neither permitted nor denied by domain of ifi.uio.no) client-ip=93.58.133.64; envelope-from=michawe@ifi.uio.no; helo=[10.0.0.2];
X-UiO-Spam-info: not spam, SpamAssassin (score=-4.9, required=5.0, autolearn=disabled, AWL=0.091, HTML_MESSAGE=0.001, TVD_RCVD_IP=0.001, UIO_MAIL_IS_INTERNAL=-5, uiobl=NO, uiouri=NO)
X-UiO-Scanned: AC860511FA351B8731793D9FC31F12F7198968AD
Archived-At: <https://mailarchive.ietf.org/arch/msg/taps/pKN22XlIa-db_E5FnK_5D6MHmoU>
Subject: Re: [Taps] New Transport Networking APIs in iOS 12 beta
X-BeenThere: taps@ietf.org
X-Mailman-Version: 2.1.26
Precedence: list
List-Id: "IETF Transport Services \(TAPS\) Working Group" <taps.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/taps>, <mailto:taps-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/taps/>
List-Post: <mailto:taps@ietf.org>
List-Help: <mailto:taps-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/taps>, <mailto:taps-request@ietf.org?subject=subscribe>
X-List-Received-Date: Fri, 15 Jun 2018 08:00:55 -0000

Hi,

Thanks for sharing this! It’s quite interesting -


> On Jun 11, 2018, at 6:47 PM, Jonathan Lennox <jonathan@vidyo.com> wrote:
> 
> I’ve read over Apple’s new API.  (One note: the URL that Tommy sent a link to doesn’t have the full documentation of the API yet; many of the types and methods still say “No overview available.” If you’re an Apple developer, the header files supplied with the macOS 10.14 and iOS 12 beta SDKs in the Xcode 10 beta contain much fuller versions of the documentation.)

I agree, things are a bit inconsistent in the online docs for now… e.g. somehow this:
https://developer.apple.com/documentation/network?language=objc <https://developer.apple.com/documentation/network?language=objc>
seems to be more complete than
https://developer.apple.com/documentation/network/nwpath <https://developer.apple.com/documentation/network/nwpath>
but then there are also differences that are probably not due to the language choice only. Well, it all clearly says “Beta”, so that’s ok, we’ll just have to wait until this documentation is updated.


> The main difference I’ve found between TAPS and Network.framework is that Network.framework doesn’t have a Preconnection object.  Instead, Connection objects for outgoing connections are directly created from a constructor, and then must have their .start method called before they act.
> 
> This part is a relatively minor semantic difference, but more significant is how incoming connections are handled.  In Network.framework, there is a Listener object with a new_connection handler, and this object can produce unlimited numbers of Connections until stopped.  This is unlike TAPS where a Listen action consumes a Preconnection, and to receive multiple connections on the same port, Listen must be called on multiple cloned Preconnections.

I agree that the first difference is minor (constructor vs. “Preconnection”). I would also say that the latter difference is interesting but not huge… (“under the hood” it’s easy to imagine that these can be two ways to essentially expose the same thing). I’d also agree that the Network.framework method is more convenient though. Tommy - what would you say about moving our API in that direction for Listening?


> I feel like the Network.framework model is an easier programming model for most use cases, but it has the downside that an API user has no way to pace its handling of incoming connections.

I haven’t played with the Network.framework myself, but I would guess that, if I want to slow down the rate at which I handle incoming connections, there isn’t really much difference between not calling Listen (current TAPS) vs. ignoring a newly created incoming Connection (Network.framework). Why wouldn’t that work as a way to pace conn. handling?

Cheers,
Michael