[P4-dev] Announcement of new open source tool p4pktgen

Mihai Budiu mbudiu at vmware.com
Sat Dec 2 09:48:28 EST 2017


This is great! Maybe we can integrate this with the p4c compiler testing.

Mihai



________________________________
From: P4-dev <p4-dev-bounces at lists.p4.org> on behalf of Andy Fingerhut <andy.fingerhut at gmail.com>
Sent: Saturday, December 2, 2017 4:07:04 AM
To: p4-dev
Cc: noetzli at stanford.edu; jehandad at vt.edu
Subject: [P4-dev] Announcement of new open source tool p4pktgen

Andres Noetzli, Colin Burgin, Jehandad Khan, and I have developed a
tool called p4pktgen.  It is an automatic test case generator for P4
programs.  You can find the code, installation instructions, and a
first example of running it on some very short P4 programs, with
sample output, at its home page:

    https://github.com/p4pktgen/p4pktgen<https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_p4pktgen_p4pktgen&d=DwMFaQ&c=uilaK90D4TOVoH58JNXRgQ&r=tGW6TKXajnoXSyy1S1P4DHGPe8sj54GGvw-b21n7aWg&m=W_cYX52Z0dgSTPXaiO--l-lyzDtfyRAQ8WqAP7YfOM0&s=YHWvUFTopVrEGnnm-dD601N8yyArTw0XbhXwMik8C-c&e=>

p4pktgen is a tool for generating input packets and table entries for
P4 programs that cover all paths of the program.

It supports programs written in either the P4_14 or P4_16 variants of
the language, as long as the program can be compiled using the open
source p4c-bm2-ss compiler (part of the https://github.com/p4lang/p4c<https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_p4lang_p4c&d=DwMFaQ&c=uilaK90D4TOVoH58JNXRgQ&r=tGW6TKXajnoXSyy1S1P4DHGPe8sj54GGvw-b21n7aWg&m=W_cYX52Z0dgSTPXaiO--l-lyzDtfyRAQ8WqAP7YfOM0&s=66QKDtj9bZ925cUtKEIy_BEa63vrgO5T6046F1Z0i9I&e=>
repository), compiled to a bmv2 JSON file for use with the
simple_switch software switch (part of the
https://github.com/p4lang/behavioral-model<https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_p4lang_behavioral-2Dmodel&d=DwMFaQ&c=uilaK90D4TOVoH58JNXRgQ&r=tGW6TKXajnoXSyy1S1P4DHGPe8sj54GGvw-b21n7aWg&m=W_cYX52Z0dgSTPXaiO--l-lyzDtfyRAQ8WqAP7YfOM0&s=q7H5GdL_GTLkhIgZJGUrrdAzfb_vpXJyoG3LElQMlNo&e=> repository).

It currently covers all combinations of execution paths through the
parser and ingress control block, but ignores the egress control
block. It runs the test cases in simple_switch to check that the
packet follows the expected path of execution, and also writes out a
data file describing the test cases, which should be useful in
executing the test cases on other P4 implementations (additional work
is required to adapt the test cases to run on other implementations).

Please give it a try if this kind of tool interests you, and leave
suggestions for enhancements, or bug reports, as Github issues.

Regards,
Andy Fingerhut
Cisco Systems, Inc.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.p4.org/pipermail/p4-dev_lists.p4.org/attachments/20171202/51f8b439/attachment-0002.html>


More information about the P4-dev mailing list