Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Setup CAM

    Code Block
    languagetext
    #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
  2. Reboot the switch

    Code Block
    languagetext
    #reload
  3. Create openflow instance

    Code Block
    languagetext
    #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
  4. Setup interfaces

    Code Block
    languagetext
    (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
  5. Enable the openflow instance

    Code Block
    languagetext
    (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. 

...

  1. Download the source code

    Code Block
    languagetext
    git clone https://github.com/CPqD/ofsoftswitch13.git
  2. Go back to the specific version of Cpqd

    Code Block
    languagetext

...

mininet/util/install.sh -3f

...

  1. git checkout f308c28242de57502f06d3dee80ce47ac17b6603
  2. Apply the following patch

    Code Block
    languagetext

...

deb http://old-releases.ubuntu.com/ubuntu/ raring main restricted
deb-src http://old-releases.ubuntu.com/ubuntu/ raring main restricted
  1. titlepatchfile_cpqd
    collapsetrue
    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(&eth_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
    languagetext
    patch -p0 < ../patchfile_cpqd 
  2. Build following the READ file in the directory

 

 

 

Now update your apt cache and install the old version of bison:

Code Block
languagetext
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
languagetext
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
languagetext
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
languagetext
cd ~/ofsoftswitch13
./boot.sh
./configure
make
sudo make install

Done.

Code Block
languagetext
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.

...

languagetext

...