├── .gitignore ├── cucumber.yml ├── sliceable_switch ├── test │ ├── .gitignore │ ├── rest_if │ │ ├── result.stderr │ │ ├── modify_network.json │ │ ├── create_mac.json │ │ ├── show_mac.json │ │ ├── show_macs.json │ │ ├── create_port_mac.json │ │ ├── show_port_mac.json │ │ ├── show_port_macs.json │ │ ├── create_network.json │ │ ├── show_ports.json │ │ ├── create_port.json │ │ ├── list_networks.json │ │ ├── show_port.json │ │ ├── show_network.json │ │ ├── add_filter.json │ │ ├── httpc │ │ └── tests.sh │ ├── redirector │ │ ├── www │ │ │ ├── stop.png │ │ │ ├── index.html │ │ │ └── standard.css │ │ └── iptables.sh │ ├── filter │ │ ├── result.stderr │ │ └── tests.sh │ ├── slice │ │ ├── result.stderr │ │ └── tests.sh │ └── 65535_slices.pl ├── .gitignore ├── create_slice_table.sql ├── sliceable_switch_null.conf ├── sliceable_switch_rest_null.conf ├── features │ ├── step_definitions │ │ ├── reset_stats.rb │ │ ├── up_steps.rb │ │ ├── kill_steps.rb │ │ ├── misc_steps.rb │ │ ├── stats_steps.rb │ │ ├── send_packets_steps.rb │ │ ├── create_table_steps.rb │ │ └── dump_flows_steps.rb │ ├── support │ │ └── hooks.rb │ ├── help.feature │ └── port_mac_mixed_binding.feature ├── sliceable_switch.conf ├── sliceable_switch_external.conf ├── redirector.h ├── create_tables.sh ├── apache │ └── sliceable_switch ├── create_filter_table.sql ├── sample.conf ├── filter.h ├── sample_rest.conf ├── sliceable_switch.h ├── fdb.h ├── slice.h ├── libpathresolver.h ├── port.h ├── checker.c └── Makefile ├── simple_restapi_manager ├── examples │ ├── .gitignore │ ├── example.conf │ ├── Makefile │ └── example.c ├── .gitignore ├── README.md ├── Makefile ├── simple_restapi_manager.h └── librestapi.h ├── group_dumper ├── .gitignore ├── Makefile └── utility.h ├── learning_switch_edged ├── .gitignore ├── learning_switch.conf ├── Makefile ├── mac.rb ├── port.rb ├── datapath_db.h ├── fdb.h ├── flow_entry.h └── datapath-db.rb ├── flow_dumper ├── .gitignore ├── Makefile ├── README.md └── flow-dumper.rb ├── load_balance_switch ├── .gitignore ├── README.md ├── Makefile ├── switch.conf ├── fdb.h ├── path_resolver.h └── port.h ├── path_manager ├── .gitignore ├── README.md ├── Makefile └── path_manager.h ├── show_description ├── .gitignore ├── show_description.conf ├── Makefile └── README.md ├── routing_switch ├── .gitignore ├── routing_switch_null.conf ├── routing_switch_lldp_over_ip.conf ├── routing_switch.conf ├── features │ ├── support │ │ ├── hooks.rb │ │ └── env.rb │ └── step_definitions │ │ ├── up_steps.rb │ │ ├── kill_steps.rb │ │ ├── misc_steps.rb │ │ └── send_packets_steps.rb ├── routing_switch.h ├── routing_switch_fullmesh.conf ├── routing_switch_lldp_over_ip_fullmesh.conf ├── fdb.h ├── Makefile └── libpathresolver.h ├── transaction_manager ├── .gitignore ├── examples │ ├── example.conf │ └── Makefile ├── Makefile ├── README.md └── transaction_manager.h ├── broadcast_helper ├── .gitignore └── Makefile ├── packetin_dispatcher ├── .gitignore ├── README.md ├── packetin_dispatcher.conf └── Makefile ├── simple_load_balancer ├── .gitignore ├── README.md ├── simple_load_balancer.conf └── Makefile ├── redirectable_routing_switch ├── .gitignore ├── create_authorized_host_db.sh ├── iptables.sh ├── redirectable_routing_switch_null.conf ├── redirectable_routing_switch.conf ├── Makefile ├── redirectable_routing_switch.h ├── authenticator.h ├── redirector.h ├── fdb.h └── libpathresolver.h ├── topology ├── .gitignore ├── topology.conf ├── topology_fullmesh.conf ├── service_management.h ├── show_topology.h ├── topology_management.h ├── topology_service_interface_option_parser.h ├── subscriber_table.h ├── list_switch.c ├── topology_table.h ├── probe_timer_table.h ├── Makefile └── list_port.c ├── monitoring_manager ├── .gitignore ├── monitoring.conf ├── toolutils.h ├── examples │ ├── Makefile │ └── example1.conf ├── Makefile ├── toolutils.c └── libmonitoring.h ├── flow_manager ├── flow_manager.conf ├── .gitignore ├── examples │ ├── utils.h │ ├── Makefile │ └── utils.c └── Makefile ├── features ├── topology.feature ├── flow_dumper.feature ├── flow_manager.feature ├── path_manager.feature ├── group_dumper.feature ├── show_description.feature ├── packetin_dispatcher.feature ├── simple_load_balancer.feature ├── transaction_manager.feature ├── simple_restapi_manager.feature ├── learning_switch_edged.feature ├── support │ └── env.rb ├── routing_switch.feature ├── broadcast_helper.feature ├── load_balance_switch.feature ├── redirectable_routing_switch.feature ├── sliceable_switch.feature └── monitoring_manager.feature ├── simple_multicast ├── README ├── mfc.rb └── simple-multicast.rb ├── Gemfile ├── .travis.yml ├── traffic_monitor_memcached ├── traffic_monitor.conf ├── counter.rb └── fdb.rb ├── Rakefile ├── learning_switch_memcached ├── Makefile ├── learning_switch.feature ├── fdb.rb └── learning-switch.rb ├── multi_learning_switch_memcached └── Makefile ├── Guardfile └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | Gemfile.lock -------------------------------------------------------------------------------- /cucumber.yml: -------------------------------------------------------------------------------- 1 | default: --tags ~@wip 2 | -------------------------------------------------------------------------------- /sliceable_switch/test/.gitignore: -------------------------------------------------------------------------------- 1 | /httpd 2 | -------------------------------------------------------------------------------- /sliceable_switch/test/rest_if/result.stderr: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /simple_restapi_manager/examples/.gitignore: -------------------------------------------------------------------------------- 1 | example 2 | -------------------------------------------------------------------------------- /group_dumper/.gitignore: -------------------------------------------------------------------------------- 1 | *.o 2 | /.depends 3 | /group_dumper 4 | -------------------------------------------------------------------------------- /learning_switch_edged/.gitignore: -------------------------------------------------------------------------------- 1 | *.o 2 | /.depends 3 | /learning_switch 4 | -------------------------------------------------------------------------------- /flow_dumper/.gitignore: -------------------------------------------------------------------------------- 1 | *.a 2 | *.o 3 | *.swp 4 | *~ 5 | .depends 6 | flow_dumper 7 | -------------------------------------------------------------------------------- /load_balance_switch/.gitignore: -------------------------------------------------------------------------------- 1 | *.a 2 | *.o 3 | *.swp 4 | *~ 5 | .depends 6 | switch 7 | -------------------------------------------------------------------------------- /path_manager/.gitignore: -------------------------------------------------------------------------------- 1 | *.a 2 | *.o 3 | *.swp 4 | *~ 5 | .depends 6 | path_manager 7 | -------------------------------------------------------------------------------- /show_description/.gitignore: -------------------------------------------------------------------------------- 1 | *.o 2 | *.swp 3 | *~ 4 | .depends 5 | show_description 6 | -------------------------------------------------------------------------------- /routing_switch/.gitignore: -------------------------------------------------------------------------------- 1 | *.a 2 | *.o 3 | *.swp 4 | *~ 5 | .depends 6 | routing_switch 7 | -------------------------------------------------------------------------------- /transaction_manager/.gitignore: -------------------------------------------------------------------------------- 1 | *.a 2 | *.o 3 | *.swp 4 | *~ 5 | .depends 6 | examples/example -------------------------------------------------------------------------------- /broadcast_helper/.gitignore: -------------------------------------------------------------------------------- 1 | *.a 2 | *.o 3 | *.swp 4 | *~ 5 | .depends 6 | broadcast_helper 7 | -------------------------------------------------------------------------------- /simple_restapi_manager/.gitignore: -------------------------------------------------------------------------------- 1 | nbproject 2 | .depends 3 | *.o 4 | *.a 5 | monitoring 6 | 7 | -------------------------------------------------------------------------------- /sliceable_switch/test/rest_if/modify_network.json: -------------------------------------------------------------------------------- 1 | { "description": "new description here" } 2 | -------------------------------------------------------------------------------- /transaction_manager/examples/example.conf: -------------------------------------------------------------------------------- 1 | vswitch("switch") { 2 | datapath_id "0x1234" 3 | } 4 | -------------------------------------------------------------------------------- /packetin_dispatcher/.gitignore: -------------------------------------------------------------------------------- 1 | *.a 2 | *.o 3 | *.swp 4 | *~ 5 | .depends 6 | packetin_dispatcher 7 | -------------------------------------------------------------------------------- /simple_load_balancer/.gitignore: -------------------------------------------------------------------------------- 1 | *.a 2 | *.o 3 | *.swp 4 | *~ 5 | .depends 6 | simple_load_balancer 7 | -------------------------------------------------------------------------------- /simple_restapi_manager/examples/example.conf: -------------------------------------------------------------------------------- 1 | vswitch("switch") { 2 | datapath_id "0x1234" 3 | } 4 | -------------------------------------------------------------------------------- /sliceable_switch/.gitignore: -------------------------------------------------------------------------------- 1 | *.db 2 | *.o 3 | *~ 4 | /.depends 5 | /sliceable_switch 6 | /checker 7 | -------------------------------------------------------------------------------- /sliceable_switch/test/rest_if/create_mac.json: -------------------------------------------------------------------------------- 1 | { "id": "mac_created_via_rest_if", "mac": "01:00:00:00:00:01" } -------------------------------------------------------------------------------- /sliceable_switch/test/rest_if/show_mac.json: -------------------------------------------------------------------------------- 1 | {"id":"mac_created_via_rest_if","mac":"01:00:00:00:00:01"} 2 | -------------------------------------------------------------------------------- /sliceable_switch/test/rest_if/show_macs.json: -------------------------------------------------------------------------------- 1 | [{"id":"mac_created_via_rest_if","mac":"01:00:00:00:00:01"}] 2 | -------------------------------------------------------------------------------- /redirectable_routing_switch/.gitignore: -------------------------------------------------------------------------------- 1 | *.a 2 | *.o 3 | *.swp 4 | *~ 5 | .depends 6 | redirectable_routing_switch 7 | -------------------------------------------------------------------------------- /sliceable_switch/test/rest_if/create_port_mac.json: -------------------------------------------------------------------------------- 1 | { "id": "port_mac_created_via_rest_if", "mac": "01:01:01:01:01:01" } -------------------------------------------------------------------------------- /sliceable_switch/test/rest_if/show_port_mac.json: -------------------------------------------------------------------------------- 1 | {"id":"port_mac_created_via_rest_if","mac":"01:01:01:01:01:01"} 2 | -------------------------------------------------------------------------------- /sliceable_switch/test/rest_if/show_port_macs.json: -------------------------------------------------------------------------------- 1 | [{"id":"port_mac_created_via_rest_if","mac":"01:01:01:01:01:01"}] 2 | -------------------------------------------------------------------------------- /topology/.gitignore: -------------------------------------------------------------------------------- 1 | *.a 2 | *.o 3 | *.swp 4 | *~ 5 | .depends 6 | show_topology 7 | topology 8 | topology_discovery 9 | -------------------------------------------------------------------------------- /sliceable_switch/test/rest_if/create_network.json: -------------------------------------------------------------------------------- 1 | { "id": "slice_created_via_rest_if", "description": "description here" } 2 | -------------------------------------------------------------------------------- /sliceable_switch/test/rest_if/show_ports.json: -------------------------------------------------------------------------------- 1 | [{"vid":65535,"datapath_id":"1024","id":"port_created_via_rest_if","port":1}] 2 | -------------------------------------------------------------------------------- /sliceable_switch/test/rest_if/create_port.json: -------------------------------------------------------------------------------- 1 | { "id": "port_created_via_rest_if", "datapath_id": "1024", "port": 1, "vid": 65535 } -------------------------------------------------------------------------------- /monitoring_manager/.gitignore: -------------------------------------------------------------------------------- 1 | nbproject 2 | .depends 3 | *.o 4 | *.a 5 | monitoring 6 | examples/example1.o 7 | examples/example1 8 | 9 | -------------------------------------------------------------------------------- /sliceable_switch/test/redirector/www/stop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trema/apps/HEAD/sliceable_switch/test/redirector/www/stop.png -------------------------------------------------------------------------------- /flow_manager/flow_manager.conf: -------------------------------------------------------------------------------- 1 | vswitch { 2 | datapath_id "0x1" 3 | } 4 | 5 | vswitch { 6 | datapath_id "0x2" 7 | } 8 | 9 | link 0x1,0x2 10 | -------------------------------------------------------------------------------- /features/topology.feature: -------------------------------------------------------------------------------- 1 | Feature: topology app 2 | 3 | Scenario: compile topology 4 | When I cd to "topology" 5 | Then I successfully run `make` 6 | -------------------------------------------------------------------------------- /sliceable_switch/test/rest_if/list_networks.json: -------------------------------------------------------------------------------- 1 | [{"id":"slice1","description":"description for slice1"},{"id":"slice2","description":"description for slice2"}] -------------------------------------------------------------------------------- /packetin_dispatcher/README.md: -------------------------------------------------------------------------------- 1 | Packet in dispatch application 2 | ============================== 3 | 4 | This directory includes packet-in dispatch application. 5 | -------------------------------------------------------------------------------- /features/flow_dumper.feature: -------------------------------------------------------------------------------- 1 | Feature: flow_dumper app 2 | 3 | Scenario: compile flow_dumper 4 | When I cd to "flow_dumper" 5 | Then I successfully run `make` 6 | -------------------------------------------------------------------------------- /simple_multicast/README: -------------------------------------------------------------------------------- 1 | Simple multicast applicastion 2 | ============================== 3 | 4 | This directory includes a simple implementation of multicast switch. 5 | -------------------------------------------------------------------------------- /features/flow_manager.feature: -------------------------------------------------------------------------------- 1 | Feature: flow_manager app 2 | 3 | Scenario: compile flow_manager 4 | When I cd to "flow_manager" 5 | Then I successfully run `make` 6 | -------------------------------------------------------------------------------- /features/path_manager.feature: -------------------------------------------------------------------------------- 1 | Feature: path_manager app 2 | 3 | Scenario: compile path_manager 4 | When I cd to "path_manager" 5 | Then I successfully run `make` 6 | -------------------------------------------------------------------------------- /redirectable_routing_switch/create_authorized_host_db.sh: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | sqlite3 authorized_host.db 'create table authorized_host (mac unsigned bigint, description text)' 4 | -------------------------------------------------------------------------------- /sliceable_switch/test/rest_if/show_port.json: -------------------------------------------------------------------------------- 1 | {"attachments":[{"id":"port_mac_created_via_rest_if","mac":"01:01:01:01:01:01"}],"config":{"vid":65535,"datapath_id":"1024","port":1}} 2 | -------------------------------------------------------------------------------- /features/group_dumper.feature: -------------------------------------------------------------------------------- 1 | Feature: group_dumper app 2 | 3 | @wip 4 | Scenario: compile group_dumper 5 | When I cd to "group_dumper" 6 | Then I successfully run `make` 7 | -------------------------------------------------------------------------------- /features/show_description.feature: -------------------------------------------------------------------------------- 1 | Feature: show_description app 2 | 3 | Scenario: compile show_description 4 | When I cd to "show_description" 5 | Then I successfully run `make` 6 | -------------------------------------------------------------------------------- /sliceable_switch/test/filter/result.stderr: -------------------------------------------------------------------------------- 1 | Usage: 2 | filter list 3 | filter show [FILTER_ID] 4 | filter add [FILTER_ID] [FILTER_CRITERIA] 5 | filter delete [FILTER_ID] [FILTER_CRITERIA] 6 | -------------------------------------------------------------------------------- /features/packetin_dispatcher.feature: -------------------------------------------------------------------------------- 1 | Feature: packetin_dispatcher app 2 | 3 | Scenario: compile packetin_dispatcher 4 | When I cd to "packetin_dispatcher" 5 | Then I successfully run `make` 6 | -------------------------------------------------------------------------------- /features/simple_load_balancer.feature: -------------------------------------------------------------------------------- 1 | Feature: simple_load_balancer app 2 | 3 | Scenario: compile simple_load_balancer 4 | When I cd to "simple_load_balancer" 5 | Then I successfully run `make` 6 | -------------------------------------------------------------------------------- /features/transaction_manager.feature: -------------------------------------------------------------------------------- 1 | Feature: transaction_manager app 2 | 3 | Scenario: compile transaction_manager 4 | When I cd to "transaction_manager" 5 | Then I successfully run `make` 6 | -------------------------------------------------------------------------------- /flow_manager/.gitignore: -------------------------------------------------------------------------------- 1 | *.a 2 | *.o 3 | *.swp 4 | *~ 5 | .depends 6 | flow_manager 7 | examples/example1 8 | examples/example2 9 | examples/example3 10 | examples/example4 11 | examples/example5 12 | -------------------------------------------------------------------------------- /features/simple_restapi_manager.feature: -------------------------------------------------------------------------------- 1 | Feature: simple_restapi_manager app 2 | 3 | Scenario: compile simple_restapi_manager 4 | When I cd to "simple_restapi_manager" 5 | Then I successfully run `make` 6 | -------------------------------------------------------------------------------- /features/learning_switch_edged.feature: -------------------------------------------------------------------------------- 1 | Feature: learning_switch_edged app 2 | 3 | @wip 4 | Scenario: compile learning_switch_edged 5 | When I cd to "learning_switch_edged" 6 | Then I successfully run `make` 7 | -------------------------------------------------------------------------------- /Gemfile: -------------------------------------------------------------------------------- 1 | source "https://rubygems.org" 2 | 3 | 4 | group :develop do 5 | gem "aruba" 6 | gem "cucumber" 7 | gem "guard" 8 | gem "guard-bundler" 9 | gem "guard-cucumber" 10 | gem "trema", "~> 0.4.2" 11 | end 12 | -------------------------------------------------------------------------------- /redirectable_routing_switch/iptables.sh: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | IPTABLES=/sbin/iptables 4 | WWW_SERVER_HOST=172.16.17.200 5 | TUN_INTERFACE=of0 6 | 7 | $IPTABLES -t nat -A PREROUTING -i $TUN_INTERFACE -j DNAT --to $WWW_SERVER_HOST 8 | -------------------------------------------------------------------------------- /features/support/env.rb: -------------------------------------------------------------------------------- 1 | require "aruba/cucumber" 2 | 3 | 4 | Before do 5 | @dirs = [ File.join( File.dirname( __FILE__ ), "..", ".." ) ] 6 | @aruba_timeout_seconds = 30 7 | system "rake clean 1>/dev/null 2>/dev/null" 8 | end 9 | -------------------------------------------------------------------------------- /features/routing_switch.feature: -------------------------------------------------------------------------------- 1 | Feature: routing_switch app 2 | 3 | Scenario: compile routing_switch 4 | Given I cd to "topology" 5 | And I successfully run `make` 6 | When I cd to "../routing_switch" 7 | Then I successfully run `make` 8 | -------------------------------------------------------------------------------- /features/broadcast_helper.feature: -------------------------------------------------------------------------------- 1 | Feature: broadcast_helper app 2 | 3 | Scenario: compile broadcast_helper 4 | Given I cd to "topology" 5 | And I successfully run `make` 6 | When I cd to "../broadcast_helper" 7 | Then I successfully run `make` 8 | -------------------------------------------------------------------------------- /features/load_balance_switch.feature: -------------------------------------------------------------------------------- 1 | Feature: load_balance_switch app 2 | 3 | Scenario: compile load_balance_switch 4 | Given I cd to "topology" 5 | And I successfully run `make` 6 | When I cd to "../load_balance_switch" 7 | Then I successfully run `make` 8 | -------------------------------------------------------------------------------- /show_description/show_description.conf: -------------------------------------------------------------------------------- 1 | vswitch { 2 | datapath_id "0x1" 3 | } 4 | 5 | vhost ("host1") 6 | vhost ("host2") 7 | vhost ("host3") 8 | vhost ("host4") 9 | 10 | link "0x1", "host1" 11 | link "0x1", "host2" 12 | link "0x1", "host3" 13 | link "0x1", "host4" 14 | -------------------------------------------------------------------------------- /features/redirectable_routing_switch.feature: -------------------------------------------------------------------------------- 1 | Feature: redirectable_routing_switch app 2 | 3 | Scenario: compile redirectable_routing_switch 4 | Given I cd to "topology" 5 | And I successfully run `make` 6 | When I cd to "../redirectable_routing_switch" 7 | Then I successfully run `make` 8 | -------------------------------------------------------------------------------- /features/sliceable_switch.feature: -------------------------------------------------------------------------------- 1 | Feature: sliceable_switch app 2 | 3 | Scenario: compile sliceable_switch 4 | Given I cd to "topology" 5 | And I successfully run `make` 6 | And I cd to "../flow_manager" 7 | And I successfully run `make` 8 | When I cd to "../sliceable_switch" 9 | Then I successfully run `make` 10 | -------------------------------------------------------------------------------- /features/monitoring_manager.feature: -------------------------------------------------------------------------------- 1 | Feature: monitoring_manager app 2 | 3 | Scenario: compile monitoring_manager 4 | Given I cd to "topology" 5 | And I successfully run `make` 6 | And I cd to "../flow_manager" 7 | And I successfully run `make` 8 | When I cd to "../monitoring_manager" 9 | Then I successfully run `make` 10 | -------------------------------------------------------------------------------- /sliceable_switch/test/rest_if/show_network.json: -------------------------------------------------------------------------------- 1 | {"bindings":[{"type":2,"id":"mac_created_via_rest_if","mac":"01:00:00:00:00:01"},{"vid":65535,"datapath_id":"1024","type":4,"id":"port_mac_created_via_rest_if","mac":"01:01:01:01:01:01","port":1},{"vid":65535,"datapath_id":"1024","type":1,"id":"port_created_via_rest_if","port":1}],"description":"description here"} 2 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: ruby 2 | 3 | script: "rake cucumber" 4 | 5 | rvm: 6 | - 1.8.7 7 | - 1.9.3 8 | - 2.0.0 9 | 10 | before_install: 11 | - sudo apt-get update -qq 12 | - sudo apt-get install libpcap-dev libjansson-dev -qq 13 | - gem install bundler 14 | 15 | notifications: 16 | webhooks: http://trema-hubot.herokuapp.com/hubot/travis?room=1 17 | -------------------------------------------------------------------------------- /path_manager/README.md: -------------------------------------------------------------------------------- 1 | Simple Path Management Application 2 | ================================== 3 | 4 | This application is created for the tutorial session at Tokyo Institute of 5 | Technology. It is intended for persons who want to understand how to install 6 | flow entries into OpenFlow switches and how to implement IPC among modules 7 | developed on top of Trema. 8 | -------------------------------------------------------------------------------- /traffic_monitor_memcached/traffic_monitor.conf: -------------------------------------------------------------------------------- 1 | vswitch { 2 | datapath_id "0x1" 3 | } 4 | 5 | vswitch { 6 | datapath_id "0x2" 7 | } 8 | 9 | vhost ("host1") { 10 | ip "192.168.0.1" 11 | mac "00:00:00:00:00:01" 12 | } 13 | 14 | vhost ("host2") { 15 | ip "192.168.0.2" 16 | mac "00:00:00:00:00:02" 17 | } 18 | 19 | link "0x1", "host1" 20 | link "0x2", "host2" 21 | link "0x1", "0x2" 22 | -------------------------------------------------------------------------------- /sliceable_switch/test/rest_if/add_filter.json: -------------------------------------------------------------------------------- 1 | [{"priority":0,"nw_dst":"1.1.1.1","wildcards":"in_datapath_id","ofp_wildcards":"in_port,nw_tos,tp_src,tp_dst","dl_src":"00:00:00:00:00:00","slice":"slice1","nw_proto":0,"dl_dst":"00:00:00:00:00:00","id":"13176184135067690516","in_datapath_id":0,"nw_tos":0,"dl_vlan":0,"in_port":0,"dl_vlan_pcp":0,"action":"DENY","tp_src":0,"dl_type":0,"nw_src":"10.0.0.2","tp_dst":0}] 2 | -------------------------------------------------------------------------------- /sliceable_switch/test/redirector/iptables.sh: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | IPTABLES=/sbin/iptables 4 | WWW_SERVER_HOST=172.16.17.200 5 | WWW_SERVER_PORT=80 6 | TUN_INTERFACE=of0 7 | 8 | $IPTABLES -t nat -A PREROUTING -i $TUN_INTERFACE -p tcp --dport 80 -j DNAT --to $WWW_SERVER_HOST:$WWW_SERVER_PORT 9 | #$IPTABLES -A FORWARD -i $TUN_INTERFACE -p tcp --dport 80 -j ACCEPT 10 | #$IPTABLES -A FORWARD -i $TUN_INTERFACE -j DROP 11 | -------------------------------------------------------------------------------- /load_balance_switch/README.md: -------------------------------------------------------------------------------- 1 | Load Balance Switch Application 2 | =============================== 3 | 4 | This application is created for the tutorial session at Tokyo Institute of 5 | Technology. It is intended for persons who want to understand how to 6 | implement IPC among moudles developed on top of Trema. Thus, it does not 7 | provide full load balance functionality and definitely does not work in 8 | real network environment. 9 | -------------------------------------------------------------------------------- /simple_load_balancer/README.md: -------------------------------------------------------------------------------- 1 | Simple Server Load Balancer Application 2 | ======================================= 3 | 4 | This application is created for the tutorial session at Kyushu Institute of 5 | Technology. It is intended for persons who want to understand how to handle 6 | packet-in events and how to install flow entries to OpenFlow switches. Thus, 7 | it does not provide full load balancer functionality and definitely does not 8 | work in real network environment. 9 | -------------------------------------------------------------------------------- /learning_switch_edged/learning_switch.conf: -------------------------------------------------------------------------------- 1 | trema_switch( "sw1" ) { 2 | datapath_id "0x1" 3 | } 4 | 5 | trema_switch( "sw2" ) { 6 | datapath_id "0x2" 7 | } 8 | 9 | vhost ( "host1" ) { 10 | ip "192.168.0.1" 11 | netmask "255.255.0.0" 12 | mac "00:00:00:01:00:01" 13 | } 14 | 15 | vhost ( "host2" ) { 16 | ip "192.168.0.2" 17 | netmask "255.255.0.0" 18 | mac "00:00:00:01:00:02" 19 | } 20 | 21 | link "sw1", "host1" 22 | link "sw2", "host2" 23 | link "sw1", "sw2" 24 | -------------------------------------------------------------------------------- /Rakefile: -------------------------------------------------------------------------------- 1 | require "cucumber/rake/task" 2 | 3 | 4 | Cucumber::Rake::Task.new 5 | 6 | 7 | def apps 8 | ( Dir.glob( "*" ) - [ "features" ] ).select do | each | 9 | File.directory?( each ) 10 | end 11 | end 12 | 13 | 14 | def c_apps 15 | apps.select do | each | 16 | FileTest.exists? File.join( each, "Makefile" ) 17 | end 18 | end 19 | 20 | 21 | task :clean do 22 | c_apps.each do | each | 23 | cd each do 24 | sh "make clean" 25 | end 26 | end 27 | end 28 | -------------------------------------------------------------------------------- /sliceable_switch/test/redirector/www/index.html: -------------------------------------------------------------------------------- 1 | 2 |
3 | 4 | 5 |
11 |
12 |