Page tree

Versions Compared

Key

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

...

Code Block
languagetext
linenumberstrue
CONTAINER ID        IMAGE                         COMMAND                  CREATED             STATUS              PORTS                                      NAMES
20c0298eb652        onosproject/oc-cassini:0.21   "sh /root/script/pus…"   2 hours ago         Up 2 hours          22/tcp, 8080/tcp, 0.0.0.0:11002->830/tcp   odtn-emulator_openconfig_cassini_1_1

2

...

Execute Operations

2.1

...

So we use the command listed below to send RPC request to the container:

Code Block
languagepowershell
netconf-console --host=127.0.0.1 --port=11003 -u admin -p admin --rpc={XML_FILE_NAME}

The root node of "openconfig-platform.yang" is "<components>" and its sublist "<component>" contains "<name>" node as its identity. Besides "openconfig-terminal-device.yang" adds node "<optical-channel>" into "<component>" node. "<target-power-config>" is defined as a child node of "<optical-channel>".

2.1.1 Perform <get> Operation

If you want to get the whole components, the content of get-components is:

Code Block
languagexml
linenumberstrue
<?xml version="1.0"?>
<get xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
  <filter xmlns:oc-platform="http://openconfig.net/yang/platform">
    <oc-platform:components/>
  </filter>
</get>

You can take a look at the output of get components here: out-get-components.xml

If you want to get only the "<optical-channel>" of "<component>", the content of get-components-op-channel is:

Code Block
languagexml
linenumberstrue
<?xml version="1.0"?>
<get xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<filter>
    <components xmlns="http://openconfig.net/yang/platform">
      <component>
        <optical-channel xmlns="http://openconfig.net/yang/terminal-device" />
      </component>
    </components>
  </filter>
</get>

The output is out-get-components-op-channel:

...

languagexml
linenumberstrue
collapsetrue

...

ONOS startup and node discovery

This section is the environment for section 2.3 and 2.4.

Firstly, an ONOS instance is started via command "bazel run onos-local -- clean". Secondly, the docker container connects to ONOS via command "onos-netcfg localhost device.json". The content of device.json is:

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

Then, we use "onos localhost" to log into ONOS CLI environment and see if the docker container is detected.

Code Block
Welcome to Open Network Operating System (ONOS)!
     ____  _  ______  ____
    / __ \/ |/ / __ \/ __/
   / /_/ /    / /_/ /\ \
   \____/_/|_/\____/___/

Documentation: wiki.onosproject.org
Tutorials:     tutorials.onosproject.org
Mailing lists: lists.onosproject.org

Come help out! Find out how at: contribute.onosproject.org

Hit '<tab>' for a list of available commands
and '[cmd] --help' for help on a specific command.
Hit '<ctrl-d>' or type 'logout' to exit ONOS session.

onf@root > devices             </config>
        </optical-channel>
      </component>
      <component>
              <optical-channel xmlns="http://openconfig.net/yang/terminal-device">
          <config>
            <frequency>0</frequency>
            <target-output-power>0.0</target-output-power>
            <line-port>oe1</line-port>
          </config>
        </optical-channel>
      </component>
      <component>
        <optical-channel xmlns="http://openconfig.net/yang/terminal-device">
          <config>
    11:54:09
id=netconf:127.0.0.1:11002, available=true, local-status=connected 4m53s ago, role=MASTER, type=TERMINAL_DEVICE,  <frequency>194700000</frequency>
            <target-output-power>-10.0</target-output-power>
   mfr=EDGECORE, hw=Cassini, sw=OcNOS, serial=, chassis=1, driver=cassini-ocnos, ipaddress=127.0.0.1, locType=none, name=cassini2, port=11002, protocol=NETCONF

2.2 Config Power by using ONOS CLI Command "power-config"

An ONOS command is provided to configure the power of line-side ports.

In ONOS CLI environment, the description for command "power-config" is listed:

Code Block
onf@root > help power-config         <line-port>oe2</line-port>
          </config>
        </optical-channel>
      </component>
      <component>
        <optical-channel xmlns="http://openconfig.net/yang/terminal-device">
          <config>
            <frequency>0</frequency>
            <target-output-power>-10.0</target-output-power>
            <line-port>oe2</line-port>
              </config>
        </optical-channel>
      </component>
      <component>
        <optical-channel xmlns="http://openconfig.net/yang/terminal-device"> 11:56:39
DESCRIPTION
        onos:power-config

   <config>
 Get/Edit the target-output-power for specific optical-channel

SYNTAX
      <frequency>0</frequency>
      onos:power-config [options] operation connection point [value]

ARGUMENTS
        <target-output-power>-10.0</target-output-power>operation
            <line-port>oe3</line-port>
    Netconf Operation including get, edit-config, etc.
  </config>
        </optical-channel>
      </component>
(required)
        <component>connection point
        <optical-channel xmlns="http://openconfig.net/yang/terminal-device">
        {DeviceID}/{PortNumber}
               <config> (required)
        value
    <frequency>0</frequency>
            <target-output-power>-10.0</target-output-power>
power value. Unit: dBm

OPTIONS
         <line-port>oe3</line-port>help
          </config>
      Display  </optical-channel>this help message
      </component>
  -j, --json
         <component>
        <optical-channel xmlns="http://openconfig.net/yang/terminal-device">
Output JSON


This command also supports auto-completion function for each parameter.

Currently, only get and edit-config operations are supported:

Code Block
onf@root > power-config           <config>
            <frequency>194700000</frequency>
                  <target-output-power>-10.0</target-output-power>
            <line-port>oe4</line-port>
          </config>
        </optical-channel>
      </component>
      <component>
        <optical-channel xmlns="http://openconfig.net/yang/terminal-device">
          <config>
            <frequency>194750000</frequency>
            <target-output-power>-10.0</target-output-power>
             <line-port>oe4</line-port>
   11:56:43
get       </config>
      lock  </optical-channel>
      </component>
    unlock  <component>
        <opticalget-channel xmlns="http://openconfig.net/yang/terminal-device">
config      copy-config     <config>
edit-config     kill-session    close-session   <frequency>194700000</frequency>
delete-config

2.2.1 Perform <get> Operation

Through power-config command, you can get the power value of any line-side port of any optical device, for example,

Code Block
onf@root > power-config get netconf:127.0.0.1:11002/216             <target-output-power>-10.0</target-output-power>
            <line-port>oe5</line-port>
          </config>
        </optical-channel>
      </component>
      <component>
        <optical-channel xmlns="http://openconfig.net/yang/terminal-device">
          <config>
            <frequency>194750000</frequency>
            <target-output-power>-10.0</target-output-power>
            <line-port>oe5</line-port>
          </config>
        </optical-channel>
      </component>
11:56:43
The target-output-power value in port 216 on device netconf:127.0.0.1:11002 is -2.


2.2.2 Perform <edit-config> Operation

Through power-config command, you can modify the power value of any line-side port of any optical device, for example,

Code Block
onf@root > power-config edit-config netconf:127.0.0.1:11002/216 -4          <component>
        <optical-channel xmlns="http://openconfig.net/yang/terminal-device">
          <config>
            <frequency>194700000</frequency>
            <target-output-power>-10.0</target-output-power>
            <line-port>oe6</line-port>
          </config>
        </optical-channel>
      </component>
      <component>
    12:04:11
onf@root > power-config  <optical-channel xmlns="http://openconfig.net/yang/terminal-device">
get netconf:127.0.0.1:11002/216           <config>
            <frequency>194750000</frequency>
            <target-output-power>-10.0</target-output-power>
            <line-port>oe6</line-port>
          </config>
        </optical-channel>
      </component>
      <component>
        <optical-channel xmlns="http://openconfig.net/yang/terminal-device">
          <config>
            <frequency>194700000</frequency>
            <target-output-power>-10.0</12:06:01
The target-output-power>
power value in port 216 on device netconf:127.0.0.1:11002 is    <line-port>oe7</line-port>
          </config>
        </optical-channel>
      </component>
      <component>
        <optical-channel xmlns="http://openconfig.net/yang/terminal-device">
          <config>
            <frequency>194750000</frequency>
            <target-output-power>-10.0</target-output-power>
            <line-port>oe7</line-port>
          </config>
        </optical-channel>
      </component>
      <component>
        <optical-channel xmlns="http://openconfig.net/yang/terminal-device">
          <config>
            <frequency>194700000</frequency>
            <target-output-power>-10.0</target-output-power>
            <line-port>oe8</line-port>
          </config>
        </optical-channel>
      </component>
      <component>
        <optical-channel xmlns="http://openconfig.net/yang/terminal-device">
          <config>
            <frequency>194750000</frequency>
            <target-output-power>-10.0</target-output-power>
            <line-port>oe8</line-port>
          </config>
        </optical-channel>
      </component>
    </components>
  </data>
</rpc-reply>

...

-4.

2.3 Config Power on ONOS roadm GUI2 pages

Apart from configuring the power in ONOS CLI, the customer view of roadm application also provides the button to do that.

Firstly, we use command "onos localhost app activate roadm" to activate roadm application. Then, open the roadm page http://localhost:8181/onos/ui/#/roadm-gui:

Image Added

Select one device netconf:127.0.0.1:11002, and click the port icon on the right-top corner, then you can edit the power of its line-side ports on port page http://localhost:8181/onos/ui/#/roadm-gui/roadm-port-gui?devId=netconf:127.0.0.1:11002. The client-side ports couldn't be edited (see port 116).

Image Added

2.3 Config Power on a single device by using Netconf tool like netconf-console

So we use the command listed below to send RPC request to the container:

Code Block
languagepowershell
netconf-console --host=127.0.0.1 --port=11003 -u admin -p admin --rpc={XML_FILE_NAME}

The root node of "openconfig-platform.yang" is "<components>" and its sublist "<component>" contains "<name>" node as its identity. Besides "openconfig-terminal-device.yang" adds node "<optical-channel>" into "<component>" node. "<target-power-config>" is defined as a child node of "<optical-channel>".

2.3.1 Perform <get> Operation

If you want to get the whole components, the content of get-components is:

Code Block
languagexml
linenumberstrue
<?xml version="1.0"?>
<get xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
  <filter xmlns:oc-platform="http://openconfig.net/yang/platform">
    <oc-platform:components/>
  </filter>
</get>


You can take a look at the output of get components here: out-get-components.xml

If you want to get only the "<optical-channel>" of "<component>", the content of get-components-op-channel is:

Code Block
languagexml
linenumberstrue
<?xml version="1.0"?>
<get xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
  <filter>
    <components xmlns="http://openconfig.net/yang/platform">
      <component>
        <optical-channel xmlns="http://openconfig.net/yang/terminal-device">
          <config>
            <line-port>oe1</line-port>/>
            <frequency>194750000</frequency>
          </config>component>
        </optical-channel>
    components>
  </component>filter>
    </components>
  </filter>
</get>
</get>

...

</get>

The output is out-get-components-configop-nodeschannel:

Code Block
languagexml
linenumberstrue
collapsetrue
<nc:rpc<rpc-reply xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:703f18cc-512f-411c-8b8d-f07a87b4797f">
  <data xmlnsxmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:c9220366-76bd-43ba-ad3c-13e1b7014e21">
  <data>
    <components xmlns="http://openconfig.net/yang/platform">
      <component>
        <name>oe1/2</name>
        <optical-channel xmlns="http://openconfig.net/yang/terminal-device">
          <config>
            <frequency>194750000<<frequency>0</frequency>
            <target-output-power>-510.1<0</target-output-power>
            <line-port>oe1</line-port>
          </config>
        </optical-channel>
      </component>
      </components><component>
  </data>
</nc:rpc-reply>

2.1.2 Perform <edit-config> operation

If you want to change the target-output-power value as 0dBm  instead of the default -5.1 dBm  where "<name>" ID is "oe1/2", the content of file is set-target-output-power :

Code Block
languagexml
linenumberstrue
<?xml version="1.0"?>
<edit-config xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
  <target><running/></target>
  <config>
    <components xmlns="http://openconfig.net/yang/platform">
      <component>
        <name>oe1/2</name>      <optical-channel xmlns="http://openconfig.net/yang/terminal-device">
          <config>
            <frequency>0</frequency>
            <target-output-power>0.0</target-output-power>
            <line-port>oe1</line-port>
          </config>
        </optical-channel>
      </component>
      <component>
        <optical-channel xmlns="http://openconfig.net/yang/terminal-device">
          <config>
            <frequency>194700000</frequency>
            <target-output-power>-10.0</target-output-power>
            <line-port>oe2</line-port>
          </config>
        </optical-channel>
      </component>
      <component>
        <optical-channel xmlns="http://openconfig.net/yang/terminal-device">
          <config>
            <target-output-power>0</target-output-power>
          </config><frequency>0</frequency>
        </optical-channel>
      </component>
    </components>
  </config>
</edit-config>

The output is:

Code Block
languagexml
linenumberstrue
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:3b4de76f-74f0-4f06-808d-64320a6c47ed">
  <ok/>
</rpc-reply>

Then we request the "<config>" nodes again to check this operation, where the frequency is 194750000 and the line-port is oe1 using  get-config-nodes:

As you the following output illustrates, the target-output-power is changed from -5.1 to 0.

Code Block
languagexml
linenumberstrue
<nc:rpc-reply xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:ca069e53-020a-4201-a9d3-53f4e5534bec">
  <data xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
    <components xmlns="http://openconfig.net/yang/platform">
      <component>     <target-output-power>-10.0</target-output-power>
            <line-port>oe2</line-port>
          </config>
        </optical-channel>
      </component>
      <component>
        <optical-channel xmlns="http://openconfig.net/yang/terminal-device">
          <config>
            <frequency>0</frequency>
            <target-output-power>-10.0</target-output-power>
            <line-port>oe3</line-port>
          </config>
        <name>oe1/2</name></optical-channel>
      </component>
      <component>
        <optical-channel xmlns="http://openconfig.net/yang/terminal-device">
          <config>
            <frequency>194750000<<frequency>0</frequency>
            <target-output-power>-power>010.0</target-output-power>
            <line-port>oe1<port>oe3</line-port>
          </config>
        </optical-channel>
      </component>
      <component>
       </components>
  </data>
</nc:rpc-reply>

2.2 ONOS startup and node discovery

This section is the environment for section 2.3 and 2.4.

Firstly, an ONOS instance is started via command "bazel run onos-local -- clean". Secondly, the docker container connects to ONOS via command "onos-netcfg localhost device.json". The content of device.json is:

Code Block
{
  "devices" : {
    "netconf:127.0.0.1:11002" : { <optical-channel xmlns="http://openconfig.net/yang/terminal-device">
          <config>
      "basic" : {
    <frequency>194700000</frequency>
    "name":"cassini2",
        "driver":"cassini-ocnos"
 <target-output-power>-10.0</target-output-power>
     },
      "netconf" : { <line-port>oe4</line-port>
        "ip" : "127.0.0.1", </config>
        "port" : "11002",</optical-channel>
        "username" : "root",</component>
        "password" : "root",<component>
        "idle-timeout" : "0"<optical-channel xmlns="http://openconfig.net/yang/terminal-device">
      }
    }<config>
  }
}

Then, we use "onos localhost" to log into ONOS CLI environment and see if the docker container is detected.

Code Block
Welcome to Open Network Operating System (ONOS)!
     ____  _  ______  ____
    / __ \/ |/ / __ \/ __/
   / /_/ /    / /_/ /\ \
   \____/_/|_/\____/___/

Documentation: wiki.onosproject.org
Tutorials:     tutorials.onosproject.org
Mailing lists: lists.onosproject.org

Come help out! Find out how at: contribute.onosproject.org

Hit '<tab>' for a list of available commands
and '[cmd] --help' for help on a specific command.
Hit '<ctrl-d>' or type 'logout' to exit ONOS session.

onf@root > devices            <frequency>194750000</frequency>
            <target-output-power>-10.0</target-output-power>
            <line-port>oe4</line-port>
          </config>
        </optical-channel>
      </component>
      <component>
        <optical-channel xmlns="http://openconfig.net/yang/terminal-device">
          <config>
            <frequency>194700000</frequency>
            <target-output-power>-10.0</target-output-power>
            <line-port>oe5</line-port>
          </config>
        </optical-channel>
      </component>
      <component>
        <optical-channel xmlns="http://openconfig.net/yang/terminal-device">
          <config>
            <frequency>194750000</frequency>
            <target-output-power>-10.0</target-output-power>
            <line-port>oe5</line-port>
          </config>
        </optical-channel>
      </component>
      <component>
       11:54:09
id=netconf:127.0.0.1:11002, available=true, local<optical-status=connected 4m53s ago, role=MASTER, type=TERMINAL_DEVICE, mfr=EDGECORE, hw=Cassini, sw=OcNOS, serial=, chassis=1, driver=cassini-ocnos, ipaddress=127.0.0.1, locType=none, name=cassini2, port=11002, protocol=NETCONF

2.3 Config Power by using ONOS CLI Command "power-config"

An ONOS command is provided to configure the power of line-side ports.

In ONOS CLI environment, the description for command "power-config" is listed:

Code Block
onf@root > help power-config     channel xmlns="http://openconfig.net/yang/terminal-device">
          <config>
            <frequency>194700000</frequency>
            <target-output-power>-10.0</target-output-power>
            <line-port>oe6</line-port>
          </config>
        </optical-channel>
      </component>
      <component>
        <optical-channel xmlns="http://openconfig.net/yang/terminal-device">
          <config>
            <frequency>194750000</frequency>
            <target-output-power>-10.0</target-output-power>
            <line-port>oe6</line-port>
          </config>
        </optical-channel>
      </component>
           11:56:39
DESCRIPTION
<component>
        onos:power-config

    Get/Edit the target-output-power for specific optical-channel

SYNTAX
<optical-channel xmlns="http://openconfig.net/yang/terminal-device">
         onos:power-config [options] operation connection point [value]

ARGUMENTS
 <config>
            operation<frequency>194700000</frequency>
            <target-output-power>-10.0</target-output-power>
    Netconf Operation including get, edit-config, etc.
   <line-port>oe7</line-port>
             (required)</config>
        connection point
 </optical-channel>
      </component>
      <component>
   {DeviceID}/{PortNumber}
     <optical-channel xmlns="http://openconfig.net/yang/terminal-device">
          (required)<config>
        value
    <frequency>194750000</frequency>
            target<target-output-power value. Unit: dBm

OPTIONS
        --help
      power>-10.0</target-output-power>
          Display this help message
 <line-port>oe7</line-port>
         -j, --json </config>
        </optical-channel>
      </component>
  Output JSON

This command also supports auto-completion function for each parameter.

Currently, only get and edit-config operations are supported:

Code Block
onf@root > power-config <component>
        <optical-channel xmlns="http://openconfig.net/yang/terminal-device">
          <config>
            <frequency>194700000</frequency>
            <target-output-power>-10.0</target-output-power>
            <line-port>oe8</line-port>
          </config>
        </optical-channel>
      </component>
      <component>
                  <optical-channel xmlns="http://openconfig.net/yang/terminal-device">
          <config>
            <frequency>194750000</frequency>
                11:56:43
get<target-output-power>-10.0</target-output-power>
             lock<line-port>oe8</line-port>
          </config>
   unlock          get-config</optical-channel>
      copy-config     edit-config     kill-session</component>
    close-session   delete-config

2.3.1 Perform <get> Operation

Through power-config command, you can get the power value of any line-side port of any optical device, for example,

Code Block
onf@root > power-config get netconf:127.0.0.1:11002/216                           </components>
  </data>
</rpc-reply>

If you want to get the "<config>" nodes only where the frequency is 194750000 and the line-port is oe1, the content of get-config-nodes is:

Code Block
languagexml
linenumberstrue
<?xml version="1.0"?>
<get xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
  <filter>
    <components xmlns="http://openconfig.net/yang/platform">
      <component>
        <optical-channel xmlns="http://openconfig.net/yang/terminal-device">
          <config>
            <line-port>oe1</line-port>
            <frequency>194750000</frequency>
          </config>
        </optical-channel>
      </component>
          11:56:43
The target-output-power value in port 216 on device netconf:127.0.0.1:11002 is -2.

2.3.2 Perform <edit-config> Operation

Through power-config command, you can modify the power value of any line-side port of any optical device, for example,

Code Block
onf@root > power-config edit-config netconf:127.0.0.1:11002/216 -4     </components>
  </filter>
</get>
</get>

The output is is out-get-config-nodes:

Code Block
languagexml
linenumberstrue
<nc:rpc-reply xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:703f18cc-512f-411c-8b8d-f07a87b4797f">
  <data xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
    <components xmlns="http://openconfig.net/yang/platform">
      <component>
        <name>oe1/2</name>
        <optical-channel xmlns="http://openconfig.net/yang/terminal-device">
          <config>
            <frequency>194750000</frequency>
            <target-output-power>-5.1</target-output-power>
            <line-port>oe1</line-port>
          </config>
        </optical-channel>
      </component>
    </components>
   12:04:11
onf@root > power-config get netconf:127.0.0.1:11002/216                                 </data>
</nc:rpc-reply>

2.3.2 Perform <edit-config> operation

If you want to change the target-output-power value as 0dBm  instead of the default -5.1 dBm  where "<name>" ID is "oe1/2", the content of file is set-target-output-power :

Code Block
languagexml
linenumberstrue
<?xml version="1.0"?>
<edit-config xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
  <target><running/></target>
  <config>
    <components xmlns="http://openconfig.net/yang/platform">
      <component>
        <name>oe1/2</name>
        <optical-channel xmlns="http://openconfig.net/yang/terminal-device">
          <config>
            <target-output-power>0</target-output-power>
          </config>
        </optical-channel>
      </component>
        12:06:01
The target-output-power value in port 216 on device netconf:127.0.0.1:11002 is -4.

2.4 Config Power on ONOS roadm GUI2 pages

Apart from configuring the power in ONOS CLI, the customer view of roadm application also provides the button to do that.

Firstly, we use command "onos localhost app activate roadm" to activate roadm application. Then, open the roadm page http://localhost:8181/onos/ui/#/roadm-gui:

Image Removed

Select one device netconf:127.0.0.1:11002, and click the port icon on the right-top corner, then you can edit the power of its line-side ports on port page http://localhost:8181/onos/ui/#/roadm-gui/roadm-port-gui?devId=netconf:127.0.0.1:11002. The client-side ports couldn't be edited (see port 116).

...

</components>
  </config>
</edit-config>


The output is:

Code Block
languagexml
linenumberstrue
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:3b4de76f-74f0-4f06-808d-64320a6c47ed">
  <ok/>
</rpc-reply>

Then we request the "<config>" nodes again to check this operation, where the frequency is 194750000 and the line-port is oe1 using  get-config-nodes:

As you the following output illustrates, the target-output-power is changed from -5.1 to 0.