# P4 Dev

**URL:** https://forum.p4.org/c/p4-dev/12.md

[Latest](https://forum.p4.org/latest.md) · [Categories](https://forum.p4.org/categories.md)

---

## [About the P4 Dev category](https://forum.p4.org/t/about-the-p4-dev-category/42)

<div class="topic-metadata">

**Author:** [@judysnow](https://forum.p4.org/u/judysnow)\
**Replies:** 0

</div>

General P4 software development discussions Use the following paragraphs for a longer description, or to establish category guidelines or rules: Why should people use this category? What is it for? How exactly is …

---

## [bf-sde-9.7.0 on Newport (Tofino2) — FPGA not detected on PCIe, platform init fails](https://forum.p4.org/t/bf-sde-9-7-0-on-newport-tofino2-fpga-not-detected-on-pcie-platform-init-fails/1471)

<div class="topic-metadata">

**Author:** [@yiodian.chu](https://forum.p4.org/u/yiodian.chu)\
**Replies:** 0\
**Last updated:** [June 13, 2026, 2:34pm UTC](https://forum.p4.org/t/bf-sde-9-7-0-on-newport-tofino2-fpga-not-detected-on-pcie-platform-init-fails/1471 "2026-06-13T14:34:41Z")

</div>

Platform: Intel Newport (Accton AS9516-32D), Tofino2, Ubuntu 20.04, kernel 5.4.0-128 Problem: After installing bf-sde-9.7.0 with newport+asic+tofino2 profile, switchd fails with: BF\_PLTFM ERROR - Error in opening /dev/…

---

## [Integrate STF with p4testgen](https://forum.p4.org/t/integrate-stf-with-p4testgen/1406)

<div class="topic-metadata">

**Author:** [@gzrccfy](https://forum.p4.org/u/gzrccfy)\
**Replies:** 3\
**Last updated:** [November 23, 2025, 6:26pm UTC](https://forum.p4.org/t/integrate-stf-with-p4testgen/1406 "2025-11-23T18:26:22Z")

</div>

I’m trying to use p4testgen to generate test case for my p4-16 program. p4testgen --target bmv2 --arch v1model --test-backend STF --out-dir tests --max-tests 5 basic\_forwarding.p4 And I’m trying to use the python scrip…

---

## [Checksum calculation ICMPv6](https://forum.p4.org/t/checksum-calculation-icmpv6/1296)

<div class="topic-metadata">

**Author:** [@davidcc73](https://forum.p4.org/u/davidcc73)\
**Replies:** 2\
**Last updated:** [September 15, 2025, 9:19am UTC](https://forum.p4.org/t/checksum-calculation-icmpv6/1296 "2025-09-15T09:19:23Z")

</div>

I am converting an ICMPv6 RS packet into an RA one and send it back, but I can not get the calculations of the ICMPv6 checksum to work correctly, wireshark keeps detecting as being wrong, what am I missing here? header…

---

## [Implementing P4 projects in real hardware](https://forum.p4.org/t/implementing-p4-projects-in-real-hardware/1072)

<div class="topic-metadata">

**Author:** [@absuarez](https://forum.p4.org/u/absuarez)\
**Replies:** 2\
**Last updated:** [June 6, 2025, 4:03pm UTC](https://forum.p4.org/t/implementing-p4-projects-in-real-hardware/1072 "2025-06-06T16:03:11Z")

</div>

Hello, I aim to implement the projects that I have been testing on Mininet and bmv2 switches on real hardware. However, I am not well-versed on which ones are the most adequate hardware to perform my tests. Can someon…

---

## [Help: p4types\_pb2 and google.rpc import errors in Python gRPC controller](https://forum.p4.org/t/help-p4types-pb2-and-google-rpc-import-errors-in-python-grpc-controller/1317)

<div class="topic-metadata">

**Author:** [@AL-OTU](https://forum.p4.org/u/AL-OTU)\
**Replies:** 0\
**Last updated:** [May 26, 2025, 5:42pm UTC](https://forum.p4.org/t/help-p4types-pb2-and-google-rpc-import-errors-in-python-grpc-controller/1317 "2025-05-26T17:42:10Z")

</div>

Hi everyone, I’m trying to get a Python-based P4Runtime controller working with a Tofino switch, but I’m running into a couple of import errors when using the generated protobuf files. I’ve already generated the binding…

---

## [Need Advice on P4 Tofino Setup – Platform Detection, Custom Controller, and IDS Project](https://forum.p4.org/t/need-advice-on-p4-tofino-setup-platform-detection-custom-controller-and-ids-project/1315)

<div class="topic-metadata">

**Author:** [@AL-OTU](https://forum.p4.org/u/AL-OTU)\
**Replies:** 1\
**Last updated:** [May 21, 2025, 5:13am UTC](https://forum.p4.org/t/need-advice-on-p4-tofino-setup-platform-detection-custom-controller-and-ids-project/1315 "2025-05-21T05:13:56Z")

</div>

Hey everyone, I’m working on a project using a Tofino-based switch (UfiSpace S9180-32X) and the Intel P4 SDE (version 9.13.1). I’m building a simple IDS (Intrusion Detection System) as part of a summer Project, and so f…

---

## [Challenge on Packet Recirculation](https://forum.p4.org/t/challenge-on-packet-recirculation/1276)

<div class="topic-metadata">

**Author:** [@tveggala](https://forum.p4.org/u/tveggala)\
**Replies:** 10\
**Last updated:** [April 7, 2025, 12:07pm UTC](https://forum.p4.org/t/challenge-on-packet-recirculation/1276 "2025-04-07T12:07:37Z")

</div>

Hi, I am writing P4 code to perform deep packet inspection on incoming traffic, using the method of recirculation. I came across a logic which is able to detect a pattern, stop recirculation, and execute a desired actio…

---

## [Storing payload byte in a temporary variable](https://forum.p4.org/t/storing-payload-byte-in-a-temporary-variable/1277)

<div class="topic-metadata">

**Author:** [@tveggala](https://forum.p4.org/u/tveggala)\
**Replies:** 1\
**Last updated:** [March 19, 2025, 3:34pm UTC](https://forum.p4.org/t/storing-payload-byte-in-a-temporary-variable/1277 "2025-03-19T15:34:30Z")

</div>

Hi, I am developing P4 code to do some operation on packet payload. For example, If I have a table like below, I am trying to find a way to store the packet byte in a temporary variable and do some operation on it. Is …

---

## [Switch's IP and MAC address](https://forum.p4.org/t/switchs-ip-and-mac-address/1270)

<div class="topic-metadata">

**Author:** [@akshataavk](https://forum.p4.org/u/akshataavk)\
**Replies:** 1\
**Last updated:** [March 9, 2025, 8:25pm UTC](https://forum.p4.org/t/switchs-ip-and-mac-address/1270 "2025-03-09T20:25:35Z")

</div>

Hello, As part of my project, I am working on a load balancer with 2 switches in the topology (JSON file). I followed the tutorials, and I found hosts broadcasting to send a packet from one host to another via the ports…

---

## [What happens when a table with actions defined but without any keys defined?](https://forum.p4.org/t/what-happens-when-a-table-with-actions-defined-but-without-any-keys-defined/1265)

<div class="topic-metadata">

**Author:** [@fengkeyleaf](https://forum.p4.org/u/fengkeyleaf)\
**Replies:** 2\
**Last updated:** [March 3, 2025, 8:06pm UTC](https://forum.p4.org/t/what-happens-when-a-table-with-actions-defined-but-without-any-keys-defined/1265 "2025-03-03T20:06:36Z")

</div>

Hi there, I found out an example that has some tables with actions defined but without keys defined, such as @name(".flowlet") table flowlet { actions = { lookup\_flowlet\_map; } } When we appl…

---

## [Clone3 function on stratum\_bmv2](https://forum.p4.org/t/clone3-function-on-stratum-bmv2/1261)

<div class="topic-metadata">

**Author:** [@pabloEsiiABGM](https://forum.p4.org/u/pabloEsiiABGM)\
**Replies:** 5\
**Last updated:** [February 24, 2025, 6:00pm UTC](https://forum.p4.org/t/clone3-function-on-stratum-bmv2/1261 "2025-02-24T18:00:16Z")

</div>

Hi All, I’m trying to use clone3 function on the stratum\_bmv2 software switch, but cannot detect the cloned packets using the standard\_metadata.instance\_type value of the packet. Every packet seems NORMAL type instead o…

---

## [How to get a graph of IR nodes compiled by p4c and work on it from another program?](https://forum.p4.org/t/how-to-get-a-graph-of-ir-nodes-compiled-by-p4c-and-work-on-it-from-another-program/1259)

<div class="topic-metadata">

**Author:** [@fengkeyleaf](https://forum.p4.org/u/fengkeyleaf)\
**Replies:** 10\
**Last updated:** [February 20, 2025, 9:46pm UTC](https://forum.p4.org/t/how-to-get-a-graph-of-ir-nodes-compiled-by-p4c-and-work-on-it-from-another-program/1259 "2025-02-20T21:46:58Z")

</div>

Hi all, As far as I know, p4c compiles a P4 program into a graph of IR nodes with provided arguments, like back-end target. So assume I want to write my own program that can process or traverse a graph of IR nodes after…

---

## [Error during P4 program compilation: "Too many heap sections: Increase MAXHINCR or MAX\_HEAP\_SECTS"](https://forum.p4.org/t/error-during-p4-program-compilation-too-many-heap-sections-increase-maxhincr-or-max-heap-sects/1231)

<div class="topic-metadata">

**Author:** [@sun-titto](https://forum.p4.org/u/sun-titto)\
**Replies:** 10\
**Last updated:** [January 9, 2025, 7:34am UTC](https://forum.p4.org/t/error-during-p4-program-compilation-too-many-heap-sections-increase-maxhincr-or-max-heap-sects/1231 "2025-01-09T07:34:42Z")

</div>

I am writing a P4 program on an Ubuntu virtual machine in VMware, with 8.5GB of allocated memory and an 8-core CPU. Since my program is quite large, I encountered the error “Too many heap sections: Increase MAXHINCR or M…

---

## [Bmv2 multicast modify port during egress](https://forum.p4.org/t/bmv2-multicast-modify-port-during-egress/1236)

<div class="topic-metadata">

**Author:** [@gxpy](https://forum.p4.org/u/gxpy)\
**Replies:** 1\
**Last updated:** [December 25, 2024, 3:57pm UTC](https://forum.p4.org/t/bmv2-multicast-modify-port-during-egress/1236 "2024-12-25T15:57:31Z")

</div>

Hello, I try to find a way to generate new packets using multicast. My simple idea is to change metadata egress\_port during egress processing. However, when I run this code, the replicated packets content is modified as …

---

## [Intel P4 Studio](https://forum.p4.org/t/intel-p4-studio/1211)

<div class="topic-metadata">

**Author:** [@mnwrhsn](https://forum.p4.org/u/mnwrhsn)\
**Replies:** 2\
**Last updated:** [November 10, 2024, 10:23pm UTC](https://forum.p4.org/t/intel-p4-studio/1211 "2024-11-10T22:23:21Z")

</div>

Folks, I am leading a research group at a university. We want to use P4 for CPS applications and are in the process of purchasing two Tofino2 switches. For that, I recently applied for the Intel Connectivity Research Pr…

---

## [Using a virtual iproute2 port as an egress port on the device](https://forum.p4.org/t/using-a-virtual-iproute2-port-as-an-egress-port-on-the-device/1180)

<div class="topic-metadata">

**Author:** [@nebulator0](https://forum.p4.org/u/nebulator0)\
**Replies:** 4\
**Last updated:** [May 6, 2024, 8:44am UTC](https://forum.p4.org/t/using-a-virtual-iproute2-port-as-an-egress-port-on-the-device/1180 "2024-05-06T08:44:05Z")

</div>

I am trying to implement a basic Mininet scenario for testing purposes, where I’d like demonstrate how a switch would encapsulate macsec frames for a legacy device that is incapable doing so on their own. I originated my…

---

## [Register use in V1model Architecture](https://forum.p4.org/t/register-use-in-v1model-architecture/1152)

<div class="topic-metadata">

**Author:** [@aashiqkamal](https://forum.p4.org/u/aashiqkamal)\
**Replies:** 8\
**Last updated:** [April 5, 2024, 4:21pm UTC](https://forum.p4.org/t/register-use-in-v1model-architecture/1152 "2024-04-05T16:21:56Z")

</div>

Dear Community, I have used a program to write a value in a register. Here is a sample code - // Declaring a register which is 32 bit size with 0-1023 indexed. register\<bit\<32\>\>(1024) last\_seq; // bit\<32\> seq\_store; …

---

## [How to simulate a customized propagation delay?](https://forum.p4.org/t/how-to-simulate-a-customized-propagation-delay/1147)

<div class="topic-metadata">

**Author:** [@dan1el](https://forum.p4.org/u/dan1el)\
**Replies:** 5\
**Last updated:** [March 28, 2024, 3:00pm UTC](https://forum.p4.org/t/how-to-simulate-a-customized-propagation-delay/1147 "2024-03-28T15:00:48Z")

</div>

I’m working on a project to implement a customized propagation delay on tofino2. I’ve found very few references online, and it seems that p4 doesn’t really have this feature either. Is it feasible to send this packet to…

---

## [Clone3() Migration](https://forum.p4.org/t/clone3-migration/1127)

<div class="topic-metadata">

**Author:** [@davidcc73](https://forum.p4.org/u/davidcc73)\
**Replies:** 8\
**Last updated:** [March 10, 2024, 5:37pm UTC](https://forum.p4.org/t/clone3-migration/1127 "2024-03-10T17:37:21Z")

</div>

I am working on a program that uses the project p4-srv6 (GitHub - netgroup/p4-srv6) as a basis for multihoming. Still, there is a problem, this project uses an older version of P4c before the function clone3() was deprec…

---

## [Using the ONOS app to control the BMv2 switches](https://forum.p4.org/t/using-the-onos-app-to-control-the-bmv2-switches/1114)

<div class="topic-metadata">

**Author:** [@SOUL](https://forum.p4.org/u/SOUL)\
**Replies:** 4\
**Last updated:** [March 7, 2024, 9:01am UTC](https://forum.p4.org/t/using-the-onos-app-to-control-the-bmv2-switches/1114 "2024-03-07T09:01:13Z")

</div>

In fact, I used a combination of ONOS Mininet and P4 to create a virtual network, like this “s1 = self.addSwitch(‘s11’, cls=ONOSBmv2Switch, pipeconf=‘org.onosproject.pipelines.int’, grpcPort=50001, cpuport=CPU\_PORT,long…

---

## [INTCollector issues](https://forum.p4.org/t/intcollector-issues/905)

<div class="topic-metadata">

**Author:** [@msaueressig](https://forum.p4.org/u/msaueressig)\
**Replies:** 3\
**Last updated:** [March 7, 2024, 7:19am UTC](https://forum.p4.org/t/intcollector-issues/905 "2024-03-07T07:19:58Z")

</div>

Hello. i’m trying to use INTCollector( tunv\_ebpf / INTCollector · GitLab) to collect INT data from a testbed. I’m really struggling to do so, first I couldn’t install ONOS properly, so I installed a VM from a tutorial( B…

---

## [Precision Time Protocol (PTP) in P4?](https://forum.p4.org/t/precision-time-protocol-ptp-in-p4/1094)

<div class="topic-metadata">

**Author:** [@Sandman](https://forum.p4.org/u/Sandman)\
**Replies:** 5\
**Last updated:** [March 4, 2024, 11:19pm UTC](https://forum.p4.org/t/precision-time-protocol-ptp-in-p4/1094 "2024-03-04T23:19:41Z")

</div>

Hi everyone, I know that this is a complex topic, but has anyone over here used Precision Time Protocol or PTP for time synchronization in their Network Telemetry operations or anything as such? We are adding timing inf…

---

## [Flow table entry eviction](https://forum.p4.org/t/flow-table-entry-eviction/1093)

<div class="topic-metadata">

**Author:** [@nurlybekovnt](https://forum.p4.org/u/nurlybekovnt)\
**Replies:** 2\
**Last updated:** [February 20, 2024, 5:58am UTC](https://forum.p4.org/t/flow-table-entry-eviction/1093 "2024-02-20T05:58:16Z")

</div>

Hi there! Please help me to find a piece of C code, where the eviction of entries in the flow table is implemented. I found different options: idle\_timeout\_auto\_delete, support\_timeout. But I couldn’t find their implemen…

---

## [Connecting bmv2 switches with controllers pox, onos, etc](https://forum.p4.org/t/connecting-bmv2-switches-with-controllers-pox-onos-etc/1091)

<div class="topic-metadata">

**Author:** [@absuarez](https://forum.p4.org/u/absuarez)\
**Replies:** 1\
**Last updated:** [February 15, 2024, 8:07am UTC](https://forum.p4.org/t/connecting-bmv2-switches-with-controllers-pox-onos-etc/1091 "2024-02-15T08:07:40Z")

</div>

Hello, I was wondering whether there are tutorials and general steps to connect a bmv2 switch with SDN controllers, for example, I would like to do something similar to what OVS does when there is no match in a table an…

---

## [\[resolved\] P4runtime: No forwarding pipeline config or SEGFAULT](https://forum.p4.org/t/resolved-p4runtime-no-forwarding-pipeline-config-or-segfault/1061)

<div class="topic-metadata">

**Author:** [@leonderooij](https://forum.p4.org/u/leonderooij)\
**Replies:** 4\
**Last updated:** [December 17, 2023, 10:15pm UTC](https://forum.p4.org/t/resolved-p4runtime-no-forwarding-pipeline-config-or-segfault/1061 "2023-12-17T22:15:49Z")

</div>

Hi all! I’m experimenting with creating a p4 application that forwards packets to a different destination based on table entries set by a custom c/c++ application. The p4 program is here: rtpengine/test-dpu-offload/p4/…

---

## [To what extent can P4 extract attributes/headers/etc from HTTPS packets](https://forum.p4.org/t/to-what-extent-can-p4-extract-attributes-headers-etc-from-https-packets/1042)

<div class="topic-metadata">

**Author:** [@bcheevers123](https://forum.p4.org/u/bcheevers123)\
**Replies:** 6\
**Last updated:** [December 10, 2023, 10:32am UTC](https://forum.p4.org/t/to-what-extent-can-p4-extract-attributes-headers-etc-from-https-packets/1042 "2023-12-10T10:32:09Z")

</div>

To what extent can P4 extract attributes/headers/etc from HTTPS packets? I understand that P4 can extract information from protocols at Layer’s 4 and below: \`header ethernet\_t { bit\<48\> dstAddr; bit\<48\> srcAddr; bit\<…

---

## [Adding a Custom Header between the UDP Header and the Payload](https://forum.p4.org/t/adding-a-custom-header-between-the-udp-header-and-the-payload/1032)

<div class="topic-metadata">

**Author:** [@Sandman](https://forum.p4.org/u/Sandman)\
**Replies:** 3\
**Last updated:** [November 17, 2023, 8:23pm UTC](https://forum.p4.org/t/adding-a-custom-header-between-the-udp-header-and-the-payload/1032 "2023-11-17T20:23:15Z")

</div>

Hello everyone, I was wondering if it is possible to add a custom header for INT in between a UDP header and the payload after that and then parse that header in some subsequent destination. If yes, how would you do it?…

---

## [Added a Custom Header for INT after the Ethernet Header: Behavioral Model Working; Not working on the target;](https://forum.p4.org/t/added-a-custom-header-for-int-after-the-ethernet-header-behavioral-model-working-not-working-on-the-target/1029)

<div class="topic-metadata">

**Author:** [@Sandman](https://forum.p4.org/u/Sandman)\
**Replies:** 2\
**Last updated:** [November 15, 2023, 3:29pm UTC](https://forum.p4.org/t/added-a-custom-header-for-int-after-the-ethernet-header-behavioral-model-working-not-working-on-the-target/1029 "2023-11-15T15:29:08Z")

</div>

\#include \<core.p4\> #include \<xsa.p4\> ... const bit\<16\> HNEW\_TYPE = 0x1996; //NEW HEADER CUSTOM ... // \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*…

---

## [Lucid language for Tofino](https://forum.p4.org/t/lucid-language-for-tofino/1021)

<div class="topic-metadata">

**Author:** [@patronhill](https://forum.p4.org/u/patronhill)\
**Replies:** 0\
**Last updated:** [November 2, 2023, 3:11pm UTC](https://forum.p4.org/t/lucid-language-for-tofino/1021 "2023-11-02T15:11:07Z")

</div>

What do you think about Lucid? GitHub - PrincetonUniversity/lucid at 28d2a0a82c4c091a4c7909668d9eb7957df700a7 I know we can’t talk about Tofino, but it’s still interesting

[Next page](https://forum.p4.org/c/p4-dev/12.md?page=1)
