Changes between Version 6 and Version 7 of Internal/OpenFlow/VirtualSwitch


Ignore:
Timestamp:
Aug 11, 2009, 2:52:40 AM (15 years ago)
Author:
akoshibe
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Internal/OpenFlow/VirtualSwitch

    v6 v7  
    11= The virtual switch =
    2 Virtual switches are the main service offered by the !OpenFlow capable switch that make overlay networks possible. When created, a virtual switch will behave as an !OpenFlow device, manipulating packets according to the flow tables it is given from the controller. by default, there are no virtual switches set up on the IP8800. You have to create them either by specifying them in openflow.conf or by using the command `setvsi` through the CLI. Here we talk about the latter way of creating virtual switches.   
     2Virtual switches are what makes !OpenFlow overlay networks possible. When created, a virtual switch will behave as an !OpenFlow device, manipulating packets according to the flow table information it recieves from the controller. by default, there are no virtual switches set up on the IP8800. You have to create them either by specifying them in openflow.conf or by using the command `setvsi` through the CLI. Here we talk about the latter way of creating virtual switches.   
    33
    44== Overview ==
    55This article covers:
    6  * Summary of CLI commands used in virtual switching
    76 * Virtual switch setup from CLI (as opposed to directly editing openflow.conf)
    87 * Making the switch and controller work
     
    109   
    1110== CLI Commands ==
    12 The commands for virtual switching will not be found among the usual list of commands when you type `?` at the terminal. Command completion doesn't work either, so you have to type out the whole command.
    13  
    14 The full list of commands, along with their flags, are found on the NEC guide.
     11The commands for virtual switching will not be found among the usual list of commands that are listed when you type `?` at the terminal. Command completion doesn't work either, so you have to type out the whole command. In addition, if `no-save` was specified in openflow.conf, you will not be able to use `setvsi` or `deletevsi` from the CLI.   
    1512
     13The detailed list of commands and their uses are found on the NEC guide.
    1614
     15== Setup: SW-SB09 ==
     16VLAN 28 on the switch used in the Sandbox 9 setup is made to run a virtual switch. The current port configurations:
     17 * ports 1-12 : CM (VLAN 3)
     18 * ports 13-24 : Control (VLAN 27)
     19 * ports 25-36 : Data (VLAN 28)
     20 * ports 37-48 : Trunk 
    1721
    18 === when openflow.conf gets messed up (6/22) ===
    19 One method to rewrite the !OpenFlow configuration is to delete openflow.conf directly through the switch, then use the `setvsi` command to set the new virtual switches up. This should be unnecessary, but it happened to be effective when old configurations did not seem to go away despite editing the .conf file using a PC.
     22The ports were assigned to the VLANs using the CLI (details [wiki:Documentation/OpenFlow/CLISetup here]). To start the virtual switch on VLAN 28 (ports 25-36), in the CLI type:
    2023
    2124{{{
    22 > cd /mnt/
    23 > rm openflow.conf
    24 remove 'openflow.conf'? y
    25 > setvsi 1 1,3,5,7,9,11,13,15,2.1 tcp 172.16.4.224 dpid 0x0123456789ab
    26 > setvsi 2 17,19,21,23,25,27,29,31,2.2 tcp 172.16.4.180 dpid 0x012345678abc
    27 > setvsi 3 33,35,37,39,41,43,45,47,2.3 tcp 172.16.4.64 dpid 0x01234567abcd
    28 > showswitch
    29 vlan    ports                                           secure channel     
    30 ----    -----                                           --------------     
    31 1       1, 3, 5, 7, 9, 11, 13, 15, 2.1                  disconnected       
    32 2       17, 19, 21, 23, 25, 27, 29, 31, 2.2             disconnected       
    33 3       33, 35, 37, 39, 41, 43, 45, 47, 2.3             disconnected       
     25setvsi 28 25-36 tcp 172.16.100.1:6633 dpid 0x012345678987
     26}}}   
     27
     28This starts a virtual switch with the VLAN ID 28 encompassing all 12 VLAN 28 ports, that uses a TCP connection to the controller at port 6633.   
     29
     30== Virtual switches without controllers (7/8) ==
     31 * If you have a group of ports, and they share a VLAN, if even one port out of the group is configured to be a virtual switch, the whole group of ports cease to function as a regular switch.   
     32
     33 * If some ports of the switch are meant to be left as legacy switches, it seems better to not include the trunk info when using the `setvsi` command. Including the trunk port in setvsi when there is no controller will mess up functionality of the trunk as well.
     34
     35== some experimentation with Ruby sockets (8/4) ==
     36The switch will keep trying to contact a controller, regardless of whether the controller is active. This happens once every 15 seconds or so, and can be seen with a very simple script that listens on TCP 6633 (the default !OpenFlow port) on the console's !OpenFlow VLAN interface, which has the IP address 172.16.100.1:
     37
     38{{{
     39#!/usr/bin/ruby -w
     40require 'socket'
     41
     42# allow the switch to try to establish a connection
     43ofpsock = TCPserver.new("172.16.100.1", 6633)
     44
     45#listen to see what port the switch is using
     46while (session = ofpsock.accept)
     47        t = Time.now   # to see interval of messages
     48        peer = session.peeraddr
     49        puts "#{peer[1]}  #{peer[2]}    #{t.to_s.split[3]}"
     50session.close
     51end
    3452}}}
    3553
    36 The updated contents of openflow.conf:
     54You get:
    3755{{{
    38 setvsi 1 1,3,5,7,9,11,13,15,2.1 tcp 172.16.4.224 dpid 0x0123456789ab
    39 setvsi 2 17,19,21,23,25,27,29,31,2.2 tcp 172.16.4.180 dpid 0x012345678abc
    40 setvsi 3 33,35,37,39,41,43,45,47,2.3 tcp 172.16.4.64 dpid 0x01234567abcd
     5655354   172.16.100.10     20:53:22
     5755353   172.16.100.10     20:53:37
     5855352   172.16.100.10     20:53:52
     5955351   172.16.100.10     20:54:07
     60...
    4161}}}
    4262
    43 However, it seems like it is not possible to set `double-wide-mode`, or `no-save` through the CLI. These have to be added by editing openflow.conf using the PC.
     63The first and second columns show the port and IP address of the peer, respectively. 172.16.100.10 is the VLAN interface IP address for the Openflow VLAN on the switch, so you know it is the !OpenFlow switch trying to establish a connection with the controller.
    4464
    45 == Virtual switches without controllers (7/8) ==
    46  *Without the controller, virtual switches basically don't do anything. Plus, if you have a group of ports, and they share a VLAN, if even one port out of the group is configured to be a virtual switch, the whole group of ports cease to function as a regular switch.   
    47 
    48  *If some ports of the switch are meant to be left as legacy switches, it seems better to not include the trunk info when using the `setvsi` command. Including the trunk port in setvsi when there is no controller will mess up functionality of the trunk as well.
    49 
     65[[BR]]
     66[[BR]]
    5067 
    5168[wiki:Documentation/OpenFlow/ go back to OpenFlow index]