Hi,
I try to not to deviate from the NG-SDN tutorial (in terms of deploying an scenario) because all complicated things are already programmed. Check the Makefile from the tutorial and, also check EXERCISE 4.
They state in EXERCISE 4:
6. Push netcfg to ONOS to trigger device and link discovery
On a terminal window, type:
$ make netcfg
And if you check the actual Makefile:
_netcfg:
$(info *** Pushing ${NGSDN_NETCFG_JSON} to ONOS...)
${onos_curl} -X POST -H 'Content-Type:application/json' \
${onos_url}/v1/network/configuration -d@./mininet/${NGSDN_NETCFG_JSON}
@echo
netcfg: NGSDN_NETCFG_JSON := netcfg.json
netcfg: _netcfg
As you see, they reference a file netcfg.json
and push it to ONOS. That file includes device information, port information and hosts information. The connfiguration data for the devices includes the IP and port that ONOS needs to know so that the P4Runtime session is established. That is probably why the controller cannot find the switch, see the managementAddress
key in the netcfg.json
file. Copnsider that your own programs pipeconf
, if you use Stratum and so on also matter, and that is specified in the configuration file as well as the drivers you activate in ONOS. That is why keeping as much as you can from the tutorial is helpful (at least in the beginning).
{
"devices": {
"device:leaf1": {
"basic": {
"managementAddress": "grpc://mininet:50001?device_id=1",
"driver": "stratum-bmv2",
"pipeconf": "org.onosproject.ngsdn-tutorial",
"locType": "grid",
"gridX": 200,
"gridY": 600
},
"fabricDeviceConfig": {
"myStationMac": "00:aa:00:00:00:01",
"mySid": "3:101:2::",
"isSpine": false
}
},
...
},
"ports": {
"device:leaf1/3": {
"interfaces": [
{
"name": "leaf1-3",
"ips": ["2001:1:1::ff/64"]
}
]
},
...
},
"hosts": {
"00:00:00:00:00:1A/None": {
"basic": {
"name": "h1a",
"locType": "grid",
"gridX": 100,
"gridY": 700
}
},
...
}
}
If you want a good recommendation, go step by step. Keep as much as you can from the tutorial (maybe not the control plane app, because you need your own). But still use mininet, the Makefile and so on. If you need to switch from Mininet to your own simple_switch
process do it but only once Mininet worked. Try to only make changes but step by step.
Cheers,