Trema on MyPLC/Fedora 8

142 views
Skip to first unread message

Oliver Michel

unread,
Jan 18, 2012, 8:26:37 PM1/18/12
to trem...@googlegroups.com
Hello,

I am a network researcher from the University of Vienna, Austria, currently working at the University of Illinois at Urbana-Champaign. We find the Trema Project very interesting and like to use Trema as our OpenFlow Controller for experiments on a meso-scale deployment within the GENI (geni.net) testbed.
As we are using PlanetLab-nodes as hosts running under Fedora 8 as base operating system, it would be the easiest to deploy Trema on one of these hosts.
Subsequently, I installed Ruby 1.8.7-p302 using RVM on one of these system and found equivalents for all the other required packages. Unfortunately I still can't completely build Trema:

$ ./build.rb 
gcc -I/home/pgenigpolabbbncom_uiuc_sr_geni/opt/trema/objects/openflow -g -std=gnu99 -D_GNU_SOURCE -fno-strict-aliasing -Werror -Wall -Wextra -Wformat=2 -Wcast-qual -Wcast-align -Wwrite-strings -Wconversion -Wfloat-equal -Wpointer-arith -fPIC -c -o /home/pgenigpolabbbncom_uiuc_sr_geni/opt/trema/objects/lib/persistent_storage.o /home/pgenigpolabbbncom_uiuc_sr_geni/opt/trema/src/lib/persistent_storage.c
cc1: warnings being treated as errors
/home/pgenigpolabbbncom_uiuc_sr_geni/opt/trema/src/lib/persistent_storage.c: In function 'init_backend':
/home/pgenigpolabbbncom_uiuc_sr_geni/opt/trema/src/lib/persistent_storage.c:94: warning: passing argument 1 of 'finalize_backend' with different width due to prototype
/home/pgenigpolabbbncom_uiuc_sr_geni/opt/trema/src/lib/persistent_storage.c: In function 'finalize_persistent_storage':
/home/pgenigpolabbbncom_uiuc_sr_geni/opt/trema/src/lib/persistent_storage.c:261: warning: passing argument 1 of 'finalize_backend' with different width due to prototype
/home/pgenigpolabbbncom_uiuc_sr_geni/opt/trema/src/lib/persistent_storage.c: In function 'clear_persistent_storage':
/home/pgenigpolabbbncom_uiuc_sr_geni/opt/trema/src/lib/persistent_storage.c:272: warning: passing argument 1 of 'finalize_backend' with different width due to prototype
rant: [ERROR] in file `/home/pgenigpolabbbncom_uiuc_sr_geni/opt/trema/Rantfile', line 350: 
rant: [ERROR] Task `default' fail.
rant aborted!
./build.rb aborted!

Did anyone ever tried to install Trema on Fedora (8)? Or does anyone have any suggestions how to solve the problem?

Thank you very much in advance,
Oliver

CHIBA Yasunobu

unread,
Jan 19, 2012, 1:09:26 AM1/19/12
to trem...@googlegroups.com
Hi,

Trema does not support older Linux distributions such as Fedora 8 but
you may be able run it on Fedora 8 at your own risk!

The following is a memo that shows how I could install Trema on Fedora 8.

1. Install Ruby from RVM

$ bash -s stable < <(curl -s
https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer
)
$ echo '[[ -s "$HOME/.rvm/scripts/rvm" ]] && .
"$HOME/.rvm/scripts/rvm" # Load RVM function' >> ~/.bash_profile
$ . .bash_profile
$ rvm install 1.8.7
$ rvm use 1.8.7

2. Build Trema and sample controllers

2.1 Get source code

$ git clone git://github.com/trema/trema.git
$ cd trema

2.2 Modify Rantfile to suppress errors with older gcc

Trema requires gcc 4.3+ but Fedora 8 only has gcc 4.1. This causes
compilation errors.
To avoid those errors, remove -Wconversion from CFLAGS in Rantfile.

# See http://gcc.gnu.org/wiki/NewWconversion for detail

2.3 Run build.rb

$ ./build.rb

3. Run sample controllers

3.1 Add your account to sudoers.

3.2 Modify "ruby/trema/link.rb" not to call sysctl (patch attached).

3.3 Run sample controllers

$ export PATH=$PATH:/sbin
$ ./trema run objects/examples/learning_switch/learning_switch -c
src/examples/learning_switch/learning_switch.conf

Hope this helps.

Regards,
CHIBA Yasunobu

2012/1/19 Oliver Michel <oliver...@editum.de>:

fedora8.patch

Oliver

unread,
Jan 19, 2012, 1:54:21 PM1/19/12
to trema-dev
Hi,
thank you very much for your help! I ended up doing the following:
$ rvm use 1.8.7

$ sudo yum groupinstall "Development Tools"
$ sudo yum install git gmp gmp-devel mpfr mpfr-devel

$ wget http://mirrors-us.seosue.com/gcc/releases/gcc-4.3.0/gcc-4.3.0.tar.bz2
$ tar -xvjpf gcc-4.3.0.tar.bz2

$ mkdir gcc-obj && cd gcc-obj
$ ../gcc-4.3.0/configure

$ make
$ sudo make install

$ git clone git://github.com/trema/trema.git && cd trema
$ ./build.rb

This lets Trema compile successfully, however, when trying to run a
sample controller after applying the path to link.rb, further errors
occur. These errors are relatively obvious as the script calls the ip-
command which is not available on Fedora.

$ export PATH=$PATH:/sbin
$ sudo ruby ./trema run objects/examples/learning_switch/
learning_switch -c src/examples/learning_switch/learning_switch.conf

sudo: ip: command not found
Command 'sudo ip link add name trema0-0 type veth peer name trema0-1'
failed!

I guess for now, I look for another workaround, maybe installing Trema
on a dedicated machine. However, it would be great if Fedora would be
supported at some point. Trema really is a great project!

Thank you, Oliver

CHIBA Yasunobu

unread,
Jan 19, 2012, 6:48:56 PM1/19/12
to trem...@googlegroups.com
Hi,

> occur. These errors are relatively obvious as the script calls the ip-
> command which is not available on Fedora.

"sudo yum install iproute" may install ip command :-)

Regards,
CHIBA Yasunobu

Oliver Michel

unread,
Jan 19, 2012, 7:35:35 PM1/19/12
to trem...@googlegroups.com
> "sudo yum install iproute" may install ip command :-)

Obviously I got a little lost, thank you :-)
Still learning-switch controller is not running:

> $ sudo ruby ./trema run objects/examples/learning_switch/learning_switch -c src/examples/learning_switch/learning_switch.conf

RTNETLINK answers: Operation not permitted
Command 'sudo /sbin/ip link add name trema0-0 type veth peer name trema0-1' failed!

Do you have any ideas, what the problem here could be?

Thank you,
Oliver

CHIBA Yasunobu

unread,
Jan 19, 2012, 8:41:10 PM1/19/12
to trem...@googlegroups.com
Hi,

> RTNETLINK answers: Operation not permitted
> Command 'sudo /sbin/ip link add name trema0-0 type veth peer name trema0-1' failed!

It seems creating a virtual Ethernet device is not permitted on your
environment while it is possible with standard Ferora 8 distribution.
I am not familiar with PlanetLab but I suppose the purpose-built Linux
kernel or security mechanism of PlanetLab does not allow you to use
the function.

If you do not need to run the network emulation part of Trema, you may
be able to simply run the sample controller as follows:

$ ./trema run objects/examples/learning_switch/learning_switch

However, if you want to run the network emulation part, further
investigation or other clean Linux environment may be needed.

Regards,
CHIBA Yasunobu

Oliver Michel

unread,
Jan 20, 2012, 3:41:16 PM1/20/12
to trem...@googlegroups.com
Hi,

perfect, this lets Trema run. Thank you very much for your kind assistance!

Oliver

Reply all
Reply to author
Forward
0 new messages