1. Topology preparation
The topology of this demo contains three nodes:
2 Cassini terminal devices - You can pull the image from dockerhub via command
docker pull onosproject/oc-cassini:0.21
1 TAPI-2.1 OLS device - You can pull the image from dockerhub via command
docker pull onosproject/tapi-2.1:0.02
About these three containers, the source code is at repo https://github.com/opennetworkinglab/ODTN-emulator.
Then, the topo configuration file consists of two json files:
device.json: You can download this file via command
wget https://raw.githubusercontent.com/opennetworkinglab/ODTN-emulator/master/topo/with-rest-tapi/device.json
The content is:
{ "devices" : { "netconf:127.0.0.1:11002" : { "basic" : { "name":"cassini2", "driver":"cassini-ocnos" }, "netconf" : { "ip" : "127.0.0.1", "port" : "11002", "username" : "root", "password" : "root", "idle-timeout" : "0" } }, "rest:127.0.0.1:11000": { "rest": { "ip": "127.0.0.1", "port": 11000, "protocol": "http", "testUrl":"/restconf/data/tapi-common:context", "manufacturer": "tapi-swagger", "hwVersion": "0", "swVersion": "2.1" }, "basic": { "driver": "ols" } }, "netconf:127.0.0.1:11003" : { "basic" : { "name":"cassini1", "driver":"cassini-ocnos" }, "netconf" : { "ip" : "127.0.0.1", "port" : "11003", "username" : "root", "password" : "root", "idle-timeout" : "0" } } } }
link.json: You can download this file via command
wget https://raw.githubusercontent.com/opennetworkinglab/ODTN-emulator/master/topo/with-rest-tapi/link.json
The content is:
{ "links": { "netconf:127.0.0.1:11002/201-rest:127.0.0.1:11000/100000035178": { "basic": { "type": "OPTICAL", "metric": 1, "durable": true, "bidirectional": true } }, "rest:127.0.0.1:11000/100000035182-netconf:127.0.0.1:11003/201": { "basic": { "type": "OPTICAL", "metric": 1, "durable": true, "bidirectional": true } } } }
2. Run Topology and ONOS instance
Firstly, start three device emulator:
docker run -it -d --name odtn-emulator_openconfig_cassini_1_1 -p 11002:830 onosproject/oc-cassini:0.21 docker run -it -d --name odtn-emulator_openconfig_cassini_2_1 -p 11003:830 onosproject/oc-cassini:0.21 docker run -it -d --name odtn-emulator_tapi_ols_1 -p 11000:1234 onosproject/tapi-2.1:0.02
And you will see three containers running:
ONFs-MacBook-Pro:tapi2.1-javaServer onf$ docker ps -a CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 8eafc849aa22 onosproject/tapi-2.1:0.02 "sh /root/script/ent…" About an hour ago Up About an hour 0.0.0.0:11000->1234/tcp odtn-emulator_tapi_ols_1 4cdd162d17ac onosproject/oc-cassini:0.21 "sh /root/script/pus…" 4 hours ago Up About an hour 22/tcp, 8080/tcp, 0.0.0.0:11003->830/tcp odtn-emulator_openconfig_cassini_2_1 31a67778f3b7 onosproject/oc-cassini:0.21 "sh /root/script/pus…" 4 hours ago Up About an hour 22/tcp, 8080/tcp, 0.0.0.0:11002->830/tcp odtn-emulator_openconfig_cassini_1_1
Meanwhile, run the ONOS instance locally:
cd $ONOS_ROOT export ONOS_APPS=odtn-service,drivers,gui2 bazel run onos-local -- clean
Secondly, push topology info into ONOS controller:
onos-netcfg localhost device.json onos-netcfg localhost link.json
Open the webpage, you will see the topology:
3. Connectivity Creation/Deletion
Now, you can execute connectivity operations based on the topology and the controller.
3.1 Connectivity Creation
In Python2.X environment, create line-side connectivity:
execute-tapi-post-call.py 127.0.0.1 tapi-connectivity:create-connectivity-service line-side
The output is something like:
There is no line-side service in ONOS now. Build line-side connectivity: |Item|SRC|DST| |:--|:--|:--| |onos-cp|netconf:127.0.0.1:11003/201|netconf:127.0.0.1:11002/201| |connection id|line|line| |sip uuid|d9d86f52-4db7-4515-8183-d20c5dd4c497|867fb6db-102d-417f-8687-e7ca327e901f| The json content of creation operation for line-side connectivity service is {"tapi-connectivity:input": {"end-point": [{"direction": "BIDIRECTIONAL", "layer-protocol-qualifier": "tapi-photonic-media:PHOTONIC_LAYER_QUALIFIER_NMC", "protection-role": "WORK", "layer-protocol-name": "PHOTONIC_MEDIA", "role": "UNKNOWN", "service-interface-point": {"service-interface-point-uuid": "d9d86f52-4db7-4515-8183-d20c5dd4c497"}, "local-id": "Src_end_point"}, {"direction": "BIDIRECTIONAL", "layer-protocol-qualifier": "tapi-photonic-media:PHOTONIC_LAYER_QUALIFIER_NMC", "protection-role": "WORK", "layer-protocol-name": "PHOTONIC_MEDIA", "role": "UNKNOWN", "service-interface-point": {"service-interface-point-uuid": "867fb6db-102d-417f-8687-e7ca327e901f"}, "local-id": "Dst_end_point"}]}}. The request context is: tapi-connectivity:create-connectivity-service. The return message of the request is: {"tapi-connectivity:output": {"service": {"connection": [{"connection-uuid": "170cc3c8-fdee-4a26-806e-bcbe04576c9e"}], "end-point": [{"service-interface-point": {"service-interface-point-uuid": "d9d86f52-4db7-4515-8183-d20c5dd4c497"}, "local-id": "e9971bde-232b-4b06-8ece-4457638eaace"}, {"service-interface-point": {"service-interface-point-uuid": "867fb6db-102d-417f-8687-e7ca327e901f"}, "local-id": "5c79dc42-833b-4008-bf9b-de3701bbc4ce"}], "uuid": "0244e790-f668-4265-855b-c9859aeccc30"}}}
And the intent is installed:
Also, we could see the running logs of the container odtn-emulator_tapi_ols_1 to see the restful request on it:
ONFs-MacBook-Pro:tapi2.1-javaServer onf$ docker logs odtn-emulator_tapi_ols_1 23:18:18.825 [qtp1946827416-19] INFO io.swagger.api.impl.DataApiServiceImpl - method dataContextGet is called. 23:18:28.018 [qtp1946827416-17] INFO io.swagger.api.impl.DataApiServiceImpl - method dataContextConnectivityContextPost is called. 23:18:28.018 [qtp1946827416-17] WARN io.swagger.api.impl.DataApiServiceImpl - The list of TapiConnectivityConnection shouldn't be null or empty 23:18:28.019 [qtp1946827416-12] INFO io.swagger.api.impl.DataApiServiceImpl - method dataContextConnectivityContextPost is called. 23:18:28.019 [qtp1946827416-12] WARN io.swagger.api.impl.DataApiServiceImpl - The list of TapiConnectivityConnection shouldn't be null or empty 23:18:48.832 [qtp1946827416-16] INFO io.swagger.api.impl.DataApiServiceImpl - method dataContextGet is called.
3.2 Connectivity Deletion
In Python2.X environment, delete the installed line-side connectivity:
execute-tapi-delete-call.py 127.0.0.1 both
The output is something like:
(py2) ONFs-MacBook-Pro:tmp onf$ execute-tapi-delete-call.py 127.0.0.1 both The json content of deletion operation for connectivity service is {"tapi-connectivity:input": {"service-id-or-name": "0244e790-f668-4265-855b-c9859aeccc30"}}. Returns json string for deletion operations is <Response [200]>
Also, we could see the updates of the running logs of odtn-emulator_tapi_ols_1:
ONFs-MacBook-Pro:tapi2.1-javaServer onf$ docker logs odtn-emulator_tapi_ols_1 ...... 23:23:48.944 [qtp1946827416-16] INFO io.swagger.api.impl.DataApiServiceImpl - method dataContextGet is called. 23:24:03.005 [qtp1946827416-19] INFO io.swagger.api.impl.DataApiServiceImpl - method dataContextConnectivityContextConnectivityServiceuuidDelete is called. 23:24:03.006 [qtp1946827416-19] INFO io.swagger.api.impl.DataApiServiceImpl - remove the tapi-connectivity:connectivity-service with uuid 819578a0-8cdc-4394-971e-9c941d631af7. 23:24:03.008 [qtp1946827416-12] INFO io.swagger.api.impl.DataApiServiceImpl - method dataContextConnectivityContextConnectivityServiceuuidDelete is called. 23:24:03.009 [qtp1946827416-12] INFO io.swagger.api.impl.DataApiServiceImpl - remove the tapi-connectivity:connectivity-service with uuid 9d5d9e19-7889-449d-af8f-fb3d903a5500. 23:24:18.956 [qtp1946827416-17] INFO io.swagger.api.impl.DataApiServiceImpl - method dataContextGet is called.