Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents


1. Topology preparation

The topology of this demo contains three nodes:

...

  • device.json: You can download this file via command

    Code Block
    wget https://raw.githubusercontent.com/opennetworkinglab/ODTN-emulator/master/topo/with-rest-tapi/device.json

    The content is:

    Code Block
    languagejs
    {
      "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

    Code Block
    wget https://raw.githubusercontent.com/opennetworkinglab/ODTN-emulator/master/topo/with-rest-tapi/link.json

    The content is:

    Code Block
    languagejs
    {
      "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:

Code Block
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:

Code Block
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:

Code Block
cd $ONOS_ROOT
export ONOS_APPS=odtn-service,drivers,gui2
bazel run onos-local -- clean

Secondly, push topology info into ONOS controller:

Code Block
onos-netcfg localhost device.json
onos-netcfg localhost link.json

Open the webpage, you will see: