= Switch Control Service = [[PageOutline(2-100,Contents)]] 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) 1. Assigning two or more VLAN IDs on a port, making it a trunk 1. Getting per port statistics (in, out packet counts) and configuration (VLAN) information 1. Enabling/disabling a port 1. Turning on/off default switch topology protocols - Spanning Tree Protocol (STP) 1. Saving the per-port configuration of the entire switch 1. 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) 1. 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 (Work In Progress) == '''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[]..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 === {{{ Service to tabulate statistics and data flow for switches. Start OpenFlow switch. vlanId is mandatory, other parameters omit for edit vlan TCP port number of the controller. OpenFlow switch id (12 hex digits). IP address of the controller. Port numbers belongs to OpenFlow vlan. Use for NEC switch. vlan id for OpenFlow switch. Use for NEC switch. IP Address or Hostname of switch. Transport protocol of secure channel. Use for NEC switch. This service allows to add VLAN of a given switch. Swich has to be defined as trunk Port number. New VLAN ID or array of VLAN IDs. IP Address or Hostname of switch. This service configures switch with default parameters (only Pronto switch has this feature). IP Address or Hostname of switch. This service changes mode for switch (only Pronto switch has this feature). IP Address or Hostname of switch. This service allows to add VLAN of a given switch. Swich has to be defined as trunk Port number. New VLAN ID or array of VLAN IDs. IP Address or Hostname of switch. This service enables or disables the interface. Port number. IP Address or Hostname of switch. true disables , false enables port. Shows switch mode - implemented only for Pronto switch. IP Address or Hostname of switch to query. This service gets interface vlan configuration. Port number (interface) to view vlan configuration IP Address or Hostname of switch to query. Start OpenFlow switch. vlan id for OpenFlow switch. IP Address or Hostname of switch. This service stores switch configuration to database. This service restore default configuration from specified file. IP Address or Hostname of switch. This service restore configuration from database to given switch. IP Address or Hostname of switch. Name of configuration. This service enables or disables the Spanning Tree Protocol. VLAN. IP Address or Hostname of switch. true enables, false disables Spanning Tree Protocol. This service allows remote VLAN configuration of a given switch. Port number. New VLAN ID or array of VLAN IDs. Native VLAN ID IP Address or Hostname of switch. acces or trunk This service gets switch configuration to database. Name of configuration. This service outputs Port data based on IP Address or Hostname. Port to view statistics on (use 0 for all ports) IP Address or Hostname of switch to query. This service outputs Port data based on IP Address or Hostname. Port to view status on IP Address or Hostname of switch to query. This service stores switch configuration to database. IP Address or Hostname of switch. Name of configuration. }}} === 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 1. 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. 1. Establish repository for FTP based loading of OF image, and set up corresponding u-boot configuration.