# How do i add tables in my forwarding p4 program

**URL:** <https://forum.p4.org/t/how-do-i-add-tables-in-my-forwarding-p4-program/1137>\
**Category:** Getting Started with P4\
**Created:** [March 20, 2024, 9:46am UTC](https://forum.p4.org/t/how-do-i-add-tables-in-my-forwarding-p4-program/1137 "2024-03-20T09:46:36Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![zak415](https://avatars.discourse-cdn.com/v4/letter/z/49beb7/32.png) [@zak415](https://forum.p4.org/u/zak415)\
**Post date:** [March 20, 2024, 9:46am UTC](https://forum.p4.org/t/how-do-i-add-tables-in-my-forwarding-p4-program/1137/1 "2024-03-20T09:46:36Z")

</div>

So I’ve been trying to add tables in bfrt\_python without success when I ping between hosts, so in my table → key im trying to match with lpm, and so when I enter my two hosts ip addr and their respective port, the tofino-switch should be able to redirect the traffic (“in this case: ping”) between them hosts.

---

<div class="post-metadata">

**Author:** ![SteffenLindner](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.p4.org/steffenlindner/32/99_2.png) [@SteffenLindner](https://forum.p4.org/u/SteffenLindner)\
**Post date:** [March 20, 2024, 10:45am UTC](https://forum.p4.org/t/how-do-i-add-tables-in-my-forwarding-p4-program/1137/2 "2024-03-20T10:45:23Z")

</div>

Did you handle ARP appropriately? I assume that you are able to add the table entries. Otherwise, you should ask in the correct Intel Forum about Tofino specific tooling.

---

<div class="post-metadata">

**Author:** ![zak415](https://avatars.discourse-cdn.com/v4/letter/z/49beb7/32.png) [@zak415](https://forum.p4.org/u/zak415)\
**Post date:** [March 20, 2024, 11:09am UTC](https://forum.p4.org/t/how-do-i-add-tables-in-my-forwarding-p4-program/1137/3 "2024-03-20T11:09:35Z")

</div>

Could you expand on that please?

---

<div class="post-metadata">

**Author:** ![SteffenLindner](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.p4.org/steffenlindner/32/99_2.png) [@SteffenLindner](https://forum.p4.org/u/SteffenLindner)\
**Post date:** [March 20, 2024, 12:10pm UTC](https://forum.p4.org/t/how-do-i-add-tables-in-my-forwarding-p4-program/1137/4 "2024-03-20T12:10:09Z")

</div>

Before you can send layer-3 packets, your sending host needs to resolve the MAC address of its next hop → ARP. That’s why I asked whether you handle ARP, and whether the MAC address can be resolved.

Otherwise, you need to be clearer about what doesn’t work. Does the table add operation not work? Is simply the ping not working (which might be caused by unresolved ARP requests)?

---

<div class="post-metadata">

**Author:** ![zak415](https://avatars.discourse-cdn.com/v4/letter/z/49beb7/32.png) [@zak415](https://forum.p4.org/u/zak415)\
**Post date:** [March 25, 2024, 10:06am UTC](https://forum.p4.org/t/how-do-i-add-tables-in-my-forwarding-p4-program/1137/5 "2024-03-25T10:06:04Z")

</div>

Thanks for your help, we resolved to use the ports instead for the time being.
