Re: [Ecn-in-quic] Darwin issue with setting ECN/DCSP via sendmsg

"Eggert, Lars" <lars@netapp.com> Wed, 06 December 2017 09:28 UTC

Return-Path: <lars@netapp.com>
X-Original-To: ecn-in-quic@ietfa.amsl.com
Delivered-To: ecn-in-quic@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 9601712711B for <ecn-in-quic@ietfa.amsl.com>; Wed, 6 Dec 2017 01:28:21 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.9
X-Spam-Level:
X-Spam-Status: No, score=-1.9 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=netapp.onmicrosoft.com
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 qgOkneQF6I7r for <ecn-in-quic@ietfa.amsl.com>; Wed, 6 Dec 2017 01:28:19 -0800 (PST)
Received: from mx144.netapp.com (mx144.netapp.com [IPv6:2620:10a:4005:8000:2306::d]) (using TLSv1.2 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 4CCDF126B6E for <ecn-in-quic@ietf.org>; Wed, 6 Dec 2017 01:28:19 -0800 (PST)
X-IronPort-AV: E=Sophos;i="5.45,367,1508828400"; d="asc'?scan'208,217";a="230643473"
Received: from vmwexchts02-prd.hq.netapp.com ([10.122.105.23]) by mx144-out.netapp.com with ESMTP; 06 Dec 2017 01:28:18 -0800
Received: from HIOEXCMBX01-PRD.hq.netapp.com (10.122.105.34) by VMWEXCHTS02-PRD.hq.netapp.com (10.122.105.23) with Microsoft SMTP Server (TLS) id 15.0.1320.4; Wed, 6 Dec 2017 01:28:18 -0800
Received: from VMWEXCCAS06-PRD.hq.netapp.com (10.122.105.22) by hioexcmbx01-prd.hq.netapp.com (10.122.105.34) with Microsoft SMTP Server (TLS) id 15.0.1320.4; Wed, 6 Dec 2017 01:28:17 -0800
Received: from NAM01-SN1-obe.outbound.protection.outlook.com (10.120.60.153) by VMWEXCCAS06-PRD.hq.netapp.com (10.122.105.22) with Microsoft SMTP Server (TLS) id 15.0.1320.4 via Frontend Transport; Wed, 6 Dec 2017 01:28:17 -0800
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=netapp.onmicrosoft.com; s=selector1-netapp-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=z6Uddsnwczzqxpc9W3/VQbWs4cytkRCCkMFD/WevFmU=; b=medkoUxQuvcIVBM95eGj9/A7GmCB04tECGIODMXyRtT1lBfz/bm+qEHgTBr7FuZ/AaNOCxiCK1JoObSpAWpU19p/EDxIUau9LlnE3ZJwvNiROLGxBH13YbZgbfmrR2Alg0taQFOgIOb5YDSWWc19cCdrMcNFryOg51P/vAdObOs=
Received: from BLUPR06MB1764.namprd06.prod.outlook.com (10.162.224.150) by BLUPR06MB1762.namprd06.prod.outlook.com (10.162.224.148) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.282.5; Wed, 6 Dec 2017 09:28:15 +0000
Received: from BLUPR06MB1764.namprd06.prod.outlook.com ([10.162.224.150]) by BLUPR06MB1764.namprd06.prod.outlook.com ([10.162.224.150]) with mapi id 15.20.0282.012; Wed, 6 Dec 2017 09:28:15 +0000
From: "Eggert, Lars" <lars@netapp.com>
To: Ingemar Johansson S <ingemar.s.johansson@ericsson.com>
CC: "ecn-in-quic@ietf.org" <ecn-in-quic@ietf.org>, Stuart Cheshire <cheshire@apple.com>
Thread-Topic: Darwin issue with setting ECN/DCSP via sendmsg
Thread-Index: AQHTaR8/6SyjNx9qckGSIV0mAKO5gaM1+m4AgAAcaAA=
Date: Wed, 06 Dec 2017 09:28:15 +0000
Message-ID: <3E64AF2D-4676-427A-80A1-E93560910A0A@netapp.com>
References: <D4780C25-61CC-42F3-8583-CD9E669E21F2@netapp.com> <DB4PR07MB348EA5CDB819A49FF11D1B6C2320@DB4PR07MB348.eurprd07.prod.outlook.com>
In-Reply-To: <DB4PR07MB348EA5CDB819A49FF11D1B6C2320@DB4PR07MB348.eurprd07.prod.outlook.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: yes
X-MS-TNEF-Correlator:
x-mailer: Apple Mail (2.3445.4.7)
authentication-results: spf=none (sender IP is ) smtp.mailfrom=lars@netapp.com;
x-originating-ip: [217.70.211.15]
x-ms-publictraffictype: Email
x-microsoft-exchange-diagnostics: 1; BLUPR06MB1762; 6:kwfM37uU93DLoyOEh+aquwHwY2yQYS+VwBsT1uRpyP/V8PipDD5MBDBMGqPYTjej26Vlt8pJ+dTD+oAoczhh9ERkQkh6JDiXcU4reGBaLSve77pjBHL7U6690phlr5ixSKDLEQ9gR3UqOQsD+fmHADkQr8EPP3EqLryt7tEMqGbnqwwCKDL8GQab3BgX8eRK5zhJ91aBNyvLqnWu58Oe4xegxFGIbS8uOxBQ6cdkYj6vh8MplRe8iE6bokRwj6fzl+VZZsmRDfImR4vUuEj+nIAu1AgNouNTttoTyU3MLAKkVI/rqF5+ksC2NuSw/kjK3rZ/0EfDH29r3qAKjZl219SAjF6ctZq/aAMFs0qow34=; 5:4EnO6vRq1Gr0uEDiyDXISH88+eWB8Q8AgwsPVCisD+JZLjlwixdwTeU+ZDF/J+m0261xLCqI2MeBRg3oPCXb/5oY3Mlz3HqA8cyRg0BVLbcwiUTzTexQnEy4szMXalrrUjHiudctp8qgOjlXtOHAclaUuPdiUNIh2Q90Ae4HZ3o=; 24:RsuXpsThv6f6CU7uSusJ1AlvniAXDXGWGk+Pj8gpjPJYj65KoyZmwVc59713PIa72wEvC5loaA8503Ds62Tx8Xfwallh4zi7oRlGg8rA8U8=; 7:oTysgOrxreXn3mtqolgT/kwjn134tuo2MCaJRk/wo/RAnJS1x+d5f2D3oLhgWQx5Kd7QObA75utfUZouY9Ag+y1VjXqGvXJWr3vKpKcbDh4V4dlUeYwg7+fbl+8pzy8VlYI6tTCV4MB/MrODw+lRF1AZKCyH1oXrGQg52uEO8fc1qvIcL6Twyt0ik7NwN4s63FxETY6kv6ijZOX27cnwt0WT69fFsaggIRY6FAFuLi6wAeHXXXLLqlwGllzCVKn0
x-ms-exchange-antispam-srfa-diagnostics: SSOS;
x-ms-office365-filtering-correlation-id: 750eb34d-bf73-4c54-de31-08d53c8badbf
x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(5600026)(4604075)(2017052603286)(49563074); SRVR:BLUPR06MB1762;
x-ms-traffictypediagnostic: BLUPR06MB1762:
x-microsoft-antispam-prvs: <BLUPR06MB176269762794F128AAA6AB5FA7320@BLUPR06MB1762.namprd06.prod.outlook.com>
x-exchange-antispam-report-test: UriScan:(37575265505322)(80524489315369)(166708455590820)(31960201722614);
x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(102415395)(6040450)(2401047)(5005006)(8121501046)(3002001)(10201501046)(3231022)(93006095)(93001095)(6055026)(6041248)(20161123564025)(20161123562025)(20161123555025)(20161123558100)(20161123560025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(6072148)(201708071742011); SRVR:BLUPR06MB1762; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:BLUPR06MB1762;
x-forefront-prvs: 05134F8B4F
x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(366004)(376002)(346002)(24454002)(13464003)(377424004)(199004)(189003)(68736007)(3660700001)(33656002)(2950100002)(6916009)(97736004)(2900100001)(2906002)(106356001)(105586002)(8936002)(101416001)(77096006)(7736002)(316002)(5660300001)(66066001)(54906003)(50226002)(3280700002)(3846002)(57306001)(6116002)(36756003)(229853002)(53936002)(6246003)(606006)(4001150100001)(102836003)(14454004)(81166006)(6506006)(76176011)(6436002)(6486002)(8666007)(81156014)(8676002)(6512007)(236005)(4326008)(54896002)(6306002)(99936001)(82746002)(478600001)(99286004)(86362001)(83716003)(966005)(25786009)(53546010)(129583001); DIR:OUT; SFP:1101; SCL:1; SRVR:BLUPR06MB1762; H:BLUPR06MB1764.namprd06.prod.outlook.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en;
received-spf: None (protection.outlook.com: netapp.com does not designate permitted sender hosts)
spamdiagnosticoutput: 1:99
spamdiagnosticmetadata: NSPM
Content-Type: multipart/signed; boundary="Apple-Mail=_FE99706F-AF5B-457B-ABFD-0B99404F1407"; protocol="application/pgp-signature"; micalg="pgp-sha512"
MIME-Version: 1.0
X-MS-Exchange-CrossTenant-Network-Message-Id: 750eb34d-bf73-4c54-de31-08d53c8badbf
X-MS-Exchange-CrossTenant-originalarrivaltime: 06 Dec 2017 09:28:15.5477 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 4b0911a0-929b-4715-944b-c03745165b3a
X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR06MB1762
X-OriginatorOrg: netapp.com
Archived-At: <https://mailarchive.ietf.org/arch/msg/ecn-in-quic/U03exKzSaijjGk-KujpH9EWUlgs>
Subject: Re: [Ecn-in-quic] Darwin issue with setting ECN/DCSP via sendmsg
X-BeenThere: ecn-in-quic@ietf.org
X-Mailman-Version: 2.1.22
Precedence: list
List-Id: "ECN in the QUIC protocol discussion list." <ecn-in-quic.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/ecn-in-quic>, <mailto:ecn-in-quic-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/ecn-in-quic/>
List-Post: <mailto:ecn-in-quic@ietf.org>
List-Help: <mailto:ecn-in-quic-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/ecn-in-quic>, <mailto:ecn-in-quic-request@ietf.org?subject=subscribe>
X-List-Received-Date: Wed, 06 Dec 2017 09:28:21 -0000

On 2017-12-6, at 8:46, Ingemar Johansson S <ingemar.s.johansson@ericsson.com> wrote:
> I have never tried out Darwin, read however that it is sort of the basis for Mac OSX. Are the issues with outbound packets in Darwin solved in MaxOSX ?

These issues also exist in MacOSX. I use "Darwin" to mean "the MacOSX kernel", which may not be 100% accurate.

Also, there was an issue on Linux kernels before 4.9 where you needed to pass in an "int" to set the TOS byte (while at the same time you read the TOS byte as a byte). That caused my code to fail on older Linux kernels and took some time to diagnose. See https://github.com/torvalds/linux/commit/e895cdce683161081e3626c4f5a5c55cb72089f8 <https://github.com/torvalds/linux/commit/e895cdce683161081e3626c4f5a5c55cb72089f8> On newer kernels, you can set and read the TOS byte as a byte, which obviously makes a lot more sense.

Lars

> 
> /Ingemar
> 
>> -----Original Message-----
>> From: Ecn-in-quic [mailto:ecn-in-quic-bounces@ietf.org] On Behalf Of
>> Eggert, Lars
>> Sent: den 29 november 2017 15:35
>> To: ecn-in-quic@ietf.org; Stuart Cheshire <cheshire@apple.com>
>> Subject: [Ecn-in-quic] Darwin issue with setting ECN/DCSP via sendmsg
>> 
>> Hi,
>> 
>> sorry for abusing this list. In order to play with ECN and QUIC, I've added
>> support for being able to set ECN (and DSCP) fields on the UDP packets I
>> generate.
>> 
>> The good news is that the socket option calls to set the default for a socket
>> are exactly the same on Linux, FreeBSD and Darwin, and it works on all
>> platforms.
>> 
>> The other good news is that receiving per-packet ECN (and DSCP)
>> information on inbound packets received via recvmsg/recvmmsg is almost
>> identical on all three platforms (Linux uses a slightly different option name
>> than the other two), and it also works everywhere.
>> 
>> Sending packets with per-packet ECN (and DCSP) information by initializing
>> "struct cmsghdr" information for sendmsg/sendmmsg also uses the same
>> API on all three platforms. However, it only seems to work on Linux and
>> FreeBSD.
>> 
>> On Darwin, there is no error, but the outbound packets are *not* marked as
>> indicated in the accompanying "struct cmsghdr".
>> 
>> In case this is of interest to anyone.
>> 
>> Lars