Changes between Version 20 and Version 21 of Internal/OpenFlow/QuantaSetup


Ignore:
Timestamp:
Dec 21, 2013, 3:03:41 AM (11 years ago)
Author:
akoshibe
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Internal/OpenFlow/QuantaSetup

    v20 v21  
    3030The 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:
    3131
    32  * The image on the flash underlies a diagnostics test interface
    33  * The image on the cf card underlies !XorPlus, a switching firmware that allows the Quanta to be configured as a regular switch
    34  * The image on th cf card also allows access to a older version of the !OpenFlow interface, along with the system shell
    35 
    36 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]. 
    37 
    38 === 2.1 The cf card image ===
     32 * The image on flash contains a diagnostics test interface
     33 * The image on the cf card lets you access 3 main things:
     34  1. !XorPlus, a switching firmware that allows the Quanta to be configured as a regular switch
     35  1. an older version of the !OpenFlow interface, and
     36  1. a system shell
     37
     38What follows next is a quick primer for u-boot and an overview of the two images. Note, usage of u-boot is covered in greater detail in [#III section 3]. 
     39
     40=== 2.1 u-boot === #uboot
     41u-boot is the second-stage boot loader for the switch firmware. 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.   
     42
     43To 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:
     44
     45{{{
     46kermit -l /dev/ttyS0
     47set carrier-watch off
     48set baud 115200
     49connect
     50}}}
     51
     52Then 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:
     53
     54{{{
     55U-Boot 1.3.0 (Sep  9 2010 - 16:00:13)
     56
     57CPU:   8541, Version: 1.1, (0x80720011)
     58Core:  E500, Version: 2.0, (0x80200020)
     59Clock Configuration:
     60       CPU: 825 MHz, CCB: 330 MHz,
     61
     62...
     63
     64Net:   TSEC0, TSEC1
     65IDE:   Bus 0: OK
     66  Device 0: Model: CF Card Firm: Ver2.35 Ser#: 14EF0707040600187736
     67            Type: Hard Disk
     68            Capacity: 1923.9 MB = 1.8 GB (3940272 x 512)
     69Hit any key to stop autoboot:  0
     70=>
     71}}}
     72
     73u-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:
     74
     75 * `?` - list available commands
     76 * `help` - get more information about a command
     77 * `printenv` - list current environment variables
     78 * `setenv` - make changes to / create new environment variables
     79 * `saveenv` - save changes to environment variables
     80 * `copy` - use tftp to copy files to flash
     81 * `imls` - list images in flash
     82 * `flinfo` - print flash memory contents 
     83
     84 [#III Section 3]  will go into more detail.
     85
     86The next two sections quickly describe the two images found on a fresh switch.
     87
     88=== 2.2 The cf card image ===
    3989This 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`.
    4090
    41 After a good chunk of it loads, you are given three choices:
     91If you let the switch boot without intervention, you are presented with three choices:
    4292{{{
    4393    Please choose which to start: Pica8 XorPlus, OpenFlow, or System shell:
     
    52102The 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`. 
    53103
    54 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 to test out a new image, or to check configuration scripts for !XorPlus or !OpenFlow.
    55 
    56 === 2.2 The flash image ===
    57 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: 
     104The last choice, "System shell", lets you access the base system using the `ash` shell, and is regular Linux as far as anyone cares. This last mode is useful if you need to access the cf card to test out a new image, or to check configuration scripts for !XorPlus or !OpenFlow.
     105
     106Any of these options can be chosen by entering a number and hitting <Enter> when the above list pops up.
     107
     108=== 2.3 The flash image ===
     109This 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. The following prompt shows up after the standard boot-up procedures: 
    58110
    59111{{{
     
    73125}}}
    74126There 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^.
    75 
    76 === 2.3 u-boot === #uboot
    77 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.   
    78 
    79 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:
    80 
    81 {{{
    82 kermit -l /dev/ttyS0
    83 set carrier-watch off
    84 set baud 115200
    85 connect
    86 }}}
    87 
    88 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:
    89 
    90 {{{
    91 U-Boot 1.3.0 (Sep  9 2010 - 16:00:13)
    92 
    93 CPU:   8541, Version: 1.1, (0x80720011)
    94 Core:  E500, Version: 2.0, (0x80200020)
    95 Clock Configuration:
    96        CPU: 825 MHz, CCB: 330 MHz,
    97 
    98 ...
    99 
    100 Net:   TSEC0, TSEC1
    101 IDE:   Bus 0: OK
    102   Device 0: Model: CF Card Firm: Ver2.35 Ser#: 14EF0707040600187736
    103             Type: Hard Disk
    104             Capacity: 1923.9 MB = 1.8 GB (3940272 x 512)
    105 Hit any key to stop autoboot:  0
    106 =>
    107 }}}
    108 
    109 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:
    110 
    111  * `?` - list available commands
    112  * `help` - get more information about a command
    113  * `printenv` - list current environment variables
    114  * `setenv` - make changes to / create new environment variables
    115  * `saveenv` - save changes to environment variables
    116  * `copy` - use tftp to copy files to flash
    117  * `imls` - list images in flash
    118  * `flinfo` - print flash memory contents 
    119 
    120 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. 
    121127
    122128== III A u-boot Primer == #III
     
    152158
    153159}}}
    154 The output above is from a fresh Quanta out of the box. 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. 
     160The output above is from a fresh switch out of the box. 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. 
    155161
    156162The general syntax for these variables can be summarized as follows: