Hello. I'm trying to use this lib to build a controller for both bmv2 and Tofino. Thus, I want to run the example first to know how this lib works. However, I received an RPC error and cannot run l2_switch
successfully.
My environment
- OS: Ubuntu 22.04
- ARCH: x86_64
- p4c: 1.2.4.2
- go: 1.22.2
- simple_switch_grpc: 1.15.0-6ee70b5e
How I run l2_switch
The command to install go-bindata
is not suitable for go 1.22.2, so I install it using go install -a -v github.com/go-bindata/go-bindata/...@latest
I have installed p4c already, so I adjusted the Makefile and compiled p4 code manually:
p4c $(CURDIR)/cmd/l2_switch/l2_switch.p4 -o $(CURDIR)/cmd/l2_switch/l2_switch.out/ -b bmv2 -a v1model --std p4-16 --p4runtime-files $(CURDIR)/cmd/l2_switch/l2_switch.out/p4info.pb.txt
Then I used make bin
to compile examples. After that, I run examples in the following way:
> sudo python 1sw_demo.py
*** Creating network
*** Adding hosts:
h1 h2
*** Adding switches:
s1
*** Adding links:
(h1, s1) (h2, s1)
*** Configuring hosts
h1 h2
*** Starting controller
*** Starting 1 switches
s1 Starting P4 switch s1
simple_switch_grpc -i 1@s1-eth1 -i 2@s1-eth2 --no-p4 --log-console --device-id 0
switch has been started
# Following output is
> ./bin/l2_switch -bin cmd/l2_switch/l2_switch.out/l2_switch.json -p4info cmd/l2_switch/l2_switch.out/p4info.pb.txt -verbose
INFO[0000] Connecting to server at 127.0.0.1:9559
INFO[0000] P4Runtime server version is 1.3.0
INFO[0000] We are the primary client!
INFO[0000] Setting forwarding pipe
DEBU[0000] Enabling digest 'digest_t'
DEBU[0000] Configuring multicast group 171 for broadcast
FATA[0000] Error when initializing defaults: Cannot configure multicast group 171 for broadcast: rpc error: code = Unknown desc =
And simple_switch_grpc
's log is:
> tail -f /tmp/p4s.s1.log
Calling target program-options parser
Adding interface s1-eth1 as port 1
[03:27:55.530] [bmv2] [D] [thread 1187235] Adding interface s1-eth1 as port 1
Adding interface s1-eth2 as port 2
[03:27:55.567] [bmv2] [D] [thread 1187235] Adding interface s1-eth2 as port 2
Server listening on 0.0.0.0:9559
[03:27:55.608] [bmv2] [I] [thread 1187235] Starting Thrift server on port 9090
[03:27:55.608] [bmv2] [I] [thread 1187235] Thrift server was started
[03:28:55.842] [bmv2] [D] [thread 1187954] Set default default entry for table 'tbl_l2_switch89': l2_switch89 -
[03:28:55.842] [bmv2] [D] [thread 1187954] Set default default entry for table 'IngressImpl.smac': IngressImpl.learn_mac -
[03:28:55.842] [bmv2] [D] [thread 1187954] Set default default entry for table 'IngressImpl.dmac': IngressImpl.drop -
[03:28:55.842] [bmv2] [D] [thread 1187954] Set default default entry for table 'tbl_l2_switch39': l2_switch39 -
[03:28:55.842] [bmv2] [D] [thread 1187954] Set default default entry for table 'tbl_l2_switch41': l2_switch41 -
[03:28:55.843] [bmv2] [D] [thread 1187954] simple_switch target has been notified of a config swap
[03:28:55.846] [bmv2] [E] [thread 1187958] [P4Runtime] Missing port in multicast group replica
I would like to know where to start to find out why this error occurs. Please give me some advice.