Code Monkey home page Code Monkey logo

apps's Introduction

Welcome to Trema

Build Status Code Climate Coverage Status Dependency Status

Trema is an OpenFlow controller programming framework that provides everything needed to create OpenFlow controllers in Ruby. It provides a high-level OpenFlow library and also a network emulator that can create OpenFlow-based networks for testing on your PC. This self-contained environment helps streamlines the entire process of development and testing.

Prerequisites

  • Ruby 2.0.0 or higher (RVM).
  • Open vSwitch (apt-get install openvswitch-switch).

Documentation

See https://relishapp.com/trema/trema/docs for links to documentation for all APIs.

Sample Code

Study sample code for implementation examples of Trema features. Each sample code project is executable source example of how to write a OpenFlow controller using Trema Ruby API.

Contributors

Special thanks to all contributors for submitting patches. A full list of contributors including their patches can be found at:

https://github.com/trema/trema/contributors

License

Trema is released under the GNU General Public License version 2.0 or MIT License:

apps's People

Contributors

amotoki avatar charlesmcchan avatar daisuke-k avatar infrastation avatar nickkaranatsios avatar r-mibu avatar sugyo avatar teyenliu avatar y-higuchi avatar yasuhito avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

apps's Issues

Fail to build flow_manager examples when trema gem is used

When trema is installed via "gem", a compilation of flow_manager examples fails with the following errors. flow_manager/examples/Makefile expects trema-config exists in ../../trema. It must check trema-config in the system using which.

make[1]: Entering directory /home/ubuntu/apps/flow_manager/examples' gcc -MM -std=gnu99 -D_GNU_SOURCE -g -fno-strict-aliasing -Werror -Wall -Wextra -Wformat=2 -Wcast-qual -Wcast-align -Wwrite-strings -Wconversion -Wfloat-equal -Wpointer-arith -I. -I.. utils.c example1.c example2.c example3.c example4.c example5.c > .depends ../libpath.h:26:19: fatal error: trema.h: No such file or directory compilation terminated. ../libpath.h:26:19: fatal error: trema.h: No such file or directory compilation terminated. ../libpath.h:26:19: fatal error: trema.h: No such file or directory compilation terminated. ../libpath.h:26:19: fatal error: trema.h: No such file or directory compilation terminated. ../libpath.h:26:19: fatal error: trema.h: No such file or directory compilation terminated. ../libpath.h:26:19: fatal error: trema.h: No such file or directory compilation terminated. make[1]: *** [depend] Error 1 make[1]: Leaving directory/home/ubuntu/apps/flow_manager/examples'
make: *** [examples] Error 2

[sliceable_switch] (trivial) description がカラの場合、表示が統一されていない

REST API 経由でネットワークを POST したときと、そのネットワークを GET したときで表示が違います。

"description"を指定せずにネットワークを POST するとその、response body は
{"id":"neta","description":null}
になります。
一方で、そのネットワークを GET すると
{"id":"neta","description":""}
になっています。

"" に統一した方がよいかなと思います。
テスト(features)と合わせてpull-requestを出しておきます。

sliceable switch cannot handle 64bit dpid with MSB set

16桁のDPIDを登録すると、DPID の下位の桁が失われてしまう。

sqliteは、unsigned bigint と書いても 63ビットを超えるとfloatにするような動きをしている。

dpidのカラムは、unsigned bigintで定義されていますが、
sqliteでは、INTEGER(符号付き64bit)として取り扱われるため
2 ^ 63 以上の値を格納する際に型が変わり値が丸められるようです。

16桁のDPIDを利用してスライスにポートをバインディング

[root@ofcrm001 sliceable_switch]# ./slice add-port slice003 0xabcdef0000000031 17 0xffff nodrp013
A port is added successfully.
[root@ofcrm001 sliceable_switch]# ./slice show slice003
[Description]

[Port-based bindings]
ID Datapath ID Port VID
nodrp013 0xabcdef0000000000 17 65535

[MAC-based bindings]
No bindings found.

[MAC-based bindings on ports]
No bindings found.

結果、上記の通りDatapath IDが、0xabcdef0000000031ではなく、0xabcdef0000000000となってしまいます。

sqlite3 の問題だと思います。
同じコマンドを実行してみましたが、以下のようになりました。
また、sqlite3 で直接 INSERT をしても同じ現象になりましたので。

64bit dpid を使用する場合は backend DB として sqlite3 を利用するように
変更すべきでしょう。 Sliceable switch はサンプルアプリの位置付けのため、
手軽に利用できる sqlite3 を使っています。
本格的に利用する場合はそのあたりを直す必要があります。

$ sqlite3 ../../var/db/slice.db
SQLite version 3.7.9 2011-11-01 00:52:41
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> .tables
bindings slices
sqlite> .header on
sqlite> .schema slices;
sqlite> .schema slices
CREATE TABLE slices (
number unsigned smallint not null,
id text not null,
description text,
constraint number_unique unique (number) on conflict fail,
constraint id_unique unique (id) on conflict fail
);
sqlite> select * from slices;
number|id|description
1|6da2d726-a852-47b1-ab03-6e842a85394e|ID=6da2d726-a852-47b1-ab03-6e842a85394e Name=net1 at Quantum.
2|17c038ad-55d1-4876-b4a7-6dca762966b3|ID=17c038ad-55d1-4876-b4a7-6dca762966b3 Name=ext_net at Quantum.
sqlite> select * from bindings;
type|datapath_id|port|vid|mac|id|slice_number
1|33270089032258|1|65535||64216194-f4df-4e9b-a84b-a4b88ebbb071|1
1|33270089032258|2|65535||bcd062b8-3c36-46c1-aa53-8721a188a45e|1
1|1.23798137339904e+19|17|65535||abcdef0000000031:0011:ffff|1
sqlite> INSERT INTO bindings (type,datapath_id,port,vid,slice_number,id) values (1,12379813733990400049,19,65535,1,'abcdef0000000031:0013:ffff');
sqlite> select * from bindings;
type|datapath_id|port|vid|mac|id|slice_number
1|33270089032258|1|65535||64216194-f4df-4e9b-a84b-a4b88ebbb071|1
1|33270089032258|2|65535||bcd062b8-3c36-46c1-aa53-8721a188a45e|1
1|1.23798137339904e+19|17|65535||abcdef0000000031:0011:ffff|1
1|1.23798137339904e+19|19|65535||abcdef0000000031:0013:ffff|1

sliceable_switch REST server does not work with apache 2.4.x

apache 2.4.6 is the default version of Ubuntu saucy (13.10).

Apache 2.4 made several changes in directives and its behaviors including mod_rewrite.

  • Filenames in /etc/apache2/sites-available should ends with ".conf".
    /etc/apache2/sites-available/sliceable_switch is ignored by a2ensite.
  • "Require all granted/denied" need to be used instead of "Allow/Deny from all" in apache 2.2
  • mod_rewrite rule needs to be update.
    POST /networks returns 404 Not Found with the current rewrite rule.

I haven't found the solution for the last item.

show_topology fails when TREMA_TMP is other than TREMA_HOME/tmp

こんな感じで Trema を起動しているのですが、

sudo LOGGING_LEVEL=$TREMA_LOG_LEVEL TREMA_TMP=$TREMA_TMP_DIR
trema run -d -c $TREMA_SS_CONFIG

Trema は gem でインストール、TREMA_TMP_DIR は /opt/stack/data/trema になっています。

そうすると、

ubuntu@ostack01:/opt/stack/trema/apps/topology (current)$ sudo ./show_topology -g
Failed to bind ( fd = 4, sun_path = /tmp/sock/trema.show_topology.m.sock, errno = No such file or directory [2] ).
Failed to create a receive queue.
Failed to bind ( fd = 4, sun_path = /tmp/sock/trema.topology-client-28184.sock, errn o = No such file or directory [2] ).
Failed to create a receive queue.
Failed to bind ( fd = 4, sun_path = /tmp/sock/trema.topology-client-28184.sock, errn o = No such file or directory [2] ).
Failed to create a receive queue.
Could not create a PID file: /tmp/pid/show_topology.pid

と怒られました。
標準のパス以外の TREMA_TMP を指定すると動かないように見えます。

環境は以下です。

$ gem list | grep trema
trema (0.3.3)
$ git show | head -1

Doc/Missing install dependency: tar

Yes, I know it sounds strange, but I tried to install trema (gem install trema) following the readme on a minimal fedora system, and it failed due to ...
"bash: tar: command not found" :)
The installation instructions should probably be updated. ("tar" is also the package name on fedora)

Unable to compile sliceable_routing_switch

Unable to compile sliceable_routing_switch with trema master-branch.

gcc -MM -I/home/shuji/openflow/trema/src/lib -I/home/shuji/openflow/trema/objects/openflow -I../topology -std=gnu99 -g -D_GNU_SOURCE -Wall fdb.c filter.c libpathresolver.c port.c sliceable_routing_switch.c slice.c redirector.c > .depends
gcc fdb.o filter.o libpathresolver.o port.o sliceable_routing_switch.o slice.o redirector.o -L/home/shuji/openflow/trema/objects/lib -ltrema -lrt -lpthread -lsqlite3 -ldl -L../topology -ltopology -o sliceable_routing_switch
libpathresolver.o: In function `allocate_node':
/home/shuji/openflow/apps/sliceable_routing_switch/libpathresolver.c:109: undefined reference to `create_hash_with_size'
libpathresolver.o: In function `create_node_table':
/home/shuji/openflow/apps/sliceable_routing_switch/libpathresolver.c:254: undefined reference to `create_hash_with_size'
collect2: ld returned 1 exit status
make: *** [sliceable_routing_switch] Error 1

No space between ID and description when ID is long

When ID is longer than 31 characters, there was no space between ID and
a description and it becomes difficult to identify an ID.

$ SLICE_DB_FILE=/opt/stack/data/trema/sliceable_switch/db/slice.db ./slice list
ID Description
9d66f98f-8dbd-48fe-ac1d-d25e92222e77ID=9d66f98f-8dbd-48fe-ac1d-d25e92222e77 Name=net1 at Quantum.
12b9e6db-bbc5-43b8-968a-519349528f34ID=12b9e6db-bbc5-43b8-968a-519349528f34 Name=ext_net at Quantum.

Refine show-switch-features.rb

case 文中で、クラスを見て分岐を行うよう、修正を行う。

case message
  when DescStatsReply # class で指定する
     ...
  when TableStatsReply
     ...
end

[Ubuntu 14.04] Sliceable Switch ./create_table.sh creates wrong filter entry and it breaks Sliceable Switch completely

When I tried to run sliceable switch on Ubuntu 14.04, all packets are dropped.
It is due to the wrong default entry of the filter table.

The second colums is "ofp_wildcards".
This field should be 4194303 (in decimal) = 0x3FFFFF (in hex), but it is 0 (which means no wildcard match).
This means packet-in packets do not match the default filter entry (ALLOW) and will be dropped.
As a result, traffic in all slices will be dropped.

[Ubuntu 14.04]

$ sqlite3 filter.db
SQLite version 3.8.2 2013-12-06 14:53:30
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> .header on
sqlite> select * from filter;
priority|ofp_wildcards|in_port|dl_src|dl_dst|dl_vlan|dl_vlan_pcp|dl_type|nw_tos|nw_proto|nw_src|nw_dst|tp_src|tp_dst|wildcards|in_datapath_id|slice_number|action|id
0|0|0|0|0|0|0|0|0|0|0|0|0|0|3|0|0|0|default
sqlite> 

$ COLUMNS=60 dpkg -l perl
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name           Version      Architecture Description
+++-==============-============-============-=================================
ii  perl           5.18.2-2ubun amd64        Larry Wall's Practical Extraction

[Ubuntu 12.04]

$ sqlite3 filter.db 
SQLite version 3.7.9 2011-11-01 00:52:41
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> select * from filter;
0|4194303|0|0|0|0|0|0|0|0|0|0|0|0|3|0|0|0|default

$ COLUMNS=60 dpkg -l perl
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name           Version        Description
+++-==============-==============-============================================
ii  perl           5.14.2-6ubuntu Larry Wall's Practical Extraction and Report

[sliceable_switch] error: Duplicated path found.

After I changed a slice definition/configuration while running sliceable_switch,
I got some error like:
Thu Jun 7 15:20:54 2012 [error] Duplicated path found.
Thu Jun 7 15:20:54 2012 [error] Failed to set up path.

I guess this error caused by path_entries that are left after load_slice_definitions_from_sqlite().
Path_entries are added at setup_path() (sliceable_switch.c 220),
but not deleted when delete_all_flows() (slice.c 547).

Related Commit:
ac2adec
flow_manager supported

I'm not sure that we should add delete_path_db() and create_path_db() after delete_all_flows(),
or modify "delete_affected_flows()".

port mirroring on trema ?help

sorry, I'm a student thesis. I want to try to discuss about mirorring port on Trema. brother there is a reference?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.