[tsvwg] Some personal opinions on the state of UDP ECN socket APIs

Martin Duke <martin.h.duke@gmail.com> Fri, 08 November 2024 15:36 UTC

Return-Path: <martin.h.duke@gmail.com>
X-Original-To: tsvwg@ietfa.amsl.com
Delivered-To: tsvwg@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id B2BB4C16940C for <tsvwg@ietfa.amsl.com>; Fri, 8 Nov 2024 07:36:24 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.106
X-Spam-Level:
X-Spam-Status: No, score=-2.106 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_BLOCKED=0.001, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com
Received: from mail.ietf.org ([50.223.129.194]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id vzxkvBFuwiPE for <tsvwg@ietfa.amsl.com>; Fri, 8 Nov 2024 07:36:24 -0800 (PST)
Received: from mail-qk1-x731.google.com (mail-qk1-x731.google.com [IPv6:2607:f8b0:4864:20::731]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (P-256) server-digest SHA256) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id AAFA0C1EC4C7 for <tsvwg@ietf.org>; Fri, 8 Nov 2024 07:36:15 -0800 (PST)
Received: by mail-qk1-x731.google.com with SMTP id af79cd13be357-7b18da94ba9so214085285a.0 for <tsvwg@ietf.org>; Fri, 08 Nov 2024 07:36:15 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1731080174; x=1731684974; darn=ietf.org; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=YZxmKyhrp1odSF074hFD5/8nbV/yr0oxLiT7Ru9j2SI=; b=dzHttr6+r6zxipIqt+YF3nlHpdUL5BDu2XUFMlf5H1Y1H9D6sIY0UQwhRQBlQuExNl bI9fICfsoo2+eXOpIS7AFX+Dz5oPkOXBjsvbEIet8H+743PFD5ycwFRE7d+BNBIOcwCU tN6shV1p7LS/GOZQInkevb9EoGBGVZj2SYP5ggitAqVkA9C+sdffBYmdVA+8zy1JH8nQ TWy3NOaNQAIQPHYZ0fWfgka/p93tvIsxvPsPYGJ3XIab3NLg9MwlwAMaaLWpb6gIEZvz hABWCeKA1mk9OdXjMgfBDmqtL/f5aZVWumpssKkyJ+zq/QeHmOBBBk7cAW8Sg7ZTXGMz kFLg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731080174; x=1731684974; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=YZxmKyhrp1odSF074hFD5/8nbV/yr0oxLiT7Ru9j2SI=; b=fOpGqdBO3ZtMJZ0f/0/ISUUqXyubQohPKpSxMRa3/8KMr6NCOF47m8cWOwohOEDK0K nJDqi4Qd1mVbVXgxujgyDRTNwUozfqerIwPUdhxDC6DuTWqCem+LuMWc7StRl5ApySAJ qJHDSi0AeBqGW4VpOWOlIyTOod9NHu76rHsWoeC82X2Zlq2iKj7hGQSt+4lNEIQklxPf puO/QgdFlujtHtqmIdDMs2T/QVKa+a2o8qWeQsG6++TFf1WDC6lBsSG27JLlJ66FX5yK Sim2aUMM6J9Gg0bpwyrAh72jWtPvylSQ+YaNHdwVNtDlajE+X8bcwtWM7r1u51KSHAZR aFvg==
X-Gm-Message-State: AOJu0YyGH9yBjmmT0n0mY/XEChiPjv3s6YEqn4P+4RUXpKskGfWCCr4m caUvUMAwS1+geYxVv3GDZ8O/TRZ9DpoiOeIqnEzoPp8e5DTx5a03F1P1+rF7YGv9F3NSM7HAA2U TqR+uVSJNHfP9z1EHa4soLPUacYyos2iFVCw=
X-Google-Smtp-Source: AGHT+IEvrdQ5Dn2LTYkZ2fXNHrONx+7PEUHwKNfI2hv/ltiXIoS7NJzPqxtlO1xAe9JQRzDVM9jSYLp2GjWq7JPt4Oc=
X-Received: by 2002:a05:620a:f11:b0:7a6:6b97:4da2 with SMTP id af79cd13be357-7b3318d01ebmr614489285a.11.1731080174219; Fri, 08 Nov 2024 07:36:14 -0800 (PST)
MIME-Version: 1.0
From: Martin Duke <martin.h.duke@gmail.com>
Date: Fri, 08 Nov 2024 15:36:02 +0000
Message-ID: <CAM4esxRp9OG2QDx6JKz+dPhMhueKF5Kj1_qi8ER3__ptKj=JCQ@mail.gmail.com>
To: tsvwg <tsvwg@ietf.org>
Content-Type: multipart/alternative; boundary="000000000000dcba2c0626688223"
Message-ID-Hash: BGW367E5OFDWLZSS6ZRVNSX3UMI46BMV
X-Message-ID-Hash: BGW367E5OFDWLZSS6ZRVNSX3UMI46BMV
X-MailFrom: martin.h.duke@gmail.com
X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-tsvwg.ietf.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header
X-Mailman-Version: 3.3.9rc6
Precedence: list
Subject: [tsvwg] Some personal opinions on the state of UDP ECN socket APIs
List-Id: Transport Area Working Group <tsvwg.ietf.org>
Archived-At: <https://mailarchive.ietf.org/arch/msg/tsvwg/XO9fyA2l6psK4DZ1mJe1YY4KLJg>
List-Archive: <https://mailarchive.ietf.org/arch/browse/tsvwg>
List-Help: <mailto:tsvwg-request@ietf.org?subject=help>
List-Owner: <mailto:tsvwg-owner@ietf.org>
List-Post: <mailto:tsvwg@ietf.org>
List-Subscribe: <mailto:tsvwg-join@ietf.org>
List-Unsubscribe: <mailto:tsvwg-leave@ietf.org>

I don't want this to go in the draft, but here are some things l like about
the various platform APIs, which would feature in a converged solution:

1) I like that on an Apple v6 socket, if it's dual stack the IPv4 stuff
"just works" without another setsockopt() call.
2) I like that the Windows API uses IP_ECN, etc., rather than TOS, to
formally separate ECN from DSCP. (I am told that Apple is the same under
the hood, although that's not clear from the name). When the TOS byte is
treated as a whole, then code that is setting ECN has to do a getsockopt()
to find out the DSCP bits and setsockopt() to send DSCP back with the
correct ECN. This is very annoying. I will say that RFC3542 (informational)
suggests IPV6_TCLASS, and I would be happy to help fix that, if it's an
obstacle for kernel developers.
3) I like that Windows has a wrapper function called WSASetIpRecvEcn()
which takes care of all the v4/v6 stuff for you, so you don't need all
these if statements. I don't like that it doesn't take care of both IP
versions on a dual stack socket, which seems like a violation of the idea
that it "just works."

I don't know if the 3-4 OSes can get together and sort this out, but I
would love for my I-D to be obsolete.

Martin