Hello,
I am trying to learn about ONOS by pushing a P4 program to a Stratum device running on a physical Barefoot Tofino switch.
The ONOS instance is running on a local machine - version 2.6.0
Stratum build - stratum-bfrt-21.10-9.4.0-amd64.deb
I attempted to write a very basic ONOS application that loads a sample P4 program - simple_l3_arping.p4. Used the build.sh script provided as part for the
fabric-tofino project as a reference to build the P4 program.
The application was registered successfully.
ONOS log snippet
2021-12-17T15:14:59,320 | INFO | onos-store-app-app-activation | ApplicationManager | 193 - org.onosproject.onos-core-net - 2.6.0 | Application org.onosproject.foo-app has been installed
2021-12-17T15:14:59,324 | INFO | onos-store-app-app-activation | FeaturesServiceImpl | 11 - org.apache.karaf.features.core - 4.2.9 | Adding features: foo-app/[1.0.0.SNAPSHOT,1.0.0.SNAPSHOT]
2021-12-17T15:14:59,605 | INFO | features-3-thread-1 | FeaturesServiceImpl | 11 - org.apache.karaf.features.core - 4.2.9 | Changes to perform:
2021-12-17T15:14:59,605 | INFO | features-3-thread-1 | FeaturesServiceImpl | 11 - org.apache.karaf.features.core - 4.2.9 | Region: root
2021-12-17T15:14:59,606 | INFO | features-3-thread-1 | FeaturesServiceImpl | 11 - org.apache.karaf.features.core - 4.2.9 | Bundles to install:
2021-12-17T15:14:59,606 | INFO | features-3-thread-1 | FeaturesServiceImpl | 11 - org.apache.karaf.features.core - 4.2.9 | mvn:org.onosproject/foo-app/1.0-SNAPSHOT
2021-12-17T15:14:59,607 | INFO | features-3-thread-1 | FeaturesServiceImpl | 11 - org.apache.karaf.features.core - 4.2.9 | Installing bundles:
2021-12-17T15:14:59,607 | INFO | features-3-thread-1 | FeaturesServiceImpl | 11 - org.apache.karaf.features.core - 4.2.9 | mvn:org.onosproject/foo-app/1.0-SNAPSHOT
2021-12-17T15:14:59,619 | INFO | features-3-thread-1 | FeaturesServiceImpl | 11 - org.apache.karaf.features.core - 4.2.9 | Starting bundles:
2021-12-17T15:14:59,620 | INFO | features-3-thread-1 | FeaturesServiceImpl | 11 - org.apache.karaf.features.core - 4.2.9 | org.onosproject.foo-app/1.0.0.SNAPSHOT
2021-12-17T15:15:01,769 | INFO | features-3-thread-1 | PiPipeconfManager | 193 - org.onosproject.onos-core-net - 2.6.0 | New pipeconf registered: org.onosproject.foo.simple_l3_arping.tofino.mavericks_sde_9_2_0 (fingerprint=0e:b7:17:06:82:87:0a:26)
2021-12-17T15:15:01,770 | INFO | features-3-thread-1 | PiPipeconfManager | 193 - org.onosproject.onos-core-net - 2.6.0 | New pipeconf registered: org.onosproject.foo.simple_l3_arping.tofino.mavericks_sde_9_4_0 (fingerprint=f0:f6:4b:47:6d:5a:9e:86)
2021-12-17T15:15:01,770 | INFO | features-3-thread-1 | PiPipeconfManager | 193 - org.onosproject.onos-core-net - 2.6.0 | New pipeconf registered: org.onosproject.foo.simple_l3_arping.tofino.montara_sde_9_2_0 (fingerprint=0e:b7:17:06:f1:e7:a1:d8)
2021-12-17T15:15:01,770 | INFO | features-3-thread-1 | PiPipeconfManager | 193 - org.onosproject.onos-core-net - 2.6.0 | New pipeconf registered: org.onosproject.foo.simple_l3_arping.tofino.montara_sde_9_4_0 (fingerprint=f0:f6:4b:47:8d:ac:87:06)
2021-12-17T15:15:01,771 | INFO | features-3-thread-1 | PipeconfLoader | 251 - org.onosproject.foo-app - 1.0.0.SNAPSHOT | Started
2021-12-17T15:15:01,772 | INFO | features-3-thread-1 | MainComponent | 251 - org.onosproject.foo-app - 1.0.0.SNAPSHOT | Started
2021-12-17T15:15:01,774 | INFO | features-3-thread-1 | FeaturesServiceImpl | 11 - org.apache.karaf.features.core - 4.2.9 | Done.
2021-12-17T15:15:01,775 | INFO | onos-store-app-app-activation | ApplicationManager | 193 - org.onosproject.onos-core-net - 2.6.0 | Application org.onosproject.foo-app has been activated
My netcfg.json looks like below:
{
"devices": {
"device:stratum-inventec-d10056-1": {
"basic": {
"managementAddress": "grpc://10.4.16.67:9559?device_id=1",
"driver": "stratum-tofino",
"pipeconf": "org.onosproject.foo.simple_l3_arping.tofino.montara_sde_9_4_0"
}
}
}
}
At this point, an attempt to push netcfg/pipeconf to ONOS fails - Unknown format for p4_device_config·
ONOS log snippet
2021-12-17T15:15:22,116 | INFO | onos-gdp-0 | GrpcChannelControllerImpl | 230 - org.onosproject.onos-protocols-grpc-ctl - 2.6.0 | Creating new gRPC channel grpc://10.4.16.67:9559?device_id=1...
2021-12-17T15:15:22,170 | INFO | onos-gdp-0 | P4RuntimeControllerImpl | 230 - org.onosproject.onos-protocols-grpc-ctl - 2.6.0 | Creating P4Runtime client for device:stratum-inventec-d10056-1...
2021-12-17T15:15:22,176 | INFO | onos-gdp-0 | GnmiControllerImpl | 230 - org.onosproject.onos-protocols-grpc-ctl - 2.6.0 | Creating gNMI client for device:stratum-inventec-d10056-1...
2021-12-17T15:15:22,220 | INFO | onos-gdp-0 | GnoiControllerImpl | 230 - org.onosproject.onos-protocols-grpc-ctl - 2.6.0 | Creating gNOI client for device:stratum-inventec-d10056-1...
2021-12-17T15:15:22,228 | INFO | onos-gdp-0 | DeviceManager | 193 - org.onosproject.onos-core-net - 2.6.0 | Local role is MASTER for device:stratum-inventec-d10056-1
2021-12-17T15:15:22,233 | WARN | onos-event-dispatch-default0 | ModelCache | 201 - org.onosproject._onos-gui2-base-jar - 2.6.0 | DeviceID device:stratum-inventec-d10056-1 not found as a UiDevice
2021-12-17T15:15:22,236 | WARN | onos-event-dispatch-default0 | ModelCache | 201 - org.onosproject._onos-gui2-base-jar - 2.6.0 | DeviceID device:stratum-inventec-d10056-1 not found as a UiDevice
2021-12-17T15:15:22,239 | INFO | onos-gdp-0 | GeneralDeviceProvider | 235 - org.onosproject.onos-providers-general-device - 2.6.0 | Notifying role MASTER (preference 0) for term 1 to device:stratum-inventec-d10056-1
2021-12-17T15:15:22,240 | WARN | onos-device-manager-background | DeviceManager | 193 - org.onosproject.onos-core-net - 2.6.0 | Node was instructed to be MASTER role for device:stratum-inventec-d10056-1, but this node cannot reach the device. Relinquishing role.··
2021-12-17T15:15:22,242 | WARN | onos-event-dispatch-default0 | ModelCache | 201 - org.onosproject._onos-gui2-base-jar - 2.6.0 | DeviceID device:stratum-inventec-d10056-1 not found as a UiDevice
2021-12-17T15:15:22,242 | WARN | onos-event-dispatch-default0 | ModelCache | 201 - org.onosproject._onos-gui2-base-jar - 2.6.0 | DeviceID device:stratum-inventec-d10056-1 not found as a UiDevice
2021-12-17T15:15:22,243 | WARN | onos-event-dispatch-default0 | ModelCache | 201 - org.onosproject._onos-gui2-base-jar - 2.6.0 | DeviceID device:stratum-inventec-d10056-1 not found as a UiDevice
2021-12-17T15:15:22,243 | INFO | onos-gdp-0 | StreamClientImpl | 237 - org.onosproject.onos-protocols-p4runtime-ctl - 2.6.0 | Setting mastership on device:stratum-inventec-d10056-1... master=true, newElectionId=20, masterElectionId=null, sessionOpen=false
2021-12-17T15:15:22,292 | INFO | onos-topo-build-1 | TopologyManager | 193 - org.onosproject.onos-core-net - 2.6.0 | Topology DefaultTopology{time=106851400245026, creationTime=1639782922291, computeCost=88471, clusters=0, devices=0, links=0} changed
2021-12-17T15:15:22,296 | INFO | onos-gdp-0 | DeviceManager | 193 - org.onosproject.onos-core-net - 2.6.0 | Device device:stratum-inventec-d10056-1 registered
2021-12-17T15:15:22,333 | INFO | onos-device-manager-background | GeneralDeviceProvider | 235 - org.onosproject.onos-providers-general-device - 2.6.0 | Notifying role MASTER (preference 0) for term 2 to device:stratum-inventec-d10056-1
2021-12-17T15:15:22,334 | INFO | onos-flow-backup-0 | DeviceFlowTable | 192 - org.onosproject.onos-core-dist - 2.6.0 | Synchronizing device device:stratum-inventec-d10056-1 flows for term 2
2021-12-17T15:15:22,334 | INFO | onos-device-manager-background | StreamClientImpl | 237 - org.onosproject.onos-protocols-p4runtime-ctl - 2.6.0 | Setting mastership on device:stratum-inventec-d10056-1... master=true, newElectionId=40, masterElectionId=null, sessionOpen=true
2021-12-17T15:15:22,406 | INFO | onos-pipeconf-watchdog-0 | PipelineConfigClientImpl | 237 - org.onosproject.onos-protocols-p4runtime-ctl - 2.6.0 | Setting pipeline config for device:stratum-inventec-d10056-1 to org.onosproject.foo.simple_l3_arping.tofino.montara_sde_9_4_0...
2021-12-17T15:15:22,631 | WARN | grpc-default-executor-1 | P4RuntimeClientImpl | 230 - org.onosproject.onos-protocols-grpc-ctl - 2.6.0 | Error while performing SET-pipeline-config on device:stratum-inventec-d10056-1: INVALID_ARGUMENT: Unknown format for p4_device_config.·
Stratum log snippet
bf-sde> I20211217 23:15:22.359282 12997 p4_service.cc:778] Controller (connection_id: 1, election_id: 20, uri: ipv4:10.4.16.144:55446) is connected as MASTER for node (aka device) with ID 1.
I20211217 23:15:22.359341 12997 p4_service.cc:778] Controller (connection_id: 1, election_id: 40, uri: ipv4:10.4.16.144:55446) is connected as MASTER for node (aka device) with ID 1.
E20211217 23:15:22.631534 14390 bf_pipeline_utils.cc:42] StratumErrorSpace::ERR_INVALID_PARAM: Unknown format for p4_device_config.
E20211217 23:15:22.631582 14390 bfrt_node.cc:153] Return Error: ExtractBfPipelineConfig(config, &bf_config) failed with StratumErrorSpace::ERR_INVALID_PARAM: Unknown format for p4_device_config.
E20211217 23:15:22.631603 14390 bfrt_switch.cc:74] Return Error: DoVerifyForwardingPipelineConfig(node_id, config) failed with StratumErrorSpace::ERR_INVALID_PARAM: Unknown format for p4_device_config.·
E20211217 23:15:22.631625 14390 error_buffer.cc:30] (p4_service.cc:456): Failed to set forwarding pipeline config for node 1: Unknown format for p4_device_config.·
E20211217 23:15:25.246840 14390 bf_pipeline_utils.cc:42] StratumErrorSpace::ERR_INVALID_PARAM: Unknown format for p4_device_config.
20211217 23:15:43.234520 12997 p4_service.cc:805] Controller (connection_id: 1, election_id: 40, uri: ipv4:10.4.16.144:55446) which was MASTER for node (aka device) with ID 1 is disconnected. The node is now orphan :(
I am guessing this has something to do with the formatting of the P4Info file?
Wondering if anyone else has encountered this issue before. Any debugging tips/guidance would be really helpful.
Thanks,
Prashanth