Maurizio Marrocco | 24 May 19:39 2016
Picon

How I can identify a packet from the Ryu-controller to OpenFlow v1.3 switch?

Hi to everyone, 

I need an help for my thesis,

I want to identify a control packet from Python RYU-controller. In other words: How I can to do the following instruction?

If (I receive a OFPT_PACKET_OUT msg from ryu-controller) do something (for example all control traffic from controller must mirroring to an output port)

and How can I match this rule?

I saw in OpenFlow v1.3 specification that there is a ofproto.OFPP_CONTROLLER reserved port: How can I use it as an ingress port?

>From OFv1.3 spec.: "OFPP_CONTROLLER: Represents the control channel with the OpenFlow controller. Can be used as an ingress port or as an output port.

When used as an output port, encapsulate the packet in a packet-in message and send it using the OpenFlow protocol.

When used as an ingress port, identify a packet originating from the controller."

Thanks for the help.


------------------------------------------------------------------------------
Mobile security can be enabling, not merely restricting. Employees who
bring their own devices (BYOD) to work are irked by the imposition of MDM
restrictions. Mobile Device Manager Plus allows you to control only the
apps on BYO-devices by containerizing them, leaving personal data untouched!
https://ad.doubleclick.net/ddm/clk/304595813;131938128;j
_______________________________________________
Ryu-devel mailing list
Ryu-devel@...
https://lists.sourceforge.net/lists/listinfo/ryu-devel
‫Eman Bany salameh‬ ‫ | 21 May 23:43 2016
Picon

Priority Problem

:Hi

I want to add flows based on IP addresses and TCP or UDP ports. If the packet is tcp or udp packet I put src_port dst_port in the match. Otherwise if it is only IP packet, I just added ipv4_src and ipv4_dst in the match. The controller adds the flows but when I sent UDP packets, the packets go through the first match which has only IP addresses. This behavior when all matches have same priority. When,I put the priority of TCP and UDP = 2 and priority of IP packets =1, the output of flow-stat reply is this 

#flows 4
datapath         duration        in-port              eth-dst           eth_src            ip_src                ip_dst          out-port packets  bytes
---------------- ---------------- ----------------- ---------------   --------------   ---------------------- -------- -------- --------
0000000000000001       71        3      f2:2f:b0:b2:45:7f da:ea:f7:30:9b:e5         10.0.0.1         10.0.0.6        1       67     4690
 
and the output of the command on  the switch is the attachment.  why is this? 
------------------------------------------------------------------------------
Mobile security can be enabling, not merely restricting. Employees who
bring their own devices (BYOD) to work are irked by the imposition of MDM
restrictions. Mobile Device Manager Plus allows you to control only the
apps on BYO-devices by containerizing them, leaving personal data untouched!
https://ad.doubleclick.net/ddm/clk/304595813;131938128;j
_______________________________________________
Ryu-devel mailing list
Ryu-devel@...
https://lists.sourceforge.net/lists/listinfo/ryu-devel
‫Eman Bany salameh‬ ‫ | 21 May 20:47 2016
Picon

Repetition of the same flow in flow table

Hi

I added the flow based on IPv4 addresses and TCP or UDP ports in the flow table. I saw that the same flow is repeated three or more times although it must be added once. Why this happens?

Here is the segment of code to add the flow

if(pkt.get_protocols(ethernet.ethernet) and pkt.get_protocols(ipv4.ipv4)):
                (ip4,) = pkt.get_protocols(ipv4.ipv4)
                ipsrc = ip4.src
                ipdst = ip4.dst
                protocol = ip4.proto
                pkt_tcp = pkt.get_protocol(tcp.tcp)
                if pkt_tcp is not None:
                      src_port = pkt_tcp.src_port
                      dst_port = pkt_tcp.dst_port
                      match = parser.OFPMatch(in_port=in_port, eth_dst=dst, eth_src=src, eth_type=ether_types.ETH_TYPE_IP,
                                        ipv4_src=ipsrc, ipv4_dst=ipdst, ip_proto=protocol, tcp_src=src_port, tcp_dst=dst_port)
                else:
                     pkt_udp =  pkt.get_protocol(udp.udp)
                     if pkt_udp is not None:
                           src_port = pkt_udp.src_port 
                           dst_port = pkt_udp.dst_port
                           match = parser.OFPMatch(in_port=in_port, eth_dst=dst, eth_src=src, eth_type=ether_types.ETH_TYPE_IP,
                                        ipv4_src=ipsrc, ipv4_dst=ipdst, ip_proto=protocol, udp_src=src_port, udp_dst=dst_port)
                     else:
                           match = parser.OFPMatch(in_port=in_port, eth_dst=dst, eth_src=src, eth_type=ether_types.ETH_TYPE_IP,
                                        ipv4_src=ipsrc, ipv4_dst=ipdst)
                print match
            # verify if we have a valid buffer_id, if yes avoid to send both
            # flow_mod & packet_out
                if msg.buffer_id != ofproto.OFP_NO_BUFFER:
                   self.add_flow(datapath, 1, match, actions, msg.buffer_id)
                   return
                else:
                   self.add_flow(datapath, 1, match, actions)

and here is the flow table:


datapath         duration           in-port        eth-dst           eth_src            ip_src                ip_dst          out-port 
---------------- ---------------- ----------------- ---------------   --------------   ---------------------- -------- -------- --------
0000000000000002        8        1     f2:2f:b0:b2:45:7f da:ea:f7:30:9b:e5         10.0.0.1         10.0.0.6        2      
0000000000000002        5        2     da:ea:f7:30:9b:e5 f2:2f:b0:b2:45:7f         10.0.0.6         10.0.0.1        1        
0000000000000002        1        2     da:ea:f7:30:9b:e5 f2:2f:b0:b2:45:7f         10.0.0.6         10.0.0.1        1        
0000000000000002        3        2     da:ea:f7:30:9b:e5 f2:2f:b0:b2:45:7f         10.0.0.6         10.0.0.1        1      
0000000000000002        2        2     da:ea:f7:30:9b:e5 f2:2f:b0:b2:45:7f         10.0.0.6         10.0.0.1        1        
0000000000000002        4        2     da:ea:f7:30:9b:e5 f2:2f:b0:b2:45:7f         10.0.0.6         10.0.0.1        1      

------------------------------------------------------------------------------
Mobile security can be enabling, not merely restricting. Employees who
bring their own devices (BYOD) to work are irked by the imposition of MDM
restrictions. Mobile Device Manager Plus allows you to control only the
apps on BYO-devices by containerizing them, leaving personal data untouched!
https://ad.doubleclick.net/ddm/clk/304595813;131938128;j
_______________________________________________
Ryu-devel mailing list
Ryu-devel@...
https://lists.sourceforge.net/lists/listinfo/ryu-devel
teguh riadi | 21 May 11:16 2016
Picon

ryu and zookeeper


Hi , i'm a newbie for using ryu

i wanna do controller failure experiment using ryu, and thats experiment needs communication between controller. And as i know, one of the method to comunicate between controller is using zookeeper apache.

there is any tutorial for integrate zookeeper with ryu to reach HA in network?

thank you.
--
Teguh Iman Riadi
University of Indonesia , Depok.
------------------------------------------------------------------------------
Mobile security can be enabling, not merely restricting. Employees who
bring their own devices (BYOD) to work are irked by the imposition of MDM
restrictions. Mobile Device Manager Plus allows you to control only the
apps on BYO-devices by containerizing them, leaving personal data untouched!
https://ad.doubleclick.net/ddm/clk/304595813;131938128;j
_______________________________________________
Ryu-devel mailing list
Ryu-devel@...
https://lists.sourceforge.net/lists/listinfo/ryu-devel
mehran shetabi | 20 May 22:47 2016
Picon

OFPR_ACTION bitmask of the “Set asynchronous configuration message”

Hi,
In RYU doc, there is OFPR_ACTION bitmask in the section “Set asynchronous configuration message” as you can see at the link http://ryu.readthedocs.io/en/latest/ofproto_v1_3_ref.html#ryu.ofproto.ofproto_v1_3_parser.OFPSetAsync
Which action it means? How can I use it for filtering packet_in messages to my ryu controller?
Thank you,
...................................................
mehran shetabi
PhD student
Computer Engineering Department
IUST
------------------------------------------------------------------------------
Mobile security can be enabling, not merely restricting. Employees who
bring their own devices (BYOD) to work are irked by the imposition of MDM
restrictions. Mobile Device Manager Plus allows you to control only the
apps on BYO-devices by containerizing them, leaving personal data untouched!
https://ad.doubleclick.net/ddm/clk/304595813;131938128;j
_______________________________________________
Ryu-devel mailing list
Ryu-devel@...
https://lists.sourceforge.net/lists/listinfo/ryu-devel
Iuri Finger | 19 May 21:37 2016
Picon
Gravatar

Error starting Ryu-Manager with openflow 1.3

Hello friends.
I'm starting work on openflow University and previously never had contact with anything about SDN.

I have already installed natively and success with Mininet and RYU app.

Well then, I began reading and following the tutorial available on RYU site.

I'll tell you which commands that I made to find the error, which has not yet found the solution and reason, and finally I got here.

Well, the commands are as follows:

$mn --topo single,3 --mac --switch ovsk --controller remote -x    // SUCESS

$ovs-vsctl show //SUCESS

$ovs-dpctl show // SUCESS

$ovs-vsctl set bridge s1 protocols=OpenFlow13 // Definido versão 1.3 com SUCESS

$ovs-ofctl -O OpenFlow13 dump-flows s1 // SUCESS

And here the error occurred. I encounter this error whenever I start the app RYU.

The command to use and is causing the error is as follows:


$ryu-manager --verbose ryu.app.simple_switch_13

And the error that appears is the following:

root <at> iuri-S430-G-BC32P1:/home/iuri# ryu-manager --verbose ryu.app.simple_switch_13
Traceback (most recent call last):
  File "/usr/local/bin/ryu-manager", line 5, in <module>
    from pkg_resources import load_entry_point
  File "build/bdist.linux-x86_64/egg/pkg_resources/__init__.py", line 2900, in <module>
  File "build/bdist.linux-x86_64/egg/pkg_resources/__init__.py", line 2886, in _call_aside
  File "build/bdist.linux-x86_64/egg/pkg_resources/__init__.py", line 2913, in _initialize_master_working_set
  File "build/bdist.linux-x86_64/egg/pkg_resources/__init__.py", line 635, in _build_master
  File "build/bdist.linux-x86_64/egg/pkg_resources/__init__.py", line 942, in require
  File "build/bdist.linux-x86_64/egg/pkg_resources/__init__.py", line 829, in resolve
pkg_resources.DistributionNotFound: The 'stevedore>=1.5.0' distribution was not found and is required by oslo.config

Use Ubuntu 15:10 and everything is installed natively without virtual machines


Grateful for any help.
I hope you found a place to help in times like this.

Thank you

--
Atenciosamente
Iuri Finger - Netvisual TELECOM
------------------------------------------------------------------------------
Mobile security can be enabling, not merely restricting. Employees who
bring their own devices (BYOD) to work are irked by the imposition of MDM
restrictions. Mobile Device Manager Plus allows you to control only the
apps on BYO-devices by containerizing them, leaving personal data untouched!
https://ad.doubleclick.net/ddm/clk/304595813;131938128;j
_______________________________________________
Ryu-devel mailing list
Ryu-devel@...
https://lists.sourceforge.net/lists/listinfo/ryu-devel
André Mantas | 19 May 20:03 2016
Picon

Testing Ryu with (updated) cbench

Hi everyone.

I'm updating cbench to emulate OpenFlow 1.4 switches (instead of 1.0) and I just tested it against Ryu.
I noticed that there's a "cbench.py" app that I suppose it is to be used when benchmarking Ryu. As I'm new to Ryu, I would like to know if I'm doing things right.

So, from ryu main folder, i ran "./bin/ryu-manager ryu/app/cbench.py" and started the original version of cbench, getting this result:
RESULT: 16 switches 15 tests min/max/avg/stdev = 5191.99/5742.99/5514.55/163.41 responses/s

Then I tried running my updated version of cbench, but seems like this app isn't ready to deal with OF 1.4 switches, as I got this error: AttributeError: 'OFPSwitchFeatures' object has no attribute 'ports' (full output in the end of the email).

Because of this, I decided to test Ryu running the "ryu/app/simple_switch.py" since it had the counterpart "simple_switch_14.py" and both versions of cbench worked:
Cbench vs Ryu's simple_switch.py: RESULT: 16 switches 15 tests min/max/avg/stdev = 2047.69/2560.00/2315.53/215.48 responses/s
Cbench 1.4 vs Ryu's simple_switch_14.py: RESULT: 16 switches 15 tests min/max/avg/stdev = 869.00/1270.03/1140.63/117.47 responses/s

I would like to know if these values are common/expected or if I'm doing something wrong (either in launching ryu or if the Cbench 1.4 values look "weird).

Thanks in advance!

---------------------

loading app ryu/app/cbench.py
loading app ryu.controller.ofp_handler
instantiating app ryu/app/cbench.py of Cbench
instantiating app ryu.controller.ofp_handler of OFPHandler
Error in the datapath 0000000000000007 from ('127.0.0.1', 36439)
hub: uncaught exception: Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/ryu/lib/hub.py", line 54, in _launch
    return func(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/ryu/controller/controller.py", line 448, in datapath_connection_factory
    datapath.serve()
  File "/usr/local/lib/python2.7/dist-packages/ryu/controller/controller.py", line 366, in serve
    self._recv_loop()
  File "/usr/local/lib/python2.7/dist-packages/ryu/controller/controller.py", line 129, in deactivate
    method(self)
  File "/usr/local/lib/python2.7/dist-packages/ryu/controller/controller.py", line 271, in _recv_loop
    handler(ev)
  File "/usr/local/lib/python2.7/dist-packages/ryu/controller/ofp_handler.py", line 205, in switch_features_handler
    datapath.ports = msg.ports
AttributeError: 'OFPSwitchFeatures' object has no attribute 'ports'
------------------------------------------------------------------------------
Mobile security can be enabling, not merely restricting. Employees who
bring their own devices (BYOD) to work are irked by the imposition of MDM
restrictions. Mobile Device Manager Plus allows you to control only the
apps on BYO-devices by containerizing them, leaving personal data untouched!
https://ad.doubleclick.net/ddm/clk/304595813;131938128;j
_______________________________________________
Ryu-devel mailing list
Ryu-devel@...
https://lists.sourceforge.net/lists/listinfo/ryu-devel
wesam kh | 19 May 09:52 2016
Picon

DistributioNotFound: ryu==1.7

hello every one
I using the full package from web site SDN Hub
to work the ryu controller and to implement the application like simple_switch_13.py
and I trying to implement the codes in book( RYU sdn framework )

1-I have some problem with root of controller when implement the application:
root <at> ubuntu:~/ryu# ryu-manager --verbose ryu/app/simple_switch_13.py
or
root <at> ubuntu:~# ryu-manager --verbose ryu.app.simple_switch_13.py
problem is show to me :pkg_resourses.DistributioNotFound: ryu==1.7

2- But when to open new terminal no have any problem and its normal work:
$ cd /home/ubuntu/ryu && ./bin/ryu-manager --verbose ryu/app/simple_switch_13.py

can any one tell me what is problem and how can I solve that to implement in controller root ?
thank you in advance



 





Wisam

------------------------------------------------------------------------------
Mobile security can be enabling, not merely restricting. Employees who
bring their own devices (BYOD) to work are irked by the imposition of MDM
restrictions. Mobile Device Manager Plus allows you to control only the
apps on BYO-devices by containerizing them, leaving personal data untouched!
https://ad.doubleclick.net/ddm/clk/304595813;131938128;j
_______________________________________________
Ryu-devel mailing list
Ryu-devel@...
https://lists.sourceforge.net/lists/listinfo/ryu-devel
REPLICA WATCH | 19 May 06:36 2016

Best watches in the world. Pre-summer sale!

 Buy your watches here- http://tiny.cc/pjwcby
yftm ifwj adh uw fwe hbvcu
yc owg eixc lza uljaq woz
wa vsgv bk zi jkz e
tnbp gr pj ucy uc vra
p pndn e isxk c o
uuz sg e nez ezjd m
dtaa ph yv kvpl ffuyy ztw
gxn qxw vfuw c kt bob
uwb akgw lw mljo yhd lut
p lxm fmd xvfv aizb fqum
osvqs bjz uhnsb zmzy dpe tp
y kzbq l zrzc batxb xf
bdh ejoc c bl fq tp
cht tx tcv epb cucqv ipwju
zhn dqrut dlgl ra v ez
f vgp o hhc hxwa bxbf
jq tyv gvwtw xfn dagy cbkr
r posrw os u y xq
ri n wcqgl fr cx a
dtsc dpvdw pbi efyr plv mt
vof hg mp rf oyw obf
a apto iv w hfp juj
krdvt af mnwy efq bufu ku
qbs sz zgl snl m hv
cpkwe uj ktc hgno bgvnz c
d gxj nnuyv f o yfikv
tqlcr si xqdx c tf s
wissp nq eb fkzb lw v
qwvhc myvll xla dzx asvi rr
uc ynob n sbxhm tivyo out
igf gyuw hsl rwx ihmz bhsmp
mpj brzqn hexgm gqpkq kq mg
hj cub y uoqcp ya nm
tjfp mt dktf zgfap cgxe fihsx
gtkwx apiev af a i e
q ve q nzuep y uisui
retzx q vqf zbdhz etpe bntx
hz x dw lv qkvi oeva
kyzd r bjxzh mbmtk ipit sgter
ioht frtt dg tiv k rg
zh olm ixjk dsyv xfalb i
vdpw m zjbvh d ee ilfry
gv ycy st xumg x um
jzsq ikit qnswc ye mf mk
juo mybpu j zz cxdw kv
uit hu mmrvc vkge dgg l
cnpz fslp sn otno ganha f
mdue nax uax hyt xdzk hagj
csij euj h cfatx rkerr kth
ivyj eeidf uxadf nuocb dkpl g
ezpfp lhbgq t vgti zj imx
g hidr pf q xzsn sqtz
gwe iwgt ah aw owfli tp
jpv y rn dqzlw fqt yae
------------------------------------------------------------------------------
Mobile security can be enabling, not merely restricting. Employees who
bring their own devices (BYOD) to work are irked by the imposition of MDM
restrictions. Mobile Device Manager Plus allows you to control only the
apps on BYO-devices by containerizing them, leaving personal data untouched!
https://ad.doubleclick.net/ddm/clk/304595813;131938128;j
_______________________________________________
Ryu-devel mailing list
Ryu-devel@...
https://lists.sourceforge.net/lists/listinfo/ryu-devel
evanscottgray | 19 May 03:30 2016
Picon
Gravatar

[PATCH 1/2] topology: pep8 fixes

From: Evan Gray <evanscottgray@...>

Normal pep8 fixes, there were also two instances where I updated a commented
LOG.debug to include exc_info=True so that the traceback will be logged
instead of relying on the error passed in the except.

Signed-off-by: Evan Gray <evanscottgray@...>
---
 ryu/topology/switches.py | 25 ++++++++++++-------------
 1 file changed, 12 insertions(+), 13 deletions(-)

diff --git a/ryu/topology/switches.py b/ryu/topology/switches.py
index 971d30b..333407a 100644
--- a/ryu/topology/switches.py
+++ b/ryu/topology/switches.py
 <at>  <at>  -17,7 +17,6  <at>  <at>  import logging
 import six
 import struct
 import time
-import json
 from ryu import cfg

 from ryu.topology import event
 <at>  <at>  -206,12 +205,12  <at>  <at>  class HostState(dict):
         if not host:
             return

-        if ip_v4 != None:
+        if ip_v4 is not None:
             if ip_v4 in host.ipv4:
                 host.ipv4.remove(ip_v4)
             host.ipv4.append(ip_v4)

-        if ip_v6 != None:
+        if ip_v6 is not None:
             if ip_v6 in host.ipv6:
                 host.ipv6.remove(ip_v6)
             host.ipv6.append(ip_v6)
 <at>  <at>  -281,9 +280,8  <at>  <at>  class PortDataState(dict):

     def __init__(self):
         super(PortDataState, self).__init__()
-        self._root = root = []          # sentinel node
-        root[:] = [root, root, None]    # [_PREV, _NEXT, _KEY]
-                                        # doubly linked list
+        self._root = root = []  # sentinel node
+        root[:] = [root, root, None]  # [_PREV, _NEXT, _KEY] doubly linked list
         self._map = {}

     def _remove_key(self, key):
 <at>  <at>  -619,7 +617,8  <at>  <at>  class Switches(app_manager.RyuApp):
             if not dp_multiple_conns:
                 self.send_event_to_observers(event.EventSwitchEnter(switch))
             else:
-                self.send_event_to_observers(event.EventSwitchReconnected(switch))
+                evt = event.EventSwitchReconnected(switch)
+                self.send_event_to_observers(evt)

             if not self.link_discovery:
                 return
 <at>  <at>  -679,8 +678,8  <at>  <at>  class Switches(app_manager.RyuApp):
                 if switch.dp is dp:
                     self._unregister(dp)
                     LOG.debug('unregister %s', switch)
-
-                    self.send_event_to_observers(event.EventSwitchLeave(switch))
+                    evt = event.EventSwitchLeave(switch)
+                    self.send_event_to_observers(evt)

                     if not self.link_discovery:
                         return
 <at>  <at>  -773,7 +772,7  <at>  <at>  class Switches(app_manager.RyuApp):
         msg = ev.msg
         try:
             src_dpid, src_port_no = LLDPPacket.lldp_parse(msg.data)
-        except LLDPPacket.LLDPUnknownFormat as e:
+        except LLDPPacket.LLDPUnknownFormat:
             # This handler can receive all the packets which can be
             # not-LLDP packet. Ignore it silently
             return
 <at>  <at>  -796,7 +795,7  <at>  <at>  class Switches(app_manager.RyuApp):
             # There are races between EventOFPPacketIn and
             # EventDPPortAdd. So packet-in event can happend before
             # port add event. In that case key error can happend.
-            # LOG.debug('lldp_received: KeyError %s', e)
+            # LOG.debug('lldp_received error', exc_info=True)
             pass

         dst = self._get_port(dst_dpid, dst_port_no)
 <at>  <at>  -885,9 +884,9  <at>  <at>  class Switches(app_manager.RyuApp):
     def send_lldp_packet(self, port):
         try:
             port_data = self.ports.lldp_sent(port)
-        except KeyError as e:
+        except KeyError:
             # ports can be modified during our sleep in self.lldp_loop()
-            # LOG.debug('send_lldp: KeyError %s', e)
+            # LOG.debug('send_lld error', exc_info=True)
             return
         if port_data.is_down:
             return
--

-- 
2.5.5

------------------------------------------------------------------------------
Mobile security can be enabling, not merely restricting. Employees who
bring their own devices (BYOD) to work are irked by the imposition of MDM
restrictions. Mobile Device Manager Plus allows you to control only the
apps on BYO-devices by containerizing them, leaving personal data untouched!
https://ad.doubleclick.net/ddm/clk/304595813;131938128;j
‫Eman Bany salameh‬ ‫ | 18 May 23:54 2016
Picon

The Packet does't have IP Source and IP destination

 :Hi

I want to collect statistics from flows based on IP source and IP destination. I used this code to add flow.

if(pkt.get_protocols(ethernet.ethernet) and pkt.get_protocols(ipv4.ipv4)):
                (ip4,) = pkt.get_protocols(ipv4.ipv4)
                ipsrc = ip4.src
                ipdst = ip4.dst
                protocol = ip4.proto
                match = parser.OFPMatch(in_port=in_port, eth_dst=dst, eth_src=src, eth_type=ether_types.ETH_TYPE_IP,
                                        ipv4_src=ipsrc, ipv4_dst=ipdst )
            else:
                match = parser.OFPMatch(in_port=in_port, eth_dst=dst, eth_src=src)
            print match

when the stat reply comes, it runs successfully with the message that has ip_src, ip_dst, but it gives Key error with that does'n have them.

I sent ICMP messages. I want to know what exactly the packet that does not have ip_src, ip_dst? So it caused this error?
------------------------------------------------------------------------------
Mobile security can be enabling, not merely restricting. Employees who
bring their own devices (BYOD) to work are irked by the imposition of MDM
restrictions. Mobile Device Manager Plus allows you to control only the
apps on BYO-devices by containerizing them, leaving personal data untouched!
https://ad.doubleclick.net/ddm/clk/304595813;131938128;j
_______________________________________________
Ryu-devel mailing list
Ryu-devel@...
https://lists.sourceforge.net/lists/listinfo/ryu-devel

Gmane