Changes between Version 1 and Version 2 of Internal/OpenFlow/ofTopology


Ignore:
Timestamp:
Nov 7, 2011, 5:51:48 PM (13 years ago)
Author:
akoshibe
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Internal/OpenFlow/ofTopology

    v1 v2  
    9797
    9898== 1.2 Linux Bridge == #brctl
     99In terms of implementation, this is probably the simplest method.
     100
    99101A bridge will ignore VLAN tags, so if you have two VLAN interfaces e.g. eth0.111 and 222 sitting on a trunk, the packets will come in tagged. An intermediate abstraction will strip the tag from the packet (at br0), and the packet will get tagged as appropriate on the outbound. Unlike kernel IP forwrding, bridging works purely at Layer 2, hence you do not need to worry about IP addressing.
    100102
     
    116118
    117119== II !OpenFlow Methods == #of
     120This section assumes that you have all of the !OpenFLow components (e.g. OVS, NetFPGA drivers) set up and working, and that you have several choices of controller. The controller used primarily in this section is the Big Switch Networks (BSN) controller. 
    118121== 2.1 !OpenvSwitch == #OVS
     122!OpenvSwitch (OVS) is a user-space software defined switch with !OpenFlow support, complete with its own implementation of a controller. It can, and is assumed to be, built as a kernel module throughout this page.
     123=== 2.1.1 Initialization ===
     124OVS has three main components that must be initialized:
     125 * openvswitch_mod.ko, the OVS kernel module
     126 * ovsdb, the database containing configurations
     127 * ovs-vswitchd, the OVS switch daemon
     128The latter configures itself using the data provided by the former; `ovs-vsctl` is used to modify the contents of the database in order to configure the OVS switch.
     129
     130 1. Load openVswitch kernel module
     131{{{
     132 cd datapath/linux/
     133 insmod openvswitch_mod.ko
     134}}}
     135Note, OVS and Linux bridging may not be used at the same time. This step will fail if the bridge module (bridge.ko) is loaded. You may need to reboot the node in order to unload bridge.ko.   
     136 2. Start ovs-db:
     137{{{
     138 ovsdb/ovsdb-server --remote=punix:/usr/local/var/run/openvswitch/db.sock \
     139        --remote=db:Open_vSwitch,manager_options \
     140        --pidfile --detach
     141}}}
     142 3. Initialize the database:
     143{{{
     144 utilities/ovs-vsctl --no-wait init
     145}}}
     146the `--no-wait` allows the database to be initialized before ovs-vswitchd is invoked.
     147 4. Start ovs-vswitchd:
     148{{{
     149 vswitchd/ovs-vswitchd unix:/usr/local/var/run/openvswitch/db.sock --pidfile --detach
     150}}}
     151The 'unix:...db.sock' specifies that the process attach to the socket opened by `ovsdb`. 
     152=== 2.1.2 Configuring OVS ===
     153the following only needs to be done once, in the initial configurations.
     1541. Add ports:
     155{{{
     156 ovs-vsctl add-br br0
     157 ovs-vsctl add-port br0 eth0.111
     158 ovs-vsctl add-port br0 eth0.222
     159}}}
     160By the time the 'add-port' commands are used, you should not be able to ping across the two VLANS, even with correct route table entries and packet forwarding enabled in the kernel. Here, br0 is a virtual interface similar to tap0 in the bridge. There should be one virtual interface per virtual switch to be instantiated. By default, ports added to the switch are trunked. Using the option tag=VLAN ID makes the interfaces behave as access ports for the VLAN ID specified:
     161{{{
     162 ovs-vsctl add-port br0 eth0.111 tag=111
     163 ovs-vsctl add-port br0 eth0.222 tag=222
     164}}}
     165However, this is unrelated to what needs to happen here so we will not explore its uses any further (for now). [[BR]][[BR]]
     1662. If it has not been done already, initialize the !OpenFlow controller. The procedures for this step differ according to the controller in use, and are discussed in the pages for each respective controller. [[BR]]
     167A sanity check for this step is to test your virtual switch with the OVS built-in controller, `ovs-controller`, which may be initialized on the same node running OVS:
     168{{{
     169ovs-controller -v ptcp:6633
     170}}}   
     171When ovs-controller is used, the controller IP is, unsurprisingly, 127.0.0.1.
     1723. Point ovs-vswitchd to the !OpenFlow controller.
     173{{{
     174 ovs-vsctl set-controller br0 tcp:172.16.0.14:6633
     175}}}
     176In this example, the OVS process is pointed to a BSN controller (kvm-big) on 172.16.0.14, listening on port 6633^1^. `ovs-vsctl` will spit out a bunch of messages as it attempts to connect to the controller:
     177{{{
     178 ##screencap here
     179}}}
     180Given that you have a controller ready, the node should be usable once the virtual switch(es) connect(s) to the controller. The function of the switch will be determined by the flow matching rules generated by the conteoller.
    119181== 2.2 NetFPGA !OpenFlow switch == #nfpga
     182
    120183The following are the flow configurations applied to the first (trunked) setup.
    121184{{{
     
    165228!
    166229}}}
     230
     231[[BR]]
     232[[BR]]
     233[[BR]]
     234^1. This specific example requires a bit of network reconfiguration and comes with substantial risk of disconnecting your node from the network if done carelessly.^