Changes between Version 2 and Version 3 of Internal/OpenFlow/QuickStart


Ignore:
Timestamp:
Jul 26, 2010, 8:44:02 PM (14 years ago)
Author:
akoshibe
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Internal/OpenFlow/QuickStart

    v2 v3  
    11= The IP8800 Packet Switch =
    2 The IP8800/S3640 is a smart switch built by NEC capable of running firmware compliant with !OpenFlow networking. WINLAB utilizes IP8800 switches in its experimental network infrastructure. This is a quick-start guide (hopefully) suitable for anyone trying to learn how to deploy the NEC IP8800 on the network. The !OpenFlow aspect of the switch will not be discussed here in too much detail as it involves a whole different set of network configurations.
    3 
    4 ''' References ''' [[BR]]
    5 The full IP8800 operations manual can be found online. Then why am I taking my time to make this handbook? For one, the online manual is in Japanese. Even if you are literate in Japanese, the manual is quite extensive. So, to sum things up -- the purpose of this guide is to provide a quick reference so that no-body has to dig through the handbook to find out, say, how to safely shut the switch down. But, for those of you who want to check out the whole shebang, here are the links:
    6 
    7  * Vol. 1: http://www.nec.co.jp/ip88n/s36_sw/html/cfguide/index.html     
    8  * Vol. 2: http://www.nec.co.jp/ip88n/s36_sw/html/cfguide2/index.html   
    9  * Vol. 3: http://www.nec.co.jp/ip88n/s36_sw/html/cfguide3/index.html     
    10 
    11 The switches may also come with 2 CDs containing the English translated version of the manual.
    12 
    13 '''Before we begin...'''[[BR]]
    14 Here are the assumptions that are made in this handbook:
    15  * You are using the NEC IP8800/S3640-48T2XW switch. Commands vary even amongst similar lines of devices.
    16  * You are familiar with, and running some form of *nix on your PC (We are, for the most part, using Ubuntu unless specified)
    17  * You have a serial port on your machine, and have either minicom or kermit installed on your machine.
    18 
    19 '''Conventions'''[[BR]]
    20 Text in `console font` and in quotations are commands that can be entered at the command line. When in quotations, the quotes should be omitted.
    21 
    22 Each section outlined in the index starts with a short overview, followed by step-by-step instructions (if applicable), and ends with troubleshooting error messages that are associated with each.
    23  
    24 [[BR]]
    25 
    26 ----
     2The IP8800/S3640 is a smart switch built by NEC capable of running firmware compliant with !OpenFlow networking. WINLAB utilizes IP8800 switches in its experimental network infrastructure. This is a quick-start guide (hopefully) suitable for anyone trying to learn how to deploy the NEC IP8800 on the network as an !OpenFlow device.
     3
    274== Index == #index
     5 [#preamble Before we begin...] [[BR]]
    286 [#I I Introduction] [[BR]]
    297  [#Serial 1.1 Connection via serial] [[BR]]
     
    5432   
    5533----
     34== Before we begin... == #preamble
     35
     36A few things before moving onto business. Firstly, Here are the assumptions that are made in this handbook:
     37 * You are using the NEC IP8800/S3640-48T2XW switch. Commands vary even amongst similar lines of devices.
     38 * You are familiar with, and running some form of *nix on your PC (We are, for the most part, using Ubuntu unless specified)
     39 * You have a serial port on your machine, and have either minicom or kermit installed on your machine.
     40
     41''' References ''' [[BR]]
     42The full IP8800 operations manual can be found online. Then why am I taking my time to make this handbook? For one, the online manual is in Japanese. Even if you are literate in Japanese, the manual is quite extensive, and doesn't cover the !OpenFlow side of things. So, to sum things up -- the purpose of this guide is to provide quick reference to the switches' basic functionalities so that no-body has to dig through the handbook to find out, say, how to safely shut the switch down. But, for those of you who want to check out the whole shebang, here are the links:
     43
     44 * Vol. 1: http://www.nec.co.jp/ip88n/s36_sw/html/cfguide/index.html     
     45 * Vol. 2: http://www.nec.co.jp/ip88n/s36_sw/html/cfguide2/index.html   
     46 * Vol. 3: http://www.nec.co.jp/ip88n/s36_sw/html/cfguide3/index.html     
     47
     48The switches may also come with 2 CDs containing the English translated version of the manual. The !OpenFlow manual comes with the firmware. 
     49
     50'''Conventions'''[[BR]]
     51Text in `console font` and in quotations are commands that can be entered at the command line. When in quotations, the quotes should be omitted. Words surrounded by carets are various options for a command. If delimited by pipes (|), one out of the several commands separated by pipes can be entered in that spot. For example:
     52{{{
     53interface gigabitethernet <src port> <tx|rx|both>
     54}}}
     55Here, <src port> is a value between 0/1 and 0/48, and can be followed by keyword `tx`, `rx`, or `both`.
     56
     57Each section outlined in the index starts with a short overview, followed by step-by-step instructions (if applicable), and ends with troubleshooting error messages that are associated with each.
     58 
     59[[BR]][[BR]]
     60----
     61
    5662= I Introduction = #I
    5763Many "Smart" switches, including the IP8800 series switches, must be configured using the Command-line-interface(CLI). This usually involves a serial, telnet, or ssh session through a terminal. This chapter explains how to connect to the switch via serial, and covers some basic commands and operational tasks to get started with these switches. 
     
    728734= IV !OpenFlow Switching = #IV
    729735This section goes over the !OpenFlow aspects of the switch. 
     736[[BR]]
     737
    730738== 4.1 What is !OpenFlow? == #intro
    731739!OpenFlow is a virtualization technology developed by Stanford. Ideally, it allows administrators and researchers to configure the switch's behavior freely, without constraints of TCP/IP or the native firmware. This is achieved by removing traffic switching decisions off of the switch and onto an external, highly configurable controller. More on !OpenFlow can be found at http://www.openflowswitch.org. 
    732740
    733 The switch supports !OpenFlow in the form of virtual switches, or "datapaths" that overlay VLAN configurations; Each separate VLAN residing on the same device can be instantiated as a virtual switch that can be controlled by separate controllers and/or scripts, or be kept as a traditional VLAN that does commodity switching.       
    734 
     741The switch supports !OpenFlow in the form of virtual switches, or "datapaths" that overlay VLAN configurations; Each separate VLAN residing on the same device can be instantiated as a virtual switch that can be controlled by separate controllers and/or scripts, or be kept as a traditional VLAN that does commodity switching.   
     742
     743[[BR]]
     744[#index return to main index]     
     745[[BR]]
     746[[BR]]
    735747== 4.2 Outline == #outline
    736748In order to make the switch !OpenFlow capable, you need to flash the switch with an SD card containing specialized firmware. The rough outline of the steps are the following:
     
    743755 1. configure virtual switches 
    744756
    745 Since it is easier to describe using examples, this process will be described using the steps involved in configuring [http://orbit-lab.org/wiki/Internal/OpenFlow/OrbitSwitches/sw-sb-combined sw-sb-01], one of the aggregate Sand Box switches currently running in !OpenFlow mode.
    746 
     757Since it'd be easier to describe what's going on, this process will be using the configurations for [http://orbit-lab.org/wiki/Internal/OpenFlow/OrbitSwitches/sw-sb-combined sw-sb-01] as an example. You should take a bit of time to graze over the configs for the switch before going on.   
     758[[BR]]
     759[[BR]]
    747760== 4.3 Configuring the switch == #ofconf
    748 This section corresponds to steps 1 and 2 in the Outline. Because virtual switches are based on VLANs, all port and VLAn configs should be done before flashing. This part of the setup is just normal configuration using `vlan`, `interface vlan`, and `interface gigabitethernet` contexts.
     761This section corresponds to steps 1 and 2 in the Outline.
     762
     763'''''1. Disable Spanning Tree (STP)'''''. STP compromises both !OpenFlow and ORBIT nodehandler/nodeagent functionalities, so both STP and Per-VLAN Spanning Tree (PVST) must be shut down using the `spanning-tree` context from the (config)# prompt.
     764{{{
     765spanning-tree disable
     766no spanning-tree vlan 1,3,11-14,19-26
     767}}}
     768The first line disables STP. The second line disables PVST for each VLAN used.
     769[[BR]][[BR]]
     770'''''2. configure VLANs and ports, telnet'''''. Because virtual switches are based on VLANs, all port and VLAN configs should be done before flashing. This part of the setup is just normal configuration using `vlan`, `interface vlan`, and `interface gigabitethernet` contexts.
     771
     772[[BR]]
     773[#index return to main index] 
     774[[BR]]
     775[[BR]]
     776== 4.4 Preparing the SD card == #sdprep
     777When flashing, the switch is booted off of an SD card containing the firmware, license, and a configuration file. Each switch should have come with an SD card; if not (or if the SD card is shoddy), it's ok to use another 128MB card. Anything larger may be affected by a known bug that causes filesystem corruption (see 'errors' section below ). 
    749778 
    750 == 4.4 Preparing the SD card == #sdprep
    751 licenses, image file, openflow.conf
    752 == 4.5 OpenFLow Commands == #ofcom
    753 instantiating vswitches/datapaths                                                                                 
     779This section is comprised of steps 3 and 4. Technically, it's better explained as three steps:
     780
     781'''''1. Copy license to SD card'''''. The switch will refuse to boot from an SD card without the proper license file. Each license file should be named after a particular switch's serial ID, which can be found on a silver stcker on the lower righthand corner on the front of the device, or through the `show ver` command:
     782{{{
     783> sh ver                                                                     
     784Date 2010/07/26 15:42:50 UTC                                                           
     785Model: AX3640S-48T2XW                                                                 
     786S/W: OS-L3L Ver. 11.1.C                                                               
     787H/W: Main board                                                                       
     788       AX-3640-48T2XWE-L [WA13CL48T2XVS400E05A005:80330300:307:1B514-1B512]           
     789     Module slot1 PS-M(AC)                                                             
     790       AX-F2430-PSA01 [WA0PSA010000C110005A005]                                       
     791     Module slot2 FAN-M                                                               
     792       AX-F2430-FAN01 [WA2FAN010000C140005A005]                                       
     793}}}   
     794The string in square brackets right underneath "H/W: Main board" is the full serial number of the switch.
     795
     796In this case, the proper license for this switch would be named 'WA13CL48T2XVS400E05A005.dat'. This should be renamed to 'license.dat' before being saved to the card.   
     797
     798'''''2. Copy firmware image file to card'''''. The firmware is named 'k.img'. This doesn't need to be renamed.
     799
     800'''''3. Create openflow.conf'''''. Create a new file named 'openflow.conf' and save it to the card.   
     801
     802With the three files saved, the card is ready for use.
     803[[BR]]
     804== 4.5 Flashing the switch == #flash
     805The switch has an SD slot next to the serial port. Slap the card in and reboot the switch with a `reload` as user admin. 
     806{{{
     807sw-sb09-da# reload
     808Dump information extracted? (y/n): y
     809old dump file(rmdump  07/21 21:16) delete OK? (y/n): y
     810}}}
     811If connected by serial, you should be able to see the following startup sequence, which should take about 2 minutes:
     812{{{
     813sw-sb09-da#
     814ROM 00.03.52
     815.......................................................................................
     816
     817BOOT 00.03.00
     818Loading from dev2 100%
     819
     820
     821login:
     822}}}
     823
     824'Loading from dev2' indicates that the switch has successfully found, and is booting off of, the firmware on the SD card.
     825
     826=== errors ===
     827If you forget the license, or use the wrong one (e.g. one whose name doesn't match the serial ID of the switch), The switch will restart in the ROM prompt.
     828
     829The switch may also boot with the default image if the image on the SD card is corrupt. This is usually indicated by the message "Loading from dev0" and not recognizing [#ofcom OpenFlow specific commands].
     830
     831The worst case scenario is a corrupted SD card. This may be caused by various reasons, including buggy firmware, improper restart, or using a card over 128MB. Symptoms include:
     832
     833 * the device not starting up/loading the default image
     834 * scrambled/truncated filenames (e.g. 'openflow.conf' showing up as 'openf~l.con')
     835 * inability to create virtual switches
     836
     837The most surefire way to fix this is to reformat the SD card. The easiest way to do it is to use a Windows machine. When the card shows up under "Devices", right click and go to 'Format'. A window saying "Format Secure Digital Storage Device" should pop up. Set "Allocation Unit size" to "default allocation size", and click 'Start'. You may need to confirm that you want to reformat the card. The card should be good to go in about a minute or so.
     838
     839[[BR]]
     840[#index return to main index]     
     841[[BR]]
     842[[BR]]
     843
     844== 4.6 OpenFLow Commands == #ofcom
     845=== Index === #ofindex
     846these are the sub-sections to this section:
     847 [#ofback 4.6.1. Background] [[BR]]
     848 [#setv 4.6.2. Virtual switch instantiation] [[BR]]
     849 [#delvsi 4.6.3. Virtual switch deletion] [[BR]]
     850 [#ctvsi 4.6.4. Manipulating virtual switches] [[BR]]
     851 [#ofmon 4.6.5. Monitoring OpenFlow stats] [[BR]]
     852 [#others 4.6.6. other commands] [[BR]]
     853
     854The !OpenFlow capable firmware supports a suite of commands that can be used to configure !OpenFlow datapaths. These commands are located in /usr/local/bin/; try greping (is that a word?) for "vsi", or "port" for a list of commands.
     855
     856Once the switch is booted up, we can move to the final step of actually instantiating virtual switches using these commands.
     857
     858[[BR]]
     859=== 4.6.2. Virtual switch instantiation === #setv
     860
     861'''setvsi''' [[BR]]
     862
     863sw-sb-01's data VLAns are all !OpenFlow virtual switches instantiated using the command `setvsi`. `setvsi` takes on the following minimal syntax:
     864{{{
     865setvsi <VLAN ID> <ports> tcp <IP addr:port> dpid <datapath ID>
     866}}} 
     867
     868 * <VLAN ID> - the VLAN ID of the VLAn you want to overlay a virtual switch onto
     869 * <ports> - the ports, without the '0/', that are going to be part of the virtual switch
     870 * <IP addr:port> - IP address of the !OpenFlow controller you want the virtual switch to listen to, and port number (default is 6633)
     871 * <datapath ID> - 12-digit hex value defining the MAC address for the virtual switch. Always begins with '0x'
     872
     873a full synopsis can be found by typing "setvsi" at the CLI.
     874
     875setvsi basically echos the whole command into openflow.conf. This is handy since you can follow the exact commands used to instantiate the virtual switches on a particular switch by simply doing a `cat /mnt/openflow.conf`.
     876
     877'''implementation''' [[BR]]
     878Here's sw-sb-01's conf file:
     879{{{
     880sw-sb-01> cat /mnt/openflow.conf
     881setvsi 12 31,32,48.12 tcp 172.16.0.4:6633 dpid 0x001010123132
     882setvsi 14 33,34,48.14 tcp 172.16.0.4:6633 dpid 0x001010143134
     883setvsi 20 35,36,48.20 tcp 172.16.0.4:6633 dpid 0x001010203230
     884setvsi 22 37,38,48.22 tcp 172.16.0.4:6633 dpid 0x001010223232
     885setvsi 24 39,40,48.24 tcp 172.16.0.4:6633 dpid 0x001010243234
     886setvsi 26 41,42,48.26 tcp 172.16.0.4:6633 dpid 0x001010263236
     887}}}
     888
     889Each line is the exact command that was typed at the prompt. As you can see, sw-sb-01 has 6 virtual switches overlaying VLANs 12,14,20,22,24,and 26. All of them are pointed towards IP address 172.16.0.4, the ORBIT !OpenFlow controller. 
     890
     891'''ORBIT DPID conventions''' [[BR]] 
     892There are a few home-brew conventions that are used for the dpid's:
     893 * first 3 bytes are always '001010'
     894 * the 4th byte is the VLAN ID, in decimal
     895 * the last two bytes are the VLAN ID in ascii hex notation. ASCII maps decimal 0-9 to hex 30-39. 
     896
     897So, for example, if we have VLAN 12, the last 3 bytes will be '12', '31', and '32'. That's the dpid from the first setvsi line in the terminal output above.
     898
     899'''trunk ports''' [[BR]]
     900If you look at the list of ports from the conf file above, you'll notice that all of them end with "48.n", n being the VLAN ID for the virtual switch being instantiated. This value lets the switch know which VLAN ID to tag the traffic to/from a particular datapath with on a particular trunk port. For example, "48.12" means "tag virtual switch 12's traffic with VLAN ID 12 on trunk port 0/48." This is needed if you are using trunking the switch.
     901
     902[[BR]]
     903[#ofindex return to section index] [[BR]]
     904[#index return to main index]
     905[[BR]]
     906=== 4.6.3. Virtual switch deletion === #delvsi
     907`deletevsi` deletes a certain virtual switch instantiation. The syntax is as follows:
     908{{{
     909deletevsi <VLAN ID>
     910}}}
     911
     912nice and simple.
     913
     914[[BR]]
     915=== 4.6.4. Manipulating virtual switches === #ctvsi
     916You don't want to have to keep deleting and redoing virtual switches just to add or remove ports from an instantiation.
     917 * `addport <VLAN ID> <port>` - add ports to virtual switch for VLAN of <VLAN ID>
     918 * `deleteport <VLAN ID> <port>` - delete ports from virtual switch for VLAN of <VLAN ID>
     919
     920Nor do you want to keep setvsi-ing them because you didn't want a virtual switch one moment, and then you wanted it the next.
     921 * `disablevsi <VLAN ID>` - temporarily disable the virtual switch. As far as the switch is concerned, it's not there when it's disabled.
     922 * `enablevsi <VLAN ID>` - enable a disabled virtual switch.
     923
     924[[BR]]
     925[#ofindex return to section index] [[BR]]
     926[#index return to main index]
     927[[BR]]
     928=== 4.6.5. Monitoring !OpenFlow stats === #ofmon
     929There are a few commands to pull stats about flows, virtual switches, ect.
     930 * `showswitch <VLAN ID|cr> <detail|cr>` - displays virtual switch information. VLAN ID and "detail" are optional parameters.
     931 * `showflow <VLAN ID|cr> <detail|cr>` - display current flows. Same deal with parameters.
     932 * `showofinfo` - display all !OpenFlow and system (akin to doing a dmesg and sysctl -a back-to-back) stats
     933
     934'''example''' [[BR]]
     935Displaying all datapaths:
     936{{{
     937sw-sb-01> showswitch
     938vlan    ports                                           secure channel     
     939----    -----                                           --------------     
     94012      31, 32, 48.12                                   connected           
     94114      33, 34, 48.14                                   connected           
     94220      35, 36, 48.20                                   connected           
     94322      37, 38, 48.22                                   connected           
     94424      39, 40, 48.24                                   connected           
     94526      41, 42, 48.26                                   connected           
     946}}}
     947Here you can see that all of the virtual switches are registered ("connected") with the controller.
     948Now, if you want to focus on one virtual switch, say VLAN 12:
     949{{{
     950sw-sb-01> showswitch 12 detail
     951Virtual switch 12
     952  Datapath ID  : 68989104434(0x1010123132)
     953  Datapath name: sw-sb-01
     954  Port         : gigabitethernet 0/31 (link down)                               
     955                 gigabitethernet 0/32 (link down)                               
     956                 gigabitethernet 0/48.12 (link up, 1G full)                     
     957  Conn mode    : tcp             
     958  Controller   : 172.16.0.4:6633 (connected)
     959  Exact match  : 01-24, 49-50 hw 0 / hw max 3046
     960                 25-48        hw 0 / hw max 3046
     961  Exact match  : sw 0 / sw max 131072
     962  Wildcard     : sw 1 / sw max 100
     963  Emerg        : sw 0 / sw max 100
     964  Packet buff  : 256 packets / 4294967295 MB                                           
     965  Miss sendlen : 128 bytes                                                             
     966  Wcard mode   : S/W only                                                             
     967  Counter type : Packet Counter                                                       
     968  MAC learning : On                                                                   
     969  Min EQ       : 0   
     970  Max EQ       : 7                                                                     
     971  Default EQ   : 4                                                                     
     972  VSI Enable   : yes                                                     
     973}}}   
     974
     975=== 4.6.6. other commands === #others
     976I really haven't used the other commands e.g, for queue manipulation, so I can't really describe them. But here's the list of what I believe is all the commands for !OpenFlow datapath manipulation:
     977{{{
     978-r-xr-xr-x  1 root  wheel   221139 Jun  9 05:20 addport                               
     979-r-xr-xr-x  1 root  wheel   211566 Jun  9 05:20 deleteflow                             
     980-r-xr-xr-x  1 root  wheel   221162 Jun  9 05:20 deleteport                             
     981-r-xr-xr-x  1 root  wheel   202225 Jun  9 05:20 deletevsi                             
     982-r-xr-xr-x  1 root  wheel   202579 Jun  9 05:20 disablevsi                             
     983-r-xr-xr-x  1 root  wheel   202513 Jun  9 05:20 enablevsi                             
     984-r-xr-xr-x  1 root  wheel   521925 Jun  9 05:20 max-queue-rate                         
     985-r-xr-xr-x  1 root  wheel      436 Jun  9 05:20 ofconf_mng.sh                         
     986-r-xr-xr-x  1 root  wheel   202688 Jun  9 05:20 settrace                               
     987-r-xr-xr-x  1 root  wheel   231122 Jun  9 05:20 setvsi                                 
     988-r-xr-xr-x  1 root  wheel   229570 Jun  9 05:20 showflow                               
     989-r-xr-xr-x  1 root  wheel     2146 Jun  9 05:20 showofinfo                             
     990-r-xr-xr-x  1 root  wheel   232831 Jun  9 05:20 showswitch                 
     991}}}
     992
     993
     994[[BR]]
     995[#ofindex return to section index] [[BR]]
     996[#index return to main index]
     997
     998
     999