I have tried to check the json file in the past, but found no obvious errors, the json file generation is fairly standard, and no configuration errors were found after checking.
{
“hosts”: {
“00:00:00:00:00:09/-1”: {
“basic”: {
“latitude”: 28,
“ips”: [
“10.0.0.9”
],
“locations”: [
“device:bmv2:e17/3”
],
“longitude”: -43,
“name”: “h9”
}
},
“00:00:00:00:00:0b/-1”: {
“basic”: {
“latitude”: 28,
“ips”: [
“10.0.0.11”
],
“locations”: [
“device:bmv2:e18/3”
],
“longitude”: -27,
“name”: “h11”
}
},
“00:00:00:00:00:01/-1”: {
“basic”: {
“latitude”: 28,
“ips”: [
“10.0.0.1”
],
“locations”: [
“device:bmv2:e13/3”
],
“longitude”: -107,
“name”: “h1”
}
},
“00:00:00:00:00:0f/-1”: {
“basic”: {
“latitude”: 28,
“ips”: [
“10.0.0.15”
],
“locations”: [
“device:bmv2:e20/3”
],
“longitude”: 5,
“name”: “h15”
}
},
“00:00:00:00:00:0d/-1”: {
“basic”: {
“latitude”: 28,
“ips”: [
“10.0.0.13”
],
“locations”: [
“device:bmv2:e19/3”
],
“longitude”: -11,
“name”: “h13”
}
},
“00:00:00:00:00:0e/-1”: {
“basic”: {
“latitude”: 28,
“ips”: [
“10.0.0.14”
],
“locations”: [
“device:bmv2:e19/4”
],
“longitude”: -3,
“name”: “h14”
}
},
“00:00:00:00:00:10/-1”: {
“basic”: {
“latitude”: 28,
“ips”: [
“10.0.0.16”
],
“locations”: [
“device:bmv2:e20/4”
],
“longitude”: 13,
“name”: “h16”
}
},
“00:00:00:00:00:03/-1”: {
“basic”: {
“latitude”: 28,
“ips”: [
“10.0.0.3”
],
“locations”: [
“device:bmv2:e14/3”
],
“longitude”: -91,
“name”: “h3”
}
},
“00:00:00:00:00:08/-1”: {
“basic”: {
“latitude”: 28,
“ips”: [
“10.0.0.8”
],
“locations”: [
“device:bmv2:e16/4”
],
“longitude”: -51,
“name”: “h8”
}
},
“00:00:00:00:00:07/-1”: {
“basic”: {
“latitude”: 28,
“ips”: [
“10.0.0.7”
],
“locations”: [
“device:bmv2:e16/3”
],
“longitude”: -59,
“name”: “h7”
}
},
“00:00:00:00:00:02/-1”: {
“basic”: {
“latitude”: 28,
“ips”: [
“10.0.0.2”
],
“locations”: [
“device:bmv2:e13/4”
],
“longitude”: -99,
“name”: “h2”
}
},
“00:00:00:00:00:0a/-1”: {
“basic”: {
“latitude”: 28,
“ips”: [
“10.0.0.10”
],
“locations”: [
“device:bmv2:e17/4”
],
“longitude”: -35,
“name”: “h10”
}
},
“00:00:00:00:00:06/-1”: {
“basic”: {
“latitude”: 28,
“ips”: [
“10.0.0.6”
],
“locations”: [
“device:bmv2:e15/4”
],
“longitude”: -67,
“name”: “h6”
}
},
“00:00:00:00:00:04/-1”: {
“basic”: {
“latitude”: 28,
“ips”: [
“10.0.0.4”
],
“locations”: [
“device:bmv2:e14/4”
],
“longitude”: -83,
“name”: “h4”
}
},
“00:00:00:00:00:05/-1”: {
“basic”: {
“latitude”: 28,
“ips”: [
“10.0.0.5”
],
“locations”: [
“device:bmv2:e15/3”
],
“longitude”: -75,
“name”: “h5”
}
},
“00:00:00:00:00:0c/-1”: {
“basic”: {
“latitude”: 28,
“ips”: [
“10.0.0.12”
],
“locations”: [
“device:bmv2:e18/4”
],
“longitude”: -19,
“name”: “h12”
}
}
},
“devices”: {},
“links”: {}
}
This is followed by a specific switch file:
{
“devices”: {
“device:bmv2:c1”: {
“ports”: {
“1”: {
“name”: “c1-eth1”,
“speed”: 10000,
“enabled”: true,
“number”: 1,
“removed”: false,
“type”: “copper”
},
“3”: {
“name”: “c1-eth3”,
“speed”: 10000,
“enabled”: true,
“number”: 3,
“removed”: false,
“type”: “copper”
},
“2”: {
“name”: “c1-eth2”,
“speed”: 10000,
“enabled”: true,
“number”: 2,
“removed”: false,
“type”: “copper”
},
“4”: {
“name”: “c1-eth4”,
“speed”: 10000,
“enabled”: true,
“number”: 4,
“removed”: false,
“type”: “copper”
}
},
“basic”: {
“latitude”: 49,
“managementAddress”: “grpc://127.0.0.1:51931?device_id=1”,
“driver”: “bmv2”,
“longitude”: -115,
“pipeconf”: “org.onosproject.pipelines.int”
}
}
}
}
onos reports the following error.
I guess it is because the connection between the two sides of p4runtime is not established successfully. Because the index exceeds the upper limit, this exception is triggered. As a result, the grpc server of the switch is shut down, and the client in onos cannot establish the connection with the switch.