Re: [Coin] Fwd: The Future of P4, Revisited

Haoyu Song <haoyu.song@futurewei.com> Thu, 18 May 2023 17:44 UTC

Return-Path: <haoyu.song@futurewei.com>
X-Original-To: coin@ietfa.amsl.com
Delivered-To: coin@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 840ACC1516E1 for <coin@ietfa.amsl.com>; Thu, 18 May 2023 10:44:51 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.096
X-Spam-Level:
X-Spam-Status: No, score=-2.096 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, HTML_MESSAGE=0.001, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001, URIBL_DBL_BLOCKED_OPENDNS=0.001, URIBL_ZEN_BLOCKED_OPENDNS=0.001] autolearn=unavailable autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=futurewei.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 z6IHqyhiCP4m for <coin@ietfa.amsl.com>; Thu, 18 May 2023 10:44:47 -0700 (PDT)
Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on20722.outbound.protection.outlook.com [IPv6:2a01:111:f400:7ea9::722]) (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 847B5C1516E0 for <coin@irtf.org>; Thu, 18 May 2023 10:44:47 -0700 (PDT)
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JdJ7WyHynduBCrLgVgpGIVve9guP9a6Xc1nckaERreruVlN66tdfiHHvLT6K0J21e0YnCMIKAG9T9Mbr9zeXNUpRTMTIAWeaRcWQiwcobvep3vaJniVf4ohwpskAzvSIg4G9y0fZNo9KYH3qAtdjgQbKcDAfXQxwfu4OBSztpIMnIESunUIgn0ipSBcIfv0DZTndszAB9nfALg3Cqb27k6M4Y6pKINu3T5h2uoX69zS5pigBnwnDugf6Jxf35w3OSF8QCbHUdUiEIlnOEoi9jtzo34F5RDMm/dQmCTmFP3ycv/AaQI02Bh4XUcEK+ygMSSlhiS4YxBJ+Ny34IhFNSg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=Jze982ui5gHjjfWUsg3pdF6+09KMHrB71EmsFp9E/ac=; b=CxJUyYSu2mFcxtaTtSr6oWpydZdRBRphfWct5HczPtx6Vb+ABV2IsxxK/vwCmZrEv//EhdybLb7ZeZIbECQOJa7vh8dmo/nIBdXjCkMR77PqNYv9lOwIlzG+PCcneHOANXM0FfqDtIDjDgRv+0ap4iAzHRPB742Q4dWbMvPYq/9knXzAagDCXpwuXuNe3CzkeVpM3lI85tNvGbI+nDPI+R0XHoxbpbVia2owuEmLvMtS0/IMdE49CYWFi52b7A9QpkDarbTzj5rmwEXzUI7YsN2NLMbbC/mEmi4tocpiERTifkfnFVJiTWLo/wm2p1sG7r/fZo1yPwX9tHvkEZ9gMw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=futurewei.com; dmarc=pass action=none header.from=futurewei.com; dkim=pass header.d=futurewei.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Futurewei.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Jze982ui5gHjjfWUsg3pdF6+09KMHrB71EmsFp9E/ac=; b=X4oDQbwZwrOtikZWjA0RU9HShq4qlPck6Vo79b2Pcy4AF3KSmRBSQJ43rOInUp5KB5Mr3AkSTtY/xRyguX2lx4oX1bpOrOi51HFV2KhPNn0jzLtpM6eRozbX1ol3mIEBlVQVDgsVP7qaCuVXwklNFttfVNw+9a49/IZ+w+VTmTo=
Received: from BY3PR13MB4787.namprd13.prod.outlook.com (2603:10b6:a03:357::13) by PH0PR13MB5746.namprd13.prod.outlook.com (2603:10b6:510:121::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6387.30; Thu, 18 May 2023 17:44:41 +0000
Received: from BY3PR13MB4787.namprd13.prod.outlook.com ([fe80::9313:611:c939:f9d7]) by BY3PR13MB4787.namprd13.prod.outlook.com ([fe80::9313:611:c939:f9d7%7]) with mapi id 15.20.6411.019; Thu, 18 May 2023 17:44:41 +0000
From: Haoyu Song <haoyu.song@futurewei.com>
To: "hemant@mnkcg.com" <hemant@mnkcg.com>, 'Hesham ElBakoury' <helbakoury@gmail.com>
CC: "ehalep@mojatatu.com" <ehalep@mojatatu.com>, 'Toerless Eckert' <tte@cs.fau.de>, "'Bernier, Daniel'" <daniel.bernier@bell.ca>, 'Marie-Jose Montpetit' <marie@mjmontpetit.com>, 'coin' <coin@irtf.org>, 'coinrg-chairs' <coinrg-chairs@ietf.org>
Thread-Topic: [Coin] Fwd: The Future of P4, Revisited
Thread-Index: AQHZhxjBWBKzoPPX0k+KbJNrrt4LNK9bkESAgAARAQCAABdGAIAADoAAgAFujwCAAGSUgIAADYUAgAEfkACAAFKggIAALzCAgADpVQCAAANqUIAAEGIAgAACPECAAAbCgIAAARAQ
Date: Thu, 18 May 2023 17:44:41 +0000
Message-ID: <BY3PR13MB4787E81DA1B1F8EFF282C1169A7F9@BY3PR13MB4787.namprd13.prod.outlook.com>
References: <CAPjWiCT2ipu=yiZFr8hBGF2wy-Y_Dmze=8j+PgeDFyN7KNZR6w@mail.gmail.com> <ZGJl+6YPQarlDSTr@faui48e.informatik.uni-erlangen.de> <034201d98757$bbd87550$33895ff0$@mnkcg.com> <c98c172c-a483-5f69-9bff-dedd4b6a78bb@gmail.com> <044101d9876a$9f0490e0$dd0db2a0$@mnkcg.com> <c9b9a119-27ba-88db-2f08-18e8ff2c6337@gmail.com> <ZGQbyzRW5d1vkgVV@faui48e.informatik.uni-erlangen.de> <9EABD595-552E-4775-B69C-72BE49BD5C93@bell.ca> <00c501d988ea$bbd16f50$33744df0$@mnkcg.com> <095d01d98914$0bba99f0$232fcdd0$@mojatatu.com> <ZGWFQRGI0hmc3g5O@faui48e.informatik.uni-erlangen.de> <001101d989a0$4e180530$ea480f90$@mojatatu.com> <BY3PR13MB47877D31EC3B4511C8095D329A7F9@BY3PR13MB4787.namprd13.prod.outlook.com> <CAFvDQ9ogV5f-Nh9faKxANXV=ORHJVQQPjUH5qAAJb9uvP0KGMA@mail.gmail.com> <BY3PR13MB47876236862ABECD69BF97679A7F9@BY3PR13MB4787.namprd13.prod.outlook.com> <033d01d989ae$b2a828a0$17f879e0$@mnkcg.com>
In-Reply-To: <033d01d989ae$b2a828a0$17f879e0$@mnkcg.com>
Accept-Language: en-US
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=futurewei.com;
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: BY3PR13MB4787:EE_|PH0PR13MB5746:EE_
x-ms-office365-filtering-correlation-id: e531d6e0-48d9-4b70-4330-08db57c78f05
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam: BCL:0;
x-microsoft-antispam-message-info: Q1eVa5ZbL0j34n2Q/zYumcDOeyf0ukeQU/8Kef/FLcb95TsBw9vlR/jR4BzsYEBnyzRY0lSLo9NeVMHFlEICCrcrS3v2ez5Wx9ffiX97wLgneR7f3eYN9UdMD9eUh/4yYSINfwcBLZ2GyobkdTn+qLE7G6vVQX+kmi94M+2I2IrX0LdLpgHbRm3FBPUaBR72HlyfBR4jRux6g9PahzXfhb8Agyt5vjktC/OpS9sZYJko3Epc6qjZMUxr8d+x+iMe5TAUDVc3O8QbRl62YZrndx635zN4cqBQ21EYcHrl/1HZdRogN08w8w6nfdjBi/yZcouHDp88YZarjjaIbYmgAmpm7BQU3n3/P0x8O7y+yXAH40dDsqw2RI7vLuJQqYksPVOTRm62xO5hXjRL3NfiaVc6OtvZussyEJjsAOO2/qns3PQyIO6IsfQ9STNrT/fCl5Xu/iUHc3mFxINq4R/jFvvSyHOOMNiRkz8gJKoPW0UFszDBnHV/iUVECK48icEkgKC4d7zEDEOk8DQYMPcPy2UIi5uMQh6QQzf0Emqe9qyUXh5xLOrTIfWVaGFpW378aKFrFoNJbSwgcbYnFDITBXIrNS2/YjpZPu0e6IBax8RcDgK/qF6wozyUkCO0sugsZSkmIKuz+IDbxigUfx3iVWaiLEapeFWp6g4CKaV3PCw=
x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BY3PR13MB4787.namprd13.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230028)(4636009)(136003)(376002)(396003)(39840400004)(366004)(346002)(451199021)(83380400001)(26005)(55016003)(64756008)(8676002)(9686003)(66446008)(66476007)(478600001)(66556008)(76116006)(7696005)(54906003)(5660300002)(110136005)(52536014)(186003)(44832011)(33656002)(86362001)(8936002)(41300700001)(38070700005)(316002)(2906002)(122000001)(6506007)(53546011)(38100700002)(4326008)(66946007)(71200400001)(66899021); DIR:OUT; SFP:1102;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0: SHhMkRRWIdn9HdFz5iaFwn0K1Sc4dtcJAUOP76dCoc2vryrIrDVlhTCsG7MyO0kx2V865P+LchuTxMKDn0ATr5bfkE6oiWQLFqipcrnM8sikNBsv5HKTSJ9V/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rblwyqgo/f1Rgcr/C9lHYfwajm/PsVuYxA22xwFs1WAKx89SPCyysqTDHV1VpYsY9i8mVQaFMikrL4/j6xakXdcqrh/gyy79AEanmLIE5yLweWOovokdB12f/WhVbuLykGs2HQrmey9t/ZmaR3vNtsAQ0MXxQcAUzwDpM1N/BmgOlMmMyotMHlGAbgZ5DmuF/yGoyA4l78nQeyYSfZ0uMacZxFuwQXU1/Bo2XWqPkcHBtPaSW07IdcD8WGDnEO4uEexLawkRphyEbOoarzztWsXhSdRNJt/2K1LAAPDwkjf1mzTRT4ItRdZHYtKoOLX7dvTgnhZu+azenlk4kGQYtuqYGk0o4iLw7fDWz39tsYk5I=
Content-Type: multipart/alternative; boundary="_000_BY3PR13MB4787E81DA1B1F8EFF282C1169A7F9BY3PR13MB4787namp_"
MIME-Version: 1.0
X-OriginatorOrg: Futurewei.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: BY3PR13MB4787.namprd13.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: e531d6e0-48d9-4b70-4330-08db57c78f05
X-MS-Exchange-CrossTenant-originalarrivaltime: 18 May 2023 17:44:41.2612 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 0fee8ff2-a3b2-4018-9c75-3a1d5591fedc
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: QYUx+rPu1RxAON2W8KeIFD1KdDSVXUpT7oIJvahdzZi1kRhTC8EpVmqYXsjmGVSb8KOdxBJ7oEC3j+hh3QxerA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR13MB5746
Archived-At: <https://mailarchive.ietf.org/arch/msg/coin/WaNmLwY7TCEvqxYf3BPMrSIQdtA>
Subject: Re: [Coin] Fwd: The Future of P4, Revisited
X-BeenThere: coin@irtf.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: "COIN: Computing in the Network" <coin.irtf.org>
List-Unsubscribe: <https://www.irtf.org/mailman/options/coin>, <mailto:coin-request@irtf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/coin/>
List-Post: <mailto:coin@irtf.org>
List-Help: <mailto:coin-request@irtf.org?subject=help>
List-Subscribe: <https://www.irtf.org/mailman/listinfo/coin>, <mailto:coin-request@irtf.org?subject=subscribe>
X-List-Received-Date: Thu, 18 May 2023 17:44:51 -0000

The lack of support for general stateful functions is a sustained problem for P4 (e.g. MAC learning can’t be realized by dataplane alone because P4 doesn’t allow dataplane to write to a table). There are certain “stateful” problems that can be supported if they can be described by a fixed state transition table. The TCP state tracking should be in this category.
Another limitation is that a later logic can’t access a previous table (e.g., each table can only be access once). If the table needs multiple access, then packet recirculation is needed. Obviously, this closely binds to a pipeline architecture which P4 implies, and I don’t think this is ideal to describe general dataplance functions.

Haoyu

From: hemant@mnkcg.com <hemant@mnkcg.com>
Sent: Thursday, May 18, 2023 10:32 AM
To: Haoyu Song <haoyu.song@futurewei.com>; 'Hesham ElBakoury' <helbakoury@gmail.com>
Cc: ehalep@mojatatu.com; 'Toerless Eckert' <tte@cs.fau.de>; 'Bernier, Daniel' <daniel.bernier@bell.ca>; 'Marie-Jose Montpetit' <marie@mjmontpetit.com>; 'coin' <coin@irtf.org>; 'coinrg-chairs' <coinrg-chairs@ietf.org>
Subject: RE: [Coin] Fwd: The Future of P4, Revisited

It is best if such discussions take place in p4-dev mailer. How do you think TCP connection state in maintained without writing table entry by dataplane?  I wrote some of this code in the P4 compiler.

Hemant

From: Haoyu Song <haoyu.song@futurewei.com<mailto:haoyu.song@futurewei.com>>
Sent: Thursday, May 18, 2023 1:16 PM
To: Hesham ElBakoury <helbakoury@gmail.com<mailto:helbakoury@gmail.com>>
Cc: ehalep@mojatatu.com<mailto:ehalep@mojatatu.com>; Toerless Eckert <tte@cs.fau.de<mailto:tte@cs.fau.de>>; hemant=40mnkcg.com@dmarc.ietf.org<mailto:hemant=40mnkcg.com@dmarc.ietf.org> <hemant@mnkcg.com<mailto:hemant@mnkcg.com>>; Bernier, Daniel <daniel.bernier@bell.ca<mailto:daniel.bernier@bell.ca>>; Marie-Jose Montpetit <marie@mjmontpetit.com<mailto:marie@mjmontpetit.com>>; coin <coin@irtf.org<mailto:coin@irtf.org>>; coinrg-chairs <coinrg-chairs@ietf.org<mailto:coinrg-chairs@ietf.org>>
Subject: RE: [Coin] Fwd: The Future of P4, Revisited

Hi Hesham,

I said “it’s very limited”. P4 table is only readable (i.e., not writable) by dataplane, so it basically eliminates any dataplane stateful function that need to use tables. The stateful function can only use register arrays but unfortunately registers are local to a pipeline stage so the state update logic must be very simple and can be finish in a single stage. What you said “event” must be something very simple. Use case such as stateful load balancer can’t be implemented by P4.

There are some works addressing the issue. FlowBlaze is the most recent one, which needs a new chip architecture but it is still limited to simple stateful functions which can be realized in a single pipeline stage.

Haoyu

From: Hesham ElBakoury <helbakoury@gmail.com<mailto:helbakoury@gmail.com>>
Sent: Thursday, May 18, 2023 10:00 AM
To: Haoyu Song <haoyu.song@futurewei.com<mailto:haoyu.song@futurewei.com>>
Cc: ehalep@mojatatu.com<mailto:ehalep@mojatatu.com>; Toerless Eckert <tte@cs.fau.de<mailto:tte@cs.fau.de>>; hemant=40mnkcg.com@dmarc.ietf.org<mailto:hemant=40mnkcg.com@dmarc.ietf.org>; Bernier, Daniel <daniel.bernier@bell.ca<mailto:daniel.bernier@bell.ca>>; Marie-Jose Montpetit <marie@mjmontpetit.com<mailto:marie@mjmontpetit.com>>; coin <coin@irtf.org<mailto:coin@irtf.org>>; coinrg-chairs <coinrg-chairs@ietf.org<mailto:coinrg-chairs@ietf.org>>
Subject: Re: [Coin] Fwd: The Future of P4, Revisited

Hi Haoyu,
You say: "P4 has very limited support for stateful processing"

I am not sure I can agree with your characterization of P4. Perhaps can you elaborate on this.

Thanks
Hesham

On Thu, May 18, 2023, 9:19 AM Haoyu Song <haoyu.song@futurewei.com<mailto:haoyu.song@futurewei.com>> wrote:
Interesting discussion. See my comments below  [HS]

Haoyu

> For example, in the multicast drafts i write, we use C-pseudocode
> to specify behavior, but we do attempt to implemnt on Tofino in P4. Should we really
> use P4 code for the RFC specs... ? (much longer than C Pseudocode). Aka: quite selfish
> (but IETF relevant ;-) reason to highlight this point.

[EH]: This is an area I'm very interested in. Having a standardized and formal language to describe protocols and behavior can bring a lot of functionality and benefits to the IETF.
My initial thinking is that having such a blueprint, the IETF could generate tools to create a reference implementation that can be used for interoperability purposes therefore decreasing time to test and implement protocols and therefore RFC publications.

[HS] P4 can only describe dataplane behaviors, so any control plane stuff is out of scope. For dataplane, if it's used to describe header format, it's not better than the "struct" in C. The language uses the match-action table abstraction with an implication of pipeline implementation which may make it cumbersome or even impossible to describe the  behavior (e.g.,  P4 has very limited support for stateful processing). In general, I don't think P4 at its current form can undertake the role for formal protocol specification.