Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to forward PacketIn messages to ONOS controller from Tofino switch #1088

Open
endrigoshi opened this issue Jan 18, 2023 · 0 comments
Open

Comments

@endrigoshi
Copy link

Dear all,

I am currently working on a project where we will use ONOS to control a Tofino1 switch. However, I am having problems in receiving PacketIn messages at ONOS, while adding rules to Tofino works fine.

The Tofino platform being used is Wedge100BF-32qs, SDE version is 9.7.2 and Stratum running as a docker container (stratumproject/stratum-bfrt:latest-9.7.2); while on the other side I am running ONOS 3.0.0. The Tofino switch and the PC where ONOS is running are both connected to a L2-switch. Moreover, I have another PC that that has two interfaces connected to port 7/0 (308) and 16/0 (0) of Tofino.

I have tried different matching rules that invoke a "send_to_cpu()" action, but I have seen that in no case I am able to see the PacketIns arrive on the ONOS side. Considering the Tofino platform that I am using, I have set CPU_PORT=192 (I have tried both options: setting it directly in the .p4 code and also providing the -DCPU_PORT=192 flag during compilation).

The "copy_to_cpu()" action is defined as below:

action copy_to_cpu() {
    ig_intr_md_for_tm.ucast_egress_port = CPU_PORT;
    hdr.packet_in.setValid();
    hdr.packet_in.ingress_port = (BasicPortId_t)basic_md.bridged.base.ig_port;
    table0_counter.count();
    }

From ONOS, I add a rule that matches on the ETH_TYPE and if its ARP it triggers the copy_to_cpu() action above. I have noticed that Tofino is not able to set the egress_port to 192, which leads to egress_port=0. The counters in the flow rule suggest that the packet is indeed matched, while the port counters show that it is sent out of port 0 (which in this case is port 16/0) and I can confirm this using Wireshark. The same behavior happens even when I write "192" instead of "CPU_PORT" in line 2 of the above snippet. If instead I set the egress_port to 308 (meaning port 7/0), I can see the packet received correctly on the other interface.

I would appreciate any insight on whether I am doing something wrong with the setup, or if I forgetting some configuration that can enable Tofino to send the PacketIns to ONOS.

Best regards,
Endri

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant