= 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: {{{ #older flash drive boot for Indigo flash_bootcmd=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 #older flash drive boot for Pica8 cfcard_bootcmd=setenv bootargs root=/dev/ram console=ttyS0,$br; ext2load ide 0:1 0x1000000 /uImage;ext2load ide 0:1 0x2000000 /uInitrd2m;ext2load ide 0:1 0x400000 /LB9A.dtb;bootm 1000000 2000000 400000 #NFS boot of OF image from flash drive nfs_bootcmd=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 #Current Pica8 boot from CF card cfcard_bootcmd2=setenv bootargs root=/dev/hda1 rw noinitrd console=ttyS0,$baudrate;ext2load ide 0:1 0x1000000 boot/uImage;ext2load ide 0:1 0x400000 boot/LB9A.dtb;bootm 1000000 - 400000 #Current Indigo boot from CF card bootargs_hda1_of=setenv bootargs root=/dev/hda1 rw console=ttyS0,${br} DEV_ADDR=${ip} ETH0_IP=${ip} GATEWAY=${gip} dpid=${dpid} CONTROLLER=${ofip} CTRL_PORT=${ofp} controller_ip=${ofip} controller_port=${ofp} cfcard_bootcmd3=run bootargs_hda1_of;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: {{{ indigo-unknown# }}} 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): sw.sb9.orbit-lab.org> }}} === Proposed Command Prompts === ==== Syntax ==== {{{ <3-letter switch mode>-.sw..orbit-lab.org> }}} where '<', '>' are used as section delimiters, except for the last one which concludes the command prompt label. Below are examples of the proposed command prompts for switches in different modes: {{{ Pronto 3240, 3290 switches: -------------------------- Pica8 mode: pi8-v1.sw1.sb9.orbit-lab.org> Indigo mode: ind-v1.sw1.sb9.orbit-lab.org> Pica8's OVS mode: ovs-v1.sw1.sb9.orbit-lab.org> NEC switches: ------------ This is the regular mode on top of which it can support a hybrid mode: nec-v1.sw1.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. 1. Establish repository for FTP based loading of OF image, and set up corresponding u-boot configuration.