bmv2 switch is Unreachable

69 views
Skip to first unread message

Abaomelody

unread,
Feb 8, 2024, 3:00:50 AM2/8/24
to ONOS Developers
Hi guys,

I'm trying to run a bmv2 switch outside the mininet environment: 
simple_switch_grpc --no-p4 -i 0@wlp1s0 --device-id 1 -- --grpc-server-addr localhost:1234 --cpu-port 255

It seems the bmv2 switch is running properly because I could use P4Runtime Shell to push a P4pipeline to this switch. 
I would like the onos controller to connect with this switch, so I did some changes in the netcfg file provided by NGSDN tutorial, the configuration looks like this:
{
    "devices": {
        "device:bmv2:s1": {
            "basic": {
                "managementAddress": "grpc://127.0.0.1:1234?device_id=1",
                "driver": "bmv2",
                "pipeconf": "org.onosproject.ngsdn-tutorial"
            }
        }
    }
}

After pushing this netcfg, in onos-log, it shows that the connection with the device was refused, and in onos-cli the device's available status is FALSE, here is the screenshot from onos-log:
 
Screenshot from 2024-02-08 08-24-03.png

I'm wondering if something is missing in the netcfg file. 
I appreciate any advice or guidance from you. 

Thanks.

Davide Scano

unread,
Feb 8, 2024, 3:11:45 AM2/8/24
to Abaomelody, ONOS Developers
Hi Abaomelody

1) did you tu the switch within a docker container or is on “the host” machine?
2) can you  please share the onos logs?

Best
Davide 

On 8 Feb 2024, at 9:00 AM, Abaomelody <joyce...@gmail.com> wrote:

Hi guys,

I'm trying to run a bmv2 switch outside the mininet environment: 
simple_switch_grpc --no-p4 -i 0@wlp1s0 --device-id 1 -- --grpc-server-addr localhost:1234 --cpu-port 255

It seems the bmv2 switch is running properly because I could use P4Runtime Shell to push a P4pipeline to this switch. 
I would like the onos controller to connect with this switch, so I did some changes in the netcfg file provided by NGSDN tutorial, the configuration looks like this:
{
    "devices": {
        "device:bmv2:s1": {
            "basic": {
                "managementAddress": "grpc://127.0.0.1:1234?device_id=1",
                "driver": "bmv2",
                "pipeconf": "org.onosproject.ngsdn-tutorial"
            }
        }
    }
}

After pushing this netcfg, in onos-log, it shows that the connection with the device was refused, and in onos-cli the device's available status is FALSE, here is the screenshot from onos-log:
 
<Screenshot from 2024-02-08 08-24-03.png>


I'm wondering if something is missing in the netcfg file. 
I appreciate any advice or guidance from you. 

Thanks.

--
You received this message because you are subscribed to the Google Groups "ONOS Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to onos-dev+u...@opennetworking.org.
To view this discussion on the web visit https://groups.google.com/a/opennetworking.org/d/msgid/onos-dev/4f8059fc-9655-4a16-97bf-fd83342b73fdn%40opennetworking.org.
For more options, visit https://groups.google.com/a/opennetworking.org/d/optout.
<Screenshot from 2024-02-08 08-24-03.png>

Abaomelody

unread,
Feb 8, 2024, 3:16:20 AM2/8/24
to ONOS Developers, Davide Scano, ONOS Developers, Abaomelody
Hi Davide,
Thanks for asking.

1) the switch is running on "the host" machine.
2) attached is the screenshot from onos-log.

Thanks.

Screenshot from 2024-02-08 08-24-03.png

Abaomelody

unread,
Feb 9, 2024, 8:15:42 AM2/9/24
to ONOS Developers, Abaomelody, Davide Scano, ONOS Developers
Hi,
just an update for my previous post. I realized that if the bmv2 switch is bound to 127.0.0.1 (localhost), it's only accessible from within the host machine itself.After changing the ip addr to the host's ip address, this connection error has been fixed.

Thanks.

Davide Scano

unread,
Feb 9, 2024, 8:19:57 AM2/9/24
to Abaomelody, ONOS Developers
Super good and I’m sorry Abaomelody I wasn’t able to replay to you yesterday.
Best, 
Davide 

On 9 Feb 2024, at 2:15 PM, Abaomelody <joyce...@gmail.com> wrote:

Hi,
Reply all
Reply to author
Forward
0 new messages