1 | | = Setting up the Quanta LB4G = |
2 | | Unlike the IP8800, This is a purely !OpenFlow switch, unable to do anything without a controller. The steps can be found documented elsewhere (ref. below), but we repeat the steps just in case things change. |
3 | | |
4 | | == 1. Preparation == |
5 | | === 1.1 References === |
| 1 | [#bottom jump to bottom] [[BR]] |
| 2 | = The Quanta LB9A/u-boot primer = |
| 3 | This page is meant to be a "handbook" of sorts that give you a general picture and a HOW-TO of the various technicalities associated with configuring the Quanta LB9A, a switch that, when set up properly, becomes a "purely !OpenFlow" switch that must be connected to a controller to function as a network device. |
| 4 | |
| 5 | == Index == #index |
| 6 | ...more like quick links. |
| 7 | [#I I Prep work] - some things to keep around and in mind when working with these switches[[BR]] |
| 8 | [#II II LB9A facilities] - the bootloader, firmware and their modes, hardware, and how to get to them[[BR]] |
| 9 | [#III III A u-boot Primer] - using the bootloader to configure and troubleshoot[[BR]] |
| 10 | [#IV IV OpenFlow Switching] - setting up !OpenFlow mode[[BR]] |
| 11 | |
| 12 | == I. Preparations == #I |
| 13 | The following things are good to have on hand. |
| 14 | === 1.1 References === |
13 | | === 1.2 Prerequisites === |
14 | | * OS on PC: Ubuntu |
15 | | * packages on PC: ckermit, xinetd, tftpd-hpa |
16 | | |
17 | | == 2. Installation == |
18 | | === 2.1 Connecting to the switch === |
19 | | A serial connection can be set up between the switch and a machine using a RJ-45 to RS-232 cable. Surprisingly, a Cisco cable will work for this. Connect the RJ-45 end to the port labeled "Con" on the switch, and the other end to the PC. Next, start a session from a shell with kermit as root: |
| 22 | === 1.2 Prerequisites === |
| 23 | * A PC running some *nix with a serial port |
| 24 | * null modem cable |
| 25 | * packages on PC: ckermit, openssh |
| 26 | |
| 27 | == II LB9A facilities == #II |
| 28 | The Quanta switch is basically a Linux box with a bunch of ports. Out of the box, the Quanta comes with two versions of customized Linux, one pre-installed on the on-board flash, and the other, on the removable cf card. The flash and cf card are the two primary forms of memory found on the switch that we really need to care about. One can chose which image to load through u-boot, the second-stage boot loader provided with the switch. In either case, the Linux base for the Quanta is comprised of the kernel image (uImage), the filesystem (uInitrd2m), and device tree (LB9A.dtb). The primary differences between the two images are: |
| 29 | |
| 30 | * The image on the flash underlies a diagnostics test interface |
| 31 | * The image on the cf card underlies !XorPlus, a switching firmware that allows the Quanta to be configured as a regular switch |
| 32 | * The image on th cf card also allows access to a older version of the !OpenFlow interface, along with the system shell |
| 33 | |
| 34 | What follows next is a overview of the two images and u-boot. Note, usage of u-boot is covered in greater detail in [#III section 3]. |
| 35 | |
| 36 | === 2.1 The cf card image === |
| 37 | This is the image loaded by default when the switch is powered on. It can also be loaded from u-boot with the command `run cfcard_bootcmd`. |
| 38 | |
| 39 | After a good chunk of it loads, you are given three choices: |
| 40 | {{{ |
| 41 | Please choose which to start: Pica8 XorPlus, OpenFlow, or System shell: |
| 42 | (Will choose default entry if no input in 10 seconds.) |
| 43 | [1] Pica8 XorPlus * default |
| 44 | [2] OpenFlow |
| 45 | [3] System shell |
| 46 | }}} |
| 47 | |
| 48 | As seen in the above "screenshot", XorPlus will be automatically loaded after 10 seconds, giving you the standard switch CLI. !XorPlus is a full-fledged switch configuration interface; Documentation for using XorPlus can be downloaded from the [http://www.pica8.org/documents/user-guide Pica8 website]. |
| 49 | |
| 50 | The second choice, "!OpenFlow", gives you an outdated version of the Indigo interface, the "pure OpenFlow" switch firmware. The interface is essentially a standard Linux shell, plus !OpenFlow facilities such as `of-bcm-cli`. |
| 51 | |
| 52 | The last choice, "System shell", lets you access the base system using the ash shell. This last mode is useful if you need to access the cf card contents (e.g. to try different versions of firmware without erasing stuff/dealing with flashing the switch). |
| 53 | |
| 54 | |
| 55 | === 2.2 The flash image === |
| 56 | This image can be loaded form the u-boot prompt with the command `run flash_bootcmd`. As far as I can tell, the sole purpose of this image is to provide a diagnostics test facility. The following prompt shows up after the standard boot-up procedures: |
| 57 | |
| 58 | {{{ |
| 59 | Diagnostic Test Main Menu v1.3 (LB9A - Linux) |
| 60 | |
| 61 | [1 ] File Management |
| 62 | [2 ] Board Information |
| 63 | [3 ] Diagnostic Test |
| 64 | [4 ] Manufacturing Test Mode Set |
| 65 | [5 ] Test Error Log File Management |
| 66 | [6 ] PING |
| 67 | [7 ] Reset |
| 68 | [8 ] For Vibration Test |
| 69 | |
| 70 | Enter your choice: |
| 71 | |
| 72 | }}} |
| 73 | There isn't much I can tell you about this interface, except that option [1 ] doesn't do anything, [7 ] reboots the switch, and [8 ] might be unsafe to do on a hard, inclined surface^1^. |
| 74 | |
| 75 | === 2.3 u-boot === |
| 76 | u-boot is the second-stage boot loader that comes with the switch. It has enough smarts to allow you to flash the switch and inspect/configure various boot options, and in the case of !OpenFlow, set parameters that the switch will use to connect to the controller. |
| 77 | |
| 78 | To enter the u-boot prompt, you have to interrupt the boot process when you see the u-boot banner.The easiest way to do this is to have a serial connection to the switch so you can see it boot. This can be set up using a RJ-45 to RS-232 cable. A Cisco cable will also work for this. Connect the RJ-45 end to the port labeled "Con" on a switch, and the other end to the PC. Next, start a session from a shell with kermit as root: |
| 87 | Then power on/reboot the switch. If you see the U-Boot banner, you can stop the boot process by hitting any key. This should lead you to the '=>' u-boot prompt: |
| 88 | |
| 89 | {{{ |
| 90 | U-Boot 1.3.0 (Sep 9 2010 - 16:00:13) |
| 91 | |
| 92 | CPU: 8541, Version: 1.1, (0x80720011) |
| 93 | Core: E500, Version: 2.0, (0x80200020) |
| 94 | Clock Configuration: |
| 95 | CPU: 825 MHz, CCB: 330 MHz, |
| 96 | |
| 97 | ... |
| 98 | |
| 99 | Net: TSEC0, TSEC1 |
| 100 | IDE: Bus 0: OK |
| 101 | Device 0: Model: CF Card Firm: Ver2.35 Ser#: 14EF0707040600187736 |
| 102 | Type: Hard Disk |
| 103 | Capacity: 1923.9 MB = 1.8 GB (3940272 x 512) |
| 104 | Hit any key to stop autoboot: 0 |
| 105 | => |
| 106 | }}} |
| 107 | |
| 108 | u-boot is configured by creating and modifying environment variables. These can be anything from a single variable to a multi-line script of many variables, parameters, and flags. Several commands that are good to know for working with u-boot are: |
| 109 | |
| 110 | * `?` - list available commands |
| 111 | * `help` - get more information about a command |
| 112 | * `printenv` - list current environment variables |
| 113 | * `setenv` - make changes to / create new environment variables |
| 114 | * `saveenv` - save changes to environment variables |
| 115 | * `copy` - use tftp to copy files to flash |
| 116 | * `imls` - list images in flash |
| 117 | * `flinfo` - print flash memory contents |
| 118 | |
| 119 | This list is by no means exhaustive, even with respect to the commands that we mention throughout this page. Which brings us to the next section, the u-boot primer. |
| 120 | |
| 121 | == III A u-boot Primer == #III |
| 122 | This section is a HOW-TO for using u-boot with respect to the Quanta, e.g. variables, scripts, and memory maps unique to this switch. !OpenFlow related u-boot stuff can be found in the [#IV next section]. |
| 123 | |
| 124 | === 3.1 Environment variables === |
| 125 | As mentioned in the last section, u-boot is configured through environment variables. The command `printenv` lets you see all of them: |
| 126 | |
| 127 | {{{ |
| 128 | => printenv |
| 129 | flash_bootcmd=setenv bootargs root=/dev/ram console=ttyS0,$baudrate; bootm ffd00000 ff000000 ffee0000 |
| 130 | cfcard_bootcmd=setenv bootargs root=/dev/ram console=ttyS0,$baudrate; ext2load ide 0:1 0x1000000 /uImage;ext2load ide 0:1 0x2000000 /uInitrd2m;ext2load ide 0:1 0x400000 /LB9A.dtb;bootm 1000000 2000000 400000 |
| 131 | bootdelay=5 |
| 132 | baudrate=115200 |
| 133 | loads_echo=1 |
| 134 | ipaddr=192.168.2.1 |
| 135 | serverip=192.168.2.12 |
| 136 | rootpath=/nfsroot |
| 137 | gatewayip=192.168.2.254 |
| 138 | netmask=255.255.255.0 |
| 139 | hostname=LB9A_X |
| 140 | bootfile=eldk-quanta |
| 141 | loadaddr=4000000 |
| 142 | ethact=TSEC0 |
| 143 | bootcmd=run cfcard_bootcmd |
| 144 | ethaddr=60:eb:69:21:5b:e3 |
| 145 | eth1addr=60:eb:69:21:5b:e4 |
| 146 | stdin=serial |
| 147 | stdout=serial |
| 148 | stderr=serial |
| 149 | |
| 150 | Environment size: 644/8188 bytes |
| 151 | |
| 152 | }}} |
| 153 | Each entry is a line of the form [variable name]=[parameters]. the parameters can be a combination of u-boot commands and other variables in a way similar to a simple shell script. |
| 154 | |
| 155 | For example, note the first two entries in the "screen shot" above: |
| 156 | {{{ |
| 157 | <entry 1> flash_bootcmd=setenv bootargs root=/dev/ram console=ttyS0,$baudrate; bootm ffd00000 ff000000 ffee0000 |
| 158 | <entry 2> cfcard_bootcmd=setenv bootargs root=/dev/ram console=ttyS0,$baudrate; ext2load ide 0:1 0x1000000 /uImage;ext2load ide 0:1 0x2000000/uInitrd2m;ext2load ide 0:1 0x400000 /LB9A.dtb;bootm 1000000 2000000 400000 |
| 159 | }}} |
| 160 | they were part of the `run` commands mentioned earlier. The parameters to these variables create another variable called "bootargs" using command `setenv`. What follows are the parameters for this new variable: |
| 161 | * `root=/dev/ram` - probably specifies where the root filesystem should be loaded^2^ |
| 162 | * `console=ttyS0` - set console |
| 163 | * `$baudrate` - use the parameters specified in the variable "baudrate" |
| 164 | The parameters that follow the semicolon after `$baudrate` differ a bit for the two variables. For the cfcard entry the `ext2load` cammands specifies where to fetch the kernel, ramdisk, and device tree files from, and finally issues the command `bootm` to load the image. |
| 165 | |
| 166 | |
| 167 | == IV OpenFlow Switching == #IV |
| 168 | == 4.1 Installation == |
| 169 | === 4.1.1 Connecting to the switch === |
| 170 | A serial connection can be set up between the switch and a machine using a RJ-45 to RS-232 cable. Surprisingly, a Cisco cable will work for this. Connect the RJ-45 end to the port labeled "Con" on the switch, and the other end to the PC. Next, start a session from a shell with kermit as root: |
| 171 | |
| 172 | {{{ |
| 173 | kermit -l /dev/ttyS0 |
| 174 | set carrier-watch off |
| 175 | set baud 115200 |
| 176 | connect |
| 177 | }}} |
| 178 | |