Ricardo Balbinot | 28 Nov 15:28 2014
Picon

Problems with vlan_pcp match field

Hi,

Another question... I have the following code:

CODE A
match = parser.OFPMatch(vlan_pcp=0, vlan_vid=id_grupo)
actions = [parser.OFPActionGroup(group_id=id_grupo)]
resp = self.add_flow(datapath,32768,match,actions)

ADD_FLOW is this code:
ofproto = datapath.ofproto
parser = datapath.ofproto_parser
instruct = [parser.OFPInstructionActions(ofproto.OFPIT_APPLY_ACTIONS,actions)]
mod = parser.OFPFlowMod(datapath=datapath,priority=priority,match=match,
            instructions=instruct,command=ofproto.OFPFC_ADD,table_id=0)
datapath.send_msg(mod)

Using the code as is, I have no flow entry added to the switch at all... when I remove the valn_pcp field from the match, the flow is added normaly....
I am using an ovs switch with openflow 1.3... I already tried to manually add the flow entry using dpctl with the vlan_pcp field, and it adds the flow rule normally, so I am guessing this might be a Ryu problem...

Any sugestions at all??

--
-------------------------------
Me. Ricardo Balbinot
------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk
_______________________________________________
Ryu-devel mailing list
Ryu-devel@...
https://lists.sourceforge.net/lists/listinfo/ryu-devel
Yuji Oshima | 28 Nov 09:18 2014
Picon

[PATCH] bmp: bug fix of peer bgp ID in BMP Message

Ryu BGP sets self-BGP ID as Peer BGP ID in BMP Message.

Signed-off-by: Yuji Oshima <yuji.oshima0x3fd@...>
---
 ryu/services/protocols/bgp/bmp.py |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/ryu/services/protocols/bgp/bmp.py b/ryu/services/protocols/bgp/bmp.py
index c899b5b..4fbbecb 100644
--- a/ryu/services/protocols/bgp/bmp.py
+++ b/ryu/services/protocols/bgp/bmp.py
 <at>  <at>  -112,7 +112,7  <at>  <at>  class BMPClient(Activity):

         peer_distinguisher = 0
         peer_as = peer._neigh_conf.remote_as
-        peer_bgp_id = self._core_service.router_id
+        peer_bgp_id = peer.protocol.recv_open_msg.bgp_identifier
         timestamp = peer.state._established_time

         local_address = peer.host_bind_ip
 <at>  <at>  -146,7 +146,7  <at>  <at>  class BMPClient(Activity):
             peer_type = bmp.BMP_PEER_TYPE_GLOBAL

         peer_as = peer._neigh_conf.remote_as
-        peer_bgp_id = self._core_service.router_id
+        peer_bgp_id = peer.protocol.recv_open_msg.bgp_identifier
         peer_address, _ = peer.protocol._remotename

         return bmp.BMPPeerDownNotification(bmp.BMP_PEER_DOWN_REASON_UNKNOWN,
 <at>  <at>  -168,7 +168,7  <at>  <at>  class BMPClient(Activity):

         peer_distinguisher = 0
         peer_as = peer._neigh_conf.remote_as
-        peer_bgp_id = self._core_service.router_id
+        peer_bgp_id = peer.protocol.recv_open_msg.bgp_identifier
         peer_address, _ = peer.protocol._remotename

         bgp_update = peer._construct_update(path)
--

-- 
1.7.9.5

------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk
Minoru TAKAHASHI | 28 Nov 08:47 2014
Picon

[PATCH 2/2] doc/app/ofctl_rest: Add command examples for OFPVID_NONE/PRESENT

Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@...>
---
 doc/source/app/ofctl_rest.rst | 82 +++++++++++++++++++++++++++++++++++++++++--
 1 file changed, 80 insertions(+), 2 deletions(-)

diff --git a/doc/source/app/ofctl_rest.rst b/doc/source/app/ofctl_rest.rst
index 2e1669f..973448b 100644
--- a/doc/source/app/ofctl_rest.rst
+++ b/doc/source/app/ofctl_rest.rst
 <at>  <at>  -1430,8 +1430,8  <at>  <at>  Description of Match on request messages
         eth_src         Ethernet source address (string)                   {"eth_src": "aa:bb:cc:11:22:33"}
         dl_type         Ethernet frame type (int)                          {"dl_type": 123}
         eth_type        Ethernet frame type (int)                          {"eth_type": 2048}
-        dl_vlan         VLAN id (string)                                   {"dl_vlan": 5}
-        vlan_vid        VLAN id (string)                                   {"vlan_vid": 5}
+        dl_vlan         VLAN id (int or string)                            See :ref:`example-of-vlan-id-match-field`
+        vlan_vid        VLAN id (int or string)                            See :ref:`example-of-vlan-id-match-field`
         vlan_pcp        VLAN priority (int)                                {"vlan_pcp": 3, "vlan_vid": 3}
         ip_dscp         IP DSCP (6 bits in ToS field) (int)                {"ip_dscp": 3, "eth_type": 2048}
         ip_ecn          IP ECN (2 bits in ToS field) (int)                 {"ip_ecn": 0, "eth_type": 34525}
 <at>  <at>  -1499,6 +1499,84  <at>  <at>  Description of Match on request messages
             "0x3434343434343434/0x01010101010101010"

 
+.. _example-of-vlan-id-match-field:
+
+Example of VLAN ID match field
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+    The following is available in OpenFlow1.0 or later.
+
+    - To match only packets with VLAN tag and VLAN ID equal value 5::
+
+        $ curl -X POST -d '{
+            "dpid": 1,
+            "match":{
+                "dl_vlan": 5
+            },
+            "actions":[
+                {
+                    "type":"OUTPUT",
+                    "port": 1
+                }
+            ]
+         }' http://localhost:8080/stats/flowentry/add
+
+    .. NOTE::
+        When "dl_vlan" field is described as decimal int value, OFPVID_PRESENT(0x1000) bit is automatically applied.
+
+    The following is available in OpenFlow1.2 or later.
+
+    - To match only packets without a VLAN tag::
+
+        $ curl -X POST -d '{
+            "dpid": 1,
+            "match":{
+                "dl_vlan": "0x0000"   # Describe OFPVID_NONE(0x0000)
+            },
+            "actions":[
+                {
+                    "type":"OUTPUT",
+                    "port": 1
+                }
+            ]
+         }' http://localhost:8080/stats/flowentry/add
+
+    - To match only packets with a VLAN tag regardless of its value::
+
+        $ curl -X POST -d '{
+            "dpid": 1,
+            "match":{
+                "dl_vlan": "0x1000/0x1000"   # Describe OFPVID_PRESENT(0x1000/0x1000)
+            },
+            "actions":[
+                {
+                    "type":"OUTPUT",
+                    "port": 1
+                }
+            ]
+         }' http://localhost:8080/stats/flowentry/add
+
+    - To match only packets with VLAN tag and VLAN ID equal value 5::
+
+        $ curl -X POST -d '{
+            "dpid": 1,
+            "match":{
+                "dl_vlan": "0x1005"   # Describe sum of VLAN-ID(e.g. 5) | OFPVID_PRESENT(0x1000)
+            },
+            "actions":[
+                {
+                    "type":"OUTPUT",
+                    "port": 1
+                }
+            ]
+         }' http://localhost:8080/stats/flowentry/add
+
+    .. NOTE::
+        When using the descriptions for OpenFlow1.2 or later, please describe "dl_vlan" field as hexadecimal
string value,
+        and OFPVID_PRESENT(0x1000) bit is NOT automatically applied.
+
+
+
 Description of Actions on request messages
 ------------------------------------------

--

-- 
1.9.1

------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk
Minoru TAKAHASHI | 28 Nov 08:47 2014
Picon

[PATCH 1/2] ofctl_v1_2/3: Fully support the match combinations for VLAN ID

Currently, when VLAN ID match field is specified,
ofctl_v1_[23] is compatible with only match combination 1) of
the following three match combinations.
This patch makes it possible to set the all three combinations.

  Match combinations for VLAN ID :
    1) To match only packets with VLAN tag and VID equal value
    2) To match only packets without a VLAN tag
    3) To match only packets with a VLAN tag regardless of its value

In order to set the match combinations 2) or 3), please describe
"dl_vlan" field as hexadecimal string value like as follows.

  Before applying this patch:
    {"dl_vlan": 3 }              # int

  After applying this patch:
    {"dl_vlan": 3 }              # int (same as before applying)
    {"dl_vlan": "0x0000"}        # hexadecimal string without mask
    {"dl_vlan": "0x1000/0x1000"} # hexadecimal string with mask

NOTE: When "dl_vlan" field is described as decimal int value,
      OFPVID_PRESENT(0x1000) bit is automatically applied.
      OTOH, OFPVID_PRESENT(0x1000) bit is NOT automatically applied
      to hexadecimal string value.

For curl command examples, please refer to the following page in Ryu-documentation.
http://ryu.readthedocs.org/en/latest/app/ofctl_rest.html#example-of-vlan-id-match-field

Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@...>
---
 ryu/lib/ofctl_v1_2.py            | 48 ++++++++++++++++++---
 ryu/lib/ofctl_v1_3.py            | 48 ++++++++++++++++++---
 ryu/tests/unit/lib/test_ofctl.py | 92 ++++++++++++++++++++++++++++++++++++++--
 3 files changed, 170 insertions(+), 18 deletions(-)

diff --git a/ryu/lib/ofctl_v1_2.py b/ryu/lib/ofctl_v1_2.py
index 40989a2..c8b9174 100644
--- a/ryu/lib/ofctl_v1_2.py
+++ b/ryu/lib/ofctl_v1_2.py
 <at>  <at>  -198,8 +198,8  <at>  <at>  def to_match(dp, attrs):
                'eth_src': to_match_eth,
                'dl_type': int,
                'eth_type': int,
-               'dl_vlan': int,
-               'vlan_vid': int,
+               'dl_vlan': to_match_vid,
+               'vlan_vid': to_match_vid,
                'vlan_pcp': int,
                'ip_dscp': int,
                'ip_ecn': int,
 <at>  <at>  -268,9 +268,6  <at>  <at>  def to_match(dp, attrs):
             ip_proto = attrs.get('nw_proto', attrs.get('ip_proto', 0))
             key = conv[ip_proto][key]
             kwargs[key] = value
-        elif key == 'vlan_vid':
-            # VLAN ID
-            kwargs[key] = value | ofproto_v1_2.OFPVID_PRESENT
         else:
             # others
             kwargs[key] = value
 <at>  <at>  -296,6 +293,28  <at>  <at>  def to_match_ip(value):
         return value

 
+def to_match_vid(value):
+    # NOTE: If "vlan_id/dl_vlan" field is described as decimal int value
+    #       (and decimal string value), it is treated as values of
+    #       VLAN tag, and OFPVID_PRESENT(0x1000) bit is automatically
+    #       applied. OTOH, If it is described as hexadecimal string,
+    #       treated as values of oxm_value (including OFPVID_PRESENT
+    #       bit), and OFPVID_PRESENT bit is NOT automatically applied.
+    if isinstance(value, int):
+        # described as decimal int value
+        return value | ofproto_v1_2.OFPVID_PRESENT
+    else:
+        if '/' in value:
+            val = value.split('/')
+            return int(val[0], 0), int(val[1], 0)
+        else:
+            if value.isdigit():
+                # described as decimal string value
+                return int(value, 10) | ofproto_v1_2.OFPVID_PRESENT
+            else:
+                return int(value, 0)
+
+
 def to_match_metadata(value):
     if '/' in value:
         value = value.split('/')
 <at>  <at>  -330,9 +349,9  <at>  <at>  def match_to_str(ofmatch):
         mask = match_field['OXMTlv']['mask']
         value = match_field['OXMTlv']['value']
         if key == 'dl_vlan':
-            value &= ~ofproto_v1_2.OFPVID_PRESENT
+            value = match_vid_to_str(value, mask)
         elif key == 'metadata':
-            value = ('%d/%d' % (value, mask) if mask else '%d' % value)
+            value = match_metadata_to_str(value, mask)
         else:
             if mask is not None:
                 value = value + '/' + mask
 <at>  <at>  -343,6 +362,21  <at>  <at>  def match_to_str(ofmatch):
     return match

 
+def match_metadata_to_str(value, mask):
+    return ('%d/%d' % (value, mask) if mask else '%d' % value)
+
+
+def match_vid_to_str(value, mask):
+    if mask is not None:
+        value = '0x%04x/0x%04x' % (value, mask)
+    else:
+        if value & ofproto_v1_2.OFPVID_PRESENT:
+            value = str(value & ~ofproto_v1_2.OFPVID_PRESENT)
+        else:
+            value = '0x%04x' % value
+    return value
+
+
 def send_stats_request(dp, stats, waiters, msgs):
     dp.set_xid(stats)
     waiters_per_dp = waiters.setdefault(dp.id, {})
diff --git a/ryu/lib/ofctl_v1_3.py b/ryu/lib/ofctl_v1_3.py
index 96c22d2..bc21a7f 100644
--- a/ryu/lib/ofctl_v1_3.py
+++ b/ryu/lib/ofctl_v1_3.py
 <at>  <at>  -215,8 +215,8  <at>  <at>  def to_match(dp, attrs):
                'eth_src': to_match_eth,
                'dl_type': int,
                'eth_type': int,
-               'dl_vlan': int,
-               'vlan_vid': int,
+               'dl_vlan': to_match_vid,
+               'vlan_vid': to_match_vid,
                'vlan_pcp': int,
                'ip_dscp': int,
                'ip_ecn': int,
 <at>  <at>  -289,9 +289,6  <at>  <at>  def to_match(dp, attrs):
             ip_proto = attrs.get('nw_proto', attrs.get('ip_proto', 0))
             key = conv[ip_proto][key]
             kwargs[key] = value
-        elif key == 'vlan_vid':
-            # VLAN ID
-            kwargs[key] = value | ofproto_v1_3.OFPVID_PRESENT
         else:
             # others
             kwargs[key] = value
 <at>  <at>  -317,6 +314,28  <at>  <at>  def to_match_ip(value):
         return value

 
+def to_match_vid(value):
+    # NOTE: If "vlan_id/dl_vlan" field is described as decimal int value
+    #       (and decimal string value), it is treated as values of
+    #       VLAN tag, and OFPVID_PRESENT(0x1000) bit is automatically
+    #       applied. OTOH, If it is described as hexadecimal string,
+    #       treated as values of oxm_value (including OFPVID_PRESENT
+    #       bit), and OFPVID_PRESENT bit is NOT automatically applied.
+    if isinstance(value, int):
+        # described as decimal int value
+        return value | ofproto_v1_3.OFPVID_PRESENT
+    else:
+        if '/' in value:
+            val = value.split('/')
+            return int(val[0], 0), int(val[1], 0)
+        else:
+            if value.isdigit():
+                # described as decimal string value
+                return int(value, 10) | ofproto_v1_3.OFPVID_PRESENT
+            else:
+                return int(value, 0)
+
+
 def to_match_metadata(value):
     if '/' in value:
         value = value.split('/')
 <at>  <at>  -352,9 +371,9  <at>  <at>  def match_to_str(ofmatch):
         mask = match_field['OXMTlv']['mask']
         value = match_field['OXMTlv']['value']
         if key == 'dl_vlan':
-            value &= ~ofproto_v1_3.OFPVID_PRESENT
+            value = match_vid_to_str(value, mask)
         elif key == 'metadata':
-            value = ('%d/%d' % (value, mask) if mask else '%d' % value)
+            value = match_metadata_to_str(value, mask)
         else:
             if mask is not None:
                 value = value + '/' + mask
 <at>  <at>  -365,6 +384,21  <at>  <at>  def match_to_str(ofmatch):
     return match

 
+def match_metadata_to_str(value, mask):
+    return ('%d/%d' % (value, mask) if mask else '%d' % value)
+
+
+def match_vid_to_str(value, mask):
+    if mask is not None:
+        value = '0x%04x/0x%04x' % (value, mask)
+    else:
+        if value & ofproto_v1_3.OFPVID_PRESENT:
+            value = str(value & ~ofproto_v1_3.OFPVID_PRESENT)
+        else:
+            value = '0x%04x' % value
+    return value
+
+
 def send_stats_request(dp, stats, waiters, msgs):
     dp.set_xid(stats)
     waiters_per_dp = waiters.setdefault(dp.id, {})
diff --git a/ryu/tests/unit/lib/test_ofctl.py b/ryu/tests/unit/lib/test_ofctl.py
index dd73b5e..0c09464 100644
--- a/ryu/tests/unit/lib/test_ofctl.py
+++ b/ryu/tests/unit/lib/test_ofctl.py
 <at>  <at>  -189,6 +189,44  <at>  <at>  class Test_ofctl(unittest.TestCase):
         dp = ofproto_protocol.ProtocolDesc(version=test.ver)
         ofproto = dp.ofproto

+        vid_present = dp.ofproto.OFPVID_PRESENT
+        expected_value = {
+            "vlan_vid": {
+                0: {"to_match": 0 | vid_present, "to_str": "0"},
+                3: {"to_match": 3 | vid_present, "to_str": "3"},
+                4095: {"to_match": 4095 | vid_present, "to_str": "4095"},
+                "0": {"to_match": 0 | vid_present, "to_str": "0"},
+                "3": {"to_match": 3 | vid_present, "to_str": "3"},
+                "4095": {"to_match": 4095 | vid_present, "to_str": "4095"},
+                "0x0000": {"to_match": 0x0000, "to_str": "0x0000"},
+                "0x0003": {"to_match": 0x0003, "to_str": "0x0003"},
+                "0x0fff": {"to_match": 0x0fff, "to_str": "0x0fff"},
+                "0x1000": {"to_match": 0x1000, "to_str": "0"},
+                "0x1003": {"to_match": 0x1003, "to_str": "3"},
+                "0x1fff": {"to_match": 0x1fff, "to_str": "4095"},
+                "4096/4096": {"to_match": (4096, 4096),
+                              "to_str": "0x1000/0x1000"},
+                "4096/4097": {"to_match": (4096, 4097),
+                              "to_str": "0x1000/0x1001"},
+                "2744/2748": {"to_match": (2744, 2748),
+                              "to_str": "0x0ab8/0x0abc"},
+                "2748/2748": {"to_match": (2748, 2748),
+                              "to_str": "0x0abc/0x0abc"},
+                "2748/2749": {"to_match": (2748, 2749),
+                              "to_str": "0x0abc/0x0abd"},
+                "0x1000/0x1000": {"to_match": (0x1000, 0x1000),
+                                  "to_str": "0x1000/0x1000"},
+                "0x1000/0x1001": {"to_match": (0x1000, 0x1001),
+                                  "to_str": "0x1000/0x1001"},
+                "0x0ab8/0x0abc": {"to_match": (0x0ab8, 0x0abc),
+                                  "to_str": "0x0ab8/0x0abc"},
+                "0x0abc/0x0abc": {"to_match": (0x0abc, 0x0abc),
+                                  "to_str": "0x0abc/0x0abc"},
+                "0x0abc/0x0abd": {"to_match": (0x0abc, 0x0abd),
+                                  "to_str": "0x0abc/0x0abd"}
+            }
+        }
+
         # str -> match
         match = to_match(dp, attrs)

 <at>  <at>  -230,8 +268,7  <at>  <at>  class Test_ofctl(unittest.TestCase):
                     eq_(ipv6, field_value)
                 return
             elif key == 'vlan_vid':
-                vid = value | ofproto.OFPVID_PRESENT
-                eq_(vid, field_value)
+                eq_(expected_value['vlan_vid'][value]['to_match'], field_value)
                 return
             elif key == 'metadata':
                 # Metadata
 <at>  <at>  -308,6 +345,9  <at>  <at>  class Test_ofctl(unittest.TestCase):
                     # without mask
                     eq_(ipv6, field_value)
                 return
+            elif key == 'dl_vlan':
+                eq_(expected_value['vlan_vid'][value]['to_str'], field_value)
+                return
             elif key == 'metadata':
                 # Metadata
                 meta, mask = _to_match_metadata(value)
 <at>  <at>  -373,7 +413,28  <at>  <at>  class test_data_v1_2():
             {'eth_dst': "aa:bb:cc:11:22:33"},
             {'eth_dst': "aa:bb:cc:11:22:33/00:00:00:00:ff:ff"},
             {'eth_type': 0x800},
-            {'dl_vlan': 5},
+            {'dl_vlan': 0},
+            {'dl_vlan': 3},
+            {'dl_vlan': 4095},
+            {'dl_vlan': "0"},
+            {'dl_vlan': "3"},
+            {'dl_vlan': "4095"},
+            {'dl_vlan': "0x0000"},
+            {'dl_vlan': "0x0003"},
+            {'dl_vlan': "0x0fff"},
+            {'dl_vlan': "0x1000"},
+            {'dl_vlan': "0x1003"},
+            {'dl_vlan': "0x1fff"},
+            {'dl_vlan': "4096/4096"},
+            {'dl_vlan': "4096/4097"},
+            {'dl_vlan': "2744/2748"},
+            {'dl_vlan': "2748/2748"},
+            {'dl_vlan': "2748/2749"},
+            {'dl_vlan': "0x1000/0x1000"},
+            {'dl_vlan': "0x1000/0x1001"},
+            {'dl_vlan': "0x0ab8/0x0abc"},
+            {'dl_vlan': "0x0abc/0x0abc"},
+            {'dl_vlan': "0x0abc/0x0abd"},
             {'vlan_pcp': 3, 'vlan_vid': 3},
             {'ip_dscp': 3, 'eth_type': 0x0800},
             {'ip_ecn': 4, 'eth_type': 0x86dd},
 <at>  <at>  -395,7 +456,28  <at>  <at>  class test_data_v1_2():
             {'tp_dst': 2, 'ip_proto': 6},
             {'tp_src': 3, 'ip_proto': 17},
             {'tp_dst': 4, 'ip_proto': 17},
+            {'vlan_vid': 0},
             {'vlan_vid': 3},
+            {'vlan_vid': 4095},
+            {'vlan_vid': "0"},
+            {'vlan_vid': "3"},
+            {'vlan_vid': "4095"},
+            {'vlan_vid': "0x0000"},
+            {'vlan_vid': "0x0003"},
+            {'vlan_vid': "0x0fff"},
+            {'vlan_vid': "0x1000"},
+            {'vlan_vid': "0x1003"},
+            {'vlan_vid': "0x1fff"},
+            {'vlan_vid': "4096/4096"},
+            {'vlan_vid': "4096/4097"},
+            {'vlan_vid': "2744/2748"},
+            {'vlan_vid': "2748/2748"},
+            {'vlan_vid': "2748/2749"},
+            {'vlan_vid': "0x1000/0x1000"},
+            {'vlan_vid': "0x1000/0x1001"},
+            {'vlan_vid': "0x0ab8/0x0abc"},
+            {'vlan_vid': "0x0abc/0x0abc"},
+            {'vlan_vid': "0x0abc/0x0abd"},
             {'tcp_src': 3, 'ip_proto': 6},
             {'tcp_dst': 5, 'ip_proto': 6},
             {'udp_src': 2, 'ip_proto': 17},
 <at>  <at>  -590,7 +672,8  <at>  <at>  def _add_tests_match(cls):
     for attr in cls.attr_list:
         for key, value in attr.items():
             method_name = 'test_' + \
-                str(cls.ver) + '_' + key + '_' + str(value) + '_match'
+                str(cls.ver) + '_' + key + '_' + str(
+                    value) + str(type(value)) + '_match'

             def _run(self, name, attr, cls):
                 print ('processing %s ...' % name)
 <at>  <at>  -604,6 +687,7  <at>  <at>  def _add_tests_match(cls):
             im = new.instancemethod(func, None, Test_ofctl)
             setattr(Test_ofctl, method_name, im)

+
 """ Test case """

 # for of12
--

-- 
1.9.1

------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk
Sai Sindhur Malleni | 28 Nov 04:02 2014
Picon

Bidirectional Forwarding Detection

Hi all,

I am trying to write an app on the RYU controller which changes the flows in switches to a new path on the event of a link failure along one path. I believe I have to make use of the group tables and action buckets concept to achieve this. Also, I enabled BFD on the openvswitch, but am unable to figure out what event is going to trigger the group table entry and how to implement it. Any inputs would be highly appreciate.
------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk
_______________________________________________
Ryu-devel mailing list
Ryu-devel@...
https://lists.sourceforge.net/lists/listinfo/ryu-devel
Ricardo Balbinot | 27 Nov 23:12 2014
Picon

Copying an existing ethernet payload(only) into a new packet

Hi,

I am trying to create a new packet that changes some fields from an existing (received via packet_in) ethernet packet, adds a new vlan header and then sends back (via packet_out) the packet to the switch, with the same original ethernet payload....

At this moment I am solving this using some OF13 rules, but I would like to know how to do this at the controller. 

Reading about the packet library I know I can easily build a new ethernet packet, with a vlan header after it, and that I can even add a bytearray to the end of the original serialized and newly created packet... what I do not know is how I can access the right position of the original received packet that points me to the original ethernet packet's payload. 

Could you give some insight on how this can be done? 

Best regards,
Ricardo

------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk
_______________________________________________
Ryu-devel mailing list
Ryu-devel@...
https://lists.sourceforge.net/lists/listinfo/ryu-devel
Yafeng Zhou | 27 Nov 17:09 2014
Picon

Where is the log saved in ryu?

Hi all,

  I am a newer in ryu, could anyone tell me where is the log saved by the controller if I write the code like this:

self.logger.info("packet in %s %s %s %s", dpid, src, dst, in_port)

And what should I do if I want save the log to other path?
Thank you in advance!
------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk
_______________________________________________
Ryu-devel mailing list
Ryu-devel@...
https://lists.sourceforge.net/lists/listinfo/ryu-devel
Yafeng Zhou | 27 Nov 15:34 2014
Picon

logging in ryu

Hello,all,
    
    I am trying to use the logging module in my app, the codes like this:

import logging

logging.basicConfig(filename='/home/ubuntu/Desktop/yaphone/log/log.txt', level=logging.NOTSET)
LOG = logging.getLogger('myapp')
LOG.setLevel(logging.NOTSET)
LOG.info('test')

and run the app as :ryu-manager myapp, but I found nothing in log.txt

However I run it as: python myapp, everythong goes will, and 'test' in log.txt

I think ryu do some tricks, could anyone tell me the reason?
Thank you in advance!
------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk
_______________________________________________
Ryu-devel mailing list
Ryu-devel@...
https://lists.sourceforge.net/lists/listinfo/ryu-devel
Weiyang Mo | 27 Nov 07:34 2014
Picon

Send msg to a specific dpid?

Hi 

Is there any simple way to get all the Datapath instances (e.g. a list?) that I can send to a specific one. For
example I have two switches dpid=1 and dpid=2, I receiver packet_in from dpid=1 and wants to do something
on dpid2.

 <at> set_ev_cls(ofp_event.EventOFPPacketIn, MAIN_DISPATCHER)
def _packet_in_handler(self, ev):
    ev.msg.datapath.id == 1  True
    #I want send some msg to dpid 2, How can I access dpid instance? 

Thank you very much.

William

------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk
Ramprakash R | 26 Nov 08:39 2014
Picon

Link type on packet_in_handler

Hello,

I am trying to build upon the topology viewer app to show the hosts
connected to the switches. It currently shows only the switches and no
hosts are shown. To learn the hosts, I need to learn the hosts only on
edge ports and not on inter-switch links. Is there an easy way to find
out if the link on which the packet_in event is received is an
inter-switch link so I can avoid learning the host on that link?

Thanks in advance for your help...

Thanks,
Ram

------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk
Pablo M. Guevara | 25 Nov 20:00 2014
Picon

what is the best approach for adding static flows?

Hello team,
I'm writing an application that requires me to add some flows when the 
switch registers with the controller. What is the recommended way if 
doing this? I mean, should I add the flows on EventOFPStateChange, 
EventOFPSwitchFeatures or some other event? My first aproach was to do 
so on EventOFPStateChange. I don't see a reason why to do it upon 
reception of EventOFPSwitchFeatures event.
Thanks in advance

--

-- 
Pablo

------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk

Gmane