Quanta Lb4g Config

8
Console This switch has an Ethernet console interface and for this reason, you will need some sort of Ethernet/serial cable to interact with the switch. Serial console cable RJ-45 to nine-pin(RS-232) female port. The RJ-45 plugs into the female RJ-45 consol port on the switch. The RS-232 connects directly to a standard PC type serial port. settings * speed: 115200 * data bits: 8 * stop bits: 1 * parity bits: 0 * flow control: none (or xon/xoff) Connecting to the Console 1. Use a serial to ethernet cable (i.e. serial on one end and RJ45 on the other) 2. Connect the RJ45 cable to the port on the Quanta switch which says "Con" 3. From the terminal, connect to the terminal at a baud rate of 115200: screen /dev/ttyS0 115200 NB. If the output is garbled, restart your system with the serial console cable plugged. Firmware The Inidgo OpenFlow switching software package has to be installed to make this switch OpenFlow 1.0 compatible. Installing firmware This operation includes installing the U-Boot, Kernel, and Ram Disk images. For ease of configuration, you may want a host system which is able to access the public Internet and also the switch. This system is necessary to install the images and configure the switch. The U-Boot image is needed to load the Kernel and thus, if has not been installed, you will have to install it manually. To know if the U-Boot has been installed, when the switch is booting, you will see some of the following lines: U-Boot 1.1.6 CPU 8541 Core E500 Hit any key to stop autoboot: 5 If you are not able to see this lines, you can reboot the switch by pressing the reset button "7".

description

Quanta Lb4g Config

Transcript of Quanta Lb4g Config

Page 1: Quanta Lb4g Config

Console

This switch has an Ethernet console interface and for this reason, you will need some sort of Ethernet/serial cable to interact with the switch.Serial console cable

RJ-45 to nine-pin(RS-232) female port. The RJ-45 plugs into the female RJ-45 consol port on the switch. The RS-232 connects directly to a standard PC type serial port.settings

* speed: 115200 * data bits: 8 * stop bits: 1 * parity bits: 0 * flow control: none (or xon/xoff)

Connecting to the Console

1. Use a serial to ethernet cable (i.e. serial on one end and RJ45 on the other)

2. Connect the RJ45 cable to the port on the Quanta switch which says "Con"

3. From the terminal, connect to the terminal at a baud rate of 115200:

screen /dev/ttyS0 115200

NB. If the output is garbled, restart your system with the serial console cable plugged.Firmware

The Inidgo OpenFlow switching software package has to be installed to make this switch OpenFlow 1.0 compatible.Installing firmware

This operation includes installing the U-Boot, Kernel, and Ram Disk images.

For ease of configuration, you may want a host system which is able to access the public Internet and also the switch. This system is necessaryto install the images and configure the switch.

The U-Boot image is needed to load the Kernel and thus, if has not been installed, you will have to install it manually. To know if the U-Boot has been installed, when the switch is booting, you will see some of thefollowing lines:

U-Boot 1.1.6CPU 8541Core E500

Hit any key to stop autoboot: 5

If you are not able to see this lines, you can reboot the switch by pressing the reset button "7".

Page 2: Quanta Lb4g Config

In out setup, the U-Boot image was already installed and so we interrupted the autoboot process and went ahead to loading the Kernel and Ramdisk. In particular, we did the following:

1. Setup a tftp server. To do this, we:

* a. installed the tftpd-hpa package * b. ensured xinetd was installed * c. created the file /etc/xinetd.d/tftp with the following contents:

service tftp

{

protocol = udp port = 69 socket_type = dgram bind = 192.168.2.2 wait = yes user = root server = /usr/sbin/in.tftpd server_args = -c -v -v -vvvv -s /tftpboot disable = no

}

* d. Restarted xinet.d

/etc/init.d/xinetd restart

PS. Since your tftp server had IP address 192.168.2.2/24, we gave this address to eth0 on our linux box.

2.

vi /etc/network/interfaces'''

auto loiface lo inet loopbackauto eth0iface eth0 inet staticaddress 192.168.2.2netmask 255.255.255.0

3.

/etc/init.d/networking restart

4. Connect an Ethernet cable (from your linux box which is connected to the console) to the Quanta switch on the port labeled ETH1 which residesnear the "Con" port.

5. Place the files uImage, uInitrd2m, and U-boot.bin in the /tftpboot folder (create this folder if it does not exist).

6. Upload the Linux Kernel and Ram Disk images

copy -k tftp://<server ip>/uImagecopy -k tftp://192.168.2.2/uimage

Page 3: Quanta Lb4g Config

copy -r tftp://<server ip>/uInitrd2m

PS. To updage a new U-Boot.bin

copy -b tftp://192.168.2.2/u-boot.bin

To update device tree=> copy -d tftp://192.168.2.2/LB9A.dtb

7. Type "boot" to restart the switch to the command prompt.

The link below provides detailed information on this process:

http://www.openflowswitch.org/wk/index.php/LB4GImageSetupBringing up the LB4G switch

1. After logging to the $ prompt, copy your system configuration files to the /sfs directory

cp /etc/system*.* /sfs

2.Rename the two files copied (these config. files will be loaded by default from the rc.sh script):

mv system_config.default system_config

mv system_init.default system_init

3. Configure system_init: At the beginning of this bash script, set the management IP address, gateway, and netmasK. Below is an example:

ETH0_IP=a.b.c.d; GATEWAY=e.f.g.h; NETMASK=i.j.k.l;

NB. ETH0 and ETH1 from the script correspond to physical ports ETH1 and ETH2 on the switch.

4. Configure system_config: At the beginning of this script, set the OpenFlow controller's IP address and port number. Below is an example:

CONTROLLER=a.b.c.d; CTRL_PORT=abcd;

NB. You can also go ahead and specify a datapath id (Datapath here meansthe swith. So you're simply specifying an id for the OpenFlow switch)

dpid=12abcd123abc;

NB. This should be a 12 digit hex number

5. After these configurations, save your changes and reboot the switch:

/sbin/sfs_create

/sbin/reboot

6. On startup, your switch will continually attempt to connect to the controller. Details of these attempts can be viewed in the log file

Page 4: Quanta Lb4g Config

"/ctrl.log or /cli.log." These are the log files which you will be your guide. Furthermore, if the switch is not able to contact a controller, it will default to a "fail-open" mode where it functions are a regular switch.

IMPORTANT The Quanta switch has been so configured to separate the dataplane and control plane. For this reason, you will use either ETH1 or ETH2 on the switch's front panel to connect to your controller. This requires setting the proper network block (Management IP address, Mask etc.) for the whichever port you decide to use. As a side note, PORT 1 on can be used to connect to the controller. However, this requires configuring tap0 on the switch (has not been tested by Stanford).Notes and Issues:

1. The Quanta switch is currently designed to support 1 (yes, thats ONE)OpenFlow instance. Therefore, unlike the HPs and NECs where you can create several instances and have each point to its own controller, the Quanta supports only 1 such instance. In particular, Stanford envisions this instance directed at FlowVisor and then FlowVisor will slice/redirect flows to the respective controllers.

2. When you boot the switch (as is), all configurations will be lost. Toavoid this, copy all system files to /sfs. Modify these files within /sfs and save changes by:

/sbin/sfs_create

To set and save the root password, boot the switch, change the password using "passwd", and then copy etc/passwd and etc/shadow to /sfs. Then modify system_init to copy these from /sfs to /etc.

if test -e /sfs/shadow; then

echo "Found shadow password file in sfs" cp /sfs/shadow /etc/shadow

fi

NB. Always run "sfs_create" before rebooting the switch to avoid the loss of your precious configurations.

3. When you ssh in, the normal login is not processed so your path is not set (which prevents commands from being executed). You can fix this by typing

export PATH=/sbin:/bin

OR

add an rc script in /root. Again, you will have to first store this rc script in /sfs and add a line in system_init which copies this rc scriptback to /VLAN issues:

1. The following statement has been quoted from the indigo release document:

"The switch has only been tested in an untagged environment, although it should pass through tags transparently to the controller andshould support matching and rewriting of VLAN tags. You can create a

Page 5: Quanta Lb4g Config

VLAN for the purposes of being untagged by using the CLI discussed... [below]."

The details below have been copied and pasted from the indigo release document (A link is provided at the end of this document):

Note that there are two CLIs involved here: The Linux command line with the prompt ~ $ and the OpenFlow/Broadcom? CLI with the prompt OF-BCM.0>.Below, CLI refers the the OpenFlow/Broadcom? CLI.

If the above initialization sequence is used (the one detailed below thetopic Firmware), the CLI will not be available for interactive use (AND YOU WILL WANT INTERACTIVE USE TO CONFIGURE VLANS). If the system is configured manually (for example, by setting no_sysconf=1 in extra_boot_args) then the CLI may be accessed to provide limited controland monitoring of the switch. Here is a sample sequence:

* System brought to ~ $ prompt with no_sysconf=1 set.

* Connected via serial port or by ssh (user: root, default password is OpenFlow). You'll need two windows (serial or ssh).

* Edit /etc/rc.soc to comment out the call to ofd + You can create anew rc.soc in your sfs system; the default system_config will overwrite the existing one on boot.

* In one window, execute /sbin/of-bcm-cli. + See below for using theCLI + Run the OpenFlow datapath in the background:

OF-BCM.0> setenv portlist 1,2,3,4,5,6,7 OF-BCM.0> bg "ofd --interfaces=$portlist ptcp:"

+ Use ? for help in the of-bcm shell.

* In another window a the Linux prompt, start the ofprotocol executable to connect the datapath and controller:

~ $ ofprotocol tcp:127.0.0.1 tcp:172.16.12.12:6634

* You can use /sbin/dpctl to examine the status of ofdatapath as normal

Highlights of the CLI:

* Use ? for help

* There are two physical devices controlled independently. Use 0: and 1: to switch between them. Creating a VLAN on one, for example, willnot create the VLAN on the second. The "current" device is indicated in the prompt.

* Ports are referred to as ge0, ge1, ... on each switch device. The OpenFlow port numbers map ge0 -> 1, ge1 ->2, etc., for the first device and ge0 -> 25, ge1 -> 26, etc., for the second device.

* The command 'show' will give a variety of MIB counters for ports.

* The command 'ofdatapath' takes the same arguments as the user-datapath executable of the same name in the OpenFlow reference software release.

Page 6: Quanta Lb4g Config

* The shell command language is similar to csh and provides various control structures and environment features

* Only a limited number of switch control features are available to control ports and VLANs

6. A list of useful commands (including powering off/restarting the switch) are provided in the /sbin directory.Experiences interacting with the CLI

1. To interact with the OpenFlow/Broadcom? CLI do the following:

/sbin/of-bcm-cli

which will provide the new command prompt

OF-BCM.0>

The last 0 corresponds to device 0. To change to device 1, do the following:

OF-BCM.0>1:

2. From the OC-BCM command prompt you can control and monitor the switch(including cool things such as vlan configuration, port configuration etc.). Typing "help" at the prompt will display the list of commands available.

OF-BCM.0>help

Typing the name of a command along with the "?" will display instructions on how to use this command.

OF-BCM.0>PORT ?

3. A useful command to show the current configuation of your switch ports would be:

OF-BCM.0>PortStat

If there are hosts on your switch ports, you should see a link status of"up," else "down", among other parameters.

4. While in the OF-BCM prompt, you can see see files on the switch (i.e.the same files that would have been visible if you were in the $ prompt). To change back to the $ prompt, do the following:

OF-BCM.0>exit

Experience with VLANS

Only limited port and VLAN control features are available. With this said, when configuring VLANs remember that the Quanta is broken into 2 devices, each containing 24 ports. Device 0 maps ge0 -> 1, ge1 ->2, etc.and Device 1 maps ge0 -> 25, ge1 -> 26, etc. The "0" to the end of "OF-BCM.0>" implies that Device 0 will be configured and "OF-BCM.1>" impliesthat Device 1 will be configured. To switch between devices do:

OF-BCM.0>1:

Page 7: Quanta Lb4g Config

OF-BCM.1>0:

Assume we are configuring device 0.

* To show all VLANs

OF-BCM.0>vlan show

* To create a VLAN with id 2:

OF-BCM.0>vlan create 2

* To destroy a VLAN with id 2:

OF-BCM.0>vlan destroy 2

* To add port ge0 to VLAN 2

OF-BCM.0>vlan add 2 !PortBitMap=ge0'''

* To add ports ge0, ge1, and ge2 to VLAN 2

OF-BCM.0>vlan add 2 !PortBitMap=ge0-ge2

* To remove port ge0 from VLAN 2

OF-BCM.0>vlan remove 2 !PortBitMap=ge0

Licensing

* The Linux kernel code for the LB4G is based on version 2.6.15 and is released under GPLv2.

* The Linux kernel code for the Broadcom reference designs is based on version 2.6.25 and is released under GPLv2.

* U-Boot is based on version 1.1.6 and is released under the GPLv2. It is available at http://www.denx.de/wiki/U-Boot. Patches from Quanta have been applied and are available from Stanford.

* Busybox is version 1.4.2 and is released under the GPLv2. It is available at http://busybox.net/downloads/.

* Dropbear is version 0.52; see the accompanying file in licenses/dropbear for additional information.

* The OpenFlow code is covered by the OpenFlow license detailed at http://www.openflowswitch.org/wp/legal/. It is available at http://www.openflowswitch.org/.

* The linux-bcm-core.ko file is released as a binary-only file underthe OpenFlow license (see above).

* The of-bcm-cli code is released as a binary-only file under the OpenFlow license (see above). This CLI itself is copyright Broadcom.

Access control

You can ssh to this switch using the network information provided from

Page 8: Quanta Lb4g Config

the following ticket: http://groups.geni.net/syseng/ticket/845Additional info

* To obtain the firmware, you must first request an account from DanTalayco [email protected]. He will provide you the nesessary essentials to obtain the firmware. However, I have attached the two firmware versions used thus far. * Indigo Release notes: http://www.openflowswitch.org/wk/index.php/IndigoReleaseNotes. * Indigo Image setup: http://www.openflowswitch.org/wk/index.php/IndigoImageSetup