CPqD / ofsoftswitch13

OpenFlow 1.3 switch.
http://cpqd.github.com/ofsoftswitch13
302 stars 192 forks source link

Switch not sending features reply message to a request from controller #150

Closed hdnivara closed 9 years ago

hdnivara commented 9 years ago

Hello,

I'm using OpenFlow reference implementation v1.3 switch (CPqD/Ericsson) and Ryu controller.

My Ryu controller app is based on the L2 forwarding switch example. Whenever I start my controller, it receives the 'hello' message from the switch and goes to config mode and sends out a "features request" message. But, the switch isn't responding with a reply.

But, it works perfectly when used in Mininet environment. I'm seeing this issue in a physical setup.

See below for logs (physical/mininet environment) and commands used to execute the switch and controller.

Any help would be appreciated.

Thanks, /Aravind

Topology
========

controller (20.0.0.2/eth1) <----------> switch (20.0.0.1/eth1)
                                                      ^
                                                      |
                                                      |
                                                      |
                                                      v
                                         datapath (2 ports - eth3, eth6)

Commands Used
=============
sudo udatapath/ofdatapath -i eth3,eth6 ptcp:6653 -d abcdefabcdef
sudo secchan/ofprotocol ptcp:6653 tcp:20.0.0.2:6653 --fail closed --log-file=/tmp/ofp.log -v
ryu-manager --ofp-listen-host 20.0.0.2 --ofp-tcp-listen-port 6653 --verbose fpm_firewall.py

Switch Logs
===========
 47 Dec 27 12:53:58|00047|vconn|DBG|tcp:20.0.0.2:6653: sent (Success): hello
 48 Dec 27 12:53:58|00048|poll_loop|DBG|[POLLIN] on fd 6: 0x4213b9 0x44dcfa
0x429b1a 0x422dbf 0x411c    10 0x4112ee
 49 Dec 27 12:53:58|00049|ofl_msg_u|WARN|Received message has wrong version.
 50 Dec 27 12:53:58|00050|vconn|DBG|tcp:20.0.0.2:6653: received:
 51 00000000  05 00 00 08 d4 d2 48 6b-
 52
 53 Dec 27 12:53:58|00051|vconn|DBG|tcp:20.0.0.2:6653: negotiated OpenFlow
version 0x04 (we support     versions 0x04 to 0x04 inclusive, peer no later than
version 0x05)
 54 Dec 27 12:53:58|00052|rconn|INFO|tcp:20.0.0.2:6653: connected
 55 Dec 27 12:53:58|00053|rconn|DBG|tcp:20.0.0.2:6653: entering ACTIVE
 56 Dec 27 12:53:58|00054|vconn|DBG|tcp:20.0.0.2:6653: received: feat_req

Controller Logs (physical setup)
================================
$ ryu-manager --ofp-listen-host 20.0.0.2 --ofp-tcp-listen-port 6653 --verbose fpm_firewall.py
loading app fpm_firewall.py
loading app ryu.controller.ofp_handler
instantiating app ryu.controller.ofp_handler of OFPHandler
instantiating app fpm_firewall.py of fpm_firewall
BRICK ofp_event
  PROVIDES EventOFPPacketIn TO {'fpm_firewall': set(['main'])}
  PROVIDES EventOFPSwitchFeatures TO {'fpm_firewall': set(['config'])}
  CONSUMES EventOFPEchoRequest
  CONSUMES EventOFPHello
  CONSUMES EventOFPErrorMsg
  CONSUMES EventOFPSwitchFeatures
  CONSUMES EventOFPPortDescStatsReply
BRICK fpm_firewall
  CONSUMES EventOFPPacketIn
  CONSUMES EventOFPSwitchFeatures
connected socket:<eventlet.greenio.GreenSocket object at 0x305bdd0> address:('20.0.0.1', 38321)
hello ev <ryu.controller.ofp_event.EventOFPHello object at 0x3064390>
move onto config mode

Controller Logs (mininet setup)
===============================
$ ryu-manager fpm_firewall.py --verbose
loading app fpm_firewall.py
loading app ryu.controller.ofp_handler
instantiating app ryu.controller.ofp_handler of OFPHandler
instantiating app fpm_firewall.py of fpm_firewall
BRICK ofp_event
  PROVIDES EventOFPPacketIn TO {'fpm_firewall': set(['main'])}
  PROVIDES EventOFPSwitchFeatures TO {'fpm_firewall': set(['config'])}
  CONSUMES EventOFPPortDescStatsReply
  CONSUMES EventOFPEchoRequest
  CONSUMES EventOFPSwitchFeatures
  CONSUMES EventOFPHello
  CONSUMES EventOFPErrorMsg
BRICK fpm_firewall
  CONSUMES EventOFPPacketIn
  CONSUMES EventOFPSwitchFeatures
connected socket:<eventlet.greenio.GreenSocket object at 0x2c07590> address:('127.0.0.1', 43124)
hello ev <ryu.controller.ofp_event.EventOFPHello object at 0x2c07ad0>
move onto config mode
EVENT ofp_event->fpm_firewall EventOFPSwitchFeatures
switch features ev version: 0x4 msg_type 0x6 xid 0x1735277a OFPSwitchFeatures(auxiliary_id=0,capabilities=79,datapath_id=1,n_buffers=256,n_tables=64)
<my app specific log messages>
...
move onto main mode
hdnivara commented 9 years ago

Never mind.

My mistake. The connection between datapath and ofproto was incorrect in my setup. I'm using a unix socket file for that purpose and everything works as expected.

Please go ahead and close this.

lassade commented 8 years ago

@hdnivara can you tell more about what was your mistake? I think i just made the same mistake myself.