[tsvwg] Re: DTLS in SCTP: my concern and proposal

Claudio Porfiri <claudio.porfiri@ericsson.com> Tue, 18 March 2025 10:33 UTC

Return-Path: <claudio.porfiri@ericsson.com>
X-Original-To: tsvwg@mail2.ietf.org
Delivered-To: tsvwg@mail2.ietf.org
Received: from localhost (localhost [127.0.0.1]) by mail2.ietf.org (Postfix) with ESMTP id 38180DC60A4 for <tsvwg@mail2.ietf.org>; Tue, 18 Mar 2025 03:33:11 -0700 (PDT)
X-Virus-Scanned: amavisd-new at ietf.org
X-Spam-Flag: NO
X-Spam-Score: -2.097
X-Spam-Level:
X-Spam-Status: No, score=-2.097 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_MSPIKE_H2=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_NONE=0.001] autolearn=ham autolearn_force=no
Authentication-Results: mail2.ietf.org (amavisd-new); dkim=pass (2048-bit key) header.d=ericsson.com
Received: from mail2.ietf.org ([166.84.6.31]) by localhost (mail2.ietf.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id P0qbEfW47A5L for <tsvwg@mail2.ietf.org>; Tue, 18 Mar 2025 03:33:10 -0700 (PDT)
Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2059.outbound.protection.outlook.com [40.107.20.59]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature ECDSA (P-256) server-digest SHA256) (No client certificate requested) by mail2.ietf.org (Postfix) with ESMTPS id D4068DC5149 for <tsvwg@ietf.org>; Tue, 18 Mar 2025 03:30:54 -0700 (PDT)
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=GsGBJqABhQQdSn0dAK5d3S3jmu70LFDgceTOadPwNKBLBNC1ITeBiJIwjIMVyKyKzyxpwgBtIV8cfGJL4IfbxJSFtqiRZagN0ANyUgH1e+Cpz7F9saS8GrZ7MZK+Uim3M9HPPmWvcyUj/5UgktvAzc180dfZwOIDyZtnZCajbdbLYnq3+lLLSpmIgnGi//WROC3uVvUDikQsG+OGJ1nlkmjkXDq0dro4Qbo42zvu6OW4vvTCaEVBKtiPp8jd04uzDjedTZbrv2g+1KAKe8etdG6O9QdmL3nvlPxlmPLyCssWhXqKqezt5tMZlOoozaBlPf2ZEiOa7E7qQrhBVW3Sxw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=k6G/SZ2tGjFE1oUKCzpdowKcYXUfnT4VQtRfe3PmJfA=; b=RCxgHQDn00hReEEV+f+3YEFGMu8ryCSx15/GO9Fb8YL+LnpV+7uCffvkB+4Su/XlPwpbEvDfdsRyq4jlzKYV44iDUlJYLyvPmQ9mDUXjDJG/MXrUTYR+aSC5SMiY0jXE0IHWkSUc9nOMNcxRjr3lr697AuS+R5uvRAalkuasRqQbCmO6KToccBgwpoFIajpULD7kP3LmhSYOz8XM/RE08ZJaA3iT7ID1x9QUPmmGY+tEnhxPXy9UFcwEzwmLoigPs1bIl8D8QO8EwYTE9Z+IoSZ95XwwGwybwNdr6IBUnNnPnsULKrrzx4MomfBrUNwLSXOfSTBCPQs6bOf5iAemBA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=ericsson.com; dmarc=pass action=none header.from=ericsson.com; dkim=pass header.d=ericsson.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ericsson.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=k6G/SZ2tGjFE1oUKCzpdowKcYXUfnT4VQtRfe3PmJfA=; b=kNNiPoFqDhllsdOdt66e3wed+VXJxiF1cOtfffTODdYiSkNpR5d0FmFFQgHEREkezKVYN5AwEA2u9OPltt68uaACJ7y9K+sRSEQwSfwg0MTeqxcYG0UIIdiQQJnSup9VT9tlSbc4W+MshnDujuLF3+OrRDqeazjnFkxzxSnFBt8aHfqOPjBYzGDYhR/ZZN8uuRyflic3tCwd1y7pSb24bnNGre7wD035oglPSZONh3tO6K6Q9xmAtMXjPMW/WoL/05wB8eT6HTtsy+lX+tHFx38uZ8ckqfjlJ0njNlSvj5/SsCybOfSRdKaRKGpP5STV5oQbppFryzMY4Qromgs7nQ==
Received: from PA4PR07MB7568.eurprd07.prod.outlook.com (2603:10a6:102:c7::23) by AS2PR07MB9304.eurprd07.prod.outlook.com (2603:10a6:20b:60b::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8534.33; Tue, 18 Mar 2025 10:30:52 +0000
Received: from PA4PR07MB7568.eurprd07.prod.outlook.com ([fe80::24ac:f21:985e:9f57]) by PA4PR07MB7568.eurprd07.prod.outlook.com ([fe80::24ac:f21:985e:9f57%5]) with mapi id 15.20.8534.031; Tue, 18 Mar 2025 10:30:52 +0000
From: Claudio Porfiri <claudio.porfiri@ericsson.com>
To: "tuexen@fh-muenster.de" <tuexen@fh-muenster.de>
Thread-Topic: [tsvwg] DTLS in SCTP: my concern and proposal
Thread-Index: AQHblkJ2fxj9Foj8QU+fur9mPRBThbN3SvWwgAFGMwCAACDGYA==
Date: Tue, 18 Mar 2025 10:30:52 +0000
Message-ID: <PA4PR07MB7568DFDB27DC818D24376FA287DE2@PA4PR07MB7568.eurprd07.prod.outlook.com>
References: <311D3632-F539-4109-BDF8-BE8A064EB5AE@fh-muenster.de> <PA4PR07MB756885F915AFEDB8740ABBB687DF2@PA4PR07MB7568.eurprd07.prod.outlook.com> <D9E12AD0-0E9C-48A7-B107-C9929A2E2105@fh-muenster.de>
In-Reply-To: <D9E12AD0-0E9C-48A7-B107-C9929A2E2105@fh-muenster.de>
Accept-Language: en-US, sv-SE
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=ericsson.com;
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: PA4PR07MB7568:EE_|AS2PR07MB9304:EE_
x-ms-office365-filtering-correlation-id: f993f1c7-2c9a-4a02-1ad0-08dd6607f537
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam: BCL:0;ARA:13230040|366016|1800799024|376014|13003099007|3613699012|38070700018|7053199007;
x-microsoft-antispam-message-info: hXZvqiRh1/TbmVqTi7hkDIFPeHRA9Z+bmJ4/9bwqO7gpOVfkA2b9itpFzEpwvQgJePg5lo3GztsCDLzHf0cPrhQ2vVeD8FGgVQrE8n9z+B3vAz4jbykYK2crnKHHGSTBu8dWcRKoFv8xZxcYirIRUH0XeeW+6oWBinLUTBOOpJzX1D8EwHGCPOTrLNykZC6nIBTGzaRuysgYakV0x37E5IAGa0wjPdXAAEjLqrA+6SKmVKkWNxEJ+DZyrzmihd5OQEvDZJzIBHDrj7IJn+YGw3tYJ41rEgUkg93NLamPWK88vp+3IgWk+iBqZnbKnYYnCD6+3oE5jCNoWGHKqZR/q4CN32wyz43fasNhOe7HiSPUcGbNp8VkRPTe8AKrA8AGfvx4Y6b/FtvtTxfnA9iVkQJADCt//R3coWcpkJd+tGo+S00pXMk7loRh7xRyJBlYMO8o2SPxhJ2wni9u+6wtO9vUQ2Rzz3XaY3Xs+ThFUyaiwzV9eFvX0vjSkBDSPNdk2Ch5V2r7+dPvrC0RIrJcFUWEkEV7ZjBCb5OXq9wU4qUBO0DBzEbNmW9eRfn2XKZVjN5t7yib64QrF4bGavEde+TjIvhaB/gQfuN0+3zP/UGiIjFKLzPh3Cepajf9wYCrZx746Rpe2DWTfmO4uifDyovgzftBf0xwtEd3L5z/ZFKWVzxWH5mjJl0B9jMULHXHPmhKugxDZK8UZ14FkvBt8KfftvhaDyS8UnWOHl7kBAz3FihpKwfcKnN6R7TYTUGIIOcTN8ARjzdKCCjGgohdgRUFQOt8E4nnw4VcbZy2/PsyVN8IkR7JlkQ79RfxckKgTXL/tHI9L/u/qKMoirw/UVzGu+tbtLRD5HWehc00byr1ZT/3mGvUjo/bU0cxU3uBL+N3l+W87sSZ9tqN4mG6o94veJ55BrZKmmOfXp0JgborIU70SHs2wm2Au/RsES6PusNqultlTXV07ODAzen1K1zFpJAC0PrK799BwpOUfDgZHo/0m0DepK++caOgaqXpbCH2sriEeH3skSXcg4qrC/jebOBB0qw9IYhOMDfv4Rb0Uak9Cm2zb5LhH2ucPU3Ei0JmI5fHrCauJPpPoxXOD1d0i209m0eSQgU9/rCw8pGdjvfjzZtfaKXqaBSTAzak3dgU/SCKXASqbAfi6ZA7vhPO6ro44hNhiw32dH0h8nLP52xk1MDs8zDLlWPQccgeo2ULn5YjZ7atvW3OEZOwleUqen0cWP3s/jDeBrewLmXj5dd9IZOauaIHuL/FNXTGBvCTE0Gslk6P2cOyjYyHf+HCyuBjxTmI3NMny5sRomTCGAqk2cwFuInW/g1ul1FKW11mzRcEmeA6ozGTU/gOnGxXr6EeZofgSlgo0Qu5USoW5GAkt5gR8IEBZ4lM0S+DL4rhkhRodGZQnRLlj0x2z9Z8oPs+wTpUuO1TpkqSCmDCXHABd9ErjdhvIBGcGhA10CBybvw2Lq7nUjSrF2C06A==
x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PA4PR07MB7568.eurprd07.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(1800799024)(376014)(13003099007)(3613699012)(38070700018)(7053199007);DIR:OUT;SFP:1101;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0: 5Hj2hUVScNdmK8XCTDpLNorQ2w9HOknKXyD2ZWWytdc5j16SJtmL5cibo8zUs5dN4Wvw87jUdTQo9edg3bwr+SUhb565JkuN+Tb0OmXvmkWZJWatt/05tcR/qKGuk8S9v/DCTLHy2Ixzu1keWxY6OHVtvQX8BILgD4p25Sld30Upipm0cpQZdj5vceF04HtU1vkF46T1CC3erqP7rGa+M7Km34lAGf6ad5pBYTcq/8DY04u5RjRlJeDtGwi+x3bCdkHVcUrXfwGiV1NosldGUmWXj6YHM57tmEmJN2iSbnhDKIXwfn24SJozhcbbBAJa9Fk/1ktdXVXEoS5tsVfw+oK5vPfskdmdYlcBaepeBfz9gSpRJ6StfGEuA//FWvd5T1g3yHoJfzb0antYmGYQ6nrbwrnJNBK7BF+1F+JQIc3781OE/GgNfcHFRm2DKqbvRdm5ThZUI6KrLBlUYdOUITYJUgTK2PCp1GCsrmhtECvw00p9/uqw57HtMeF5nIXOYPB3HG+WBekK4t0y1gbPQTWVQ+NBuLpRSxvptWBBCtFwJ62LgNm8GWDhtZYEzd3Cac8I/DBCXhB1vb8lPa9lVk/JzhnwGa5xW/R4K0zdWEmDAz6FPQ0p7y7+SmY6MjADmjJ5m76WqlGlS8AEcWWtBZsAmVfKFouS6a64p4GaYbjaSjh8DjkNVbbx+rbzK2prcp3XDMyuV+DpzONOUxpwi/J5iRtHAUnQQUA1ie4hNkWwpK8xteldHsynqmX8moM+RUglWpLT1/rtNPwh0gtDO7GkTlpJVBwUesDpM9JuF4648+ciq8ALxTyGUXpNczuq2NfLDjWeSHi6OL1K/C2f7XKR45hD2jeS5U4kT86N80Koy89F18aC/OyVxlATNNUZN9dotpe/NOAxieS439ky/eGJNAPtCOOT7i/it0qLxdUrucAECCVmv8dmStg6MTBc8r/UByCZ8b0XPwW6Aj7uvzTZjYB3QCroXBtRDtlkRkoLaKwy+wDYbpY4H2zj+b7yvMi4UkUnbpAdATAjQSR2FQD9y4sTlYeSfcKI7nXPRhI3UQGjT+0a4r38jfhfLd0EnNEyFrCYUGWJ3Iuxh5/Sns2OTdO6fJSVJAtpudfh9bg3yrsyVa/55ajMfJnBZ0WhN713KBZK7ZliGuMNEuW4SIgF3u8axopyGpJV6Hy8ov1jXD5D+DNfmqpWsnT8xObCb1MGgUQCJQvUfRr/zqEfx6nPX/3LDS1ZlLDvxTdbXFDjb4VwQAHF9xX/bHnojVMGfPvUqDZ0RXYtX3YOhds0c66nDDjPiTSGpBB+T8/Z/yi/+CWlvnt3JZhx0On787j17IoVNt4I3fz34L9t3z0Z2xfcmOvPTbv0HUiBFoLlH0VqOPmhD5o2S6KF1DDOdirSPdNscMwfZ07xUOnN113jvUbXnju56XhJG1xmjUHty4rGI0Si+B0SQa67QP3t/FDiij5qk40gzygwR3u/JjDa95zsUk2gJq4WEg5WEkMgvqCrcUBTk+0ykCYVH1zaT1QJwvbqdRYtDl9wl1ncbzPCJ4AGFUkxDO/9EvX5zuaLP0xHwhSPe4nlmpVxVTM9vI/+zJeJ3gPjHdccWDllrtxYcw==
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
MIME-Version: 1.0
X-OriginatorOrg: ericsson.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: PA4PR07MB7568.eurprd07.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: f993f1c7-2c9a-4a02-1ad0-08dd6607f537
X-MS-Exchange-CrossTenant-originalarrivaltime: 18 Mar 2025 10:30:52.0745 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 92e84ceb-fbfd-47ab-be52-080c6b87953f
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: ttjl7zaBFs8zT3XH1eTMZJo7Nuy1/dXMeWBZhG6YngnfIx/n2MJ5nP8eqMmyEJAcMxEfQRBX3E0z2ViqQ9kkR3E4aAGdl5f8nZAJPZfSyIE=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS2PR07MB9304
Message-ID-Hash: 7ARCQN7YQRT6MZGSJEGQS6XVTYUTVS6D
X-Message-ID-Hash: 7ARCQN7YQRT6MZGSJEGQS6XVTYUTVS6D
X-MailFrom: claudio.porfiri@ericsson.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
CC: tsvwg <tsvwg@ietf.org>
X-Mailman-Version: 3.3.9rc6
Precedence: list
Subject: [tsvwg] Re: DTLS in SCTP: my concern and proposal
List-Id: Transport Area Working Group <tsvwg.ietf.org>
Archived-At: <https://mailarchive.ietf.org/arch/msg/tsvwg/7rBaoNzP5uXA3s33iwO-xJfs04c>
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>

Hi Michael,

> -----Original Message-----
> From: tuexen@fh-muenster.de <tuexen@fh-muenster.de>
> Sent: Tuesday, March 18, 2025 9:22 AM
> To: Claudio Porfiri <claudio.porfiri@ericsson.com>
> Cc: tsvwg <tsvwg@ietf.org>
> Subject: Re: [tsvwg] DTLS in SCTP: my concern and proposal
> 
> > On 17. Mar 2025, at 14:18, Claudio Porfiri
> <claudio.porfiri=40ericsson.com@dmarc.ietf.org> wrote:
> >
> > Dear all, Michael,
> > Even though I think that you depicted pretty well a possible adoption of
> DTLS in SCTP,
> > the original intent for DTLS in SCTP was to protect all SCTP traffic including
> Control-Chunks, in my
> Hi Claudio,
> 
> I am just describing the solution specified in
> https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdatat
> racker.ietf.org%2Fdoc%2Fdraft-westerlund-tsvwg-sctp-dtls-
> chunk%2F&data=05%7C02%7Cclaudio.porfiri%40ericsson.com%7C78a1b13
> b04a74b947b2f08dd65f6b168%7C92e84cebfbfd47abbe52080c6b87953f%
> 7C0%7C0%7C638778832404403182%7CUnknown%7CTWFpbGZsb3d8eyJF
> bXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiT
> WFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=3x5KS%2BuMlhZ%2F
> U3vJWBJLXVCuM2VX%2Bf0iMRxZD9DWXbc%3D&reserved=0
> in a different way. But it is a the same solution.
> > opinion this makes an even harder challenge for keeping the Record
> Protection Operator
> > and Chunk Protection Operator aligned.
> Not sure what you are saying here.
> Conceptually, the proposal in the ID above uses a record protection operator
> and
> a chunk protection operator, which has identical state and identical code.
> Do we agree on this?

Yes, I do. I think that keeping the state aligned is an hard task.

> > That intent will also challenge your proposal, I don't see an easy solution
> using two separate
> > Instantiation of DTLS.
> There are is only a singe instance of DTLS. It is just split. The record layer
> is handled in the kernel, all the rest is done in userland.
> My proposal then comes down to using different keys and different replay
> protection arrays
> for both protection operators.

Here the point is that unfortunately the alignment needs to run at Chunk speed,
Including the control chunks generated by SCTP itself such as SACKs and HBs.

> >
> > May you consider a different architecture, where all the DTLS work is done in
> a User-space sidecar
> > working as helper function and interfacing DTLS library? That would be a
> proof-of-concept
> > as long as no better alternative exist.
> Unfortunately, I don't get, what you are suggesting. Can you elaborate?
> Are you suggesting to avoid doing the record layer in the kernel? Why?
> This is already done for kernel TLS.

What I meant comes from the need of keeping the two objects aligned at chunk speed,
that requires an intense communication between those two parts of DTLS, being one
in the kernel space and the other in the user space.
Since we need to have that communication anyhow, we may try to keep all DTLS in userspace:
When requesting for an Association that is meant to be protected, the User (or a library
being used by the user such as libsctp in Linux) will provide an API towards DTLS so that
the kernel SCTP module will use it for encryption/decryption.
That is an alternative to kernel native DTLS implementation that, at the time of writing,
is only available for Linux.

Best regards,
Claudio.

> 
> Best regards
> Michael
> >
> > Best regards,
> > Claudio.
> >
> > -----Original Message-----
> > From: tuexen@fh-muenster.de <tuexen@fh-muenster.de>
> > Sent: Sunday, March 16, 2025 8:04 AM
> > To: tsvwg <tsvwg@ietf.org>
> > Subject: [tsvwg] DTLS in SCTP: my concern and proposal
> >
> > Dear all,
> >
> > This email was originally sent to the members of the former design team.
> > It was suggested to send it also the TSVWG mailing list.
> > I covers only technical aspects.
> >
> > You all know that we had three alternate solutions. Last IETF there was the
> > consensus to go for a fourth solution, which is a compromise.
> > Part of the compromise was that we do the protection at the packet
> > level, not at the payload level.
> > So the starting point of a discussing was
> >
> https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdatat
> racker.ietf.org%2Fdoc%2Fdraft-westerlund-tsvwg-sctp-dtls-
> chunk%2F&data=05%7C02%7Cclaudio.porfiri%40ericsson.com%7C78a1b13
> b04a74b947b2f08dd65f6b168%7C92e84cebfbfd47abbe52080c6b87953f%
> 7C0%7C0%7C638778832404435783%7CUnknown%7CTWFpbGZsb3d8eyJF
> bXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiT
> WFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=qgKOQN0LfPcJ8Lb1e
> bBxV7kU8OM7xFWRl5Ic7s9mSjg%3D&reserved=0
> >
> > I suggested some modifications, but they seem to be unacceptable to the
> > authors of the ID. So I am seeking out to you all for further input for
> > this discussion, since there is an agreement that we need to move forward.
> >
> > Here is a figure describing the architecture, which I'll use in this email.
> >
> >  +---------------+ +------------------------------+
> >  |      ULP      | |           DTLS 1.3           |
> >  |               | |   +---------------------+    |
> >  |               | | +-+    Key Management   +--+ |
> >  |               | | | +---------------------+  | |
> >  |               | | |     +---+ +---+          | |
> >  |               | | |     | H | |   |          | |
> >  |               | | |     | a | |   |          | |
> >  |               | | | k   | n | | A |        k | |
> >  |               | | | e   | d | | l |        e | |
> >  |               | | | y   | s | | e |   ...  y | |
> >  |               | | | s   | h | | r |        s | |
> >  |               | | |     | a | | t |          | |
> >  |               | | |     | k | |   |          | |
> >  |               | | |     | e | |   |          | |
> >  |               | | |     +-+-+ +-+-+          | |
> >  |               | | |       |     |            | |
> >  |               | | |       +-----+---...      | |
> >  |               | | | ContentType |            | |
> >  |               | | |  +----------+----------+ | |
> >  |               | | +->|        Record       | | |
> >  |               | |    | Protection Operator | | |
> >  +               | |    +----------+----------+ | |
> >  +-------+-------+ +----------------------------+-+
> >          |                          |           |
> >          +--+-----------------------+           | keys
> >        PPID |                                   V
> >  +----------------------------------------------+-+
> >  |                    +---------------------+   | |
> >  |        SCTP        |         Chunk       |<--+ |
> >  |                    | Protection Operator |     |
> >  |                    +---------------------+     |
> >  +------------------------------------------------+
> >
> > The figure is not perfect and it does intentionally not show
> > kernel/userland boundaries.
> >
> > The Record Protection Operator transform an DTLSInnerPlaintext, which
> > contains a message (handshake, alert, ...) and a ContentType and
> > computes the DTLSCiphertext, which contains the unified_hdr and
> > the encrypted_record and vice versa.
> >
> > The Chunk Protection Operator transforms an DTLSInnerPlaintext, which
> > contains a message (list of SCTP chunks) and uses application_data
> > as the ContentType and computes the DTLSCiphertext, which contains
> > the unified_hdr and the encrypted_record and vice versa.
> > The DTLSCiphertext is the chunk value of the DTLS chunk.
> >
> > From a functional point of view, the Record Protection Operator and
> > the Record Protection Operator are very similar. Both also provide
> > replay protection.
> >
> > The proposal from Ericsson is that the Record Protection Operator and
> > the Record Protection Operator are identical. This means they share
> > the same code and the same state.
> > Since sharing the state is hard, a solution is to have only one
> > protection layer which does both. This is simple to implement,
> > if SCTP and DTLS are both implemented in user space or kernel space.
> > However, doing full DTLS in kernel space is not acceptable for FreeBSD
> > or Linux kernel developers at the moment.
> > But this is not necessary. For a kernel SCTP implementation using the
> > socket APU one can do the following:
> >
> >  +---------------+ +------------------------------+
> >  |      ULP      | |           DTLS 1.3           |
> >  |               | |   +---------------------+    |
> >  |               | |   +    Key Management   +--+ |
> >  |               | |   +---------------------+  | |
> >  |               | |       +---+ +---+          | |
> >  |               | |       | H | |   |          | |
> >  |               | |       | a | |   |          | |
> >  |               | |       | n | | A |        k | |
> >  |               | |       | d | | l |        e | |
> >  |               | |       | s | | e |   ...  y | |
> >  |               | |       | h | | r |        s | |
> >  |               | |       | a | | t |          | |
> >  |               | |       | k | |   |          | |
> >  |               | |       | e | |   |          | |
> >  |               | |       +-+-+ +-+-+          | |
> >  |               | |         |     |            | |
> >  |               | |         +-----+---...      | |
> >  |               | |               |            | |
> >  +-------+-------+ +----------------------------+-+
> >          |                         |            |
> >          +--+----------------------+            | keys
> >        cmsg |        cmsg_data=ContentType      V
> >  +----------------------------------------------+-+
> >  |                    +---------------------+   | |
> >  |        SCTP        |    Chunk/Record     |<--+ |
> >  |                    | Protection Operator |     |
> >  |                    +---------------------+     |
> >  +------------------------------------------------+
> >
> > So when the DTLS stack sends a message needing to be protected,
> > it calls sendmsg() with the message (handshake, alert, ...) and
> > a cmsg providing the ContentType. Then the kernel know that
> > the Record Protection Operator should be applied to the message
> > before putting it into the send buffer.
> > If packet level protection is enabled, the SCTP stack will use
> > the Chunk Protection Operator to construct the DTLS chunk just
> > before sending the SCTP packet.
> >
> > If a packet is received and contains a DTLS chunk, the Chunk
> > Protection Operator will decrypt the chunks and performs the
> > replay protection.
> > When a user message is put into the receive buffer, the PPID
> > is inspected to figure out, if the Record Protection Operator
> > needs to be applied. If that is the case, the content type
> > will be provided as a cmsg.
> >
> > So the proposal of Ericsson an be implemented also for SCTP kernel
> > stacks.
> > What is needed is:
> > * a DTLS implementation which provides the DTLSInnerPlaintext.
> > This looks similar to what TLS implementation might do for QUIC,
> > but this time it is DTLS, not TLS.
> > * an implementation of the DTLS record layer in the kernel
> > I think we all agree up to here. If not, please let me know.
> >
> > Here is my concern:
> >
> > In my view, Record Protection Operator and Chunk Protection Operator
> > are conceptually different things. I agree that they are functionally
> > very similar. In particular I would have no problem is using the same
> > code. But sharing the state between these two operators it what concerns
> > me. I have fixed a couple of security issues where sharing the state
> > between unrelated/independent functions was the root cause.
> > Let me illustrate this by an example.
> > Since DTLS messages are transmitted via SCTP reliably, it makes no
> > sense to me to retransmit them at the DTLS layer.
> > If both protection operators share the same state, they perform the
> > replay protection the same data (most likely an array and the sequence
> > number of the left edge). Let us assume the replay window is W.
> > Now the sender sends a key_update and uses sequence number S.
> > Assume this SCTP packet containing this message is lost.
> > If the SCTP sender sends a lot more packets and they all
> > arrive at the receiver and the retransmission is W packets later,
> > the Chunk Protection Operator will process the packet successfully,
> > but the Record Protection Operator will drop the valid packet.
> > This should not happen.
> > This is an example, and we can fix it. But it keeps the door open for
> > attacks/problems related to this state sharing (including side channel
> > attacks).
> >
> > Here is my proposal:
> >
> >  +---------------+ +------------------------------+
> >  |      ULP      | |           DTLS 1.3           |
> >  |               | |   +---------------------+    |
> >  |               | | +>+    Key Exporter     +--+ |
> >  |               | | | +---------------------+  | |
> >  |               | | | +---------------------+  | |
> >  |               | | +-+    Key Management   +  | |
> >  |               | | | +---------------------+  | |
> >  |               | | |     +---+ +---+          | |
> >  |               | | |     | H | |   |          | |
> >  |               | | |     | a | |   |          | |
> >  |               | | | k   | n | | A |        k | |
> >  |               | | | e   | d | | l |        e | |
> >  |               | | | y   | s | | e |   ...  y | |
> >  |               | | | s   | h | | r |        s | |
> >  |               | | |     | a | | t |          | |
> >  |               | | |     | k | |   |          | |
> >  |               | | |     | e | |   |          | |
> >  |               | | |     +-+-+ +-+-+          | |
> >  |               | | |       |     |            | |
> >  |               | | |       +-----+---...      | |
> >  |               | | | ContentType |            | |
> >  |               | | |  +----------+----------+ | |
> >  |               | | +->|        Record       | | |
> >  |               | |    | Protection Operator | | |
> >  +               | |    +----------+----------+ | |
> >  +-------+-------+ +----------------------------+-+
> >          |                          |           |
> >          +--+-----------------------+           | keys
> >        PPID |                                   V
> >  +----------------------------------------------+-+
> >  |                    +---------------------+   | |
> >  |        SCTP        |         Chunk       |<--+ |
> >  |                    | Protection Operator |     |
> >  |                    +---------------------+     |
> >  +------------------------------------------------+
> >
> > Let the Chunk Protection Operator use keys from the Key Exporter
> > and its own replay protection (its own sequence number and array).
> >
> > As the solution above, an implementation of the DTLS record layer
> > is needed in the SCTP stack.
> > However, the DTLS stack does not need any modifications. One could
> > even use a TLS 1.3 implementation, since SCTP can provide a reliable
> > in-sequence transmission.
> > This solution also avoids that the SCTP stack looks into the PPID,
> > which is needed by the first solution. The SCTP stack is not intended
> > to look into the SCTP stack.
> >
> > I have also two comments about the DTLS chunk:
> > 1. I am not sure we need more than one DTLS connection in general.
> >  I do understand that the key management proposed by Ericsson needs
> >  it. So the R and DCI bits might be specified in that ID.
> >  But this depends how we specify (multiple versions of) key management
> > 2. I think we can optimize the chunk layout:
> >  One could use the chunk flags to encode the flags needed for the
> unified_hdr.
> >  I think there is not use for the length field in the unified_hdr, so the L
> >  bit can go away. We could make the sequence number part of the chunk
> value
> >  with a fixed size. So the S bit can go away. Not sure, if the Connection ID
> >  is really needed.
> > But the first one is something to move around in specifications, the second
> > one is an optimization.
> >
> > It would be great, if you can share any opinions or suggestions or questions.
> > If there are other people you know that can provide input in the discussion,
> > please forward the mail to them.
> >
> > Best regards
> > Michael
> >
> >
> >
> >
> >
> >