Giter VIP home page Giter VIP logo

trema'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:

trema's People

Contributors

amotoki avatar cdwertmann avatar hideyukishimonishi avatar hkwi avatar infrastation avatar masap avatar miyakz1192 avatar miz-take avatar nhst-zz avatar nickkaranatsios avatar otahi avatar rakshasa avatar shun159 avatar sugyo avatar userlocalhost 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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

trema's Issues

log rotation

Support external log rotators (logrotate etc.)
Need to handle signal HUP

cruise.rb sometimes fails

cruise.rb sometimes fails with the following error.

# features/step_definitions/trema_steps.rb:83
    And *** sleep 20 ***                                                                          # features/step_definitions/trema_steps.rb:78
/home/bisco/bisco/ruby/trema/cli.rb:32:in `send_packets': undefined method `interface' for nil:NilClass (NoMethodError)
    from /home/bisco/bisco/ruby/trema/sub-commands.rb:179:in `send_packets'
    from ./trema:62:in `__send__'
    from ./trema:62
    from /usr/lib/ruby/1.8/fileutils.rb:121:in `chdir'
    from /usr/lib/ruby/1.8/fileutils.rb:121:in `cd'

Do not embed absolute paths in libtrema.a

When debugging with other persons core file, we cannot view source code because absolute paths are embedded in libtrema.a

#0  0xb7f0e424 in ?? () from /lib/i686/cmov/libc.so.6
(gdb) bt
#0  0xb7f0e424 in ?? () from /lib/i686/cmov/libc.so.6
#1  0xb7e79fdd in ?? () from /lib/i686/cmov/libc.so.6
#2  0x0805269d in start_messenger ()
    at /home/.../trema/src/lib/messenger.c:1704
#3  0x0805404f in start_trema ()
    at /home/.../trema/src/lib/trema.c:570
#4  0x0804c297 in main (argc=5, argv=0xbfd2b1c4)
    at src/switch_manager/switch.c:449

log messages are not displayed

In current HEAD (c363972), routing_switch doesn't print log messages to stdout.

About one month ago, I got following messages.

$ ./trema run -c src/examples/routing_switch/routing_switch.conf
idle_timeout is set to 60
Adding a port: dpid = 0xe0, port = 1
Adding a port: dpid = 0xe0, port = 2

Ruby applications cannot be daemonized

$ ./trema run src/examples/repeater_hub/repeater-hub.rb -c src/examples/repeater_hub/repeater_hub.conf -d
/home2/y-chiba/trema/trema/ruby/trema/app.rb:133:in `command': undefined method `[]' for nil:NilClass (NoMethodError)
        from /home2/y-chiba/trema/trema/ruby/trema/app.rb:72:in `daemonize!'
        from /home2/y-chiba/trema/trema/ruby/trema/dsl/runner.rb:140:in `maybe_daemonize_apps'
        from /home2/y-chiba/trema/trema/ruby/trema/ordered-hash.rb:63:in `call'
        from /home2/y-chiba/trema/trema/ruby/trema/ordered-hash.rb:63:in `each'
        from /home2/y-chiba/trema/trema/ruby/trema/ordered-hash.rb:62:in `each'
        from /home2/y-chiba/trema/trema/ruby/trema/dsl/runner.rb:139:in `maybe_daemonize_apps'
        from /home2/y-chiba/trema/trema/ruby/trema/dsl/runner.rb:39:in `daemonize'
        from /home2/y-chiba/trema/trema/ruby/trema/sub-commands.rb:67:in `run'
        from ./trema:62:in `__send__'
        from ./trema:62
        from /usr/lib/ruby/1.8/fileutils.rb:121:in `chdir'
        from /usr/lib/ruby/1.8/fileutils.rb:121:in `cd'
        from ./trema:53

dump_flows does not work

trema dump_flows causes the following error.

$ ./trema run -c src/examples/learning_switch/learning_switch.conf -d
$ ./trema dump_flows lsw
/home/bisco/trema/ruby/trema/sub-commands.rb:244:in `dump_flows': uninitialized constant Trema::SubCommands::Ofctl (NameError)
        from ./trema:62:in `__send__'
        from ./trema:62
        from /usr/lib/ruby/1.8/fileutils.rb:121:in `chdir'
        from /usr/lib/ruby/1.8/fileutils.rb:121:in `cd'
        from ./trema:53

no reasonable default for show_stats

brandonh@ubuntu:~/trema$ ./trema show_stats host1
/home/brandonh/trema/ruby/trema/sub-commands.rb:211:in `show_stats': We should not reach here. (RuntimeError)
    from ./trema:62:in `__send__'
    from ./trema:62
    from /usr/lib/ruby/1.8/fileutils.rb:121:in `chdir'
    from /usr/lib/ruby/1.8/fileutils.rb:121:in `cd'
    from ./trema:53

Show required params, or better, show all by default

switch_manager Aborted without any error msg

Description:
switch_manager aborted without any error msg

Details:
I write a config file for Trema to exe, and it claims:
/home/leisun/new/l2plus_routing_switch/trema/ruby/trema/util.rb:47:in `sh': Command '/home/leisun/new/l2plus_routing_switch/trema/objects/switch_manager/switch_manager --daemonize --port=6633 -- port_status::topology packet_in::filter state_notify::topology' failed! (RuntimeError)

When I only run switch_manager, I got this:
leisun@tovpc08:~/new/l2plus_routing_switch/trema$ /home/leisun/new/l2plus_routing_switch/trema/objects/switch_manager/switch_manager --daemonize --port=6633 -- port_status::topology packet_in::filter state_notify::topology
Aborted

Version info:
trema> git log
commit 0665827
Merge: 83d25fe 40e0ac4
Author: Yasuhito Takamiya [email protected]
Date: Mon Sep 5 18:07:36 2011 -0700

apps>git log
commit edf68700b868e7f37ea1afe5b33541bae916612d
Author: SUGYO [email protected]
Date: Thu Sep 1 17:17:53 2011 +0900

fix maximum number of processes

Trema::Mac in dictionaries give unexpected behavior

When using learning_switch/learning-switch.rb none of the learned MAC addresses in @fdb would match on later packets, instead growing the dictionary each time. Checking the dictionary with the same Trema::Mac instance would however give a match.

Not sure if this issue is limited to my system, however it was fixed by adding explicit 'hash' and 'eq?' functions to Trema::Mac.

More friendly error messages

Should show more friendly error messages when sh() fails.

...trema/util.rb:47:in `sh': Command '...trema/objects/switch_manager/switch_manager --daemonize --port=6633 -- port_status::learning_switch packet_in::learning_switch state_notify::learning_switch' failed! (RuntimeError)

Switch port # should be specified in DSL

Switch port # should be specified in DSL. In current implementation, switch port # is automatically determined and assigned but it can be explicitly specified in configuration file (DSL).

./trema/build.rb fails

./trema/build.rb fails with the following error.

$ ./trema/build.rb
rant: [ERROR] No Rantfile found, looking for:
              Rantfile, rantfile, root.rant
rant aborted!

Bug with send_packet_out

As the following code (spec/repeater_hub.rb), one form of send_packet_out works, but the other one using packet_in does not. FYI.

require File.join(File.dirname(__FILE__), "spec_helper")                                                       

class RepeaterHub < Trema::Controller                                                                          
  def packet_in datapath_id, message                                                                           
    send_flow_mod_add(datapath_id,                                                                             
                      :match => ExactMatch.from(message),                                                      
                      :actions => ActionOutput.new(OFPP_FLOOD))                                                
##THIS DOES NOT WORK...                                                                                        
#    send_packet_out(datapath_id,                                                                              
#                    :packet_in => message,                                                                    
#                    :actions => Trema::ActionOutput.new(OFPP_FLOOD))                                          

##But this works!                                                                                              
    send_packet_out(datapath_id,                                                                               
                    :data => message.buffered? ? nil : message.data,                                           
                    :in_port => message.in_port,                                                               
                    :buffer_id => message.buffer_id,                                                           
                    :actions => Trema::ActionOutput.new(OFPP_FLOOD)                                            
                    )                                                                                          
  end                                                                                                          
end                                                                                                            

describe RepeaterHub do                                                                                        
  it "should flood incoming packets to every other port" do                                                    

    network {                                                                                                  
      vswitch("switch") { dpid "0xabc" }                                                                       

      vhost ("host1") { promisc "on" }                                                                         
      vhost ("host2") { promisc "on" }                                                                         
      vhost ("host3") { promisc "on" }                                                                         

      link "switch", "host1"                                                                                   
      link "switch", "host2"                                                                                   
      link "switch", "host3"                                                                                   
    }.run(RepeaterHub) {                                                                                       
      vhost("host1").send_packet "host2"                                                                       

      vhost("host2").stats(:rx).should have(1).packets                                                         
      vhost("host3").stats(:rx).should have(1).packets                                                         
    }                                                                                                          
  end                                                                                                          
end

Segmentation fault in switch_manager

#0  0xb775b6a8 in vfprintf () from /lib/i686/cmov/libc.so.6
#1  0xb7783464 in vsnprintf () from /lib/i686/cmov/libc.so.6
#2  0x0805de59 in _die (format=0x80641a4 "Logger is not initialized. Call init_log() first")
at /home2/y-chiba/trema/trema/src/lib/utility.c:44
#3  0x0804be1e in check_initialized () at /home2/y-chiba/trema/trema/src/lib/log.c:208
#4  0x0804beb0 in _get_logging_level () at /home2/y-chiba/trema/trema/src/lib/log.c:231
#5  0x0804bfd9 in _critical (
    format=0xbf665b64 "Logger is not initialized. Call init_log() first")
    at /home2/y-chiba/trema/trema/src/lib/log.c:273
#6  0x0805de6c in _die (format=0x80641a4 "Logger is not initialized. Call init_log() first")
    at /home2/y-chiba/trema/trema/src/lib/utility.c:47
#7  0x0804be1e in check_initialized () at /home2/y-chiba/trema/trema/src/lib/log.c:208
#8  0x0804beb0 in _get_logging_level () at /home2/y-chiba/trema/trema/src/lib/log.c:231
#9  0x0804bfd9 in _critical (
    format=0xbf666004 "Logger is not initialized. Call init_log() first")
    at /home2/y-chiba/trema/trema/src/lib/log.c:273
#10 0x0805de6c in _die (format=0x80641a4 "Logger is not initialized. Call init_log() first")
    at /home2/y-chiba/trema/trema/src/lib/utility.c:47

free packet_info with free_buffer()

packet_info should be freed with free_buffer() i.e.,

parse_packet( buffer );
// ... do something ...
free_buffer( buffer ); // not free_packet()

// buffer knows how to free its user_data:
// struct buffer {
//   ...
//   user_data_free_function = free_packet;
// }

Warnings in Ruby binding

We could observe the following warnings. They should be fixed.

trema/action_common.c: In function 'nw_addr_to_i':
trema/action_common.c:31: warning: conversion to 'uint32_t' from 'long unsigned int' may alter its value
trema/action_common.c: In function 'dl_addr_short':
trema/action_common.c:41: warning: conversion to 'int' from 'long int' may alter its value
trema/hello.c: In function 'hello_init':
trema/hello.c:47: warning: conversion to 'uint32_t' from 'long unsigned int' may alter its value
trema/controller.c: In function 'form_actions':
trema/controller.c:77: warning: conversion to 'int' from 'long int' may alter its value
trema/controller.c: In function 'controller_send_flow_mod':
trema/controller.c:132: warning: conversion to 'uint16_t' from 'long unsigned int' may alter its value
trema/controller.c:137: warning: conversion to 'uint16_t' from 'long unsigned int' may alter its value
trema/controller.c:142: warning: conversion to 'uint16_t' from 'long unsigned int' may alter its value
trema/controller.c:147: warning: conversion to 'uint32_t' from 'long unsigned int' may alter its value
trema/controller.c: In function 'controller_send_packet_out':
trema/controller.c:346: warning: assignment discards qualifiers from pointer target type
trema/controller.c:351: warning: conversion to 'uint32_t' from 'long unsigned int' may alter its value
trema/controller.c: In function 'controller_run':
trema/controller.c:401: warning: conversion to 'long unsigned int' from 'int' may change the sign of the result
trema/controller.c:403: warning: assignment discards qualifiers from pointer target type
trema/features_request.c: In function 'features_request_init':
trema/features_request.c:47: warning: conversion to 'uint32_t' from 'long unsigned int' may alter its value
trema/set_config.c: In function 'set_config_init':
trema/set_config.c:42: warning: conversion to 'uint32_t' from 'long unsigned int' may alter its value

Unable to receive packet in debug mode

When running repeater_hub example with debug mode, host1 is able to send packet, but host2 is not able to receive any packet.

LOGGING_LEVEL=debug ./trema run ./objects/examples/repeater_hub/repeater_hub -c ./src/examples/repeater_hub/repeater_hub.conf

show_stats w/no options causes error

/home/brandonh/trema/ruby/trema/sub-commands.rb:211:in show_stats': We should not reach here. (RuntimeError) from ./trema:62:insend'
from ./trema:62
from /usr/lib/ruby/1.8/fileutils.rb:121:in chdir' from /usr/lib/ruby/1.8/fileutils.rb:121:incd'
from ./trema:53

If options are required, then at least print a help message; even better would be to show stats for all hosts.

cruise.rb hangs up

In cucumber scenarios, when fail to execute trema processes for some reason, the step "And wait until .... is up" never returns and whole cruise.rb hangs up.

  Scenario: Send and receive packets (in Ruby)                                                                             # features/example.learning_switch.feature:26
    Given I try trema run "./src/examples/learning_switch/learning-switch.rb" with following configuration (backgrounded): # features/step_definitions/run_steps.rb:32
      """
      vswitch("learning") { datapath_id "0xabc" }

      vhost("host1")
      vhost("host2")

      link "learning", "host1"
      link "learning", "host2"
      """
/home/ccrb/.cruise/projects/trema/work/features/support/env.rb:30:in `run': Failed to execute ./trema run "./src/examples/learning_switch/learning-switch.rb" -c /tmp/trema.conf20110808-1263-vqmqjt-0  >> /home/ccrb/.cruise/projects/trema/work/tmp/log/tmp.KvP9Lov381 2>&1 (RuntimeError)
    from /home/ccrb/.cruise/projects/trema/work/features/step_definitions/run_steps.rb:44
    from /usr/lib/ruby/1.8/tempfile.rb:188:in `open'
    from /home/ccrb/.cruise/projects/trema/work/features/step_definitions/run_steps.rb:41
    from /home/ccrb/.cruise/projects/trema/work/features/step_definitions/run_steps.rb:50:in `call'
    from /home/ccrb/.cruise/projects/trema/work/features/step_definitions/run_steps.rb:50
    from /home/ccrb/.cruise/projects/trema/work/features/step_definitions/run_steps.rb:49:in `fork'
    from /home/ccrb/.cruise/projects/trema/work/features/step_definitions/run_steps.rb:49
    from /var/lib/gems/1.8/gems/cucumber-0.9.4/bin/../lib/cucumber/core_ext/instance_exec.rb:48:in `instance_exec'
    from /var/lib/gems/1.8/gems/cucumber-0.9.4/bin/../lib/cucumber/core_ext/instance_exec.rb:48:in `cucumber_instance_exec'
    from /var/lib/gems/1.8/gems/cucumber-0.9.4/bin/../lib/cucumber/core_ext/instance_exec.rb:69:in `cucumber_run_with_backtrace_filtering'
    from /var/lib/gems/1.8/gems/cucumber-0.9.4/bin/../lib/cucumber/core_ext/instance_exec.rb:36:in `cucumber_instance_exec'
    from /var/lib/gems/1.8/gems/cucumber-0.9.4/bin/../lib/cucumber/rb_support/rb_step_definition.rb:62:in `invoke'
    from /var/lib/gems/1.8/gems/cucumber-0.9.4/bin/../lib/cucumber/step_match.rb:26:in `invoke'
    from /var/lib/gems/1.8/gems/cucumber-0.9.4/bin/../lib/cucumber/ast/step_invocation.rb:63:in `invoke'
    from /var/lib/gems/1.8/gems/cucumber-0.9.4/bin/../lib/cucumber/ast/step_invocation.rb:42:in `accept'
    from /var/lib/gems/1.8/gems/cucumber-0.9.4/bin/../lib/cucumber/ast/tree_walker.rb:99:in `visit_step'
    from /var/lib/gems/1.8/gems/cucumber-0.9.4/bin/../lib/cucumber/ast/tree_walker.rb:164:in `broadcast'
    from /var/lib/gems/1.8/gems/cucumber-0.9.4/bin/../lib/cucumber/ast/tree_walker.rb:98:in `visit_step'
    from /var/lib/gems/1.8/gems/cucumber-0.9.4/bin/../lib/cucumber/ast/step_collection.rb:15:in `accept'
    from /var/lib/gems/1.8/gems/cucumber-0.9.4/bin/../lib/cucumber/ast/step_collection.rb:14:in `each'
    from /var/lib/gems/1.8/gems/cucumber-0.9.4/bin/../lib/cucumber/ast/step_collection.rb:14:in `accept'
    from /var/lib/gems/1.8/gems/cucumber-0.9.4/bin/../lib/cucumber/ast/tree_walker.rb:93:in `visit_steps'
    from /var/lib/gems/1.8/gems/cucumber-0.9.4/bin/../lib/cucumber/ast/tree_walker.rb:164:in `broadcast'
    from /var/lib/gems/1.8/gems/cucumber-0.9.4/bin/../lib/cucumber/ast/tree_walker.rb:92:in `visit_steps'
    from /var/lib/gems/1.8/gems/cucumber-0.9.4/bin/../lib/cucumber/ast/scenario.rb:53:in `accept'
    from /var/lib/gems/1.8/gems/cucumber-0.9.4/bin/../lib/cucumber/runtime.rb:79:in `with_hooks'
    from /var/lib/gems/1.8/gems/cucumber-0.9.4/bin/../lib/cucumber/runtime.rb:95:in `before_and_after'
    from /var/lib/gems/1.8/gems/cucumber-0.9.4/bin/../lib/cucumber/runtime.rb:78:in `with_hooks'
    from /var/lib/gems/1.8/gems/cucumber-0.9.4/bin/../lib/cucumber/runtime/support_code.rb:115:in `call'
    from /var/lib/gems/1.8/gems/cucumber-0.9.4/bin/../lib/cucumber/runtime/support_code.rb:115:in `around'
    from /var/lib/gems/1.8/gems/cucumber-0.9.4/bin/../lib/cucumber/language_support/language_methods.rb:13:in `around'
    from /var/lib/gems/1.8/gems/cucumber-0.9.4/bin/../lib/cucumber/language_support/language_methods.rb:95:in `call'
    from /var/lib/gems/1.8/gems/cucumber-0.9.4/bin/../lib/cucumber/language_support/language_methods.rb:95:in `execute_around'
    from /var/lib/gems/1.8/gems/cucumber-0.9.4/bin/../lib/cucumber/language_support/language_methods.rb:12:in `around'
    from /var/lib/gems/1.8/gems/cucumber-0.9.4/bin/../lib/cucumber/runtime/support_code.rb:114:in `around'
    from /var/lib/gems/1.8/gems/cucumber-0.9.4/bin/../lib/cucumber/runtime/support_code.rb:112:in `call'
    from /var/lib/gems/1.8/gems/cucumber-0.9.4/bin/../lib/cucumber/runtime/support_code.rb:112:in `around'
    from /var/lib/gems/1.8/gems/cucumber-0.9.4/bin/../lib/cucumber/runtime.rb:90:in `around'
    from /var/lib/gems/1.8/gems/cucumber-0.9.4/bin/../lib/cucumber/runtime.rb:77:in `with_hooks'
    from /var/lib/gems/1.8/gems/cucumber-0.9.4/bin/../lib/cucumber/ast/scenario.rb:51:in `accept'
    from /var/lib/gems/1.8/gems/cucumber-0.9.4/bin/../lib/cucumber/ast/scenario.rb:106:in `with_visitor'
    from /var/lib/gems/1.8/gems/cucumber-0.9.4/bin/../lib/cucumber/ast/scenario.rb:45:in `accept'
    from /var/lib/gems/1.8/gems/cucumber-0.9.4/bin/../lib/cucumber/ast/tree_walker.rb:51:in `visit_feature_element'
    from /var/lib/gems/1.8/gems/cucumber-0.9.4/bin/../lib/cucumber/ast/tree_walker.rb:164:in `broadcast'
    from /var/lib/gems/1.8/gems/cucumber-0.9.4/bin/../lib/cucumber/ast/tree_walker.rb:50:in `visit_feature_element'
    from /var/lib/gems/1.8/gems/cucumber-0.9.4/bin/../lib/cucumber/ast/feature.rb:35:in `accept'
    from /var/lib/gems/1.8/gems/cucumber-0.9.4/bin/../lib/cucumber/ast/feature.rb:34:in `each'
    from /var/lib/gems/1.8/gems/cucumber-0.9.4/bin/../lib/cucumber/ast/feature.rb:34:in `accept'
    from /var/lib/gems/1.8/gems/cucumber-0.9.4/bin/../lib/cucumber/ast/tree_walker.rb:20:in `visit_feature'
    from /var/lib/gems/1.8/gems/cucumber-0.9.4/bin/../lib/cucumber/ast/tree_walker.rb:164:in `broadcast'
    from /var/lib/gems/1.8/gems/cucumber-0.9.4/bin/../lib/cucumber/ast/tree_walker.rb:19:in `visit_feature'
    from /var/lib/gems/1.8/gems/cucumber-0.9.4/bin/../lib/cucumber/ast/features.rb:29:in `accept'
    from /var/lib/gems/1.8/gems/cucumber-0.9.4/bin/../lib/cucumber/ast/features.rb:17:in `each'
    from /var/lib/gems/1.8/gems/cucumber-0.9.4/bin/../lib/cucumber/ast/features.rb:17:in `each'
    from /var/lib/gems/1.8/gems/cucumber-0.9.4/bin/../lib/cucumber/ast/features.rb:28:in `accept'
    from /var/lib/gems/1.8/gems/cucumber-0.9.4/bin/../lib/cucumber/ast/tree_walker.rb:14:in `visit_features'
    from /var/lib/gems/1.8/gems/cucumber-0.9.4/bin/../lib/cucumber/ast/tree_walker.rb:164:in `broadcast'
    from /var/lib/gems/1.8/gems/cucumber-0.9.4/bin/../lib/cucumber/ast/tree_walker.rb:13:in `visit_features'
    from /var/lib/gems/1.8/gems/cucumber-0.9.4/bin/../lib/cucumber/runtime.rb:45:in `run!'
    from /var/lib/gems/1.8/gems/cucumber-0.9.4/bin/../lib/cucumber/cli/main.rb:48:in `execute!'
    from /var/lib/gems/1.8/gems/cucumber-0.9.4/bin/../lib/cucumber/cli/main.rb:21:in `execute'
    from /var/lib/gems/1.8/gems/cucumber-0.9.4/bin/cucumber:8
    from /var/lib/gems/1.8/bin/cucumber:19:in `load'
    from /var/lib/gems/1.8/bin/cucumber:19
./trema killall
    And wait until "LearningSwitch" is up                                                                                  # features/step_definitions/misc_steps.rb:26
(hang-up here)

Trema compilation fails on 64 bit machine

gcc -I/root/trema/objects/openflow -g -std=c99 -D_GNU_SOURCE -fno- 
strict-aliasing -Werror -Wall -Wextra -Wformat=2 -Wcast-qual -Wcast- 
align -Wwrite-strings -Wconversion -Wfloat-equal -Wpointer-arith -c - 
o /root/trema/objects/lib/ether.o /root/trema/src/lib/ether.c 
cc1: warnings being treated as errors 
/root/trema/src/lib/ether.c: In function ‘parse_ether’: 
/root/trema/src/lib/ether.c:55: error: conversion to ‘uint32_t’ from 
‘size_t’ may alter its value 
/root/trema/src/lib/ether.c:80: error: conversion to ‘uint32_t’ from 
‘long unsigned int’ may alter its value 
/root/trema/src/lib/ether.c:93: error: conversion to ‘uint32_t’ from 
‘long unsigned int’ may alter its value 
rant: [ERROR] in file `/root/trema/Rantfile', line 330: 
rant: [ERROR] Task `default' fail. 
rant aborted! 

Build failed

I am using Ubuntu 10.04 (lucid). And ./build.rb fails with the following message

gcc -shared -o trema.so rbuffer.o port.o controller.o trema.o match.o hello.o packet_in.o features_request.o action_output.o features_reply.o -L. -L/usr/lib -L/home/ykk/Code/trema/objects/lib -L. -Wl,-Bsymbolic-functions -rdynamic -Wl,-export-dynamic    -lruby1.8 -ltrema -lrt  -lpthread -lrt -ldl -lcrypt -lm   -lc
/home/ykk/Code/trema/objects/lib/libtrema.a(openflow_application_interface.o): In function `openflow_application_interface_is_initialized':
/home/ykk/Code/trema/src/lib/openflow_application_interface.c:137: multiple definition of `openflow_application_interface_is_initialized'
/home/ykk/Code/trema/objects/lib/libtrema.a(openflow_application_interface.o):/home/ykk/Code/trema/src/lib/openflow_application_interface.c:136: first defined here
/home/ykk/Code/trema/objects/lib/libtrema.a(openflow_application_interface.o): In function `init_openflow_application_interface':
/home/ykk/Code/trema/src/lib/openflow_application_interface.c:153: multiple definition of `init_openflow_application_interface'
/home/ykk/Code/trema/objects/lib/libtrema.a(openflow_application_interface.o):/home/ykk/Code/trema/src/lib/openflow_application_interface.c:161: first defined here
/home/ykk/Code/trema/objects/lib/libtrema.a(openflow_application_interface.o): In function `finalize_openflow_application_interface':
/home/ykk/Code/trema/src/lib/openflow_application_interface.c:183: multiple definition of `finalize_openflow_application_interface'
/home/ykk/Code/trema/objects/lib/libtrema.a(openflow_application_interface.o):/home/ykk/Code/trema/src/lib/openflow_application_interface.c:191: first defined here
/home/ykk/Code/trema/objects/lib/libtrema.a(openflow_application_interface.o): In function `set_openflow_event_handlers':
/home/ykk/Code/trema/src/lib/openflow_application_interface.c:200: multiple definition of `set_openflow_event_handlers'
/home/ykk/Code/trema/objects/lib/libtrema.a(openflow_application_interface.o):/home/ykk/Code/trema/src/lib/openflow_application_interface.c:208: first defined here
/home/ykk/Code/trema/objects/lib/libtrema.a(openflow_application_interface.o): In function `set_switch_disconnected_handler':
/home/ykk/Code/trema/src/lib/openflow_application_interface.c:232: multiple definition of `set_switch_disconnected_handler'
/home/ykk/Code/trema/objects/lib/libtrema.a(openflow_application_interface.o):/home/ykk/Code/trema/src/lib/openflow_application_interface.c:239: first defined here
/home/ykk/Code/trema/objects/lib/libtrema.a(openflow_application_interface.o): In function `set_error_handler':
/home/ykk/Code/trema/src/lib/openflow_application_interface.c:252: multiple definition of `set_error_handler'
/home/ykk/Code/trema/objects/lib/libtrema.a(openflow_application_interface.o):/home/ykk/Code/trema/src/lib/openflow_application_interface.c:259: first defined here
/home/ykk/Code/trema/objects/lib/libtrema.a(openflow_application_interface.o): In function `set_vendor_handler':
/home/ykk/Code/trema/src/lib/openflow_application_interface.c:272: multiple definition of `set_vendor_handler'
/home/ykk/Code/trema/objects/lib/libtrema.a(openflow_application_interface.o):/home/ykk/Code/trema/src/lib/openflow_application_interface.c:279: first defined here
/home/ykk/Code/trema/objects/lib/libtrema.a(openflow_application_interface.o): In function `set_features_reply_handler':
/home/ykk/Code/trema/src/lib/openflow_application_interface.c:292: multiple definition of `set_features_reply_handler'
/home/ykk/Code/trema/objects/lib/libtrema.a(openflow_application_interface.o):/home/ykk/Code/trema/src/lib/openflow_application_interface.c:299: first defined here
/home/ykk/Code/trema/objects/lib/libtrema.a(openflow_application_interface.o): In function `set_get_config_reply_handler':
/home/ykk/Code/trema/src/lib/openflow_application_interface.c:312: multiple definition of `set_get_config_reply_handler'
/home/ykk/Code/trema/objects/lib/libtrema.a(openflow_application_interface.o):/home/ykk/Code/trema/src/lib/openflow_application_interface.c:319: first defined here
/home/ykk/Code/trema/objects/lib/libtrema.a(openflow_application_interface.o): In function `set_flow_removed_handler':
/home/ykk/Code/trema/src/lib/openflow_application_interface.c:353: multiple definition of `set_flow_removed_handler'
/home/ykk/Code/trema/objects/lib/libtrema.a(openflow_application_interface.o):/home/ykk/Code/trema/src/lib/openflow_application_interface.c:359: first defined here
/home/ykk/Code/trema/objects/lib/libtrema.a(openflow_application_interface.o): In function `set_port_status_handler':
/home/ykk/Code/trema/src/lib/openflow_application_interface.c:373: multiple definition of `set_port_status_handler'
/home/ykk/Code/trema/objects/lib/libtrema.a(openflow_application_interface.o):/home/ykk/Code/trema/src/lib/openflow_application_interface.c:379: first defined here
/home/ykk/Code/trema/objects/lib/libtrema.a(openflow_application_interface.o): In function `set_stats_reply_handler':
/home/ykk/Code/trema/src/lib/openflow_application_interface.c:393: multiple definition of `set_stats_reply_handler'
/home/ykk/Code/trema/objects/lib/libtrema.a(openflow_application_interface.o):/home/ykk/Code/trema/src/lib/openflow_application_interface.c:399: first defined here
/home/ykk/Code/trema/objects/lib/libtrema.a(openflow_application_interface.o): In function `set_barrier_reply_handler':
/home/ykk/Code/trema/src/lib/openflow_application_interface.c:413: multiple definition of `set_barrier_reply_handler'
/home/ykk/Code/trema/objects/lib/libtrema.a(openflow_application_interface.o):/home/ykk/Code/trema/src/lib/openflow_application_interface.c:419: first defined here
/home/ykk/Code/trema/objects/lib/libtrema.a(openflow_application_interface.o): In function `set_queue_get_config_reply_handler':
/home/ykk/Code/trema/src/lib/openflow_application_interface.c:433: multiple definition of `set_queue_get_config_reply_handler'
/home/ykk/Code/trema/objects/lib/libtrema.a(openflow_application_interface.o):/home/ykk/Code/trema/src/lib/openflow_application_interface.c:439: first defined here
/home/ykk/Code/trema/objects/lib/libtrema.a(openflow_application_interface.o): In function `send_openflow_message':
/home/ykk/Code/trema/src/lib/openflow_application_interface.c:1467: multiple definition of `send_openflow_message'
/home/ykk/Code/trema/objects/lib/libtrema.a(openflow_application_interface.o):/home/ykk/Code/trema/src/lib/openflow_application_interface.c:1438: first defined here
collect2: ld returned 1 exit status
make: *** [trema.so] Error 1
cd -
rant: [ERROR] in file `/home/ykk/Code/trema/Rantfile', line 357: 
rant: [ERROR] Task `default' fail.
rant aborted!

Mandatory option of learning switch?

learning_switch dies without much useful info when mandatory option(s) are missing.
It should give an error message something like "--datapath_id option is a mandatory."

$ ./objects/examples/learning_switch/learning_switch --name learning_switch 
The Implementation of Learning Switch.
Usage: learning_switch [OPTION]...

  -n, --name=SERVICE_NAME     service name
  -i, --datapath_id=ID        datapath ID
  -d, --daemonize             run in the background
  -l, --logging_level=LEVEL   set logging level
  -h, --help                  display this help and exit

unfriendly error message when no daemonized trema emulator running

brandonh@ubuntu:~/trema$ ./trema send_packets --source host1
/home/brandonh/trema/ruby/trema/cli.rb:73:in `send_packets': undefined method `interface' for nil:NilClass (NoMethodError)
    from /home/brandonh/trema/ruby/trema/sub-commands.rb:180:in `send_packets'
    from ./trema:62:in `__send__'
    from ./trema:62
    from /usr/lib/ruby/1.8/fileutils.rb:121:in `chdir'
    from /usr/lib/ruby/1.8/fileutils.rb:121:in `cd'
    from ./trema:53

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.