trema / apps Goto Github PK
View Code? Open in Web Editor NEWTrema application repository
Trema application repository
Quantum と組み合わせて安定して動作する Sliceable Switch をリリースする計画。
関係しそうな人に @ を飛ばしておきます。みなさん加筆修正コメント etc. おねがいします。
@chibacchie @sugyo @amotoki @HideyukiShimonishi
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
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
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.
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()".
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
Is handle_switch_ready() handler in routing_switch.c called when switch is connected?
REST API 経由でネットワークを POST したときと、そのネットワークを GET したときで表示が違います。
"description"を指定せずにネットワークを POST するとその、response body は
{"id":"neta","description":null}
になります。
一方で、そのネットワークを GET すると
{"id":"neta","description":""}
になっています。
"" に統一した方がよいかなと思います。
テスト(features)と合わせてpull-requestを出しておきます。
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
sorry, I'm a student thesis. I want to try to discuss about mirorring port on Trema. brother there is a reference?
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)
Dear maitainers,
I want to make sure whether the slicable switch app allow the MAC address overlapping between different Tenants.
Hope you can help me to figure this out.
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.
I haven't found the solution for the last item.
case 文中で、クラスを見て分岐を行うよう、修正を行う。
case message
when DescStatsReply # class で指定する
...
when TableStatsReply
...
end
Sorry for mess, I figured how it supposed to works
https://github.com/trema/apps/blob/master/topology/README.md で、
トポロジー表示の例があるが、
$ TREMA_HOME=../../trema ./show_topology -G | graph-easy
gem で Trema をインストールした場合、ユーザは TREMA_HOME を意識しないはずであり、TREMA_HOME がどこかよく分からない。
こんな感じで 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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.