Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add support for the IVS virtual switch #159

Closed
wants to merge 11 commits into from
Closed

Conversation

rlane
Copy link
Contributor

@rlane rlane commented Jun 27, 2013

IVS is an open source virtual switch available for download at
https://github.com/floodlight/ivs. It uses the openvswitch
kernel module.

I also modified test_hifi slightly to let me run those tests against IVS.

IVS is an open source virtual switch available for download at
https://github.com/floodlight/ivs. It uses the openvswitch
kernel module.
@lantz
Copy link
Member

lantz commented Jun 27, 2013

This is interesting - IVS is under my radar, although perhaps it was part of the Switch Light announcement?

Could you explain what the advantage of IVS is over OVS?

One thing I like about OVS is that there are Ubuntu packages for it - are there ubuntu packages for IVS?

All of the other switch classes in Mininet proper also include support to install the switch in install.sh.

One other thing which isn't obvious to me: should Mininet include support for all extant OF software switches (including OVS, Stanford 1.0 switch, CPqD switch, LINC, pyswitch, etc.) or should they be separate features which people can download and install?

One of the GSoC projects involves creating a repository for user-contributed enhancements, topologies, switch classes, apps, etc. for Mininet, and perhaps full system examples as well.

@rlane
Copy link
Contributor Author

rlane commented Jun 28, 2013

One nice feature of IVS is the ability to spread processing of kernel flowtable misses across multiple threads.

The IVS repository can build Debian packages but they are not yet included in any distributions. I'll add support to install.sh to clone the IVS repo and install it. I'll let you know when I've pushed this and the dpctl support to this pull request.

I'm not sure I see a benefit in moving switch classes out of the mininet repository. You'd need to carefully manage the Switch interface (and any core mininet APIs switch classes use) to ensure that it stays compatible with switch classes in other repositories. Given how little code a switch class is it seems better to keep them with the rest of mininet. I wouldn't mind if each switch class were moved to its own file, though.

dpctl is not included with IVS. The user will need to obtain it from the
OpenFlow reference repository.
@rlane
Copy link
Contributor Author

rlane commented Jun 29, 2013

I've pushed a couple of commits adding support for dpctl and installing IVS from install.sh. I tested the install script on the mininet VM.

One note on dpctl - we don't have our own version, so users will need to take it from the OpenFlow reference repository.

@lantz
Copy link
Member

lantz commented Jun 29, 2013

I recommend using ovs-ofctl, which should work hopefully!

@rlane
Copy link
Contributor Author

rlane commented Jun 30, 2013

Ok, I changed the dpctl call to use ovs-ofctl.

IVS works fine using --innamespace.
@rlane
Copy link
Contributor Author

rlane commented Jul 8, 2013

Good to merge?

@lantz
Copy link
Member

lantz commented Jul 9, 2013

What is the easiest way to verify that it passes the tests (or at least test_hifi)?
Can we do this in an automated fashion?
I want to make sure that we can test all of the switches and make sure they all pass all of the tests.

@lantz
Copy link
Member

lantz commented Jul 9, 2013

My tests seem to fail when OVS is running - what can we do to allow IVS and OVS to peacefully coexist?

@lantz
Copy link
Member

lantz commented Jul 9, 2013

I also notice that mn -c doesn't seem to work with IVS.

@lantz
Copy link
Member

lantz commented Jul 9, 2013

The installation of IVS doesn't seem to install any man pages, notably a man page for for ivs-ctl seems to be missing.

rlane added 2 commits July 9, 2013 08:34
This could happen if OVS was installed but not running.
@rlane
Copy link
Contributor Author

rlane commented Jul 9, 2013

I pushed a couple of commits fixing mn -c. The main problem I saw was ovs-vsctl waiting forever to connect to ovsdb.

For test_hifi I set SWITCH to IVSSwitch to run the test. Maybe SWITCH could be set based on an environment variable. For test_nets I just added IVSSwitch to the SWITCHES dictionary. I'd also suggest removing that dictionary and replacing it with an environment variable choosing a single switch.

I think the only thing we can do to make IVS and OVS coexist is to run them in separate namespaces. Otherwise OVS will delete IVS's kernel datapaths as soon as they're created.

After looking at it more I don't think --innamespace actually works. Shouldn't it be running the switches under mnexec? Since I added the listen connection support for dpctl, now --innamespace is broken with IVS because all the switches are trying to listen on port 6634.

The man pages are currently part of the debian packaging, so won't be included in a manual install. We're going to fix that in the future as we package for more distros.

@lantz
Copy link
Member

lantz commented Jul 9, 2013

  1. It's important to me that I can issue a single command to confirm that IVS works without having to edit a source file.
  2. It should not be a problem that all of the switches are listening on port 6634 if they're in separate namespaces.
  3. Maybe I should look at this as well but I think it's important that we can come up with an example that uses both IVS and OVS in the same network. Not sure if this is a blocking issue on the merge though - for now we can probably just say use one or the other but not both simultaneously.
  4. That being said, it's important for users to easily be able to figure out how to start up an IVS-based Mininet even when OVS is running. The reason is that OVS is currently the default switch and is automatically installed when you install Mininet. Maybe it's OK for IVS to complain and say that you need to stop OVS?

Each switch gets its own class so that the test results are listed separately.
@rlane
Copy link
Contributor Author

rlane commented Jul 10, 2013

  1. I pushed a commit that adds IVS to the test suite. It also breaks the tests up so each switch gets its own set of tests, so it's easier to tell if the test failed for a particular switch. The userspace tests seem to have a race condition between starting the switch and running the test, so they fail for me unless I insert some time.sleep(1) calls (not included in the patch).
  2. Agreed, but I don't think the switches are actually being placed in separate namespaces. How is this supposed to currently work for the userspace switch?
  3. Yeah, until we can get switch namespaces to work we'd have to say not to use both simultaneously.
  4. From what I can tell it's actually OK to have the ovs-vswitchd daemon running while using IVS for mininet. The problems occur when OVS is restarted or (maybe) reconfigured, at which point it deletes any datapaths it doesn't own. Does this match what you saw when you tried to run mininet with IVS?

@lantz
Copy link
Member

lantz commented Jul 12, 2013

I think we should be able to get switch namespaces to work. If IVS works in a namespace, then OVS can work in the root namespace. It may also be possible to get OVS to work in a namespace.

It looks like things are somewhat better now; I was able to run

for s in user ovsk ivs; do sudo mn --switch $s --test pingall; done

successfully. (Note that there is currently a race condition since the pingall test doesn't wait for all switches to connect.)

@lantz
Copy link
Member

lantz commented Jul 12, 2013

For --switch user --innamespace, we create a separate routed control network and place all switches in their own namespaces.

# mn --switch user --innamespace --topo tree,2,2 -v output
s1 -> c0 
c0 -> s1 
*** Results: 0% dropped (0/2 lost)
s2 -> c0 
c0 -> s2 
*** Results: 0% dropped (0/2 lost)
s3 -> c0 
c0 -> s3 
*** Results: 0% dropped (0/2 lost)
mininet> pingall
*** Ping: testing ping reachability
h1 -> h2 h3 h4 
h2 -> h1 h3 h4 
h3 -> h1 h2 h4 
h4 -> h1 h2 h3 
*** Results: 0% dropped (0/12 lost)
mininet> s1 ifconfig
lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

s1-eth0   Link encap:Ethernet  HWaddr 66:3e:38:47:6a:68  
          inet addr:192.168.123.2  Bcast:192.168.255.255  Mask:255.255.0.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:36 errors:0 dropped:0 overruns:0 frame:0
          TX packets:37 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:4556 (4.5 KB)  TX bytes:5310 (5.3 KB)

s1-eth1   Link encap:Ethernet  HWaddr 46:4e:ed:56:a2:64  
          UP BROADCAST RUNNING PROMISC MULTICAST  MTU:1500  Metric:1
          RX packets:13 errors:0 dropped:0 overruns:0 frame:0
          TX packets:13 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:1084 (1.0 KB)  TX bytes:1084 (1.0 KB)

s1-eth2   Link encap:Ethernet  HWaddr 62:a8:7c:e4:66:88  
          UP BROADCAST RUNNING PROMISC MULTICAST  MTU:1500  Metric:1
          RX packets:13 errors:0 dropped:0 overruns:0 frame:0
          TX packets:13 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:1084 (1.0 KB)  TX bytes:1084 (1.0 KB)

tap0      Link encap:Ethernet  HWaddr 00:00:00:00:00:01  
          UP BROADCAST RUNNING PROMISC MULTICAST  MTU:1500  Metric:1
          RX packets:6 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:500 
          RX bytes:360 (360.0 B)  TX bytes:0 (0.0 B)

mininet> 

@ghost ghost assigned lantz Jul 12, 2013
IVS needs to be sent SIGTERM so it has a chance to clean up the kernel
datapath.
This change uses the `Node.cmd` method instead of `Popen`. The `cmd` method
sends the input to a shell which may be in another namespace (if --innamespace
is in use), while `Popen` would always run in the root namespace.
@rlane
Copy link
Contributor Author

rlane commented Jul 19, 2013

I added a commit to support running IVS with --innamespace. Here's the output from ivs-ctl showing that each switch node only sees one datapath:

mininet> s1 ivs-ctl show
s1:
  kernel lookups: hit=0 missed=58 lost=0
  kernel flows=0
  ports:
    0 s1 (internal)
      rx: packets=0 bytes=0 errors=0 dropped=0
      tx: packets=0 bytes=0 errors=0 dropped=0
    1 s1-eth1 
      rx: packets=29 bytes=1858 errors=0 dropped=0
      tx: packets=29 bytes=1858 errors=0 dropped=0
    2 s1-eth2 
      rx: packets=29 bytes=1858 errors=0 dropped=0
      tx: packets=29 bytes=1858 errors=0 dropped=0
mininet> s2 ivs-ctl show
s2:
  kernel lookups: hit=0 missed=53 lost=0
  kernel flows=0
  ports:
    0 s2 (internal)
      rx: packets=0 bytes=0 errors=0 dropped=0
      tx: packets=0 bytes=0 errors=0 dropped=0
    1 s2-eth1 
      rx: packets=12 bytes=840 errors=0 dropped=0
      tx: packets=27 bytes=1662 errors=0 dropped=0
    2 s2-eth2 
      rx: packets=12 bytes=840 errors=0 dropped=0
      tx: packets=27 bytes=1662 errors=0 dropped=0
    3 s2-eth3 
      rx: packets=29 bytes=1858 errors=0 dropped=0
      tx: packets=29 bytes=1858 errors=0 dropped=0
mininet> s3 ivs-ctl show
s3:
  kernel lookups: hit=0 missed=53 lost=0
  kernel flows=0
  ports:
    0 s3 (internal)
      rx: packets=0 bytes=0 errors=0 dropped=0
      tx: packets=0 bytes=0 errors=0 dropped=0
    1 s3-eth1 
      rx: packets=12 bytes=840 errors=0 dropped=0
      tx: packets=27 bytes=1662 errors=0 dropped=0
    2 s3-eth2 
      rx: packets=12 bytes=840 errors=0 dropped=0
      tx: packets=27 bytes=1662 errors=0 dropped=0
    3 s3-eth3 
      rx: packets=29 bytes=1858 errors=0 dropped=0
      tx: packets=29 bytes=1858 errors=0 dropped=0

The root namespace sees no datapaths.

@lantz
Copy link
Member

lantz commented Jul 27, 2013

I'm out of town at the moment and also rather sick unfortunately, but that sounds good - I will take a look at it when I get back next week.

@lantz lantz closed this in e8d6ebe Aug 1, 2013
@lantz lantz reopened this Aug 1, 2013
@lantz
Copy link
Member

lantz commented Aug 1, 2013

Reopening to fix commit history. ;-p

@lantz lantz closed this in 786117d Aug 1, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants