...
Setup CAM
Code Block language text #configure (conf)#cam-acl l2acl 2 ipv4acl 2 ipv6acl 0 ipv4qos 0 l2qos 1 l2pt 0 ipmacacl 0 vman-qos 0 ecfmacl 0 openflow 8 (conf)#cam-acl-vlan vlanopenflow 1 vlaniscsi 1 vlanaclopt 0 (conf)#exit
Reboot the switch
Code Block language text #reload
Create openflow instance
Code Block language text #configure (conf)#openflow of-instance 1 (conf-of-instance-1)#controller 1 10.11.44.5 tcp [ change to your controller ip ] (conf-of-instance-1)#flow-map l2 enable (conf-of-instance-1)#flow-map l3 enable (conf-of-instance-1)#interface-type any (conf-of-instance-1)#multiple-fwd-table enable (conf-of-instance-1)#of-version 1.3 (conf)#exit
Setup interfaces
Code Block language text (conf)#interface TenGigabitEthernet 0/0 [ change to your network ports] (conf-if-te-0/0)#of-instance 1 (conf-if-te-0/0)#no switch-port (conf-if-te-0/0)#no shutdown (conf)#exit
Enable the openflow instance
Code Block language text (conf)#openflow of-instance 1 (conf-of-instance-1)#not shutdown (conf-of-instance-1)#exit
CPqD Software Switches
The CPqD 1.3 software switch cannot be compiled out of the box on recent versions of Ubuntu (>= 13.10 I believe).
In fact, the issue is not with the switch code itself but the netbee library it depends on which also needs to be compiled. The library cannot be compiled if your bison version is greater than 2.5. Unfortunately, since Ubuntu 13.10 the lowest available bison version is greater than 2.5, so the compilation doesn't work.
So, somehow you have to get an old version of bison on your system. There are multiple ways to do this, but I've detailed the approach I used below.
...
Download the source code
Code Block language text git clone https://github.com/CPqD/ofsoftswitch13.git
Go back to the specific version of Cpqd
Code Block language text
...
mininet/util/install.sh -3f
...
git checkout f308c28242de57502f06d3dee80ce47ac17b6603
Apply the following patch
Code Block language text
...
deb http://old-releases.ubuntu.com/ubuntu/ raring main restricted
deb-src http://old-releases.ubuntu.com/ubuntu/ raring main restricted
title patchfile_cpqd collapse true diff --git oflib/oxm-match.c oflib/oxm-match.c index e21edaa..d763cf9 100644 --- oflib/oxm-match.c +++ oflib/oxm-match.c @@ -202,14 +202,22 @@ oxm_prereqs_ok(const struct oxm_field *field, const struct ofl_match *rule) return false; } + /* Check for eth_type */ if (!field->dl_type[0]) return true; + else if (field->dl_type[0] == htons(0x8847)) + // quick-fix:ignore check for ethtpe when setting mpls label-id + // needs a cleaner solution which checks for a push-mpls action before the set + return true; else { HMAP_FOR_EACH_WITH_HASH (omt, struct ofl_match_tlv, hmap_node, hash_int(OXM_OF_ETH_TYPE, 0), &rule->match_fields) { uint16_t eth_type; memcpy(ð_type, omt->value, sizeof(uint16_t)); + //VLOG_INFO_RL(LOG_MODULE,&rl, "field-dltype %x ethtype %x htons %x", field->dl_type[0], + // eth_type, htons(eth_type)); + if (field->dl_type[0] == htons(eth_type)) { return true; } else if (field->dl_type[1] && field->dl_type[1] == htons(eth_type)) { @@ -349,7 +357,8 @@ parse_oxm_entry(struct ofl_match *match, const struct oxm_field *f, case OFI_OXM_OF_IPV4_SRC_W: case OFI_OXM_OF_ARP_SPA_W: case OFI_OXM_OF_ARP_TPA_W: - ofl_structs_match_put32m(match, f->header, *((uint32_t*) value), *((uint32_t*) mask)); + // note that the mask is bitwise notted to match 1.3 description of mask + ofl_structs_match_put32m(match, f->header, *((uint32_t*) value), ~(*((uint32_t*) mask))); return 0; case OFI_OXM_OF_ARP_SHA: case OFI_OXM_OF_ARP_THA:
If you save it as a file (patchfile_cpqd), then you can apply the patch as following
Code Block language text patch -p0 < ../patchfile_cpqd
- Build following the READ file in the directory
Now update your apt cache and install the old version of bison:
Code Block | ||
---|---|---|
| ||
sudo apt-get update
sudo apt-get remove bison libbison-dev
sudo apt-get install bison=2:2.5.dfsg-3ubuntu1 libbison-dev=2:2.5.dfsg-3ubuntu1 |
Double-check you have bison 2.5 installed:
Code Block | ||
---|---|---|
| ||
jono@ubuntu:~$ bison --version
bison (GNU Bison) 2.5
Written by Robert Corbett and Richard Stallman.
... |
The mininet install script should have placed the netbee source in your home directory. I'm assuming the directory is ~/nbeesrc-jan-10-2013, but you can adapt if it's different. We'll go there and finish compiling it (credit to the mininet install script):
Code Block | ||
---|---|---|
| ||
export NBEESRC=~/nbeesrc-jan-10-2013
cd ${NBEESRC}/src
make clean
cmake .
make
sudo cp ${NBEESRC}/bin/libn*.so /usr/local/lib
sudo ldconfig
sudo cp -R ${NBEESRC}/include/ /usr/ |
Now netbee is installed on the system and you can go ahead and compile the CPqD software switch. Hopefully the mininet script has already cloned the repo for you at ~/ofsoftswitch13:
Code Block | ||
---|---|---|
| ||
cd ~/ofsoftswitch13
./boot.sh
./configure
make
sudo make install |
Done.
Code Block | ||
---|---|---|
| ||
jono@ubuntu:~$ dpctl --version
dpctl 1.3.0 compiled Jul 30 2014 22:20:00 |
Optional: if you care, you can upgrade bison back to the latest version. You may also want to remove the raring.list file you created earlier so there's no chance of accidentally installing old software.
...
language | text |
---|
...