Tunneling - Capsulator

From OpenFlow Wiki

Jump to: navigation, search

Contents

Capsulator

Capsulator provides a software based tunneling solution which runs in user space. The steps listed here describing the setup are more or less geared towards interconnecting campuses but should provide the general idea.
The setup described here makes use of a server running CentOS 5.5 with the 'Development Tools' installed but should work with little problem on your linux OS of choice.
The following software is necessary to set up a tunneling server:

Building

OpenVSwitch

It is recommended that you download the OpenVSwitch source code straight from GIT. it seems to have solved some problem working with the Capsulator.
$ git clone git://openvswitch.org/openvswitch
$ cd openvswitch
$ ./boot.sh
$ ./configure --with-l26=/lib/modules/`uname -r`/build
$ make
$ sudo make install
Make sure to add the --with-l26 option as illustrated above to get the kernel module compiled as well. Otherwise the OpenVSwitch will run entirely in user space.
By default it will install into /usr/local. You may want to check to make sure that /usr/local is included in your PATH.

Capsulator

Download the source for Capsulator. This can be done straight from GIT:
$ git clone git://github.com/peymank/Capsulator.git 
Capsulator is very simple and should compile without a problem. The Makefile does not have an install option so you will have to copy the capsulator binary to /usr/local/bin if you want to. Otherwise you can just run it from the source directory itself.
$ cd Capsulator
$ make

Configuration

Capsulator.topology.gec8.png

Setup and Teardown Scripts

Create the following of_setup.sh and of_teardown.sh scripts and modify them so that they match your environment. The example below show the scripts as they are used for the Stanford setup.

of_setup.sh

#!/bin/bash

#####################################################
##### Set the parameters below
#####################################################

# OpenFlow switch settings

OF_PORT1=eth1                        # Physical interface to the OpenFlow network
OF_PORT2=tap0                        # Tap interface associated with the tunnel

DATAPATH_ID=0000002320da0764         # Unique ID for this OpenFlow switch
                                     # the benefit of the OpenFlow controller.

# Capsulator tunnel settings

TUN_PORT=eth0                        # Physical tunnel interface
TUN_PORT_SRCIP=171.66.4.133          # Interface IP address
TUN_PORT_NETMASK=255.255.255.248     # Interface subnet mask
TUN_PORT_DSTIP=64.57.23.35           # Tunnel destination IP address LA2 NetFPGA

TUN_TAG=1234                         # Tunnel tag
                                     # Any tunnel traffic received with this tag will
                                     # be forwarded to the associated tap interface

# OpenFlow controller settings

CTRL=171.66.4.132:6633               # OpenFlow controller IP address and port number
                                     # (yoza-ofctl)

#####################################################

# Initialize the internal interface
/sbin/ifconfig eth1 0.0.0.0  '''(Rob)''' should this be $TUN_PORT or $OF_PORT1: probably a NOOP anyway

# Initialize the tunnel interface
/sbin/ifconfig $TUN_PORT $TUN_PORT_SRCIP netmask $TUN_PORT_NETMASK

# Initialize the tunnel itself
# Tag traffic coming in on interface tap0 with tag $TUN_TAG and tunnel it to $TUN_PORT_DSTIP
cd ../Capsulator
./capsulator -t $TUN_PORT -f $TUN_PORT_DSTIP -vb tap0\#$TUN_TAG &

# Initialize OpenVswitch
/sbin/rmmod openvswitch_mod
/sbin/insmod /tmp/openvswitch/datapath/linux-2.6/openvswitch_mod.ko
sleep 1

/usr/local/bin/ovs-dpctl add-dp dp0
/usr/local/bin/ovs-dpctl add-if dp0 $OF_PORT1 $OF_PORT2
/usr/local/bin/ovs-dpctl show dp0
/usr/local/bin/ovs-openflowd --datapath-id=$DATAPATH_ID dp0 tcp:$CTRL

of_teardown.sh

#!/bin/bash

killall ovs-openflowd
/usr/local/bin/ovs-dpctl del-dp dp0
/sbin/rmmod openvswitch_mod
killall capsulator

Node Information

I2 Node Datapath ID Tunnel Port IP
LA2 0000002320e592f9 64.57.23.35
NY2 0000002320e3ed1c 64.57.23.51
HOU2 000000239cd6252e 64.57.23.43
Please use the settings in this table for the purpose of the GEC8 campus inter-connectivity when setting up your tunneling device .
Campus Datapath ID Tunnel Port IP Tunnel Tag Tunnel Endpoint
BBN 00000023e7a0b109 192.1.249.56 1000 NY2
Clemson 000000230dae332b TBD 2000 HOU2
Georgia Tech 0000002348195b37 TBD 3000 HOU2
Stanford 0000002320da0764 171.66.4.133 4000 LA2
Rutgers 0000002335e4e638 128.6.192.147 5000 Stanford
Princeton 000000239d8f63a3 TBD 6000 NY2
U Washington 0000002383bd2163 TBD 7000 LA2

Notes

  • Establishing a connection to any of the nodes on the I2 network requires that there be some kind of layer3 network connectivity to I2. I2 does not advertise its layer3 address space to the public Internet and as such can only be reached through specific links or as a result of route advertisements through a local provider who peers with I2.