NetworkConfigManager loads a configuration file and exposes an interface for
querying network configuration. Currently it only supports startup configuration.
Change-Id: I6b67bde56b2c97471470090b26f3e05dc6f1d7c7
diff --git a/conf/example-network.conf b/conf/example-network.conf
new file mode 100644
index 0000000..db9effb
--- /dev/null
+++ b/conf/example-network.conf
@@ -0,0 +1,101 @@
+{
+ "comment": " Multilayer topology description and configuration",
+ "restrictSwitches": false,
+ "restrictLinks": false,
+
+ "switchConfig":
+ [
+ { "nodeDpid": "00:00:ff:ff:ff:ff:ff:00", "name": "Dallas-R1", "type": "Router_SR", "allowed": true,
+ "latitude": 80.80, "longitude": 90.10,
+ "params": { "routerIp": "192.168.10.10/32",
+ "routerMac": "00:ba:ba:00:10:10",
+ "nodeSid": 110,
+ "adjacencySids": [
+ { "portNo": 3, "adjSid": 10234 },
+ { "portNo": 5, "adjSid": 29019 }
+ ],
+ "subnets": [
+ { "portNo": 1, "subnetIp": "10.0.1.1/24" },
+ { "portNo": 4, "subnetIp": "10.0.2.1/24" },
+ { "portNo": 5, "subnetIp": "10.0.3.1/24" }
+ ]
+ }
+ },
+
+ { "nodeDpid": "00:00:ff:ff:ff:ff:ff:01", "name": "Dallas-R2", "type": "Router_SR", "allowed": true,
+ "latitude": 80.80, "longitude": 90.10,
+ "params": { "routerIp": "192.168.10.11/32",
+ "routerMac": "00:ba:ba:00:10:11",
+ "nodeSid": 111,
+ "adjacencySids": [
+ { "portNo": 3, "adjSid": 10234 },
+ { "portNo": 5, "adjSid": 29019 }
+ ],
+ "subnets": [
+ { "portNo": 1, "subnetIp": "10.0.4.1/24" },
+ { "portNo": 4, "subnetIp": "10.0.5.1/24" },
+ { "portNo": 5, "subnetIp": "10.0.6.1/24" }
+ ]
+ }
+ },
+
+ { "nodeDpid": "00:00:ff:ff:ff:ff:ff:02", "name": "Dallas-W1", "type": "Roadm", "allowed": true,
+ "latitude": 80.80, "longitude": 90.10,
+ "params": { "numRegen": 2 }
+ },
+
+ { "nodeDpid": "00:00:ff:ff:ff:ff:ff:03", "name": "NYC-W10", "type": "Roadm", "allowed": true,
+ "latitude": 80.80, "longitude": 90.10,
+ "params": { "numRegen": 3 }
+ },
+
+ { "nodeDpid": "00:00:ff:ff:ff:ff:ff:04", "name": "Dallas-S1", "type": "Switch_OF10", "allowed": true,
+ "latitude": 80.80, "longitude": 90.10
+ }
+
+
+ ],
+
+ "linkConfig":[
+ { "type": "pktLink", "allowed": true,
+ "nodeDpid1": "00:00:ff:ff:ff:ff:ff:00", "nodeDpid2": "00:00:ff:ff:ff:ff:ff:04",
+ "params": { "nodeName1": "Dallas-R1", "port1": 3,
+ "nodeName2": "Dallas-S1", "port2": 20
+ }
+ },
+
+ { "type": "pktLink", "allowed": true,
+ "nodeDpid1": "00:00:ff:ff:ff:ff:ff:00", "nodeDpid2": "00:00:ff:ff:ff:ff:ff:04",
+ "params": { "port1": 4, "port2": 3 }
+ },
+
+ { "type": "wdmLink", "allowed": true,
+ "nodeDpid1": "00:00:ff:ff:ff:ff:ff:02", "nodeDpid2": "00:00:ff:ff:ff:ff:ff:03",
+ "params": { "nodeName1": "Dallas-W1",
+ "nodeName2": "NYC-W10",
+ "distKms": 5000, "numWaves": 80
+ }
+ },
+
+ { "type": "pktOptLink", "allowed": true,
+ "nodeDpid1": "00:00:ff:ff:ff:ff:ff:00", "nodeDpid2": "00:00:ff:ff:ff:ff:ff:02",
+ "params": { "nodeName1": "Dallas-R1", "port1": 33,
+ "nodeName2": "Dallas-W1", "port2": 10
+ }
+ },
+
+ { "type": "pktLink", "allowed": true,
+ "nodeDpid1": "00:00:ff:ff:ff:ff:ff:00", "nodeDpid2": "00:00:ff:ff:ff:ff:ff:01",
+ "params": { "port1": 6, "port2": 1 }
+ }
+
+ ],
+
+ "opticalReachabilty":
+ [
+ [ "Dallas-W1", "NYC-W10" ],
+ [ "NYC-W10", "Dallas-W1" ],
+ [ "Dallas-W2", "SFO-W3" ],
+ [ "SFO-W3", "Dallas-W2" ]
+ ]
+}
diff --git a/conf/onos.properties b/conf/onos.properties
index e2b0bdc..e6d5292 100644
--- a/conf/onos.properties
+++ b/conf/onos.properties
@@ -18,3 +18,5 @@
net.onrc.onos.core.datagrid.HazelcastDatagrid.datagridConfig =
# Uncomment and list all the ZooKeeper instances after localhost on multi-instance deployment.
#net.onrc.onos.core.registry.ZookeeperRegistry.connectionString = localhost:2181,otherhost:2181
+# Specify a network configuration file to be used by the NetworkConfigManager
+#net.onrc.onos.core.configmanager.NetworkConfigManager.networkConfigFile = conf/my_network.conf