[Taps] API design: dependencies or buffer control?

Michael Welzl <michawe@ifi.uio.no> Sun, 12 November 2017 16:31 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 AAB961205D3 for <taps@ietfa.amsl.com>; Sun, 12 Nov 2017 08:31:09 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -4.201
X-Spam-Level:
X-Spam-Status: No, score=-4.201 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, 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 6vAawb0nu3xz for <taps@ietfa.amsl.com>; Sun, 12 Nov 2017 08:31:07 -0800 (PST)
Received: from mail-out01.uio.no (mail-out01.uio.no [IPv6:2001:700:100:10::50]) (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 800E91200F3 for <taps@ietf.org>; Sun, 12 Nov 2017 08:31:07 -0800 (PST)
Received: from mail-mx02.uio.no ([129.240.10.43]) by mail-out01.uio.no with esmtp (Exim 4.82_1-5b7a7c0-XX) (envelope-from <michawe@ifi.uio.no>) id 1eDvA1-0002w7-TB for taps@ietf.org; Sun, 12 Nov 2017 17:31:05 +0100
Received: from dhcp-9539.meeting.ietf.org ([31.133.149.57]) by mail-mx02.uio.no with esmtpsa (TLSv1.2:DHE-RSA-AES256-GCM-SHA384:256) user michawe (Exim 4.82_1-5b7a7c0-XX) (envelope-from <michawe@ifi.uio.no>) id 1eDv9g-000DuG-CW for taps@ietf.org; Sun, 12 Nov 2017 17:31:05 +0100
From: Michael Welzl <michawe@ifi.uio.no>
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: quoted-printable
Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\))
Date: Mon, 13 Nov 2017 00:30:40 +0800
References: <CF0546DA-422B-4AA3-A593-1BC133AD730D@ifi.uio.no> <A19AC4F5-1A56-4F9B-A5C2-3643CD57FBC1@apple.com> <7F6D4FB0-3D41-4E06-BD11-54D897FA5345@ifi.uio.no> <3702C080-9EEA-441C-96C3-5A2A1FCC7ABA@apple.com> <B543F7E4-2327-4CAE-8707-0F61BE6DD655@ifi.uio.no>
To: "taps@ietf.org" <taps@ietf.org>
In-Reply-To: <B543F7E4-2327-4CAE-8707-0F61BE6DD655@ifi.uio.no>
Message-Id: <4EF62BB5-7638-4C3D-98A6-F1F081ABF216@ifi.uio.no>
X-Mailer: Apple Mail (2.3273)
X-UiO-SPF-Received: Received-SPF: neutral (mail-mx02.uio.no: 31.133.149.57 is neither permitted nor denied by domain of ifi.uio.no) client-ip=31.133.149.57; envelope-from=michawe@ifi.uio.no; helo=dhcp-9539.meeting.ietf.org;
X-UiO-Spam-info: not spam, SpamAssassin (score=-4.9, required=5.0, autolearn=disabled, AWL=0.125, UIO_MAIL_IS_INTERNAL=-5, uiobl=NO, uiouri=NO)
X-UiO-Scanned: 2AFCD679A5144F796C895D2740E53DB335848B6F
Archived-At: <https://mailarchive.ietf.org/arch/msg/taps/bjcrzLRF03QNmYg_GU8zKtyYgLI>
Subject: [Taps] API design: dependencies or buffer control?
X-BeenThere: taps@ietf.org
X-Mailman-Version: 2.1.22
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: Sun, 12 Nov 2017 16:31:10 -0000

Hi,

Another thought related to the post-sockets draft:

Post-sockets lets an application programmer define dependencies. That’s good, because dependencies exist, but it comes at the cost of complexity.
My gut feeling tells me: if you have dependencies to take care of, it’s best to leave the data with the application and not hand it over to the transport at all until the last minute.

Controlling the buffer with something like TCP_NOTSENT_LOWAT would be a way for an application to only give the most recent, relevant data to the transport, and decide to throw away data on its own in case a preceding message was thrown away (which it might learn from transport).

I haven’t written code that uses TCP_NOTSENT_LOWAT myself, but I would guess that the trade-off in using this is: if you set this value low, you have more control over the buffer and can be more efficient in your decisions, but the disadvantage is that the transport permanently comes back to you and says “empty, empty, empty, ….” - which may be inconvenient / inefficient for the programmer.

If I’m right with all my musings here, then for an application that has block dependencies, the design should depend on what is easier to handle: defining priorities towards the transport layer on one side, or dealing with the transport calling us quickly all the time because its buffer is about to run empty, plus handling dependencies in the application on the other.

I don’t know - which one IS easier?

I’d love to see this discussed a little, and I’d also love to know if my interpretation of the trade-off in this email is even correct.

Cheers,
Michael