Changes between Version 6 and Version 7 of Internal/OpenFlow/VirtualSwitch
- Timestamp:
- Aug 11, 2009, 2:52:40 AM (15 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Internal/OpenFlow/VirtualSwitch
v6 v7 1 1 = 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 givenfrom 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.2 Virtual 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. 3 3 4 4 == Overview == 5 5 This article covers: 6 * Summary of CLI commands used in virtual switching7 6 * Virtual switch setup from CLI (as opposed to directly editing openflow.conf) 8 7 * Making the switch and controller work … … 10 9 11 10 == 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. 11 The 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. 15 12 13 The detailed list of commands and their uses are found on the NEC guide. 16 14 15 == Setup: SW-SB09 == 16 VLAN 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 17 21 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. 22 The 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: 20 23 21 24 {{{ 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 25 setvsi 28 25-36 tcp 172.16.100.1:6633 dpid 0x012345678987 26 }}} 27 28 This 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) == 36 The 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 40 require 'socket' 41 42 # allow the switch to try to establish a connection 43 ofpsock = TCPserver.new("172.16.100.1", 6633) 44 45 #listen to see what port the switch is using 46 while (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]}" 50 session.close 51 end 34 52 }}} 35 53 36 The updated contents of openflow.conf:54 You get: 37 55 {{{ 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 56 55354 172.16.100.10 20:53:22 57 55353 172.16.100.10 20:53:37 58 55352 172.16.100.10 20:53:52 59 55351 172.16.100.10 20:54:07 60 ... 41 61 }}} 42 62 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.63 The 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. 44 64 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]] 50 67 51 68 [wiki:Documentation/OpenFlow/ go back to OpenFlow index]