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

Haoyu Song <haoyu.song@futurewei.com> Thu, 18 May 2023 19:07 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 75B58C151533 for <coin@ietfa.amsl.com>; Thu, 18 May 2023 12:07:42 -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=ham 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 ADTXVZyGzhEC for <coin@ietfa.amsl.com>; Thu, 18 May 2023 12:07:38 -0700 (PDT)
Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2071a.outbound.protection.outlook.com [IPv6:2a01:111:f400:7e89::71a]) (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 1F1E9C14F75F for <coin@irtf.org>; Thu, 18 May 2023 12:07:38 -0700 (PDT)
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mZC7kLny1W835Kp6QJK7O47CnI1mqRfHS/pOQP4ovpyLbgp5WtrzDC+nPPKNPOEjjCnvCfZc3oDk1dDxZXJ5rrnoNOkcylzJH7ySy1lNEs2bIQ8+C3JX4eKqHhwFvCjQplsr2lLnP9ZK28WO4nX9k0vIV4ERgtWF+xr86JGOzetuuTJojNxGxrxf14nEq2Se0hbSnmlyquQt6I3aWwKAQFsBpmbAerJ4S4pOO31kROuxcn6gYrm8/J8/MC/V/SIEhSzS0OIXfNz6Ld6t8Z5XRXKUUbZU5gXrNtF2oOBu0BEeAlLX0G0DFVnrXVPQbbyOA8HTsGt1hq+pITIiG67oIQ==
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=LnbtRBMRcCcIRBr2ULCfW6hyql/vvrQQJQq4dsfg6EQ=; b=HdNwOle34ZhmLXQYmpZTjxpjG0i1JHtS2Hin7tFM0rB1aB9FXdukHFWD8jCVADixhYWD3r/uwHBbC93l9Gip8P+dKcZgbS/QUacWoHzysCS7N6OPEsTwYDuB6Po5/+baNnPQQQGcSGgvQ4zu25caMrMfFdSIhqY2thRw+pQwr7BfMFVEuliQAmViXZpswaS6qRj6QNtMDgDvaGY/TULm8lqymNBX6x4AOPvGb2qHALPBjptiFy0F+v2wrPOm7jMxkEJ6xjG+UMI0XeHW9lhf/CEF2fuPC6ywqD4w4Eotgw2xk0OudVq2dJ4Ai+p2puPvWcogPXhrYwei07h91AKhxg==
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=LnbtRBMRcCcIRBr2ULCfW6hyql/vvrQQJQq4dsfg6EQ=; b=ACm6CvcdOv/ySgy40TZCRhfs7SILTzQh62YRrzmcUGYq71rY7KbMe/x9UKQ/dWX7i0saquy2peikcPFRVINIGW5+IyI0A7OkluY/dEf1rrYfZqUjdGZ3PBFcuqFyVq4O/7rxAB3z5gg6Hth38iNiExJN3EjzVK7E8nqEJ6eUpxI=
Received: from BY3PR13MB4787.namprd13.prod.outlook.com (2603:10b6:a03:357::13) by DM8PR13MB5157.namprd13.prod.outlook.com (2603:10b6:8:a::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.17; Thu, 18 May 2023 19:07:33 +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 19:07:32 +0000
From: Haoyu Song <haoyu.song@futurewei.com>
To: Hesham ElBakoury <helbakoury@gmail.com>
CC: "ehalep@mojatatu.com" <ehalep@mojatatu.com>, Toerless Eckert <tte@cs.fau.de>, "hemant=40mnkcg.com@dmarc.ietf.org" <hemant=40mnkcg.com@dmarc.ietf.org>, "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+KbJNrrt4LNK9bkESAgAARAQCAABdGAIAADoAAgAFujwCAAGSUgIAADYUAgAEfkACAAFKggIAALzCAgADpVQCAAANqUIAAEGIAgAACPECAAAmCgIAAASKwgAAL9QCAAATKIA==
Date: Thu, 18 May 2023 19:07:32 +0000
Message-ID: <BY3PR13MB47874735FC9CC37D108F41EE9A7F9@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> <CAFvDQ9q2_5-msxeHYgbZfy3RJB6he3kEQheRe=1qfEdUwP3HxQ@mail.gmail.com> <BY3PR13MB47879D6486069FDA49D6252C9A7F9@BY3PR13MB4787.namprd13.prod.outlook.com> <CAFvDQ9oHJqKhopdBk0d6-5n7k_DCY_vY0Q=TqkRfqyzHvzEQmA@mail.gmail.com>
In-Reply-To: <CAFvDQ9oHJqKhopdBk0d6-5n7k_DCY_vY0Q=TqkRfqyzHvzEQmA@mail.gmail.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_|DM8PR13MB5157:EE_
x-ms-office365-filtering-correlation-id: 7048075a-b59b-4955-f0e7-08db57d32209
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam: BCL:0;
x-microsoft-antispam-message-info: 1VFRjOH3RxNm5mQnNFJIHLe+wWdc+OeiDwLqUb3nZNdwRDmoR02xf90x0ujCuZZAw1vsPQjE3fqF/5zkUdCgF3qnkPKhkwhcPDZstnwkQLj6rsi7ns59PQRxKnXig6tWUcYtFkUSNlCtSK69fVOKvw05zJkPwPW40wxSk0rfAGpYl+EnZPxck+byNLIU6tahE7ghxcUSYKFQXVknmOnXriOjAt4x8yFfNAXaipN+bW8XsrKU+GuaHV5VPHeecJHjI7DaQB+kuF4enHK3YNSEnCm0GQr5qMarqePplba779A5uqyqPANQ8OBhJzcWpiBVAFoA51q7NzpZwFCifMQ1bV7FmhY/qOgivUOEr+fyBfCpeKdXffRN7LTFJX8xgIX7wNo755uMj7SSsiCyNF2PAVgx0mcUba0vwaNZITm2RZ13PVYYrrtM8eRSO8AnJWHutA4RqYAiU+JOAjd1dRgTYjXhMdPw6+CJx1BmZ2dvWYJR6aw4u4rlUP5sJHKG+zXCnh8KbMRlf7eIo8Dj+04LGNmlmZm3tpDLVJL/za3coZGuSGlXeLKQFIZ47sG2pnDfFEpvjqaF/qPfIFSi486Gkd/7fa6qWalcjjMacXFvwXg=
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)(396003)(366004)(346002)(39840400004)(376002)(451199021)(76116006)(66556008)(64756008)(66446008)(316002)(6916009)(66476007)(4326008)(478600001)(54906003)(166002)(38070700005)(86362001)(33656002)(7696005)(83380400001)(6506007)(26005)(66946007)(9686003)(53546011)(186003)(44832011)(8676002)(2906002)(8936002)(52536014)(71200400001)(5660300002)(55016003)(122000001)(41300700001)(38100700002); DIR:OUT; SFP:1102;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0: mbccvQFbG//vw7dGUE1TQrsRIs/bGc3gJh/SC0hdNLQJkm9Enc3SzqoYDC2YDL+tL7wNg2mKxqnoCDT3fylBEcD8vvQ5BMCxWcaevxRl7uLOwcjrtftypzPTAboBk4RCBPkkniwQjbTJmXFxaIpHV6VgzDyFtSVLjP4Hfs5AptNClLcrPeZq909ZLZbjMa45RNlp4uxiTBi7d7cDfYmY6R21W8/tbCKblEn1n44JuN9wC8hgfaS+9Bj0s9kFNinWe9OdF1Vv6X2uvPwRF0agDw9H12bIASFgvQhjXHDJojIhYH3ALGO3AzT3JjwlU/LaGHP2Y1p4R5j6WFvMe3M0dtg3NOVS7sjlGZoNeK9U9BQRU5V6Ry11iww1sczvnVx9eM7s2cLQ5EQ9lOFvFF5N2v01bxfh6bRpCcym5Ch3GVx86gDI6MSNmTGIQFfxux/y9b6SU1j4mx43S/E+xa6Vh83XE5Ta8iFmUsBx6c4c/xQGOIGTYNAp8s2tbm73s+PQBKDSxovMgGVI3XDzZfCqZ9L1wG00S4EnTVardm3DW/1Jz6uMpXWLF7ahR+mYA5swwkwlmho0h6PbIugjLstTwHkwl6LTM2UAxAEkUg5Fu4OEOPXN5bW/JUBcXnm/2JAkzpAWNhOI85gTWkt5fvX+OOhEnvEuIeRxQfkcmfsP8FhG/aTwN+JFaNWqJqayuKmAQnOtq95f0Qu4nqsvEqTt050KsRdtsgxLmu/8TATR2GWt3HUUnVFg4kFNjYzhrx1+HTwAIyyJ72OUPfhLisKMpZGRS81TzZm85DSqhwykrCY/+3aYzdiW8TYqQW+d2RH7I+ZF2Eyw3KoIBgrrtu/ZUTjnkCnwdvJWs6vCwtEgph+6dGjU1aT1usLOFZGDdsMCckuAZK01O4oSAssfQ7CaMeTR8fAK2FjMaiggKtPiO95a/C8SBYJNreH64xkE7m3TAMX+67a6qzw92cDFgNrc/qdsImOZQUf7PE5ZrIMdTQHVIat1i+HvpLhQ+ZgYjNnAcS4/7LvBSCyZnsmBFf/YmBdp7ib31iT8kTT1/W0QKa8DfnaKYkbGbMdmt2Trzz81IuBM9fjj5O/8tRFyLmEbpbxHX6gYsujqAFgcu1VCyI59CzY0979bx/xVQoFuHRrCtpABHCIEIgPKtVifMdh9WF7X3lKbDdABYYz3PUYIcjWsSz+flGIvV6MUSZI1M8C7fvKiU5swQFxFEU7DBrPwtzA471wQmQFRjFe0pB9WAF6uHJGzCJI6eaWFqeKXds7FCVVg2m57oYaXuonZzweRn8vccupjHN43INgldcnMD4J/FodFa5yjejIlm9KyPOs5FiUDrvDADU7xrRgw1SL3vY3keXGuXJfOq/ZoEIH4qkfx8w/1w042ZUKwvUtVBv7vo87nWQLOojuEPQj0Tq3fYDu3ApWfwU95EugB0bIWnbSZ5we15H/wgUy7vIp+OvvZClmKvh5NKmwR5xe92VumCWOyd2drpucefARw6cq0iSPeQ4gBry72UHeTk+dTF9quz/MX2c0PSG/6qDrqME3SD/hn7GkbdxyhcNTttMaMqGg=
Content-Type: multipart/alternative; boundary="_000_BY3PR13MB47874735FC9CC37D108F41EE9A7F9BY3PR13MB4787namp_"
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: 7048075a-b59b-4955-f0e7-08db57d32209
X-MS-Exchange-CrossTenant-originalarrivaltime: 18 May 2023 19:07:32.3491 (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: FchHq2AZ3eqWrTSAYI9Tg8y30/k8km/utn04xdtzMEAuC8O4dyWIk9uC8/sx/AMyUUG5SU39p4DnMCKnvvCKhw==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM8PR13MB5157
Archived-At: <https://mailarchive.ietf.org/arch/msg/coin/shQVhRdfjQ9YPutZznVXQKOCnfs>
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 19:07:42 -0000

I think it's for a software solution where the data plane and control plane processes run together to mimic the table read and write.
I'm curious to see what's the P4 code look like given the standard doesn't have a direct dataplane write interface to a table, and how it's compare to C code or pseudo code. For example, to describe the behavior of MAC learning, two lines of pseudo code are enough. What the P4 code would look like?
While it's easy to add a write interface to a table for P4 (and update P4 spec to support the programming), it can't be compiled to hardware-based dataplane yet.  Here we are talking about using P4 as a specification/description language. While P4 apps need to be tied with a specific architecture (PISA or PNA), it's difficult to use it as a general and concise language free of any assumptions.

Haoyu

From: Hesham ElBakoury <helbakoury@gmail.com>
Sent: Thursday, May 18, 2023 11:29 AM
To: Haoyu Song <haoyu.song@futurewei.com>
Cc: ehalep@mojatatu.com; Toerless Eckert <tte@cs.fau.de>; hemant=40mnkcg.com@dmarc.ietf.org; 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

Hi Haoyu,

As I mentioned in my previous email PNA allows writable tables. Please refer to this paper "High-Performance Match-Action Table Updates from within Programmable Software Data Planes" [https://www.google.com/url?sa=t&source=web&rct=j&url=https://www.net.in.tum.de/fileadmin/bibtex/publications/papers/2021-p4-writable-tables.pdf&ved=2ahUKEwja7vydvv_-AhUyO0QIHdXjCxkQFnoECA8QAQ&usg=AOvVaw2le_zu-LXBEDCeFJbs7GZ6]

Thanks
Hesham

On Thu, May 18, 2023, 10:56 AM Haoyu Song <haoyu.song@futurewei.com<mailto:haoyu.song@futurewei.com>> wrote:
Hi Hesham,

Please see P4 spec section 6.5.2 for the current "stateful" support. So far the "table" element, which is the most important construct for a P4 program,  is not stateful (i.e., dataplane writable)
I think it's a direction to extend P4 for better stateful support (part of my recent research). At least now it's unnatural and difficult to describe many stateful functions.

Haoyu

From: Coin <coin-bounces@irtf.org<mailto:coin-bounces@irtf.org>> On Behalf Of Hesham ElBakoury
Sent: Thursday, May 18, 2023 10:42 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: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,
Actually, P4 supports dataplane-modifiable tables -- see PNA.

More generally, the *language* is fully extensible. You can have whatever architecture and state externs you want. So one needs to be careful to separate language (non) limitations from target limitations.

Hesham

On Thu, May 18, 2023, 10:15 AM Haoyu Song <haoyu.song@futurewei.com<mailto:haoyu.song@futurewei.com>> wrote:
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: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.