Agung Ridwan SN | 23 May 2013 09:58
Picon

Ryu on OpenFlow

Hi,

I want to ask about output dump-flow from OpenStack+Ryu. I saw multi-table exist in dump-flow. But OpenFlow header (from capturing packet) said : OFP_VERSION 1.0. AFAIK, multi-tables are specified in OF spec v1.1? I searched from ryu directory, nothing of "ofproto_v1_1" but v1_0, v1_2, and v1_3 are exist. How come this happen? Thanks

--
Regards,

-Ag-

------------------------------------------------------------------------------
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service 
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_may
_______________________________________________
Ryu-devel mailing list
Ryu-devel@...
https://lists.sourceforge.net/lists/listinfo/ryu-devel
nitish nagesh | 22 May 2013 16:09
Picon

Sending OFPT13_SET_ASYNC message..

Hello,

   I am trying to write an Ryu app to send the OFPT13_SET_ASYNC message but i am unable to figure out how to fill the various masks given in the ofp13_async_config structure into the OFPSetAsync class (as the class initializer doesnt take any argument other than the datapath id). Can you please give me some hints or point to any existing examples which do this?

Thank you,
Nitish
------------------------------------------------------------------------------
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service 
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_may
_______________________________________________
Ryu-devel mailing list
Ryu-devel@...
https://lists.sourceforge.net/lists/listinfo/ryu-devel
Can Zhang | 22 May 2013 05:57
Favicon
Gravatar

How to profile an app?

Hello,

Now I want to profile my ryu app and plan to use cProfile. So I'd like to know where should I put cProfile.run() calls?
And how do you do that in ryu?

Best regards,
Can Zhang

------------------------------------------------------------------------------
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service 
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_may
YAMADA Hideki | 21 May 2013 06:44
Picon
Gravatar

[PATCH 1/2] lib/packet/vrrp: fix is_valid()


Signed-off-by: YAMADA Hideki <yamada.hideki@...>
---
 ryu/lib/packet/vrrp.py |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/ryu/lib/packet/vrrp.py b/ryu/lib/packet/vrrp.py
index 7c50fed..8b6140a 100644
--- a/ryu/lib/packet/vrrp.py
+++ b/ryu/lib/packet/vrrp.py
 <at>  <at>  -395,7 +395,7  <at>  <at>  class vrrp(packet_base.PacketBase):

     def is_valid(self):
         cls = self._VRRP_VERSIONS.get(self.version, None)
-        if None:
+        if cls is None:
             return False
         return cls.is_valid(self)

 <at>  <at>  -499,8 +499,8  <at>  <at>  class vrrpv2(vrrp):
         return (self.version == VRRP_VERSION_V2 and
                 self.type == VRRP_TYPE_ADVERTISEMENT and
                 VRRP_VRID_MIN <= self.vrid and self.vrid <= VRRP_VRID_MAX and
-                VRRP_PRIORITY_MIN <= self.vrid and
-                self.vrid <= VRRP_PRIORITY_MAX and
+                VRRP_PRIORITY_MIN <= self.priority and
+                self.priority <= VRRP_PRIORITY_MAX and
                 self.auth_type == VRRP_AUTH_NO_AUTH and
                 VRRP_V2_MAX_ADVER_INT_MIN <= self.max_adver_int and
                 self.max_adver_int <= VRRP_V2_MAX_ADVER_INT_MAX and
 <at>  <at>  -616,8 +616,8  <at>  <at>  class vrrpv3(vrrp):
         return (self.version == VRRP_VERSION_V3 and
                 self.type == VRRP_TYPE_ADVERTISEMENT and
                 VRRP_VRID_MIN <= self.vrid and self.vrid <= VRRP_VRID_MAX and
-                VRRP_PRIORITY_MIN <= self.vrid and
-                self.vrid <= VRRP_PRIORITY_MAX and
+                VRRP_PRIORITY_MIN <= self.priority and
+                self.priority <= VRRP_PRIORITY_MAX and
                 VRRP_V3_MAX_ADVER_INT_MIN <= self.max_adver_int and
                 self.max_adver_int <= VRRP_V3_MAX_ADVER_INT_MAX and
                 self.count_ip == len(self.ip_addresses))
--

-- 
1.7.1

------------------------------------------------------------------------------
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service 
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_may
YAMADA Hideki | 21 May 2013 06:13
Picon
Gravatar

[PATCH] test_parser_v10: remove tests for __str__

Following errors occur at current master
(commit 21692141dc7e8be2d44338ce4eff5af584e4ff8f)

======================================================================
ERROR: test_parser (ryu.tests.unit.ofproto.test_parser_v10.TestOFPFlowRemoved)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/hideki/ryu/ryu/tests/unit/ofproto/test_parser_v10.py", line 4080, in test_parser
    eq_(str(cookie['val']), check['cookie'])
KeyError: 'cookie'

======================================================================
ERROR: test_parser (ryu.tests.unit.ofproto.test_parser_v10.TestOFPPacketIn)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/hideki/ryu/ryu/tests/unit/ofproto/test_parser_v10.py", line 3782, in test_parser
    ok_(self._test_parser())
  File "/home/hideki/ryu/ryu/tests/unit/ofproto/test_parser_v10.py", line 3774, in _test_parser
    eq_(str(buffer_id['val']), check['buffer_id'])
KeyError: 'buffer_id'

======================================================================
ERROR: test_parser_padding (ryu.tests.unit.ofproto.test_parser_v10.TestOFPPacketIn)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/hideki/ryu/ryu/tests/unit/ofproto/test_parser_v10.py", line 3785, in test_parser_padding
    ok_(self._test_parser(True))
  File "/home/hideki/ryu/ryu/tests/unit/ofproto/test_parser_v10.py", line 3774, in _test_parser
    eq_(str(buffer_id['val']), check['buffer_id'])
KeyError: 'buffer_id'

======================================================================
ERROR: test_str (ryu.tests.unit.ofproto.test_parser_v10.TestOFPQueuePropMinRate)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/hideki/ryu/ryu/tests/unit/ofproto/test_parser_v10.py", line 2615, in test_str
    eq_(check['rate'], str(self.rate['val']))
KeyError: 'rate'

======================================================================
ERROR: test_str (ryu.tests.unit.ofproto.test_parser_v10.TestOFPQueuePropNone)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/hideki/ryu/ryu/tests/unit/ofproto/test_parser_v10.py", line 2564, in test_str
    eq_(check['property'], str(self.property['val']))
KeyError: 'property'

======================================================================
ERROR: test_parser (ryu.tests.unit.ofproto.test_parser_v10.TestOFPSwitchFeatures)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/hideki/ryu/ryu/tests/unit/ofproto/test_parser_v10.py", line 3580, in test_parser
    eq_(check['ports'].find('OFPPhyPort'), 0)
KeyError: 'ports'

Signed-off-by: YAMADA Hideki <yamada.hideki@...>
---
 ryu/tests/unit/ofproto/test_parser_v10.py |  370 -----------------------------
 1 files changed, 0 insertions(+), 370 deletions(-)

diff --git a/ryu/tests/unit/ofproto/test_parser_v10.py b/ryu/tests/unit/ofproto/test_parser_v10.py
index e135a62..4b1e20c 100644
--- a/ryu/tests/unit/ofproto/test_parser_v10.py
+++ b/ryu/tests/unit/ofproto/test_parser_v10.py
 <at>  <at>  -2549,21 +2549,6  <at>  <at>  class TestOFPQueuePropNone(unittest.TestCase):

         ok_(self.c.parser(buf, 0))

-    def test_str(self):
-        list_ = ('property', 'len')
-        check = {}
-        str_ = str(self.c)
-        str_ = str_.rsplit()
-
-        i = 0
-        for s in str_:
-            if s in list_:
-                check[str_[i]] = str_[i + 1]
-            i += 1
-
-        eq_(check['property'], str(self.property['val']))
-        eq_(check['len'], str(self.len['val']))
-

 class TestOFPQueuePropMinRate(unittest.TestCase):
     """ Test case for ofprotp_v1_0_parser.OFPQueuePropMinRate
 <at>  <at>  -2600,20 +2585,6  <at>  <at>  class TestOFPQueuePropMinRate(unittest.TestCase):
         res = self.c.parser(self.buf, 0)
         eq_(self.rate['val'], res.rate)

-    def test_str(self):
-        list_ = ('rate',)
-        check = {}
-        str_ = str(self.c)
-        str_ = str_.rsplit()
-        i = 0
-
-        for s in str_:
-            if s in list_:
-                check[str_[i]] = str_[i + 1]
-            i += 1
-
-        eq_(check['rate'], str(self.rate['val']))
-

 class TestOFPPacketQueue(unittest.TestCase):
     """ Test case for ofprotp_v1_0_parser.OFPPacketQueue
 <at>  <at>  -2714,24 +2685,6  <at>  <at>  class TestOFPHello(unittest.TestCase):
         eq_(xid, res.xid)
         eq_(buffer(buf), res.buf)

-        # test __str__()
-        list_ = ('version:', 'msg_type', 'xid')
-        check = {}
-        str_ = str(res)
-        str_ = str_.rsplit()
-
-        i = 0
-        for s in str_:
-            if s in list_:
-                check[str_[i]] = str_[i + 1]
-            i += 1
-
-        # comparison fails in some environment
-        #   such as hex() returns string with suffix 'L'
-        eq_(hex(ofproto_v1_0.OFP_VERSION).find(check['version:']), 0)
-        eq_(hex(ofproto_v1_0.OFPT_HELLO).find(check['msg_type']), 0)
-        eq_(hex(xid).find(check['xid']), 0)
-
     def test_serialize(self):

         class Datapath(object):
 <at>  <at>  -2791,22 +2744,6  <at>  <at>  class TestOFPErrorMsg(unittest.TestCase):
         eq_(code['val'], res.code)
         eq_(data, res.data)

-        # test __str__()
-        list_ = ('version:', 'msg_type', 'xid')
-        check = {}
-        str_ = str(res)
-        str_ = str_.rsplit()
-
-        i = 0
-        for s in str_:
-            if s in list_:
-                check[str_[i]] = str_[i + 1]
-            i += 1
-
-        eq_(hex(version['val']).find(check['version:']), 0)
-        eq_(hex(msg_type['val']).find(check['msg_type']), 0)
-        eq_(hex(xid['val']).find(check['xid']), 0)
-
     def test_serialize(self):
         class Datapath(object):
             ofproto = ofproto_v1_0
 <at>  <at>  -2882,24 +2819,6  <at>  <at>  class TestOFPEchoRequest(unittest.TestCase):
         eq_(xid['val'], res.xid)
         eq_(data, res.data)

-        # test __str__()
-        list_ = ('version:', 'msg_type', 'xid')
-        check = {}
-        str_ = str(res)
-        str_ = str_.rsplit()
-
-        i = 0
-        for s in str_:
-            if s in list_:
-                check[str_[i]] = str_[i + 1]
-            i += 1
-
-        # comparison fails in some environment
-        #   such as hex() returns string with suffix 'L'
-        eq_(hex(version['val']).find(check['version:']), 0)
-        eq_(hex(msg_type['val']).find(check['msg_type']), 0)
-        eq_(hex(xid['val']).find(check['xid']), 0)
-
     def test_serialize(self):
         class Datapath(object):
             ofproto = ofproto_v1_0
 <at>  <at>  -2968,24 +2887,6  <at>  <at>  class TestOFPEchoReply(unittest.TestCase):
         eq_(xid['val'], res.xid)
         eq_(data, res.data)

-        # test __str__()
-        list_ = ('version:', 'msg_type', 'xid')
-        check = {}
-        str_ = str(res)
-        str_ = str_.rsplit()
-
-        i = 0
-        for s in str_:
-            if s in list_:
-                check[str_[i]] = str_[i + 1]
-            i += 1
-
-        # comparison fails in some environment
-        #   such as hex() returns string with suffix 'L'
-        eq_(hex(version['val']).find(check['version:']), 0)
-        eq_(hex(msg_type['val']).find(check['msg_type']), 0)
-        eq_(hex(xid['val']).find(check['xid']), 0)
-
     def test_serialize(self):
         class Datapath(object):
             ofproto = ofproto_v1_0
 <at>  <at>  -3057,24 +2958,6  <at>  <at>  class TestOFPVendor(unittest.TestCase):
         eq_(vendor['val'], res.vendor)
         eq_(data, res.data)

-        # test __str__()
-        list_ = ('version:', 'msg_type', 'xid')
-        check = {}
-        str_ = str(res)
-        str_ = str_.rsplit()
-
-        i = 0
-        for s in str_:
-            if s in list_:
-                check[str_[i]] = str_[i + 1]
-            i += 1
-
-        # comparison fails in some environment
-        #   such as hex() returns string with suffix 'L'
-        eq_(hex(version['val']).find(check['version:']), 0)
-        eq_(hex(msg_type['val']).find(check['msg_type']), 0)
-        eq_(hex(xid['val']).find(check['xid']), 0)
-
     def test_serialize(self):
         class Datapath(object):
             ofproto = ofproto_v1_0
 <at>  <at>  -3559,26 +3442,6  <at>  <at>  class TestOFPSwitchFeatures(unittest.TestCase):
         eq_(supported['val'], port.supported)
         eq_(peer['val'], port.peer)

-        # test __str__()
-        list_ = ('version:', 'msg_type', 'xid', 'ports')
-        check = {}
-        str_ = str(res)
-        str_ = str_.rsplit()
-
-        i = 0
-        for s in str_:
-            if s in list_:
-                if str_[i + 1].startswith('{'):  # "{1: OFPPhyPort..."
-                    check[str_[i]] = str_[i + 2]
-                else:
-                    check[str_[i]] = str_[i + 1]
-            i += 1
-
-        eq_(hex(version['val']).find(check['version:']), 0)
-        eq_(hex(msg_type['val']).find(check['msg_type']), 0)
-        eq_(hex(xid['val']).find(check['xid']), 0)
-        eq_(check['ports'].find('OFPPhyPort'), 0)
-
     def test_serialize(self):
         # Not used.
         pass
 <at>  <at>  -3667,22 +3530,6  <at>  <at>  class TestOFPPortStatus(unittest.TestCase):
         eq_(supported['val'], desc.supported)
         eq_(peer['val'], desc.peer)

-        # test __str__()
-        list_ = ('version:', 'msg_type', 'xid',)
-        check = {}
-        str_ = str(res)
-        str_ = str_.rsplit()
-
-        i = 0
-        for s in str_:
-            if s in list_:
-                check[str_[i]] = str_[i + 1]
-            i += 1
-
-        eq_(hex(version['val']).find(check['version:']), 0)
-        eq_(hex(msg_type['val']).find(check['msg_type']), 0)
-        eq_(hex(xid['val']).find(check['xid']), 0)
-
     def test_serialize(self):
         # Not used.
         pass
 <at>  <at>  -3755,27 +3602,6  <at>  <at>  class TestOFPPacketIn(unittest.TestCase):
         eq_(reason['val'], res.reason)
         eq_(data[0:16], res.data)

-        # test __str__()
-        list_ = ('version:', 'msg_type', 'xid',
-                 'buffer_id', 'total_len', 'in_port', 'reason',)
-        check = {}
-        str_ = str(res)
-        str_ = str_.rsplit()
-
-        i = 0
-        for s in str_:
-            if s in list_:
-                check[str_[i]] = str_[i + 1]
-            i += 1
-
-        eq_(hex(version['val']).find(check['version:']), 0)
-        eq_(hex(msg_type['val']).find(check['msg_type']), 0)
-        eq_(hex(xid['val']).find(check['xid']), 0)
-        eq_(str(buffer_id['val']), check['buffer_id'])
-        eq_(str(total_len['val']), check['total_len'])
-        eq_(str(in_port['val']), check['in_port'])
-        eq_(str(reason['val']), check['reason'])
-
         return True

     def test_parser(self):
 <at>  <at>  -3841,22 +3667,6  <at>  <at>  class TestOFPGetConfigReply(unittest.TestCase):
         eq_(flags['val'], res.flags)
         eq_(miss_send_len['val'], res.miss_send_len)

-        # test __str__()
-        list_ = ('version:', 'msg_type', 'xid',)
-        check = {}
-        str_ = str(res)
-        str_ = str_.rsplit()
-
-        i = 0
-        for s in str_:
-            if s in list_:
-                check[str_[i]] = str_[i + 1]
-            i += 1
-
-        eq_(hex(version['val']).find(check['version:']), 0)
-        eq_(hex(msg_type['val']).find(check['msg_type']), 0)
-        eq_(hex(xid['val']).find(check['xid']), 0)
-
     def test_serialize(self):
         # Not used.
         pass
 <at>  <at>  -3905,22 +3715,6  <at>  <at>  class TestOFPBarrierReply(unittest.TestCase):
         eq_(msg_len['val'], res.msg_len)
         eq_(xid['val'], res.xid)

-        # test __str__()
-        list_ = ('version:', 'msg_type', 'xid',)
-        check = {}
-        str_ = str(res)
-        str_ = str_.rsplit()
-
-        i = 0
-        for s in str_:
-            if s in list_:
-                check[str_[i]] = str_[i + 1]
-            i += 1
-
-        eq_(hex(version['val']).find(check['version:']), 0)
-        eq_(hex(msg_type['val']).find(check['msg_type']), 0)
-        eq_(hex(xid['val']).find(check['xid']), 0)
-
     def test_serialize(self):
         # Not used.
         pass
 <at>  <at>  -4058,34 +3852,6  <at>  <at>  class TestOFPFlowRemoved(unittest.TestCase):
         eq_(tp_src['val'], match.tp_src)
         eq_(tp_dst['val'], match.tp_dst)

-        # test __str__()
-        list_ = ('version:', 'msg_type', 'xid',
-                 'match', 'cookie', 'priority', 'reason',
-                 'duration_sec', 'duration_nsec',
-                 'idle_timeout', 'packet_count', 'byte_count')
-
-        check = {}
-        str_ = str(res)
-        str_ = str_.rsplit()
-
-        i = 0
-        for s in str_:
-            if s in list_:
-                check[str_[i]] = str_[i + 1]
-            i += 1
-
-        eq_(hex(version['val']).find(check['version:']), 0)
-        eq_(hex(msg_type['val']).find(check['msg_type']), 0)
-        eq_(hex(xid['val']).find(check['xid']), 0)
-        eq_(str(cookie['val']), check['cookie'])
-        eq_(str(priority['val']), check['priority'])
-        eq_(str(reason['val']), check['reason'])
-        eq_(str(duration_sec['val']), check['duration_sec'])
-        eq_(str(duration_nsec['val']), check['duration_nsec'])
-        eq_(str(idle_timeout['val']), check['idle_timeout'])
-        eq_(str(packet_count['val']), check['packet_count'])
-        eq_(str(byte_count['val']), check['byte_count'])
-
     def test_serialize(self):
         # Not used.
         pass
 <at>  <at>  -4161,23 +3927,6  <at>  <at>  class TestOFPQueueGetConfigReply(unittest.TestCase):
         eq_(queue_id['val'], queue.queue_id)
         eq_(len_['val'], queue.len)

-        # test __str__()
-        list_ = ('version:', 'msg_type', 'xid',)
-
-        check = {}
-        str_ = str(res)
-        str_ = str_.rsplit()
-
-        i = 0
-        for s in str_:
-            if s in list_:
-                check[str_[i]] = str_[i + 1]
-            i += 1
-
-        eq_(hex(version['val']).find(check['version:']), 0)
-        eq_(hex(msg_type['val']).find(check['msg_type']), 0)
-        eq_(hex(xid['val']).find(check['xid']), 0)
-
     def test_serialize(self):
         # Not used.
         pass
 <at>  <at>  -4261,23 +4010,6  <at>  <at>  class TestOFPDescStatsReply(unittest.TestCase):
         eq_(serial_num, body.serial_num)
         eq_(dp_desc, body.dp_desc)

-        # test __str__()
-        list_ = ('version:', 'msg_type', 'xid',)
-
-        check = {}
-        str_ = str(res)
-        str_ = str_.rsplit()
-
-        i = 0
-        for s in str_:
-            if s in list_:
-                check[str_[i]] = str_[i + 1]
-            i += 1
-
-        eq_(hex(version['val']).find(check['version:']), 0)
-        eq_(hex(msg_type['val']).find(check['msg_type']), 0)
-        eq_(hex(xid['val']).find(check['xid']), 0)
-
     def test_serialize(self):
         # Not used.
         pass
 <at>  <at>  -4428,23 +4160,6  <at>  <at>  class TestOFPFlowStatsReply(unittest.TestCase):
         eq_(port['val'], action.port)
         eq_(max_len['val'], action.max_len)

-        # test __str__()
-        list_ = ('version:', 'msg_type', 'xid',)
-
-        check = {}
-        str_ = str(res)
-        str_ = str_.rsplit()
-
-        i = 0
-        for s in str_:
-            if s in list_:
-                check[str_[i]] = str_[i + 1]
-            i += 1
-
-        eq_(hex(version['val']).find(check['version:']), 0)
-        eq_(hex(msg_type['val']).find(check['msg_type']), 0)
-        eq_(hex(xid['val']).find(check['xid']), 0)
-
     def test_serialize(self):
         # Not used.
         pass
 <at>  <at>  -4525,23 +4240,6  <at>  <at>  class TestOFPAggregateStatsReply(unittest.TestCase):
         eq_(byte_count['val'], body.byte_count)
         eq_(flow_count['val'], body.flow_count)

-        # test __str__()
-        list_ = ('version:', 'msg_type', 'xid',)
-
-        check = {}
-        str_ = str(res)
-        str_ = str_.rsplit()
-
-        i = 0
-        for s in str_:
-            if s in list_:
-                check[str_[i]] = str_[i + 1]
-            i += 1
-
-        eq_(hex(version['val']).find(check['version:']), 0)
-        eq_(hex(msg_type['val']).find(check['msg_type']), 0)
-        eq_(hex(xid['val']).find(check['xid']), 0)
-
     def test_serialize(self):
         # Not used.
         pass
 <at>  <at>  -4635,23 +4333,6  <at>  <at>  class TestOFPTableStatsReply(unittest.TestCase):
         eq_(lookup_count['val'], body.lookup_count)
         eq_(matched_count['val'], body.matched_count)

-        # test __str__()
-        list_ = ('version:', 'msg_type', 'xid',)
-
-        check = {}
-        str_ = str(res)
-        str_ = str_.rsplit()
-
-        i = 0
-        for s in str_:
-            if s in list_:
-                check[str_[i]] = str_[i + 1]
-            i += 1
-
-        eq_(hex(version['val']).find(check['version:']), 0)
-        eq_(hex(msg_type['val']).find(check['msg_type']), 0)
-        eq_(hex(xid['val']).find(check['xid']), 0)
-
     def test_serialize(self):
         # Not used.
         pass
 <at>  <at>  -4775,23 +4456,6  <at>  <at>  class TestOFPPortStatsReply(unittest.TestCase):
         eq_(rx_crc_err['val'], body.rx_crc_err)
         eq_(collisions['val'], body.collisions)

-        # test __str__()
-        list_ = ('version:', 'msg_type', 'xid',)
-
-        check = {}
-        str_ = str(res)
-        str_ = str_.rsplit()
-
-        i = 0
-        for s in str_:
-            if s in list_:
-                check[str_[i]] = str_[i + 1]
-            i += 1
-
-        eq_(hex(version['val']).find(check['version:']), 0)
-        eq_(hex(msg_type['val']).find(check['msg_type']), 0)
-        eq_(hex(xid['val']).find(check['xid']), 0)
-
     def test_serialize(self):
         # Not used.
         pass
 <at>  <at>  -4879,23 +4543,6  <at>  <at>  class TestOFPQueueStatsReply(unittest.TestCase):
         eq_(tx_packets['val'], body.tx_packets)
         eq_(tx_errors['val'], body.tx_errors)

-        # test __str__()
-        list_ = ('version:', 'msg_type', 'xid',)
-
-        check = {}
-        str_ = str(res)
-        str_ = str_.rsplit()
-
-        i = 0
-        for s in str_:
-            if s in list_:
-                check[str_[i]] = str_[i + 1]
-            i += 1
-
-        eq_(hex(version['val']).find(check['version:']), 0)
-        eq_(hex(msg_type['val']).find(check['msg_type']), 0)
-        eq_(hex(xid['val']).find(check['xid']), 0)
-
     def test_serialize(self):
         # Not used.
         pass
 <at>  <at>  -4964,23 +4611,6  <at>  <at>  class TestOFPVendorStatsReply(unittest.TestCase):
         body = res.body[0]
         eq_(specific_data, body)

-        # test __str__()
-        list_ = ('version:', 'msg_type', 'xid',)
-
-        check = {}
-        str_ = str(res)
-        str_ = str_.rsplit()
-
-        i = 0
-        for s in str_:
-            if s in list_:
-                check[str_[i]] = str_[i + 1]
-            i += 1
-
-        eq_(hex(version['val']).find(check['version:']), 0)
-        eq_(hex(msg_type['val']).find(check['msg_type']), 0)
-        eq_(hex(xid['val']).find(check['xid']), 0)
-
     def test_serialize(self):
         # Not used.
         pass
--

-- 
1.7.1

------------------------------------------------------------------------------
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service 
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_may
hsin han Liu | 19 May 2013 09:17
Picon

question about ryu

Hello
1.want to know more about ryu/app/simple_isolation.py and ryu/app/simple_vlan.py ,also how to use it? 2.does ryu support vlan construction like http://openvswitch.org/support/config-cookbooks/vlan-configuration-cookbook/ without openstack?
Thanks,Allen
------------------------------------------------------------------------------
AlienVault Unified Security Management (USM) platform delivers complete
security visibility with the essential security capabilities. Easily and
efficiently configure, manage, and operate all of your security controls
from a single console and one unified framework. Download a free trial.
http://p.sf.net/sfu/alienvault_d2d
_______________________________________________
Ryu-devel mailing list
Ryu-devel@...
https://lists.sourceforge.net/lists/listinfo/ryu-devel
Agung Ridwan SN | 18 May 2013 10:33
Picon

VRRP

Hi,

I just wondering if there is an app which ready to use for VRRP case.
The test seems works (https://github.com/osrg/ryu/wiki/Test-VRRP), when it will publish to the ryu/app directory? Is it possible to run that VRRP with network from openstack? One more, how to capture GRE tunnel packet from single node installation? I found OF packet but no GRE. Thanks
------------------------------------------------------------------------------
AlienVault Unified Security Management (USM) platform delivers complete
security visibility with the essential security capabilities. Easily and
efficiently configure, manage, and operate all of your security controls
from a single console and one unified framework. Download a free trial.
http://p.sf.net/sfu/alienvault_d2d
_______________________________________________
Ryu-devel mailing list
Ryu-devel@...
https://lists.sourceforge.net/lists/listinfo/ryu-devel
FUJITA Tomonori | 17 May 2013 23:00
Picon
Gravatar

[PATCH] docs: fix ryu module import

readthedocs.org complains about the failure about ryu module import.

=
>From e94c710a1acce5fc4e25774502b4133e7d53aa7a Mon Sep 17 00:00:00 2001
From: FUJITA Tomonori <fujita.tomonori@...>
Date: Sat, 18 May 2013 05:36:21 +0900
Subject: [PATCH] docs: fix import

Signed-off-by: FUJITA Tomonori <fujita.tomonori@...>
---
 doc/source/conf.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/doc/source/conf.py b/doc/source/conf.py
index ebccb2c..4caf9b0 100644
--- a/doc/source/conf.py
+++ b/doc/source/conf.py
 <at>  <at>  -12,12 +12,13  <at>  <at> 
 # serve to show the default.

 import sys, os
-from ryu import version as ryu_version

 # If extensions (or modules to document with autodoc) are in another directory,
 # add these directories to sys.path here. If the directory is relative to the
 # documentation root, use os.path.abspath to make it absolute, like shown here.
-#sys.path.insert(0, os.path.abspath('.'))
+sys.path.insert(0, os.path.abspath('../..'))
+
+from ryu import version as ryu_version

 # -- General configuration -----------------------------------------------------

--

-- 
1.7.12.4 (Apple Git-37)

------------------------------------------------------------------------------
AlienVault Unified Security Management (USM) platform delivers complete
security visibility with the essential security capabilities. Easily and
efficiently configure, manage, and operate all of your security controls
from a single console and one unified framework. Download a free trial.
http://p.sf.net/sfu/alienvault_d2d
Isaku Yamahata | 17 May 2013 13:11
Picon
Favicon

[PATCH v2 0/6] snmp agent

Here is a v2 prototype of SNMP agent support using pysnmp.
Ryu is able to send SNMP trap as notification originator.
Right now it sends only coldStart trap on startup and specific traps
on datapath enter/leave event.

For other Ryu component to utilize SNMP agent, agentX-like API is desirable?

thanks,

Changes v1 -> v2:
- introduce Ryu specific MIB definitions
- populate datapath table and send traps on datapath enter/leave event

Isaku Yamahata (6):
  lib/dpid: helper functions converting dpid <-> bytes[8]
  services/snmp_agent: create snmp agent module
  snmp/mib: MIB definitions specific to Ryu
  services/snmp/mib: RYU-MIB.py
  snmp/mib/instances: add __RYU-MIB module which is currently empty
  snmp/agent: snmp agent support

 ryu/lib/dpid.py                               |   13 ++
 ryu/services/snmp/__init__.py                 |   15 ++
 ryu/services/snmp/agent.py                    |  286 +++++++++++++++++++++++++
 ryu/services/snmp/mibs/RYU-MIB.py             |   71 ++++++
 ryu/services/snmp/mibs/RYU-MIB.txt            |  149 +++++++++++++
 ryu/services/snmp/mibs/__init__.py            |   15 ++
 ryu/services/snmp/mibs/instances/__RYU-MIB.py |   17 ++
 ryu/services/snmp/mibs/instances/__init__.py  |   15 ++
 8 files changed, 581 insertions(+)
 create mode 100644 ryu/services/snmp/__init__.py
 create mode 100644 ryu/services/snmp/agent.py
 create mode 100644 ryu/services/snmp/mibs/RYU-MIB.py
 create mode 100644 ryu/services/snmp/mibs/RYU-MIB.txt
 create mode 100644 ryu/services/snmp/mibs/__init__.py
 create mode 100644 ryu/services/snmp/mibs/instances/__RYU-MIB.py
 create mode 100644 ryu/services/snmp/mibs/instances/__init__.py

--
1.7.10.4

------------------------------------------------------------------------------
AlienVault Unified Security Management (USM) platform delivers complete
security visibility with the essential security capabilities. Easily and
efficiently configure, manage, and operate all of your security controls
from a single console and one unified framework. Download a free trial.
http://p.sf.net/sfu/alienvault_d2d
Philipp Aeschlimann | 17 May 2013 11:29
Picon
Favicon

Re: Using OFPQueueGetConfigRequest

Sure I can, here we go...

>From e442dea1f9ae2ce0fe31698e3e5b226041b8c2a0 Mon Sep 17 00:00:00 2001
From: Aeschlimann Philipp <aepp@...>
Date: Fri, 17 May 2013 11:18:44 +0200
Subject: [PATCH] Fix for OFPQueueGetConfigReply/Request in OFP13

Signed-off-by: Philipp Aeschlimann <aepp@...>
---
 ryu/ofproto/ofproto_v1_3_parser.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/ryu/ofproto/ofproto_v1_3_parser.py
b/ryu/ofproto/ofproto_v1_3_parser.py
index 2f36859..80a777d 100644
--- a/ryu/ofproto/ofproto_v1_3_parser.py
+++ b/ryu/ofproto/ofproto_v1_3_parser.py
 <at>  <at>  -2739,7 +2739,7  <at>  <at>  class OFPPacketQueue(MsgBase):
      <at> classmethod
     def parser(cls, buf, offset):
         (msg.queue_id, msg.port, msg.len) = struct.unpack_from(
-            ofproto_v1_3.OFP_PACKET_QUEUE_PACK_STR, buf, offset)
+            ofproto_v1_3.OFP_PACKET_QUEUE_PACK_STR, msg.buf, offset)

         length = ofproto_v1_3.OFP_PACKET_QUEUE_SIZE
         offset += ofproto_v1_3.OFP_PACKET_QUEUE_SIZE
 <at>  <at>  -2771,7 +2771,7  <at>  <at>  class OFPQueueGetConfigReply(MsgBase):

         msg.queues = []
         offset += ofproto_v1_3.OFP_QUEUE_GET_CONFIG_REPLY_SIZE
-        while offset < msg.length:
+        while offset < msg_len:
             queue = OFPPacketQueue.parser(buf, offset)
             msg.queues.append(queue)
             offset += queue.len
--
1.8.2.3

g *pae

2013/5/17 Isaku Yamahata <yamahata@...>:
> Can you please send the revised patch for OFPQueueGetConfigRequest
> with your signed-off-by?
>
> On Wed, May 15, 2013 at 01:47:52PM +0200, Philipp Aeschlimann wrote:
>> Great, exactly the answer I was looking for, THX...
>>
>> g *pae
>>
>> 2013/5/15 Isaku Yamahata <yamahata@...>:
>> > On Wed, May 15, 2013 at 12:03:26PM +0200, Philipp Aeschlimann wrote:
>> >> Hey
>> >>
>> >> I'm using the following script to create the bridge (OVS). As you can
>> >> see, I'm using
>> >>
>> >> ovs-vsctl set bridge $NAME protocols=OpenFlow13
>> >>
>> >> To set the version of OFP. Is there any other place where I have to
>> >> configure this?
>> >
>> > This is correct way to configure OVS.
>> >
>> >> Because my app won't work anyways with OVS, here's the
>> >> version I'm using:
>> >
>> > Because OVS doesn't support OFPQueueGetConfigRequest yet.
>> > Not due to mis-configuration or ryu side issue.
>> > The only way is to add the feature to OVS upstream.
>> >
>> > thanks,
>> >
>> >> clt-mob-p-1093:/home/staff/aepp/unix # ovs-vsctl --version
>> >> ovs-vsctl (Open vSwitch) 1.10.0
>> >> Compiled May  6 2013 11:47:07
>> >> clt-mob-p-1093:/home/staff/aepp/unix #
>> >>
>> >> usage()
>> >> {
>> >> cat << EOF
>> >> usage: $0 options
>> >>
>> >> This script creates or deletes an Open vSwitch.
>> >>
>> >> OPTIONS:
>> >>    -h      Show this message
>> >>    -o      Can be 'add' or 'del'
>> >>    -n      The name of the bridge
>> >>    -p      Amount of port numbers
>> >>    -v      Verbose
>> >>
>> >> EXAMPLE:
>> >>    # $0 -o add -n lan0 -p 5
>> >>    # $0 -o del -n lan0 -p 5
>> >> EOF
>> >> }
>> >>
>> >> NAME=
>> >> PORTS=
>> >> OP=
>> >> VERBOSE=0
>> >> while getopts "h:o:n:p:v" OPTION
>> >> do
>> >>   case $OPTION in
>> >>     h)
>> >>       usage
>> >>       exit 1
>> >>       ;;
>> >>     n)
>> >>       NAME=$OPTARG
>> >>       ;;
>> >>     p)
>> >>       PORTS=$OPTARG
>> >>       ;;
>> >>     o)
>> >>       OP=$OPTARG
>> >>       ;;
>> >>     v)
>> >>       VERBOSE=1
>> >>       ;;
>> >>     ?)
>> >>       usage
>> >>       exit
>> >>       ;;
>> >>   esac
>> >> done
>> >>
>> >> if [[ -z $NAME ]] || [[ -z $PORTS ]] || [[ -z $OP ]]
>> >> then
>> >>   usage
>> >>   exit 1
>> >> fi
>> >>
>> >> if [ "$OP" == "add" ]
>> >> then
>> >>   # create the bridge
>> >>   ovs-vsctl add-br $NAME
>> >>
>> >>   # use OFP13
>> >>   ovs-vsctl set bridge $NAME protocols=OpenFlow13
>> >>
>> >>   for tap in `seq 0 $PORTS`; do
>> >>     ip tuntap add mode tap ${NAME}p$tap
>> >>   done;
>> >>
>> >>   # check if the ifaces, only in verbose
>> >>   if [ "$VERBOSE" == "1" ]
>> >>     then
>> >>     echo "Output of: #ip tuntap list"
>> >>     ip tuntap list
>> >>   fi
>> >>
>> >>   for tap in `seq 0 $PORTS`; do
>> >>     ip link set ${NAME}p$tap up
>> >>   done;
>> >>
>> >>   # check state of the ifaces, only in verbose
>> >>   if [ "$VERBOSE" == "1" ]
>> >>   then
>> >>     echo "Output of: #ip link"
>> >>     ip link
>> >>   fi
>> >>
>> >>   for tap in `seq 0 $PORTS`; do
>> >>     ovs-vsctl add-port $NAME ${NAME}p$tap
>> >>   done;
>> >>
>> >>   # list all ports by ovs-vsctl to check, if taps are there
>> >>   if [ "$VERBOSE" == "1" ]
>> >>     then
>> >>     echo "Output of: #ip ovs-vsctl list-ports $NAME"
>> >>     ovs-vsctl list-ports $NAME
>> >>   fi
>> >>
>> >>   # set the controller to localhost
>> >>   # TODO: make this variable
>> >>   ovs-vsctl set-controller $NAME tcp:0.0.0.0:6633
>> >>
>> >> # TODO: be more verbose
>> >> elif [ "$OP" == "del" ]
>> >> then
>> >>   # remove the bridge
>> >>   ovs-vsctl del-br $NAME
>> >>
>> >>   # remove all taps
>> >>   for tap in `seq 0 $PORTS`; do
>> >>     ip tuntap del ${NAME}p$tap mode tap
>> >>   done;
>> >>
>> >> else
>> >>   usage
>> >>   exit 1
>> >> fi
>> >>
>> >> THX in advance, Philipp - g *pae
>> >>
>> >> 2013/5/15 Isaku Yamahata <yamahata@...>:
>> >> > On Tue, May 14, 2013 at 04:10:46PM +0200, Philipp Aeschlimann wrote:
>> >> >> Hey there
>> >> >>
>> >> >> I'm trying some things with QoS and therefore i wrote a simple
>> >> >> test-app here (click download in the upper right corner):
>> >> >>
>> >> >> https://owncloud.engineering.zhaw.ch/public.php?service=files&t=f6f7e645b0d67b3c9a0cc537f8b38dfb
>> >> >>
>> >> >> It sends OFPQueueGetConfigRequest and tries to receive an
>> >> >> OFPQueueGetConfigReply. But with the appliance from here
>> >> >> https://github.com/osrg/ryu/wiki/OpenFlow_Tutorial I get this error:
>> >> >>
>> >> >> error msg ev version: 0x1 msg_type 0x1 xid 0xa6425c5e type 1 code 1
>> >> >> data _???B\^unsupported version 0x1. If possible, set the switch type
>> >> >> 0x1 code 0x1
>> >> >> unsupported version 0x1. If possible, set the switch to use one of the
>> >> >> versions [4]
>> >> >
>> >> > You have to configure OVS to use OF 1.3 instead of OF1.0.
>> >> > By default OVS uses OF1.0.
>> >> >
>> >> >> And with OVS 1.10.0 (installed localy) I get:
>> >> >>
>> >> >> error msg ev version: 0x4 msg_type 0x1 xid 0xd49cfa2a type 1 code 1
>> >> >> data ?????* type 0x1 code 0x1
>> >> >
>> >> > Althouh you set OVS to use OF1.3 somehow, OVS doesn't support
>> >> > OFPQueueGetConfigRequest yet. OVS returns an error message in respond to
>> >> > the request.
>> >> > type 0x1 = error
>> >> > code 0x1 = bad request
>> >> >
>> >> >
>> >> >> But with the following changes and the softswitch from here:
>> >> >> https://github.com/CPqD/ofsoftswitch13 everything works as expected
>> >> >>
>> >> >> diff --git a/ryu/ofproto/ofproto_v1_3_parser.py
>> >> >> b/ryu/ofproto/ofproto_v1_3_parser.py
>> >> >> index 3f2d020..cace1aa 100644
>> >> >> --- a/ryu/ofproto/ofproto_v1_3_parser.py
>> >> >> +++ b/ryu/ofproto/ofproto_v1_3_parser.py
>> >> >>  <at>  <at>  -2734,7 +2734,7  <at>  <at>  class OFPPacketQueue(MsgBase):
>> >> >>       <at> classmethod
>> >> >>      def parser(cls, buf, offset):
>> >> >>          (msg.queue_id, msg.port, msg.len) = struct.unpack_from(
>> >> >> -            ofproto_v1_3.OFP_PACKET_QUEUE_PACK_STR, buf, offset)
>> >> >> +            ofproto_v1_3.OFP_PACKET_QUEUE_PACK_STR, buffer(buf), offset)
>> >> >>
>> >> >>          length = ofproto_v1_3.OFP_PACKET_QUEUE_SIZE
>> >> >>          offset += ofproto_v1_3.OFP_PACKET_QUEUE_SIZE
>> >> >
>> >> > See below.
>> >> >
>> >> >
>> >> >>  <at>  <at>  -2766,7 +2766,7  <at>  <at>  class OFPQueueGetConfigReply(MsgBase):
>> >> >>
>> >> >>          msg.queues = []
>> >> >>          offset += ofproto_v1_3.OFP_QUEUE_GET_CONFIG_REPLY_SIZE
>> >> >> -        while offset < msg.length:
>> >> >> +        while offset < msg_len:
>> >> >
>> >> > This line looks good.
>> >> >
>> >> >>              queue = OFPPacketQueue.parser(buf, offset)
>> >> >
>> >> > msg.buf should be passed. Then first hunk can be dropped.
>> >> >
>> >> > thanks,
>> >> >
>> >> >>              msg.queues.append(queue)
>> >> >>              offset += queue.len
>> >> >>
>> >> >> The above errors from OVS are showing up anyways. THX in advance...
>> >> >>
>> >> >> g *pae
>> >> >>
>> >> >> --
>> >> >> ZHAW - Zurich University of Applied Sciences
>> >> >> Institute of Applied Information Technology InIT
>> >> >> InIT Cloud Computing Laboratory ICCLab
>> >> >>
>> >> >> Philipp Aeschlimann
>> >> >> Obere Kirchgasse 2
>> >> >> CH-8401 Winterthur
>> >> >>
>> >> >> Tel. +41 58 934 6964 (intern 6964)
>> >> >> mailto:aepp@...
>> >> >> www.zhaw.ch
>> >> >> www.cloudcomp.ch
>> >> >>
>> >> >> GPG IDKey: 647E122E
>> >> >> Fingerprint: 47B7 8D8A 98D1 E91D 4B7C E261 D88C BE9E 647E 122E
>> >> >>
>> >> >> ------------------------------------------------------------------------------
>> >> >> AlienVault Unified Security Management (USM) platform delivers complete
>> >> >> security visibility with the essential security capabilities. Easily and
>> >> >> efficiently configure, manage, and operate all of your security controls
>> >> >> from a single console and one unified framework. Download a free trial.
>> >> >> http://p.sf.net/sfu/alienvault_d2d
>> >> >> _______________________________________________
>> >> >> Ryu-devel mailing list
>> >> >> Ryu-devel@...
>> >> >> https://lists.sourceforge.net/lists/listinfo/ryu-devel
>> >> >
>> >> > --
>> >> > yamahata
>> >>
>> >> ------------------------------------------------------------------------------
>> >> AlienVault Unified Security Management (USM) platform delivers complete
>> >> security visibility with the essential security capabilities. Easily and
>> >> efficiently configure, manage, and operate all of your security controls
>> >> from a single console and one unified framework. Download a free trial.
>> >> http://p.sf.net/sfu/alienvault_d2d
>> >> _______________________________________________
>> >> Ryu-devel mailing list
>> >> Ryu-devel@...
>> >> https://lists.sourceforge.net/lists/listinfo/ryu-devel
>> >>
>> >
>> > --
>> > yamahata
>>
>
> --
> yamahata

------------------------------------------------------------------------------
AlienVault Unified Security Management (USM) platform delivers complete
security visibility with the essential security capabilities. Easily and
efficiently configure, manage, and operate all of your security controls
from a single console and one unified framework. Download a free trial.
http://p.sf.net/sfu/alienvault_d2d
YAMAMOTO Takashi | 17 May 2013 06:55
Picon
Favicon

[PATCH 0/2] RFC: of-wire json representation

this set implements basic ryu of-wire classes <-> json conversions.

- if it needs to be more human-readable than base64,
  probably explicit annotations are necessary.
- xxx: this assumes attribute names match __init__ args exactly.
  ("type_" vs "type")
- xxx: other of-wire versions
- xxx: unit tests

any comments?

json representation examples:

{"OFPMatch": {"dl_type": 0, "wildcards": 4194303, "nw_dst": 0, "dl_vlan_pcp": 0, "dl_src":
"AAAAAAAA", "nw_proto": 0, "nw_tos": 0, "tp_dst": 0, "tp_src": 0, "dl_dst": "AAAAAAAA", "dl_vlan": 0,
"nw_src": 0, "in_port": 0}}

{"OFPPacketIn": {"reason": 0, "total_len": 64, "data":
"gAAAAAAMAAUAAAAMCABFAAAyAAAAAED/9yzAqAAowKgBKHoYWGsRCJf1GeJlfgfMMcMRx8QMi5VRUTNUUdUANg==",
"in_port": 1, "buffer_id": 6}}

{"OFPSwitchFeatures": {"datapath_id": 7, "n_tables": 2, "capabilities": 0, "actions": 2047,
"ports": {"1": {"OFPPhyPort": {"hw_addr": "GsFR/++K", "curr": 192, "name":
"dmV0aDEAAAAAAAAAAAAAAA==", "supported": 0, "state": 0, "advertised": 0, "peer": 0, "config": 0,
"port_no": 1}}, "2": {"OFPPhyPort": {"hw_addr": "zi+ih/Zw", "curr": 192, "name":
"dmV0aDMAAAAAAAAAAAAAAA==", "supported": 0, "state": 0, "advertised": 0, "peer": 0, "config": 0,
"port_no": 2}}, "3": {"OFPPhyPort": {"hw_addr": "yooe83fv", "curr": 192, "name":
"dmV0aDUAAAAAAAAAAAAAAA==", "supported": 0, "state": 0, "advertised": 0, "peer": 0, "config": 0,
"port_no": 3}}, "4": {"OFPPhyPort": {"hw_addr": "+rx3jX4L", "curr": 192, "name":
"dmV0aDcAAAAAAAAAAAAAAA==", "supported": 0, "state": 0, "advertised": 0, "peer": 0, "config": 0, "p
 ort_no": 4}}}, "n_buffers": 256}}

YAMAMOTO Takashi (2):
  json representation of of-wire classes
  of-wire json: adapt OF1.0

 ryu/ofproto/ofproto_parser.py      | 71 ++++++++++++++++++++++++++++++++++++++
 ryu/ofproto/ofproto_v1_0_parser.py | 17 +++++----
 2 files changed, 79 insertions(+), 9 deletions(-)

--

-- 
1.8.0.1

------------------------------------------------------------------------------
AlienVault Unified Security Management (USM) platform delivers complete
security visibility with the essential security capabilities. Easily and
efficiently configure, manage, and operate all of your security controls
from a single console and one unified framework. Download a free trial.
http://p.sf.net/sfu/alienvault_d2d

Gmane