wiki:Software/eAM/qNetwork

Network Aggregate Manager

ORBIT provides OMF based "Aggregate Manager" for configuration of networking devices in the testbed (Network AM). The HTTP based service can be accessed by an experimenter from within the SB9, including from the console and all of the nodes, at the following address:

http://nox.orbit-lab.rutgers.edu:5052/network
Or simply as:
http://nox:5052/network

That base URL renders an XML response detailing all requests implemented by the service. Parameter values, such as to address a particular port (port #) on a particular switch (switch IP address), can be passed as URL arguments in the HTTP request. For example, to retrieve the details of particular port (say 5) on the SB9 switch (IP=10.19.0.253), the requested URL is:

http://nox:5052/network/portStat?switch=10.19.0.253&port=5

The service supports the following main features for the native mode (refer to XML response from the base URL for complete list and API specification):

  1. Getting/setting the VLAN ID on any port(s)
  2. Assigning two or more VLAN IDs on a port, making it a trunk
  3. Getting per port statistics (in, out packet counts) and configuration (VLAN) information
  4. Enabling/disabling a port
  5. Turning on/off default switch topology protocols - Spanning Tree Protocol (STP)
  6. Saving the per-port configuration of the entire switch
  7. Restoring switch configuration to prior saved version

In addition, it supports the following requests to support the OpenFlow mode:

  1. Change the mode of the switch from native to OpenFlow mode (and vice versa)
  2. Set the OpenFlow mode parameters including: control port, controller IP, switch ID (dpid), and the transport mode for secure channel

Pronto 3240 Management

Pronto switches can be configured for of following modes:

  • XorPlus
  • Production Indigo OpenFlow image (i.e. internal flash image)
  • User define OpenFlow image (i.e. NFS booted image)

To be able to switch between these modes you have to be logged in conosole.sb9.

Examples

Force switch into XorPlus mode (i.e. out of OpenFlow mode)

wget http://nox.orbit-lab.org:5052/network/deleteOpenFlow?switch=10.19.0.253

Force switch into OpenFlow mode with controller at node1-1.sb9.orbit-lab.org

wget http://nox.orbit-lab.org:5052/network/addOpenFlow?switch=10.19.0.253\&ofip=10.19.1.1\&ofp=6633
\&dpid=0x001010162001

ofp and dpid are optional (if omitted will be configured with the default set).

Force switch into OpenFlow NFS mode To configure switch in OpenFlow NFS mode, bootmode parameter has to be specified. Additional 3 parameters can be specified, nfsip, roottpath and bootfile. These parameters are optional, if omitted will be configured whit initially set parameters (for sb9 operation NSF server is provided on the console so the experimenter should place the image file names uInitrd2m into /tftpboot directory before issiong this command)

wget http://nox.orbit-lab.org:5022/network/addOpenFlow?switch=10.19.0.253\&ofip=10.19.1.1\&ofp=6633
\&dpid=0x001010162001\&bootmode=nfs\&nfsip=10.19.0.10\&roothpath='\/config'\&bootfile=uInitrd2m

Pronto 3290 Management

Note: This space is currently being used to plan for the next version of the switching service that can provide management support for accessing a richer set of operational modes being made available on the current and future switches.

SB9 switch u-boot config:

#Flash boot - Diagnostics
--------------------------
flash_bootcmd=setenv bootargs root=/dev/ram console=ttyS0,$baudrate; bootm ffd00000 ff000000 ffee0000


#NFS boot of OF image from flash drive
--------------------------------------
boot_nfs=nfs ff000000 $nfsip:$rootpath/$bootfile; setenv bootargs root=/dev/ram console=ttyS0,$br DEV_ADDR=$ip ETH0_IP=$ip GATEWAY=$gip  dpid=$dpid CONTROLLER=$ofip CTRL_PORT=$ofp rw; bootm ffd00000 ff000000 ffee0000

#Pica8 boot from CF card
------------------------
boot_pica8=setenv bootargs root=/dev/hda1 rw noinitrd console=ttyS0,$baudrate hostname=pi8.${hostname}; ext2load ide 0:1 0x1000000 boot/uImage;ext2load ide 0:1 0x400000 boot/LB9A.dtb;bootm 1000000 - 400000

#Indigo boot from CF card
-------------------------
#bootargs
bootargs_indigo=setenv bootargs root=/dev/hda1 rw console=ttyS0,${br} CMDLINE_VARS_OVERRIDE=1 hostname=ind.${hostname} DEV_ADDR=${ip} ETH0_IP=${ip} GATEWAY=${gip} datapath_id=${dpid} controller_ip=${ofip} controller_port=${ofp}

#bootcmd
boot_indigo=run bootargs_indigo; ext2load ide 0:1 0x1000000 /boot/uImage;ext2load ide 0:1 0x2000000 /boot/uInitrd2m;ext2load ide 0:1 0x400000 /boot/LB9A.dtb;bootm 1000000 2000000 400000


Current Command Prompts

Indigo:

ind.sw.sb9.orbit-lab.org#

ind.sw.sb9.orbit-lab.org# cat /etc/indigo-version 
2012.03.19-iods: User mode. Stanford-LB9A.
 

Pica8:

    Please choose which to start: Pica8 XorPlus, OpenFlow, or System shell:
        (Will choose default entry if no input in 10 seconds.)
        [1]  Pica8 XorPlus   * default
        [2]  Open vSwitch
        [3]  System shell
        [4]  Boot menu editor
Enter your choice (1,2,3,4):


pi8.sw.sb9.orbit-lab.org> 

pi8.sw.sb9.orbit-lab.org> configure
Entering configuration mode.
There are no other users in configuration mode.
[edit]
pi8.sw.sb9.orbit-lab.org# run show version
Pica8  XorPlus  1.4
Copyright (C) 2009, 2010, 2011, 2012 Pica8, Inc.
Base ethernet MAC Address   : 60:EB:69:20:E3:11
Hardware model              : Pronto 3290
Revision ID                 : 8089


Proposed Command Prompts

Syntax
<3-character switch mode>.sw[<switch id>].<sandbox or grid>.orbit-lab.org>

where '<', '>' are used as section delimiters, except for the last one which concludes the command prompt label. switch id is optional and is dropped if the domain has only one switch.

Below are examples of the proposed command prompts for switches in different modes:

Pronto 3240, 3290 switches:
--------------------------

Pica8 mode:
pi8.sw.sb9.orbit-lab.org>

Indigo mode:
ind.sw.sb9.orbit-lab.org#

Pica8's OVS mode:
ovs.sw.sb9.orbit-lab.org>

NEC switches:
------------
This is the regular mode on top of which it can support a hybrid mode:
nec.swX.grid.orbit-lab.org>

Current Network AM Functions

<services>
  <serviceGroup name='network' prefix='/network'>
    <info>Service to tabulate statistics and data flow for switches.</info>
    <service name='addOpenFlow'>
      <info>Start OpenFlow switch. vlanId is mandatory, other parameters omit for edit vlan</info>
      <args>
        <arg isRequired='true' name='port' value='conPort'>
          <info>TCP port number of the controller.</info>
        </arg>
        <arg isRequired='false' name='dpid' value='[dpid]'>
          <info>OpenFlow switch id (12 hex digits).</info>
        </arg>
        <arg isRequired='true' name='ip' value='ip'>
          <info>IP address of the controller.</info>
        </arg>
        <arg isRequired='false' name='listofports' value='[listOfPorts]'>
          <info>Port numbers belongs to OpenFlow vlan. Use for NEC switch.</info>
        </arg>
        <arg isRequired='false' name='vlanid' value='[vlanId]'>
          <info>vlan id for OpenFlow switch. Use for NEC switch.</info>
        </arg>
        <arg isRequired='true' name='switch' value='switch'>
          <info>IP Address or Hostname of switch.</info>
        </arg>
        <arg isRequired='false' name='mode' value='[conMode]'>
          <info>Transport protocol of secure channel. Use for NEC switch.</info>
        </arg>
      </args>
    </service>
    <service name='addvlan'>
      <info>This service allows to add VLAN of a given switch. Swich has to be defined as trunk</info>
      <args>
        <arg isRequired='true' name='port' value='port'>
          <info>Port number.</info>
        </arg>
        <arg isRequired='true' name='vlan' value='vlan'>
          <info>New VLAN ID or array of VLAN IDs.</info>
        </arg>
        <arg isRequired='true' name='switch' value='switch'>
          <info>IP Address or Hostname of switch.</info>
        </arg>
      </args>
    </service>
    <service name='configure'>
      <info>This service configures switch with default parameters (only Pronto switch has this feature).</info>
      <args>
        <arg isRequired='true' name='switch' value='switch'>
          <info>IP Address or Hostname of switch.</info>
        </arg>
      </args>
    </service>
    <service name='deleteOpenFlow'>
      <info>This service changes mode for switch (only Pronto switch has this feature).</info>
      <args>
        <arg isRequired='true' name='switch' value='switch'>
          <info>IP Address or Hostname of switch.</info>
        </arg>
      </args>
    </service>
    <service name='delvlan'>
      <info>This service allows to add VLAN of a given switch. Swich has to be defined as trunk</info>
      <args>
        <arg isRequired='true' name='port' value='port'>
          <info>Port number.</info>
        </arg>
        <arg isRequired='true' name='vlan' value='vlan'>
          <info>New VLAN ID or array of VLAN IDs.</info>
        </arg>
        <arg isRequired='true' name='switch' value='switch'>
          <info>IP Address or Hostname of switch.</info>
        </arg>
      </args>
    </service>
    <service name='disablePort'>
      <info>This service enables or disables the interface.</info>
      <args>
        <arg isRequired='true' name='port' value='port'>
          <info>Port number.</info>
        </arg>
        <arg isRequired='true' name='switch' value='switch'>
          <info>IP Address or Hostname of switch.</info>
        </arg>
        <arg isRequired='true' name='disable' value='disable'>
          <info>true disables , false enables port.</info>
        </arg>
      </args>
    </service>
    <service name='getmode'>
      <info>Shows switch mode - implemented only for Pronto switch.</info>
      <args>
        <arg isRequired='true' name='switch' value='switch'>
          <info>IP Address or Hostname of switch to query.</info>
        </arg>
      </args>
    </service>
    <service name='getvlan'>
      <info>This service gets interface vlan configuration.</info>
      <args>
        <arg isRequired='true' name='port' value='port'>
          <info>Port number (interface) to view vlan configuration</info>
        </arg>
        <arg isRequired='true' name='switch' value='switch'>
          <info>IP Address or Hostname of switch to query.</info>
        </arg>
      </args>
    </service>
    <service name='getvsi'>
      <info>Start OpenFlow switch.</info>
      <args>
        <arg isRequired='true' name='vlanid' value='vlanId'>
          <info>vlan id for OpenFlow switch.</info>
        </arg>
        <arg isRequired='true' name='switch' value='switch'>
          <info>IP Address or Hostname of switch.</info>
        </arg>
      </args>
    </service>
    <service name='listConfigurations'>
      <info>This service stores switch configuration to database.</info>
    </service>
    <service name='reset'>
      <info>This service restore default configuration from specified file.</info>
      <args>
        <arg isRequired='true' name='switch' value='switch'>
          <info>IP Address or Hostname of switch.</info>
        </arg>
      </args>
    </service>
    <service name='restore'>
      <info>This service restore configuration from database to given switch.</info>
      <args>
        <arg isRequired='true' name='switch' value='switch'>
          <info>IP Address or Hostname of switch.</info>
        </arg>
        <arg isRequired='true' name='name' value='name'>
          <info>Name of configuration.</info>
        </arg>
      </args>
    </service>
    <service name='rstp'>
      <info>This service enables or disables the Spanning Tree Protocol.</info>
      <args>
        <arg isRequired='true' name='vlan' value='vlan'>
          <info>VLAN.</info>
        </arg>
        <arg isRequired='true' name='switch' value='switch'>
          <info>IP Address or Hostname of switch.</info>
        </arg>
        <arg isRequired='true' name='enable' value='enable'>
          <info>true enables, false disables Spanning Tree Protocol.</info>
        </arg>
      </args>
    </service>
    <service name='setvlan'>
      <info>This service allows remote VLAN configuration of a given switch.</info>
      <args>
        <arg isRequired='true' name='port' value='port'>
          <info>Port number.</info>
        </arg>
        <arg isRequired='true' name='vlan' value='vlan'>
          <info>New VLAN ID or array of VLAN IDs.</info>
        </arg>
        <arg isRequired='false' name='native' value='[native]'>
          <info>Native VLAN ID</info>
        </arg>
        <arg isRequired='true' name='switch' value='switch'>
          <info>IP Address or Hostname of switch.</info>
        </arg>
        <arg isRequired='false' name='mode' value='[mode]'>
          <info>acces or trunk</info>
        </arg>
      </args>
    </service>
    <service name='showConfiguration'>
      <info>This service gets switch configuration to database.</info>
      <args>
        <arg isRequired='true' name='name' value='name'>
          <info>Name of configuration.</info>
        </arg>
      </args>
    </service>
    <service name='status'>
      <info>This service outputs Port data based on IP Address or Hostname.</info>
      <args>
        <arg isRequired='true' name='port' value='port'>
          <info>Port to view statistics on (use 0 for all ports)</info>
        </arg>
        <arg isRequired='true' name='switch' value='switch'>
          <info>IP Address or Hostname of switch to query.</info>
        </arg>
      </args>
    </service>
    <service name='statusOLD'>
      <info>This service outputs Port data based on IP Address or Hostname.</info>
      <args>
        <arg isRequired='true' name='port' value='port'>
          <info>Port to view status on</info>
        </arg>
        <arg isRequired='true' name='switch' value='switch'>
          <info>IP Address or Hostname of switch to query.</info>
        </arg>
      </args>
    </service>
    <service name='store'>
      <info>This service stores switch configuration to database.</info>
      <args>
        <arg isRequired='true' name='switch' value='switch'>
          <info>IP Address or Hostname of switch.</info>
        </arg>
        <arg isRequired='true' name='name' value='name'>
          <info>Name of configuration.</info>
        </arg>
      </args>
    </service>
  </serviceGroup>
</services>

TODO to fix web service (and OF setup) for SB9 data switch

  1. Web service (Network AM) should recognize the command prompts for Pica8 and Indigo (OF) modes
  2. In Indigo mode, there is a race condition between the ofprotocol service starting and the find-env script being able to pull all boot params - I think. Consequently, the ofprotocol service that talks to the controller is running blind. The reason I think it's a race condn. is since we see those boot params set when we print env vars, but the ofprotocol svc hasn't picket them up. The current fix is to restart ofprotocol with alternate script that sources the env params. So, we either fix the race condition, or we instruct the web service to execute the workaround.
    • Update: Found the below note in the script that sets up env vars from boot params. The solution then is to set another boot param! However, this still doesn't fix the problem. The env set up script parses /proc/1/environ if the override is set, but the params are not being passed from the kernel to the init process in the first place.
      # Need to get the global environment from process with PID 1       
      # By default, Linux command line variables are no longer used as they
      # can override behavior configured in flash.  Set CMDLINE_VARS_OVERRIDE
      # on the command line to push those variables into the environment.
      
      
    • Fix(ed): The /etc/sv/ofprotocol/run start script was modified to parse/source /proc/cmdline. The modified ramfs script was made persistent using ovladd/ovlsave.
  3. Establish repository for FTP based loading of OF image, and set up corresponding u-boot configuration.
Last modified 23 months ago Last modified on 01/24/16 18:56:02