Giter Club home page Giter Club logo

ofsoftswitch13's Introduction

Basic OpenFlow Software Switch (BOFUSS)

This is an OpenFlow 1.3 compatible user-space software switch implementation. The code is based on the Ericsson TrafficLab 1.1 softswitch implementation, with changes in the forwarding plane to support OpenFlow 1.3.

If you use the switch for academic purpuses, please consider the use of this citation.

@article{fernandes2020road,
  title={The road to BOFUSS: The basic OpenFlow userspace software switch},
  author={Fernandes, Eder Le{\~a}o and Rojas, Elisa and Alvarez-Horcajo, Joaquin and Kis, Zolt{\`a}n Lajos and Sanvito, Davide and Bonelli, Nicola and Cascone, Carmelo and Rothenberg, Christian Esteve},
  journal={Journal of Network and Computer Applications},
  pages={102685},
  year={2020},
  publisher={Elsevier}
}

Check the Wiki for some resources that could possibly help you to modify the switch.

UPDATE: A new experimental branch with contributions from the BEBA EU Project is available with lots of performance improvements and OpenFlow extensions. If you want to try the code checkout to the BEBA-EU branch.

$ git checkout remotes/origin/BEBA-EU

The following components are available in this package:

  • ofdatapath: the switch implementation
  • ofprotocol: secure channel for connecting the switch to the controller
  • oflib: a library for converting to/from 1.3 wire format
  • dpctl: a tool for configuring the switch from the console

Getting Started

These instructions have been tested on Ubuntu 16.04. Other distributions or versions may need different steps.

Before building

The switch makes use of the NetBee library to parse packets, so we need to install it first.

  1. Install the following packages:

    $ sudo apt-get install cmake libpcap-dev libxerces-c3.1 libxerces-c-dev libpcre3 libpcre3-dev flex bison pkg-config autoconf libtool libboost-dev
    
  2. Clone and build netbee

    $ git clone https://github.com/netgroup-polito/netbee.git
    $ cd netbee/src
    $ cmake .
    $ make
    
  3. Add the shared libraries built in /nbeesrc/bin/ to your /usr/local/lib directory

    $ sudo cp ../bin/libn*.so /usr/local/lib
    
  4. Run ldconfig

    $ sudo ldconfig
    
  5. Put the contens of folder nbeesrc/include in the /usr/include

    $ sudo cp -R ../include/* /usr/include/
    

Building

Run the following commands in the ofsoftswitch13 directory to build and install everything:

$ ./boot.sh
$ ./configure
$ make
$ sudo make install

Running

  1. Start the datapath:

    $ sudo udatapath/ofdatapath --datapath-id=<dpid> --interfaces=<if-list> ptcp:<port>
    

    This will start the datapath, with the given datapath ID, using the interaces listed. It will open a passive TCP connection on the given port. For a complete list of options, use the --help argument.

  2. Start the secure channel, which will connect the datapath to the controller:

    $ secchan/ofprotocol tcp:<switch-host>:<switch-port> tcp:<ctrl-host>:<ctrl-port>
    

    This will open TCP connections to both the switch and the controller, relaying OpenFlow protocol messages between them. For a complete list of options, use the --help argument.

Configuring

You can send requests to the switch using the dpctl utility.

  • Check the flow statistics for table 0.

    $ utilities/dpctl tcp:<switch-host>:<switch-port> stats-flow table=0
    
  • Install a flow to match IPv6 packets with extension headers hop by hop and destination and coming from port 1.

    $ utilities/dpctl tcp:<switch-host>:<switch-port> flow-mod table=0,cmd=add in_port=1,eth_type=0x86dd,ext_hdr=hop+dest apply:output=2
    
  • Add a meter:

    $ utilities/dpctl tcp:<switch-host>:<switch-port> meter-mod cmd=add,meter=1 drop:rate=50
    
  • Send flow to meter table

    $ utilities/dpctl tcp:<switch-host>:<switch-port> flow-mod table=0,cmd=add in_port=1 meter:1
    

For a complete list of commands and arguments, use the --help argument. Also, check the wiki for Flow Mod examples

Contribute

Please submit your bug reports, fixes and suggestions as pull requests on GitHub, or by contacting us directly.

License

OpenFlow 1.3 Software Switch is released under the BSD license (BSD-like for code from the original Stanford switch).

Acknowledgments

This project was supported by Ericsson Innovation Center in Brazil. Formerly maintained by CPqD in technical collaboration with Ericsson Research.

List of Contributors

Contact

E-mail: Eder Leao Fernandes (ederleaofernandes at gmail . com)

ofsoftswitch13's People

Contributors

abakagamze avatar alnvdl avatar andredaube avatar cloudysunny14 avatar ederlf avatar janscheurich avatar janskalny avatar kapplerchris avatar ljerezchaves avatar mahdth avatar nikchez01 avatar rlane avatar rrdenicol avatar simhond avatar srijanmishra avatar teto avatar viktor-nordell avatar vitalivanov avatar yamt 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  avatar  avatar  avatar  avatar  avatar

ofsoftswitch13's Issues

Table feature request support ?

Does openswitch support the table feature request and if support can we set table feature? I have sent a request, but no reply is received.

Ofsoftswitch13 sends Flow Removed event with the priority value always 0.

After the hard timer expires, the flow entry is removed from the switch. Switch sends Flow Removed event with the priority value always 0, which is not matching with the priority used for flow mod (Addition) request.

Followings are the packet capture of secure channel.

OFS:0000-56dc-ad53-86bd: ver=1.3 FLOW_MOD xid=0x14
    0x0000:  040e0040  00000014  00000000  00000001
    0x0010:  00000000  00000001  0100000a  000a0001
                                               ^^^^Priority = 1
    0x0020:  ffffffff  fffffff8  fffffffc  00010000
    0x0030:  0001000c  80000004  00000001  00000000

OFS:0000-56dc-ad53-86bd: ver=1.3 FLOW_REMOVED xid=0x0
    0x0000:  040b0040  00000000  00000000  00000001
    0x0010:  00000101  0000000a  000a4cb8  000a0000
             ^^^^Priority = 0
    0x0020:  00000000  00000000  00000000  00000000
    0x0030:  0001000c  80000004  00000001  00000000

meter-features: datapath non-responsive or crashes

Tests performed with latest ofsoftswitch13 git clone. How to reproduce:

Run OpenFlow 1.3 switch app from LINC:

$ ryu-manager l2_switch_v1_3.py

Run mininet:

$ sudo mn --topo single,3 --mac --switch user,dpid=DEADBEEFBABE  --controller remote,ip=X.X.X.X

Ping in Mininet:

mininet> h1 ping h2

See pings working ok. Send meter-features in rapid succession:

$ dpctl tcp:127.0.0.1:6634 meter-features
SENDING:
stat_req{type="mfeat", flags="0x0"}
RECEIVED:
stat_repl{type="mfeat", flags="0x0"{max_meter="256", band_types="1",capabilities ="d", max_bands = 16 , max_color = 8}}
$ dpctl tcp:127.0.0.1:6634 meter-features
SENDING:
stat_req{type="mfeat", flags="0x0"}
RECEIVED:
stat_repl{type="mfeat", flags="0x0"{max_meter="3076666496", band_types="ab7cb28",capabilities ="809c260", max_bands = 160 , max_color = 70}}
$ dpctl tcp:127.0.0.1:6634 meter-features
SENDING:
stat_req{type="mfeat", flags="0x0"}

Expect a reply, instead reply hang and ping stops. Datapath is still running just not doing anything. Datapath will not recover without restarting the Mininet command above.

Bugs for Q-in-Q packet

I found two kinds of bugs: (1) vid matching bug and (2) vlan push and pop bug for Q-in-Q packet.
(1) vid matching bug:
I setup a rule including the vid match for outermost vlan tag, and the switch does not match the packet. But it matches without vid match (the following are the stats-flow results).
w/ vid:
screenshot from 2013-05-17 00 23 31

w/o vid:
screenshot from 2013-05-17 00 19 53

(2) vlan push and pop bugs:
Then, it derives the other two bugs when we try to push vlan or pop vlan in Q-in-Q packet after matching. The following are these two bug descriptions:
(a) vlan push bug:
When the switch pushes a vlan tag into a Q-in-Q packet, it will push the inner tag to the to the original packet (link1 is the packet pcap of my experiment - 1. original, 2. expected, and 3. received).
link1: https://www.dropbox.com/s/wvv78woe3uezh73/vlan_push

(b) vlan pop bug:
When the switch pops the outermost vlan tag of a Q-in-Q packet, we will get the malformed packet. (link2 is the packet pcap of my experiment - 1. original, 2. expected, and 3. received).
link2: https://www.dropbox.com/s/b2pjgt9r0ieqfqm/vlan_pop

Ofdatapath crashes after installing a rule of unknown-type action or instruction

I set up a rule with unknown instruction or action type.
Before:

estinet$ sudo ps aux | grep ofdatapath
root     12427  0.0  1.8  61068 18588 pts/0    S+   19:46   0:00 /home/estinet/Desktop/ofsoftswitch13/udatapath/ofdatapath -v -i veth0 veth2 veth4 veth6 punix:/tmp/ofd
estinet  12589  0.0  0.0   4392   828 pts/5    S+   20:02   0:00 grep --color=auto ofdatapath

After:


estinet$ sudo ps aux | grep ofdatapath
root     12427  0.0  0.0      0     0 pts/0    Z+   19:46   0:01 [ofdatapath]  defunc
estinet  12781  0.0  0.0   4388   828 pts/5    S+   20:41   0:00 grep --color=auto ofdatapath

Wireshark dump of my openflow message (link)

Edit:
The following conditions will also cause crash:

  1. Sending a flow mod message with goto_table instruction using non-existed table_id
  2. Sending a flow mod message with non-existed table_id

The queue config retrieval fails if we make the request with port no= OFPP_ANY.

The queue config retrieval fails if we make the request with port no= OFPP_ANY. Switch returns the OFPET_QUEUE_OP_FAILED(error type) & OFPQOFC_BAD_PORT(error code). But it works fine if we pass exact available port number.

Followings are the packet capture of secure channel.

1. QUEUE_GET_CONFIG_REQUEST with port=1
OFS:0000-3ed1-30bf-2ae1: ver=1.3 QUEUE_GET_CONFIG_REQUEST xid=0x12
    0x0000:  04160010  00000012  00000001  00000000
OFS:0000-3ed1-30bf-2ae1: ver=1.3 QUEUE_GET_CONFIG_REPLY xid=0x12
    0x0000:  04170010  00000012  00000001  00000000

2. QUEUE_GET_CONFIG_REQUEST with port=OFPP_ANY(0xffffffff)
OFS:0000-3ed1-30bf-2ae1: ver=1.3 QUEUE_GET_CONFIG_REQUEST xid=0x3f
    0x0000:  04160010  0000003f  ffffffff  00000000
OFS:0000-3ed1-30bf-2ae1: ver=1.3 ERROR xid=0x3f
    0x0000:  0401001c  0000003f  00090000  04160010
    0x0010:  0000003f  ffffffff  00000000

According to the specifications, OFPP_ANY is permitted.

struct ofp_queue_get_config_request {
    struct ofp_header header;
    uint32_t port; /* Port to be queried. Should refer
                      to a valid physical port (i.e. < OFPP_MAX),
                      or OFPP_ANY to request all configured
                      queues.*/
    uint8_t pad[4];
};

compilation failure with nbee

I'm running Ubuntu 12.04 amd64. I cloned the repo at 31704b1 and ran ./boot.sh&& ./configure --prefix=$PWD/install && make install, and I see this error:

gcc -Wstrict-prototypes  -g -O2 -Wall -Wno-sign-compare -Wpointer-arith -Wdeclaration-after-statement -Wformat-security -Wswitch-enum -Wunused-parameter -Wstrict-aliasing -Wbad-function-cast -Wcast-align -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-field-initializers -Wno-override-init -export-dynamic  -o udatapath/ofdatapath udatapath/udatapath_ofdatapath-action_set.o udatapath/udatapath_ofdatapath-crc32.o udatapath/udatapath_ofdatapath-datapath.o udatapath/udatapath_ofdatapath-dp_actions.o udatapath/udatapath_ofdatapath-dp_buffers.o udatapath/udatapath_ofdatapath-dp_control.o udatapath/udatapath_ofdatapath-dp_exp.o udatapath/udatapath_ofdatapath-dp_ports.o udatapath/udatapath_ofdatapath-flow_table.o udatapath/udatapath_ofdatapath-flow_entry.o udatapath/udatapath_ofdatapath-group_table.o udatapath/udatapath_ofdatapath-group_entry.o udatapath/udatapath_ofdatapath-match_std.o udatapath/udatapath_ofdatapath-meter_entry.o udatapath/udatapath_ofdatapath-meter_table.o udatapath/udatapath_ofdatapath-packet.o udatapath/udatapath_ofdatapath-packet_handle_std.o udatapath/udatapath_ofdatapath-pipeline.o udatapath/udatapath_ofdatapath-udatapath.o lib/libopenflow.a oflib/liboflib.a oflib-exp/liboflib_exp.a nbee_link/libnbee_link.a  -ldl -lnbee 
nbee_link/nbee_link.cpp:70: error: undefined reference to 'operator new(unsigned long)'
nbee_link/nbee_link.cpp:355: error: undefined reference to 'std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(char const*, std::allocator<char> const&)'
nbee_link/nbee_link.cpp:356: error: undefined reference to 'std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(char const*, std::allocator<char> const&)'
nbee_link/nbee_link.cpp:358: error: undefined reference to 'std::basic_string<char, std::char_traits<char>, std::allocator<char> >::compare(char const*) const'
nbee_link/nbee_link.cpp:369: error: undefined reference to 'std::basic_string<char, std::char_traits<char>, std::allocator<char> >::compare(char const*) const'
nbee_link/nbee_link.cpp:380: error: undefined reference to 'std::basic_string<char, std::char_traits<char>, std::allocator<char> >::compare(char const*) const'
nbee_link/nbee_link.cpp:390: error: undefined reference to 'std::basic_string<char, std::char_traits<char>, std::allocator<char> >::compare(char const*) const'
/usr/include/c++/4.6/bits/basic_string.h:235: error: undefined reference to 'std::basic_string<char, std::char_traits<char>, std::allocator<char> >::_Rep::_S_empty_rep_storage'
/usr/include/c++/4.6/bits/basic_string.h:235: error: undefined reference to 'std::basic_string<char, std::char_traits<char>, std::allocator<char> >::_Rep::_S_empty_rep_storage'
/usr/include/c++/4.6/bits/basic_string.h:244: error: undefined reference to 'std::basic_string<char, std::char_traits<char>, std::allocator<char> >::_Rep::_M_destroy(std::allocator<char> const&)'
/usr/include/c++/4.6/bits/basic_string.h:244: error: undefined reference to 'std::basic_string<char, std::char_traits<char>, std::allocator<char> >::_Rep::_M_destroy(std::allocator<char> const&)'
nbee_link/nbee_link.cpp:542: error: undefined reference to 'std::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string()'
nbee_link/nbee_link.cpp:542: error: undefined reference to 'std::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string()'
/usr/include/c++/4.6/ext/new_allocator.h:98: error: undefined reference to 'operator delete(void*)'
/usr/include/c++/4.6/ext/new_allocator.h:92: error: undefined reference to 'operator new(unsigned long)'
/usr/include/c++/4.6/bits/stl_tree.h:973: error: undefined reference to 'std::_Rb_tree_insert_and_rebalance(bool, std::_Rb_tree_node_base*, std::_Rb_tree_node_base*, std::_Rb_tree_node_base&)'
/usr/include/c++/4.6/bits/stl_tree.h:203: error: undefined reference to 'std::_Rb_tree_decrement(std::_Rb_tree_node_base*)'
/usr/include/c++/4.6/iostream:75: error: undefined reference to 'std::ios_base::Init::Init()'
/usr/include/c++/4.6/iostream:75: error: undefined reference to 'std::ios_base::Init::~Init()'
nbee_link/libnbee_link.a(nbee_link.o)(.eh_frame+0x86d3): error: undefined reference to '__gxx_personality_v0'
collect2: ld returned 1 exit status

Maybe this link needs to be done with g++?

OFPMP_PORT_DESC

Probably multipart req/rep with OFPMP_PORT_DESC is not supported now.
I think it is mandatory function.

compile error

hi,
i hava maked Netbee library successfully before. but when i compiled ofsoftswitch13, i got several errors. i don't know why. my os is centos6 which was installed in the vmware.

the full output when attempting to make ofsoftswitch13:

./lib/util.h:62:35: error: boost/static_assert.hpp: No such file or directory
In file included from nbee_link/nbee_link.h:17,
from nbee_link/nbee_link.cpp:15:
./lib/packets.h:132: error: expected constructor, destructor, or type conversion before ‘(’ token
./lib/packets.h:144: error: expected constructor, destructor, or type conversion before ‘(’ token
./lib/packets.h:153: error: expected constructor, destructor, or type conversion before ‘(’ token
./lib/packets.h:160: error: expected constructor, destructor, or type conversion before ‘(’ token
./lib/packets.h:176: error: expected constructor, destructor, or type conversion before ‘(’ token
./lib/packets.h:186: error: expected constructor, destructor, or type conversion before ‘(’ token
./lib/packets.h:236: error: expected constructor, destructor, or type conversion before ‘(’ token
./lib/packets.h:249: error: expected constructor, destructor, or type conversion before ‘(’ token
./lib/packets.h:257: error: expected constructor, destructor, or type conversion before ‘(’ token
./lib/packets.h:266: error: expected constructor, destructor, or type conversion before ‘(’ token
./lib/packets.h:289: error: expected constructor, destructor, or type conversion before ‘(’ token
./lib/packets.h:298: error: expected constructor, destructor, or type conversion before ‘(’ token
./lib/packets.h:320: error: expected constructor, destructor, or type conversion before ‘(’ token
./lib/packets.h:344: error: expected constructor, destructor, or type conversion before ‘(’ token
In file included from nbee_link/nbee_link.cpp:17:
./lib/hash.h: In function ‘uint32_t hash_double(double, uint32_t)’:
./lib/hash.h:83: error: ‘BOOST_STATIC_ASSERT’ was not declared in this scope
make[2]: *** [nbee_link/nbee_link.o] Error 1
make[2]: Leaving directory /root/Desktop/of12softswitch' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory/root/Desktop/of12softswitch'
make: *** [all] Error 2

'inport' action in group bucket causes crash

mininet@mininet-vm:~$ sudo dpctl unix:/tmp/s1 group-mod cmd=add,group=1,type=ff port=any output=in_port

SENDING:
grp_mod{group="1", cmd="add", type="ff", buckets=[{w="0", wprt="any", wgrp="any", acts=[out{port="in_port"}]}]}


OK.

mininet@mininet-vm:~$ sudo dpctl unix:/tmp/s1 flow-mod cmd=add,table=0 in_port=1 apply:group=1
apply:group=1

SENDING:
flow_mod{table="0", cmd="add", cookie="0x0", mask="0x0", idle="0", hard="0", prio="32768", buf="none", port="any", group="any", flags="0x0", match=oxm{in_port="1"}, insts=[apply{acts=[group{id="1"}]}]}


OK.

mininet> h1 ping h2
^CPING 10.0.0.2 (10.0.0.2) 56(84) bytes of data.

--- 10.0.0.2 ping statistics ---
1 packets transmitted, 0 received, 100% packet loss, time 0ms

mininet> 

mininet@mininet-vm:~$ sudo dpctl unix:/tmp/s1 stats-flow
Jun 11 09:47:25|00001|vconn_unix|ERR|/tmp/vconn-unix.5542.0: connection to /tmp/s1 failed: Connection refused
dpctl: Error connecting to switch unix:/tmp/s1. (Connection refused)

action set_field should not include in_port and in_phy_port and wirte metadata

According to spec page 60, "Set-Field actions for OXM types OFPXMT_OFB_IN_PORT,
OXM_OF_IN_PHY_PORT and OFPXMT_OFB_METADATA are not supported, because those are not header fields."

I set up a rule for these three fields, but all are pass.

SENDING:
stat_req{type="flow", flags="0x0", table="all", oport="any", ogrp="any", cookie=0x0", >mask=0x0", match=oxm{all match}}

RECEIVED:
stat_repl{type="flow", flags="0x0", stats=[{table="0", match="oxm{all match}", dur_s="268", >dur_ns="33000", prio="32768", idle_to="0", hard_to="0", cookie="0x0", pkt_cnt="0", >byte_cnt="0", insts=[apply{acts=[set_field{field:in_port="1"}, set_field{field:in_phy_port="1"}, >set_field{field:metadata="281474976710656"}]}]}]}

Can't send packets to controller with an action

mininet@mininet:~/ofsoftswitch13$ sudo dpctl unix:/tmp/s1 flow-mod table=2,cmd=add,prio=99 eth_type=0x800,ip_proto=6,ip_dst=10.0.2.1/24 write:output=0xfffffffd

SENDING:
flow_mod{table="2", cmd="add", cookie="0x0", mask="0x0", idle="0", hard="0", prio="99", buf="none", port="any", group="any", flags="0x0", match=oxm{ip_proto="6", ipv4_dst="10.0.2.1", ipv4_dst_mask="255.255.255.0", eth_type="0x800"}, insts=[write{acts=[out{port="0"}]}]}


RECEIVED:
error{type="BAD_ACTION", code="BAD_OUT_PORT", dlen="104"}

Yet:


/* Port numbering. Ports are numbered starting from 1. */
enum ofp_port_no {
    /* Maximum number of physical and logical switch ports. */
    OFPP_MAX = 0xffffff00,
    /* Reserved OpenFlow Port (fake output "ports"). */
    OFPP_IN_PORT = 0xfffffff8,    /* Send the packet out the input port. This
                                     reserved port must be explicitly used
                                     in order to send back out of the input
                                     port. */
    OFPP_TABLE = 0xfffffff9,      /* Submit the packet to the first flow table
                                     NB: This destination port can only be
                                     used in packet-out messages. */
    OFPP_NORMAL = 0xfffffffa,     /* Process with normal L2/L3 switching. */
    OFPP_FLOOD = 0xfffffffb,      /* All physical ports in VLAN, except input
                                     port and those blocked or link down. */
    OFPP_ALL = 0xfffffffc,        /* All physical ports except input port. */
    OFPP_CONTROLLER = 0xfffffffd, /* Send to controller. */
    OFPP_LOCAL = 0xfffffffe,      /* Local openflow "port". */
    OFPP_ANY = 0xffffffff         /* Wildcard port used only for flow mod
                                     (delete) and flow stats requests. Selects
                                     all flows regardless of output port
                                     (including flows with no output port). */
};

metadata matching

There are 2 problems with metadata flow matching:

  1. conversion to network order in oxm_match.c should be:
    case OFI_OXM_OF_METADATA:{
        ofl_structs_match_put64(match, f->header, hton64(*((uint64_t*) value)));
        return 0;
    }
    case OFI_OXM_OF_METADATA_W:{
        ofl_structs_match_put64m(match, f->header,hton64(*((uint64_t*) value)),hton64(*((uint64_t*) mask)));

I think there are more Endian issues in that area (e.g. OFI_OXM_OF_IN_PHY_PORT).

  1. Cannot use memset with uint64_t:
                memset(f->value,(*metadata & ~wi->metadata_mask) | (wi->metadata & wi->metadata_mask), sizeof(uint64_t));     

Should be:

                *metadata = (*metadata & ~wi->metadata_mask) | (wi->metadata & wi->metadata_mask);

Flow entries are deleted although out_port does not match

When I send flow_mod(OFPFC_DELETE) with out_port other than OFPP_ANY, flow entries that do not match out_port are deleted. According to spec 1.3.1, this behavior is described as follows.

A.3.4.1 Modify Flow Entry Message
/* Flow setup and teardown (controller -> datapath). */
struct ofp_flow_mod {
        :
    uint32_t out_port; /* For OFPFC_DELETE* commands, require
                                 matching entries to include this as an
                                 output port. A value of OFPP_ANY
                                 indicates no restriction. */
    uint32_t out_group; /* For OFPFC_DELETE* commands, require
                                    matching entries to include this as an
                                    output group. A value of OFPG_ANY
                                    indicates no restriction. */
}

So, it should check the out_port and out_group when it deletes flow_entries.
I propose a patch as follows.

diff --git a/udatapath/flow_table.c b/udatapath/flow_table.c
index 476ece4..cef5ec6 100644
--- a/udatapath/flow_table.c
+++ b/udatapath/flow_table.c
@@ -160,7 +160,9 @@ flow_table_delete(struct flow_table *table, struct ofl_msg_flow_mod *mod, bool s
     struct flow_entry *entry, *next;

     LIST_FOR_EACH_SAFE (entry, next, struct flow_entry, match_node, &table->match_entries) {
-        if (flow_entry_matches(entry, mod, strict, true/*check_cookie*/)) {
+        if ((mod->out_port == OFPP_ANY || flow_entry_has_out_port(entry, mod->out_port)) &&
+            (mod->out_group == OFPG_ANY || flow_entry_has_out_group(entry, mod->out_group)) &&
+            flow_entry_matches(entry, mod, strict, true/*check_cookie*/)) {
              flow_entry_remove(entry, OFPRR_DELETE);
         }
     }

Switch reconnects w/o failed Echo Request

Switch connects, receives flow_mods then sends an ECHO request and receives an ECHO reply. 16 seconds later it reconnects w/ a HELLO message. The OF spec is ambiguous about who is supposed to send periodic ECHO messages to keep the connection alive, but it implies the connection should only be restarted if an ECHO request times out:

In the case that a switch loses contact with all controllers, as a result of echo request timeouts, TLS session timeouts, or other disconnections, the switch should immediately enter either \fail secure mode or \fail standalone mode

p. 25 of OF 1.3.0

No packet-in messages to controller

Hi,

I'm trying to send in packet via one end of a veth-pair (the other end is connected to the switch), but I don't receive any packet-in messages.

Have a look at this session:

openflow@openflowvm:~$ dpctl tcp:127.0.0.1:6633 stats-port 2

SENDING:
stat_req{type="port", flags="0x0", port="2"}

RECEIVED:
stat_repl{type="port", flags="0x0", stats=[{port="2", rx_pkt="51", tx_pkt="0",  
             rx_bytes="3060", tx_bytes="0", rx_drops="0", tx_drops="0", rx_errs="0",
             tx_errs="0", rx_frm="0", rx_over="0", rx_crc="0", coll="0"}]}

openflow@openflowvm:~$ nc 192.168.100.1 9999
^C
openflow@openflowvm:~$ dpctl tcp:127.0.0.1:6633 stats-port 2

SENDING:
stat_req{type="port", flags="0x0", port="2"}

RECEIVED:
stat_repl{type="port", flags="0x0", stats=[{port="2", rx_pkt="54", tx_pkt="0",
             rx_bytes="3240", tx_bytes="0", rx_drops="0", tx_drops="0", rx_errs="0",
            tx_errs="0", rx_frm="0", rx_over="0", rx_crc="0", coll="0"}]}

As 'rx_pkt' indicates, something is entering the port. It is actually an arp-request:

> sudo tcpdump -ni east_to_lsw
06:14:01.749185 ARP, Request who-has 192.168.100.1 tell 192.168.100.2, length 28

But no packet-in message enters my controller.
I am connected to the switch and can retrieve info:

> show openflow switch 4 port-stats
PORTS INFO datapath-id=datapath-id (0xdatapath-id)
port 1:
  rx pkts=4467, bytes=593358, drop=0, errs=0, frame=0, over=0, crc=0
  tx pkts=0, bytes=0, drop=0, errs=0, coll=0,
port 2:
 rx pkts=69, bytes=4140, drop=0, errs=0, frame=0, over=0, crc=0
 tx pkts=0, bytes=0, drop=0, errs=0, coll=0,
port 3:
 rx pkts=72, bytes=4320, drop=0, errs=0, frame=0, over=0, crc=0
 tx pkts=0, bytes=0, drop=0, errs=0, coll=0,
port Local:
 rx pkts=6, bytes=468, drop=0, errs=0, frame=0, over=0, crc=0
 tx pkts=0, bytes=0, drop=0, errs=0, coll=0,
[ok][2013-09-18 12:34:55]

So any ideas?
Can I turn on some debug output on the switch?

Cheers, Tobbe

Support port up/down detection

Hi. In using the group entry with fast failover type we realized that the current code would not detect when a link (or port) goes up or down and update the bucket liveness condition automatically.
It'd be great if that can be fixed.

Thank you,
Marco

Packet seems to be hit to a wrong table.

This is the packet.
000c29f7789b 000c2970196a 0800 45 00 0054 0000 4000 40 01 b74d c0a80105 c0a80106

Above packet seems to be hit to below table and to be discarded.
{table="0", match="oxm{eth_dst="00:0c:29:70:19:6a", eth_dst_mask="00:00:00:00:00:00"}", dur_s="50", dur_ns="908000", prio="32768",
idle_to="30", hard_to="0", cookie="0xa4", pkt_cnt="53", byte_cnt="5156", insts=[apply{acts=[out{port="3"}]}]}

Below message was printed.
Feb 21 15:44:29|00441|dp_acts|WARN|can't directly forward to input port.

I doubt that it matches source MAC address of the packet and eth_dst of the flow entry.

Followings are detail information.
All tables to be set to the switch.
stat_repl{type="flow", flags="0x0", stats=[{table="0", match="oxm{eth_type="0x88cc"}", dur_s="66", dur_ns="552000", prio="65535",
idle_to="0", hard_to="0", cookie="0x0", pkt_cnt="2", byte_cnt="120", insts=[write{acts=[out{port="ctrl", mlen="65535"}]}]},
{table="0", match="oxm{eth_dst="00:0c:29:70:19:6a", eth_dst_mask="00:00:00:00:00:00"}", dur_s="50", dur_ns="908000", prio="32768",
idle_to="30", hard_to="0", cookie="0xa4", pkt_cnt="53", byte_cnt="5156", insts=[apply{acts=[out{port="3"}]}]}, {table="0",
match="oxm{in_port="2"}", dur_s="51", dur_ns="327000", prio="2", idle_to="0", hard_to="0", cookie="0x0", pkt_cnt="0", byte_cnt="0",
insts=[apply{acts=[out{port="ctrl", mlen="65535"}]}]}, {table="0", match="oxm{in_port="3"}", dur_s="51", dur_ns="327000", prio="2",
idle_to="0", hard_to="0", cookie="0x0", pkt_cnt="1", byte_cnt="60", insts=[apply{acts=[out{port="ctrl", mlen="65535"}]}]},
{table="0", match="oxm{all match}", dur_s="66", dur_ns="552000", prio="0", idle_to="0", hard_to="0", cookie="0x0", pkt_cnt="15",
byte_cnt="900", insts=[]}]}

Packet information.
(gdb) print *pkt
$40 = {dp = 0x214db90, buffer = 0x312eb00, in_port = 3,
action_set = 0x31312c0, packet_out = false, out_group = 4294967295,
out_port = 4294967295, out_port_max_len = 0, out_queue = 0,
table_id = 0 '\000', buffer_id = 4294967295, handle_std = 0x31312e0}
(gdb) print *(pkt->buffer)
$41 = {base = 0x312f2f0, allocated = 1648, data = 0x312f372, size = 98,
l2 = 0x0, l3 = 0x0, l4 = 0x0, l7 = 0x0, next = 0x0, private_p = 0x0}
(gdb) x/10x pkt->buffer->data
0x312f372: 0xf7290c00 0x0c009b78 0x6a197029 0x00450008
0x312f382: 0x00005400 0x01400040 0xa8c04db7 0xa8c00501
0x312f392: 0x00080601 0x2559f15a
(gdb)

Revision of the sources.
Following is the latest log of git log.
commit 5a8c9ba
Author: ederlf [email protected]
Date: Mon Jan 14 16:47:34 2013 -0200

If you need more information, please let me know.

Issue in openflow basic MPLS

Headline: SEG FAULT at switch(datapath) when a IPv6 ping packet is received from host1 destined to host2.

Expectation:
-Once a ping packet is received at switch, mpls header is added and its label and mpls ttl values are set and sent out on port 1.

Issue:
I have added below set of match fields, actions and observed segmentation fault at switch once a ping packet is received from Host1.

Flow entry added at switch 1:
root@remote-desktop:/home/ofsoftswitch13/utilities# ./dpctl unix:/var/run/dp0 stats-flow

SENDING:
stat_req{type="flow", flags="0x0", table="all", oport="any", ogrp="any", cookie=0x0", mask=0x0", match=oxm{all match}}
field->dl_type[0] dd86 ,(eth_type) 86dd
Jul 01 15:34:00|00001|ofl_act_u|WARN|[laxman]Unpacking MPLS_ACTION_PUSH
field->dl_type[0] dd86 ,(eth_type) 86dd
RECEIVED:
stat_repl{type="flow", flags="0x0", stats=[{table="0", match="oxm{eth_dst="00:1e:67:25:50:69", in_port="2", nw_dst_ipv6="2002::1", nw_src_ipv6="2002::2", eth_src="00:21:91:8b:86:41", eth_type="0x86dd"}", dur_s="31", dur_ns="676000", prio="32768", idle_to="0", hard_to="0", cookie="0x0", pkt_cnt="0", byte_cnt="0", insts=[apply{acts=[mpls_psh{eth="0x8847"}, mpls_ttl{ttl="3"}, set_field{field:[lax]mpls_label="512"}, out{port="1"}]}]}]}

GDB backtrace info is as follows:

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff798ffbb in CNetPDLExpression::GetOperandNumber(nbNetPDLExprBase, nbPDMLField, unsigned int*) () from /usr/local/lib/libnbee.so
(gdb) bt
#0 0x00007ffff798ffbb in CNetPDLExpression::GetOperandNumber(nbNetPDLExprBase, nbPDMLField, unsigned int*) () from /usr/local/lib/libnbee.so
#1 0x00007ffff798f322 in CNetPDLExpression::EvaluateExprNumber(nbNetPDLExprBase, nbPDMLField, unsigned int*) () from /usr/local/lib/libnbee.so
#2 0x00007ffff79a34f6 in CNetPDLProtoDecoder::ScanEncapsulationSection(nbNetPDLElementBase, unsigned int_, int_, int_) () from /usr/local/lib/libnbee.so
#3 0x00007ffff79a30d3 in CNetPDLProtoDecoder::GetNextProto(nbNetPDLElementBase, unsigned int_) () from /usr/local/lib/libnbee.so
#4 0x00007ffff798c90f in CNetPDLDecoder::DecodePacket(nbNetPDLLinkLayer_t, int, pcap_pkthdr const_, unsigned char const_) () from /usr/local/lib/libnbee.so
#5 0x000000000043f2d9 in nblink_packet_parse (pktin=0x163ae20, pktout=0x163be68,

pkt_proto=0x163a570) at nbee_link/nbee_link.cpp:339

#6 0x0000000000418ce5 in packet_handle_std_validate (handle=0x163be50)

at udatapath/packet_handle_std.c:67

#7 0x0000000000410a5d in set_field (pkt=0x163d240, action=0x163bf60)

at udatapath/dp_actions.c:76

#8 dp_execute_action (pkt=0x163d240, action=0x163bf60) at udatapath/dp_actions.c:704
#9 0x0000000000411b0f in dp_execute_action_list (pkt=0x163d240, actions_num=3,

actions=0x163c030, cookie=140737347584683) at udatapath/dp_actions.c:794

#10 0x00000000004198c1 in execute_entry (pl=0x6730f0, pkt=0x163d240) at udatapath/pipeline.c:504
#11 pipeline_process_packet (pl=0x6730f0, pkt=0x163d240) at udatapath/pipeline.c:158
#12 0x0000000000413e08 in process_buffer (dp=0x658b90) at udatapath/dp_ports.c:225
#13 dp_ports_run (dp=0x658b90) at udatapath/dp_ports.c:270
#14 0x000000000041006b in dp_run (dp=0x658b90) at udatapath/datapath.c:199
#15 0x000000000041a17c in udatapath_cmd (argc=6654864, argv=)

at udatapath/udatapath.c:178

A problem about generation ID in multiple Controllers

Hi ederlf :
I have two questions
1.
In function "dp_check_generation_id(struct datapath *dp, uint64_t new_gen_id)"
"((uint64_t)(dp->generation_id - new_gen_id) < 0)" this expression doesn't follow the spec

“distance(GEN_ID_X, cached_generation_id) < 0), distance(a, b) := (int64_t)(a - b)”,

I think it may be
"((int64_t)(new_gen_id - dp->generation_id) < 0)"

and also, I think case OFPCR_ROLE_NOCHANGE should also return the current generation id in function “dp_handle_role_request”
so I modify this function like this

uint32_t role = msg->role;
uint64_t generation_id = msg->generation_id;
switch (msg->role) {
case OFPCR_ROLE_NOCHANGE:{
role = sender->remote->role;
generation_id = dp->generation_id;
break;
}
..............
}
{
struct ofl_msg_role_request reply =
{{.type = OFPT_ROLE_REPLY},
.role = role,
.generation_id = generation_id};

dp_send_message(dp, (struct ofl_msg_header *)&reply, sender);
}

...........

just recommend, and sorry for my poor English!

in_port == out_port

  • dp_actions.c, line 997.
    A packet can only be sent if in_port is different from the out_port.
    What doesn't always make sense.
    It's possible that in_port is equal to the out_port.
    For example: two mobile devices connected to the same switch through interface wlan0 (same switch port)

agree?

When applying a group action to a frame, the action set is executed first

Hi,

I've noticed a behavior which I think is not according to the spec, wanted to hear your opinion:

Let's say I have the following CLI commands:

group-mod cmd=add,type=all,group=1 weight=0,port=any,group=any output=2
flow-mod cmd=add,table=0 eth_type=0x0800 write:push_vlan=0x8100,output=3 apply:group=1

For the above configuration, I would assume that a matching frame will be sent to port 2 without the vlan header.
Moreover, when reversing the "write" and "apply" command as:

flow-mod cmd=add,table=0 eth_type=0x0800 apply:group=1 write:push_vlan=0x8100,output=3

The vlan header is not pushed to the frame exiting from port 2.

According to the spec ('Instructions' chapter):
"The instructions of the set execute in the order speci fied by this above list"
The 'above' list indicates that "apply" should be executed first.

The fix should be easy if I'm not mistaken, just changing action_set_clone() function to only init the list without copying it.

Thanks.

Switch doesn't match properly on VLAN_VID

To reproduce:

Start mininet using a linear topo with two switches:

sudo mn --switch user --controller remote --arp --topo linear,2

Install a rule on s1 that pushes vlan tags with vid=1:

mininet> s1 dpctl unix:/tmp/s1 flow-mod table=0,cmd=add in_port=1 apply:push_vlan=0x8100,set_field=vlan_vid:1,output=2

Install a rule on s2 that should match:

mininet> s2 dpctl unix:/tmp/s2 flow-mod table=0,cmd=add in_port=2,vlan_vid=1 apply:

Now send traffic from h1 to h2 and interrupt it (ping shouldn't succeed since we are dropping the packets at s2)

mininet> h1 ping h2
^C

See that the rule on s1 fired:

mininet> s1 dpctl unix:/tmp/s1 stats-flow table=0

SENDING:
stat_req{type="flow", flags="0x0", table="0", oport="any", ogrp="any", cookie=0x0", mask=0x0", match=oxm{all match}}


RECEIVED:
stat_repl{type="flow", flags="0x0", stats=[{table="0", match="oxm{in_port="1"}", dur_s="293", dur_ns="698000", prio="32768", idle_to="0", hard_to="0", cookie="0x0", pkt_cnt="5", byte_cnt="490", insts=[apply{acts=[vlan_psh{eth="0x8100"}, set_field{field:vlan_vid="1"}, out{port="2"}]}]}]}

But the rule on s2 did not fire:

mininet> s2 dpctl unix:/tmp/s2 stats-flow table=0

SENDING:
stat_req{type="flow", flags="0x0", table="0", oport="any", ogrp="any", cookie=0x0", mask=0x0", match=oxm{all match}}


RECEIVED:
stat_repl{type="flow", flags="0x0", stats=[{table="0", match="oxm{in_port="2", vlan_vid="1"}", dur_s="10", dur_ns="67000", prio="32768", idle_to="0", hard_to="0", cookie="0x0", pkt_cnt="0", byte_cnt="0", insts=[apply{acts=[]}]}]}

Intercepting the packet in wireshark shows that vlan tag was correctly added after s1.

Instead of matching on vlan_vid, if we match explicitly on vlan_vid=none:

mininet> s2 dpctl unix:/tmp/s2 flow-mod table=0,cmd=add in_port=2,vlan_vid=none apply:

Now the rule will fire:

mininet> s2 dpctl unix:/tmp/s2 stats-flow table=0

SENDING:
stat_req{type="flow", flags="0x0", table="0", oport="any", ogrp="any", cookie=0x0", mask=0x0", match=oxm{all match}}


RECEIVED:
stat_repl{type="flow", flags="0x0", stats=[{table="0", match="oxm{in_port="2", vlan_vid= none}", dur_s="8", dur_ns="152000", prio="32768", idle_to="0", hard_to="0", cookie="0x0", pkt_cnt="2", byte_cnt="196", insts=[apply{acts=[]}]}]}

switch get crashed with push_pbb and MTU >1500 for full size ping

I connect end host with 1500 MTU to OF 1.3 switch, which is doing push_pbb. I increase MTU size to 1518 for switch interface, that is doing macinmac, but next switch get crashed on receiving frame of size more than 1514.

Reproduction of Error:
sudo mn --topo tree,depth=2,fanout=2 --mac --arp --switch user --controller remote

s1-----s3 ----h3
¦ ¦------h4
¦
s2 ---h1
¦----h2

sudo dpctl unix:/tmp/s2 flow-mod table=0,cmd=add in_port=1 apply:push_pbb=0x88E7,set_field=pbb_isid:34,set_field=eth_src:"00:00:00:00:01:01",set_field=eth_dst:"00:00:00:00:02:02",output=3
sudo dpctl unix:/tmp/s1 flow-mod table=0,cmd=add in_port=1 apply:output=2
sudo dpctl unix:/tmp/s1 flow-mod table=0,cmd=add in_port=2 apply:output=1
sudo dpctl unix:/tmp/s3 flow-mod table=0,cmd=add in_port=3 apply:pop_pbb,output=1
sudo dpctl unix:/tmp/s2 flow-mod table=0,cmd=add in_port=3 apply:pop_pbb,output=1
sudo dpctl unix:/tmp/s3 flow-mod table=0,cmd=add in_port=1 apply:push_pbb=0x88E7,set_field=pbb_isid:34,set_field=eth_src:"00:00:00:00:02:02",set_field=eth_dst:"00:00:00:00:01:01",output=3

h1> ping 10.0.0.3 -s1470 (shows actual 1498)

sudo ifconfig s2-eth3 mtu 1518 :: s2 will pass to s1 switch.
sudo ifconfig s1-eth1 mtu 1518 :: s1-eth1 sees traffic coming

and crashes s1 switch, with following message:
ofdatapath: 00008|netdev|WARN|error sending Ethernet packet on s1-eth2: Message too long
ofdatapath: 00009|fault|EMER|Caught signal 6.
ofdatapath: 00010|fault|EMER|Caught signal 11.

When "--no-local-port" is used, the last port cannot be used

In dp_ports.c, dp_ports_lookup() function should be updated for the case of no local port.

struct sw_port *
dp_ports_lookup(struct datapath *dp, uint32_t port_no)
{
// exclude local port from ports_num
uint32_t ports_num = dp->local_port ? dp->ports_num -1 : dp->ports_num;

if (port_no == OFPP_LOCAL) {
    return dp->local_port;
}

if (port_no < 1 || port_no > ports_num) {
    return NULL;
}

return &dp->ports[port_no];

}

Wireshark does not dissect OF13 packets

Started off with the pre-installed VM from ftp://paperboy.nysernet.org/OpenFlow13.tar.gz
Am able to successfully push flow-mods using dpctl and also get status on them. However, I do not see any OF13 dissection in the wireshark window. I have tried all possible interfaces for "capture". Could you please suggest what could be wrong?

metadata match parsing

There's a problem with the below metadata parsing in dpctl.c,

        if (sscanf(token, MATCH_METADATA KEY_VAL "0x%"SCNx64"", (&metadata))) {
            ofp_fatal(0, "Error parsing %s: %s.", MATCH_METADATA, token);
        }
        else ofl_structs_match_put64(m, OXM_OF_METADATA, metadata);

should be:

        if (sscanf(token, MATCH_METADATA KEY_VAL "0x%"SCNx64"", (&metadata)) != 1) {

same goes for MATCH_TUNNEL_ID.

can't make nbee

Point 4. in the installation instruction ends with:

/home/tobbe/git/ofc/nbeesrc/src/nbnetvm/jit/cfg_bytecode_builder.h:181:4: note: use      ‘this->addEdge’ instead
make[2]: *** [nbnetvm/CMakeFiles/nbnetvm.dir/jit/jit_interface.cpp.o] Error 1
make[1]: *** [nbnetvm/CMakeFiles/nbnetvm.dir/all] Error 2
make: *** [all] Error 2

Reason error in Packet_in message

I start a switch without any rule and send a packet to that switch. The wireshark shows that switch does not send any packet_in message to the controller. Is there any further setting I need to do?

Can't install using official instructions on Ubuntu 13.10 nor on ArchLinux / netbee-related issue

Hi!

I'm getting stuck with ofsoftswitch13 build phase.

I'm doing ''make" as per instruction and getting

make[2]: Entering directory /home/user/ofsoftswitch13' g++ -g -O2 -export-dynamic -o udatapath/ofdatapath udatapath/udatapath_ofdatapath-action_set.o udatapath/udatapath_ofdatapath-crc32.o udatapath/udatapath_ofdatapath-datapath.o udatapath/udatapath_ofdatapath-dp_actions.o udatapath/udatapath_ofdatapath-dp_buffers.o udatapath/udatapath_ofdatapath-dp_control.o udatapath/udatapath_ofdatapath-dp_exp.o udatapath/udatapath_ofdatapath-dp_ports.o udatapath/udatapath_ofdatapath-flow_table.o udatapath/udatapath_ofdatapath-flow_entry.o udatapath/udatapath_ofdatapath-group_table.o udatapath/udatapath_ofdatapath-group_entry.o udatapath/udatapath_ofdatapath-match_std.o udatapath/udatapath_ofdatapath-meter_entry.o udatapath/udatapath_ofdatapath-meter_table.o udatapath/udatapath_ofdatapath-packet.o udatapath/udatapath_ofdatapath-packet_handle_std.o udatapath/udatapath_ofdatapath-pipeline.o udatapath/udatapath_ofdatapath-udatapath.o lib/libopenflow.a oflib/liboflib.a oflib-exp/liboflib_exp.a nbee_link/libnbee_link.a -ldl nbee_link/libnbee_link.a(nbee_link.o): In functionsigint_handler':
/home/user/ofsoftswitch13/nbee_link/nbee_link.cpp:42: undefined reference to nbDeallocatePacketDecoder(nbPacketDecoder*)' /home/user/ofsoftswitch13/nbee_link/nbee_link.cpp:43: undefined reference tonbCleanup()'
nbee_link/libnbee_link.a(nbee_link.o): In function nblink_initialize': /home/user/ofsoftswitch13/nbee_link/nbee_link.cpp:72: undefined reference tonbIsInitialized()'
/home/user/ofsoftswitch13/nbee_link/nbee_link.cpp:86: undefined reference to nbAllocatePacketDecoder(int, char*, int)' /home/user/ofsoftswitch13/nbee_link/nbee_link.cpp:79: undefined reference tonbInitialize(char const_, int, char_, int)'
collect2: error: ld returned 1 exit status
make[2]: *** [udatapath/ofdatapath] Error 1
make[2]: Leaving directory /home/user/ofsoftswitch13' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory/home/user/ofsoftswitch13'
make: *** [all] Error 2

while netbee lib and includes are where they should be:
/usr/include$ ls nbee*
nbee_extractedfieldreader.h nbee_netvm.h nbee_packetengine.h
nbee_fieldreader.h nbee_netvmports.h nbee_profiler.h
nbee.h nbee_packetdecoder.h nbee_pxmlreader.h
nbee_initcleanup.h nbee_packetdecoderutils.h
nbee_netpdlutils.h nbee_packetdumpfiles.h

ls /usr/local/lib/
libnbee.so libnbpflcompiler.so libnbsockutils.so python2.7
libnbnetvm.so libnbprotodb.so libnbsvchelper.so python3.3

nm /usr/local/lib/libnbee.so | grep nbInitialize
0000000000051bf8 T _Z12nbInitializePKciPci

Apparently the issue has something to do with "ld/g++" inability to find respective functions in the netbee library, but I don't know how to fix it by myself.

ICMP matching error

I setup a rule of ICMP and the switch will not match. If I remove ICMP filelds (i.e., icmpv4_code and icmpv4_type) in OXM, it can match.

Original:
image

After erasing:
image

ofsoftswitch13 crashed.

Hi All

The switch crashed after it received following flow mod.
[version=0x04,flow mod(DELETE,match:inport=1,no instructions),
length=0x40,xid=0xf]
0x0000: 040e0040 0000000f 00000000 00000000
0x0010: 00000000 00000000 ff030000 00000000
0x0020: 00000000 ffffffff 00000000 00000000
0x0030: 0001000c 80000004 00000001 00000000

Could you check?

Ofdatapath crashes after modifying IP of a packet

I setup a matching rule to modify source IP and the process ofdatapath will crash after sending the packet. Attached is the process status of my OS before sending and after sending.

flow-stats:
screenshot from 2013-05-15 23 05 06
Before sending:
screenshot from 2013-05-15 22 42 55
After sending:
screenshot from 2013-05-15 22 59 06

Arp modification error

Hi Ederlf ,
I set up a rule to modify ARP packet. The switch only can modify sha and tha well. The modification of opcode, spa, and tpa does not perform well. The following is my setup rule and the packet used in the eperiment

Arp Op:

 
SENDING:
stat_req{type="flow", flags="0x0", table="all", oport="any", ogrp="any", cookie=0x0", mask=0x0", match=oxm{all match}}

RECEIVED:
stat_repl{type="flow", flags="0x0", stats=[{table="0", match="oxm{in_port="1", eth_dst="00:50:56:ef:9d:cf", eth_src="00:0c:29:40:8e:9a", eth_type="0x806", arp_op="0x1", arp_spa="192.168.244.143", arp_tpa="0.0.0.0", arp_sha="00:0c:29:40:8e:9a", arp_tha="00:00:00:00:00:00"}", dur_s="9", dur_ns="480000", prio="32768", idle_to="0", hard_to="0", cookie="0x0", pkt_cnt="1", byte_cnt="42", insts=[apply{acts=[set_field{field:arp_op="0x2"}, out{port="2"}]}]}]}

wireshark dump (1. original 2. expected 3. received)

Arp Spa:


SENDING:
stat_req{type="flow", flags="0x0", table="all", oport="any", ogrp="any", cookie=0x0", mask=0x0", match=oxm{all match}}


RECEIVED:
stat_repl{type="flow", flags="0x0", stats=[{table="0", match="oxm{in_port="1", eth_dst="00:50:56:ef:9d:cf", eth_src="00:0c:29:40:8e:9a", eth_type="0x806", arp_op="0x1", arp_spa="192.168.244.143", arp_tpa="0.0.0.0", arp_sha="00:0c:29:40:8e:9a", arp_tha="00:00:00:00:00:00"}", dur_s="146", dur_ns="79000", prio="32768", idle_to="0", hard_to="0", cookie="0x0", pkt_cnt="1", byte_cnt="42", insts=[apply{acts=[set_field{field:arp_spa="192.168.1.4"}, out{port="2"}]}]}]}

wireshark dump (1. original 2. expected 3. received)

Problem in installation instructions

While installation I found a minor issue that I would like to bring to your notice.
Point 7 of Before Building mentions to put the nbeesrc/include to /usr/include. I guess what is required here is copying contents of former into latter so they will be available in global includes. So the command should be updated accordingly.

queue-mod returns Permission error when trying to create a new queue

root@purnima-OptiPlex-990:~# dpctl unix:/var/runs2.sock queue-mod 3 1 100

SENDING:
expmodqueue{port="3", queue={q="1", props=[minrate{rate="100"}]}}

RECEIVED:
error{type="QUEUE_OP_FAILED", code="EPERM", dlen="56"}

Note:No other queue present. So queue number cannot be exceeded(i.e. >8).

Not able to set "prec_level" for marking packets with band type as "dscp_remark"

->DSCP marking without setting prec_level(working):
# dpctl unix:/var/runs2.sock meter-mod cmd=add,flags=1,meter=5 dscp_remark:rate=50000

    SENDING:
    meter_mod{cmd="add", flags="0x1"", meter_id="5"", bands=[{type = dscp_remark, rate="50000", burst_size="0", prec_level="0"}]}

    OK.

->DSCP marking with prec_level setting(not working):
# dpctl unix:/var/runs2.sock meter-mod cmd=add,flags=1,meter=5 dscp_remark:rate=50000,prec_level=1

     dpctl: Error parsing band arg: prec_level=1.

Can't request flow stats for all tables

I could swear that this one is a regression.

GOOD: specifying the table.

mininet@mininet:~/mininet$ sudo dpctl unix:/tmp/s1 stats-flow table=2

SENDING:
stat_req{type="flow", flags="0x0", table="2", oport="any", ogrp="any", cookie=0x0", mask=0x0", match=oxm{all match}}

RECEIVED:
stat_repl{type="flow", flags="0x0", stats=[]}

BAD: no table specified:

mininet@mininet:~/mininet$ sudo dpctl unix:/tmp/s1 stats-flow 

SENDING:
stat_req{type="flow", flags="0x0", table="all", oport="any", ogrp="any", cookie=0x0", mask=0x0", match=oxm{all match}}


RECEIVED:
error{type="BAD_REQUEST", code="BAD_TABLE_ID", dlen="56"}

I'm guessing the recently added max-table-checking code doesn't consider the special all-tables value.

set_vlan actions don't work in sequence in group buckets

Pushing a vlan tag, then setting the vid and pcp works fine in rules, but doing the same sequence as the actions in a bucket is buggy. If you set the vid then the pcp, it doesn't actually set the vid. Similarly, setting the pcp then the vid causes it to only set the vid. Confirmed in wireshark, here's how to reproduce:

sudo mn --arp --topo=linear,2 --switch=user --controller=remote

Set up the tables w/ only vid stamping:

s1 dpctl unix:/tmp/s1 group-mod cmd=add,group=1,type=ff port=2 push_vlan=0x8100,set_field=vlan_vid:1,output=2
s1 dpctl unix:/tmp/s1 flow-mod table=0,cmd=add in_port=1 apply:group=1 
s2 dpctl unix:/tmp/s2 flow-mod table=0,cmd=add in_port=2,vlan_vid=1 apply:
h1 ping h2
^C

Packet was matched at both switches:

mininet> s1 dpctl unix:/tmp/s1 stats-flow

SENDING:
stat_req{type="flow", flags="0x0", table="all", oport="any", ogrp="any", cookie=0x0", mask=0x0", match=oxm{all match}}


RECEIVED:
stat_repl{type="flow", flags="0x0", stats=[{table="0", match="oxm{in_port="1"}", dur_s="43", dur_ns="454000", prio="32768", idle_to="0", hard_to="0", cookie="0x0", pkt_cnt="2", byte_cnt="196", insts=[apply{acts=[group{id="1"}]}]}]}

mininet> s1 dpctl unix:/tmp/s1 stats-group 1

SENDING:
stat_req{type="grp", flags="0x0", group="1"}


RECEIVED:
stat_repl{type="grp", flags="0x0", stats=[{group="1", ref_cnt="1", pkt_cnt="2", byte_cnt="196", cntrs=[{pkt_cnt="2", byte_cnt="196"}]}]}

mininet> s2 dpctl unix:/tmp/s2 stats-flow

SENDING:
stat_req{type="flow", flags="0x0", table="all", oport="any", ogrp="any", cookie=0x0", mask=0x0", match=oxm{all match}}


RECEIVED:
stat_repl{type="flow", flags="0x0", stats=[{table="0", match="oxm{in_port="2", vlan_vid="1"}", dur_s="60", dur_ns="725000", prio="32768", idle_to="0", hard_to="0", cookie="0x0", pkt_cnt="2", byte_cnt="204", insts=[apply{acts=[]}]}]}

Clear out the rules:

s1 dpctl unix:/tmp/s1 group-mod cmd=del
s2 dpctl unix:/tmp/s2 flow-mod cmd=del

Now set the vid, then set the pcp:

s1 dpctl unix:/tmp/s1 group-mod cmd=add,group=1,type=ff port=2 push_vlan=0x8100,set_field=vlan_vid:1,set_field=vlan_pcp:1,output=2
s1 dpctl unix:/tmp/s1 flow-mod table=0,cmd=add in_port=1 apply:group=1 
s2 dpctl unix:/tmp/s2 flow-mod table=0,cmd=add in_port=2,vlan_vid=1 apply:

This time, the rule on the second switch doesn't match:

mininet> h1 ping h2
^CPING 10.0.0.2 (10.0.0.2) 56(84) bytes of data.

--- 10.0.0.2 ping statistics ---
1 packets transmitted, 0 received, 100% packet loss, time 0ms

mininet> s1 dpctl unix:/tmp/s1 stats-flow

SENDING:
stat_req{type="flow", flags="0x0", table="all", oport="any", ogrp="any", cookie=0x0", mask=0x0", match=oxm{all match}}


RECEIVED:
stat_repl{type="flow", flags="0x0", stats=[{table="0", match="oxm{in_port="1"}", dur_s="21", dur_ns="279000", prio="32768", idle_to="0", hard_to="0", cookie="0x0", pkt_cnt="1", byte_cnt="98", insts=[apply{acts=[group{id="1"}]}]}]}

mininet> s1 dpctl unix:/tmp/s1 stats-group 1

SENDING:
stat_req{type="grp", flags="0x0", group="1"}


RECEIVED:
stat_repl{type="grp", flags="0x0", stats=[{group="1", ref_cnt="1", pkt_cnt="1", byte_cnt="98", cntrs=[{pkt_cnt="1", byte_cnt="98"}]}]}

mininet> s2 dpctl unix:/tmp/s2 stats-flow

SENDING:
stat_req{type="flow", flags="0x0", table="all", oport="any", ogrp="any", cookie=0x0", mask=0x0", match=oxm{all match}}


RECEIVED:
stat_repl{type="flow", flags="0x0", stats=[{table="0", match="oxm{in_port="2", vlan_vid="1"}", dur_s="26", dur_ns="319000", prio="32768", idle_to="0", hard_to="0", cookie="0x0", pkt_cnt="0", byte_cnt="0", insts=[apply{acts=[]}]}]}

Clear again:

s1 dpctl unix:/tmp/s1 group-mod cmd=del
s2 dpctl unix:/tmp/s2 flow-mod cmd=del

Set them in the other order (pcp then vid):

mininet> h1 ping h2
^CPING 10.0.0.2 (10.0.0.2) 56(84) bytes of data.

--- 10.0.0.2 ping statistics ---
1 packets transmitted, 0 received, 100% packet loss, time 0ms

mininet> s1 dpctl unix:/tmp/s1 stats-flow

SENDING:
stat_req{type="flow", flags="0x0", table="all", oport="any", ogrp="any", cookie=0x0", mask=0x0", match=oxm{all match}}


RECEIVED:
stat_repl{type="flow", flags="0x0", stats=[{table="0", match="oxm{in_port="1"}", dur_s="14", dur_ns="230000", prio="32768", idle_to="0", hard_to="0", cookie="0x0", pkt_cnt="1", byte_cnt="98", insts=[apply{acts=[group{id="1"}]}]}]}

mininet> s1 dpctl unix:/tmp/s1 stats-group 1

SENDING:
stat_req{type="grp", flags="0x0", group="1"}


RECEIVED:
stat_repl{type="grp", flags="0x0", stats=[{group="1", ref_cnt="1", pkt_cnt="1", byte_cnt="98", cntrs=[{pkt_cnt="1", byte_cnt="98"}]}]}

mininet> s2 dpctl unix:/tmp/s2 stats-flow

SENDING:
stat_req{type="flow", flags="0x0", table="all", oport="any", ogrp="any", cookie=0x0", mask=0x0", match=oxm{all match}}


RECEIVED:
stat_repl{type="flow", flags="0x0", stats=[{table="0", match="oxm{in_port="2", vlan_vid="1"}", dur_s="19", dur_ns="990000", prio="32768", idle_to="0", hard_to="0", cookie="0x0", pkt_cnt="1", byte_cnt="102", insts=[apply{acts=[]}]}]}

IPv4 src\dst matching

In match_std.c, packet_match() function, switch case (sizeof(uint32_t)), all fields and enums should be converted with OXM_TYPE().
e.g. OXM_TYPE(f->header) == OXM_TYPE(OXM_OF_IPV4_DST)

Default-match flows don't get actions set

The first example from Dpctl Flow Mod Cases seems broken.

mininet@mininet:~$ sudo dpctl  unix:/tmp/s1 flow-mod table=1,cmd=add apply:output=2

SENDING:
flow_mod{table="1", cmd="add", cookie="0x0", mask="0x0", idle="0", hard="0", prio="32768", buf="none", port="any", group="any", flags="0x0", match=oxm{all match}, insts=[]}

OK.

Why are instructions empty? If I change the match to anything else, the flow inserts correctly. Bug is there as of commit 420b87a, Jun 4.

Switch stat description does not conform to the specification

Hi All,

I have a question regarding sending back total DESC_STR_LEN (256) bytes for mfr_desc and rest of the switch description data.
Why is pointer "stats->mfr_desc" (and rest in the structure) in function ofl_msg_pack_stats_reply_desc( ) in file ofl-messages-pack.c not initialized with 0 and then why it doesn't copy from msg->mfr_desc until it receives '\0' instead of copying whole DESC_STR_LEN bytes?

Thanks,
Arun


Hi Arun,

You are right, this does not conform to the specification, as that requires those strings to be padded with zeroes.
It should cause no harm, as the fields will contain a zero delimited string (although it might freak out some memory managers :-).

Kind Regards,
Zoltan.

Not able to run ofsoftswitch13 as a user switch in mininet.

  1. How do i run ofsoftswitch13 in port 6634?
  2. In mininet i get the following output for dump-flows
    RemoteController c0: 127.0.0.1:6633 pid=7638
    UserSwitch s1: lo:127.0.0.1,s1-eth1:None,s1-eth2:None pid=7647
    Host h1: h1-eth0:10.0.0.1 pid=7645
    Host h2: h2-eth0:10.0.0.2 pid=7646

s1 is not connected to 6634. How to connect it?

  1. "sudo udatapath/ofdatapath --datapath-id=000000000001 --interfaces= ptcp:6634" ---> What should be the list of interfaces?

Thanks in advance.

Switch sends error upon receipt of Role request Message

Case 1:

While controller sends Role Request Message with ROLE_NOCHANGE, switch sends an error message with error type Role_Request_Failed and code Bad_Role.

Case 2:

For the Role Request message with ROLE_MASTER or ROLE_SLAVE, with any higher generation id, switch sometimes discards the message with old generation id error, sometimes it doesn't send any error. When there is no error then we can expect that role changes happened. But switch has the problem of Case 1, so controller can't able to get the latest role from the switch.

ofsoftswitch13 crashing frequently while configuring the switch with latest code addition

Hi,

I updated the ofsoftswitch13. While configuring the switch using dpctl commands, randomly I am getting the below error due to assertion failure. Below is the log message for the same.

ofdatapath: lib/netdev.c:938: netdev_recv: Assertion `ofpbuf_tailroom(buffer) >= (14 + 46)' failed.
Jul 05 19:14:43|00199|fault|EMER|Caught signal 6.
0x0041a67d
0x66756200632e7665
Jul 05 19:14:43|00200|fault|EMER|Caught signal 11.
0x0041a67d
0x0041a67d
0x66756200632e7665

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.