Chandra Satriana | 27 Feb 18:26 2015
Picon

Links Discovery

Hello,

I am trying to get the topology of a network, composed of a user space switch (https://github.com/CPqD/ofsoftswitch13), mininet (version 2.1.0), and ryu controller. To get the topology I run the rest_topology.py, like so:
~/ryu/ryu/app$ ryu-manager --verbose --observe-links rest_topology.py simple_switch_13.py

and mininet is run like this:  sudo mn --topo single,2 --mac --switch user --controller remote

Testing connectivity:
mininet> pingall
*** Ping: testing ping reachability
h1 -> h2
h2 -> h1
*** Results: 0% dropped (2/2 received)

When executing the curl :

 curl -X GET http://localhost:8080/v1.0/topology/switches
[{"ports": [{"hw_addr": "b2:08:80:16:40:1b", "name": "s1-eth1", "port_no": "00000001", "dpid": "0000000000000001"}, {"hw_addr": "aa:7f:8b:3d:b6:cd", "name": "s1-eth2", "port_no": "00000002", "dpid": "0000000000000001"}], "dpid": "0000000000000001"}]
 
curl -X GET http://localhost:8080/v1.0/topology/links
[]


And on the ryu log information:
EVENT TopologyAPI->switches EventLinkRequest
127.0.0.1 - - [27/Feb/2015 14:17:15] "GET /v1.0/topology/links HTTP/1.1" 200 124 0.000687

Can you tell me why the links are not reported ?



Best regards,
Chandra

------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Ryu-devel mailing list
Ryu-devel@...
https://lists.sourceforge.net/lists/listinfo/ryu-devel
Hakan Calim | 27 Feb 10:48 2015
Picon

OoS Queue configuration with ryu

Hi all,

I didn't found a way in ryu to setup port queues. I sin ryu a way to do 
this? If yes how? Thanks!

Best regards,
Hakan

------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
Yusuke Iwase | 27 Feb 02:59 2015
Picon

[PATCH] snortlib: Remove disabled flag MSG_WAITALL

Because Ryu is based on Eventlet, GreenSocket is used by default and
blocking flags is disabled. So MSG_WAITALL flag is not available.

This patch removes MSG_WAITALL flag, and fixes snortlib.py to check
received buffer size in _recv_loop_nw_sock().

Signed-off-by: IWASE Yusuke <iwase.yusuke0@...>
---
 ryu/lib/snortlib.py | 23 +++++++++--------------
 1 file changed, 9 insertions(+), 14 deletions(-)

diff --git a/ryu/lib/snortlib.py b/ryu/lib/snortlib.py
index 9cdabb6..f8f7e14 100644
--- a/ryu/lib/snortlib.py
+++ b/ryu/lib/snortlib.py
 <at>  <at>  -92,26 +92,21  <at>  <at>  class SnortLib(app_manager.RyuApp):
             hub.spawn(self._recv_loop_nw_sock, conn, addr)

     def _recv_loop_nw_sock(self, conn, addr):
-        data = str()
+        buf = str()
         while True:
-            data += conn.recv(BUFSIZE, hub.socket.MSG_WAITALL)
-
-            if len(data) == 0:
+            ret = conn.recv(BUFSIZE)
+            if len(ret) == 0:
                 self.logger.info("Disconnected from %s", addr[0])
                 break
-            elif len(data) == BUFSIZE:
+
+            buf += ret
+            while len(buf) >= BUFSIZE:
+                #self.logger.debug("Received buffer size: %d", len(buf))
+                data = buf[:BUFSIZE]
                 msg = alert.AlertPkt.parser(data)
                 if msg:
                     self.send_event_to_observers(EventAlert(msg))
-            elif len(data) > BUFSIZE:
-                self.logger.debug("Over BUFSIZE data received: %d (>%d)",
-                                  len(data), BUFSIZE)
-            elif len(data) < BUFSIZE:
-                self.logger.debug("Short BUFSIZE data received: %d (<%d)",
-                                  len(data), BUFSIZE)
-                continue
-
-            data = str()
+                buf = buf[BUFSIZE:]

     def _set_logger(self):
         """change log format."""
--

-- 
1.9.1

------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
Airbnb | 26 Feb 21:06 2015

Henrique te fez ganhar R$ 71 na sua primeira viagem no Airbnb!


Você foi convidado!

2015-02-26 20:06:16 +0000


Seu amigo Henrique te fez ganhar R$ 71 na sua primeira viagem no Airbnb, a melhor maneira de viajar. Seja legal e lembre-se de agradecer!
Valor mínimo de reserva R$ 214.
2015-02-26 20:06:16 +0000


2015-02-26 20:06:16 +0000




### Airbnb ###
------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Ryu-devel mailing list
Ryu-devel@...
https://lists.sourceforge.net/lists/listinfo/ryu-devel
saman biook aghazadeh | 26 Feb 18:31 2015
Picon

Proactive rule dispatching problem

Dear Everyone,

I wrote a module which add rules to the switch proactively. The problem is after dispatching the rule, I don't see in my monitor module, that flows going through the new rule. They still go through the previous simple rules. Here is my code.

###################################################################
from ryu.base import app_manager
from ryu.controller import ofp_event
from ryu.controller.handler import CONFIG_DISPATCHER, MAIN_DISPATCHER
from ryu.controller.handler import set_ev_cls
from ryu.ofproto import ofproto_v1_3
from ryu.lib.packet import packet
from ryu.lib.packet import ethernet
from ryu.lib.packet import tcp
from ryu.lib.packet import ipv4
from time import sleep
from ryu.lib.ovs import bridge
from SimpleXMLRPCServer import SimpleXMLRPCServer
from SimpleXMLRPCServer import SimpleXMLRPCRequestHandler
import logging
import os
import subprocess
from ryu.lib import hub
from ryu.ofproto import ether


class SimpleSwitch13(app_manager.RyuApp):
    OFP_VERSIONS = [ofproto_v1_3.OFP_VERSION]

    def __init__(self, *args, **kwargs):
        super(SimpleSwitch13, self).__init__(*args, **kwargs)
        self.mac_to_port = {}
        self.output_qos = open( "result-qos.txt", "w" );
        self.rpcServer = SimpleXMLRPCServer( ("131.94.128.248", 8500), allow_none=True )
        self.rpcServer.register_function( self._qos_receiver )
        self.megabyte = 1000000
        self.ip_address_match_set = {}
        print 'Use Control-C to exit'
        self.rcp_thread = hub.spawn(self.rpcServer.serve_forever)

    def _qos_receiver( self, sourceAddr, sourcePort, destAddr, destPort, mapId, jobId, reduceId ):
        #self.output_qos.write( sourceAddr + ", " + sourcePort + ", " + destAddr + ", " + destPort + ", " + mapId + ", " + jobId + ", " + reduceId + "\n" );
        src_port = int(sourcePort)
        dst_port = int(destPort)

        src_ip = sourceAddr
        dst_ip = destAddr


        parser = self.datapathCached.ofproto_parser
        match = parser.OFPMatch(ipv4_src=sourceAddr, ipv4_dst=destAddr, eth_type=self.ethernetType, ip_proto=self.nwType, tcp_src=src_port, tcp_dst=dst_port)
        actions = [parser.OFPActionOutput(4)]
        self.add_flow( self.datapathCached, 1, match, actions )
        return 1

    <at> set_ev_cls(ofp_event.EventOFPSwitchFeatures, CONFIG_DISPATCHER)
    def switch_features_handler(self, ev):
        datapath = ev.msg.datapath
        ofproto = datapath.ofproto
        parser = datapath.ofproto_parser
        self.datapathCached = datapath
        match = parser.OFPMatch()
        actions = [parser.OFPActionOutput(ofproto.OFPP_CONTROLLER,
                                          ofproto.OFPCML_NO_BUFFER)]
        self.add_flow(datapath, 0, match, actions)

    def add_flow(self, datapath, priority, match, actions):
        ofproto = datapath.ofproto
        parser = datapath.ofproto_parser

        inst = [parser.OFPInstructionActions(ofproto.OFPIT_APPLY_ACTIONS,
                                             actions)]
        mod = parser.OFPFlowMod(datapath=datapath, priority=priority,
                                match=match, instructions=inst)
        datapath.send_msg(mod)

    <at> set_ev_cls(ofp_event.EventOFPPacketIn, MAIN_DISPATCHER)
    def _packet_in_handler(self, ev):
        msg = ev.msg
        datapath = msg.datapath
        ofproto = datapath.ofproto
        parser = datapath.ofproto_parser
        in_port = msg.match['in_port']

        pkt = packet.Packet(msg.data)
        eth = pkt.get_protocols(ethernet.ethernet)[0]
        nw = pkt.get_protocol(ipv4.ipv4)
        tp = None
        if nw is not None:
            tp = pkt.get_protocol(tcp.tcp)
            if tp is not None:
                self.ethernetType = eth.ethertype
                self.nwType = nw.proto

        self.dpid = datapath.id
        self.mac_to_port.setdefault(self.dpid, {})
        self.mac_to_port[self.dpid][eth.src] = in_port

        if eth.dst in self.mac_to_port[self.dpid]:
            out_port = self.mac_to_port[self.dpid][eth.dst]
        else:
            out_port = ofproto.OFPP_FLOOD

        actions = [parser.OFPActionOutput(out_port)]
        #actions.append( parser.OFPActionSetQueue(7) )  

        # install a flow to avoid packet_in next time
        if out_port != ofproto.OFPP_FLOOD:
            #if nw is not None:
            match = parser.OFPMatch(in_port=in_port, eth_dst=eth.dst)
            self.add_flow(datapath, 2, match, actions)
        #out_port = ofproto.OFPP_FLOOD
        data = None
        if msg.buffer_id == ofproto.OFP_NO_BUFFER:
            data = msg.data

        out = parser.OFPPacketOut(datapath=datapath, buffer_id=msg.buffer_id,
                                  in_port=in_port, actions=actions, data=data)
        datapath.send_msg(out)
#######################################################################

The function qos_receiver is responsible to assign the proactive rules. 
Does anybody have an idea why I can't see flows going through the new rule?

Thanks

------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Ryu-devel mailing list
Ryu-devel@...
https://lists.sourceforge.net/lists/listinfo/ryu-devel
Victor Adams | 26 Feb 17:50 2015

Special Lists Of Healthcare.

 

 

Hi,
 
Would you be interested in Healthcare Industry Database?

Addiction psychiatrist

Developmental pediatrician

Hematologist

Neonatologist

Allergist

Endocrinologist

Urologist

Nephrologists

Anesthesiologist

Forensic pathologist

Hospitalist

Neurological surgeon

Cardiac electro physiologist

Gastroenterologist

Hyperbaric physician

Obstetrician

Cardiologist

Gynecologist

Internist

Oncologist

Cardiovascular surgeon

Gynecologic oncologist

Radiologist

Ophthalmologist

Dermatologist

Surgeon

Medical geneticist

Oral surgeon

Orthopedic surgeon

Pathologist

Physiatrist

Pulmonologist

Otolaryngologist

Pediatrician

Plastic surgeon

Radiation oncologist  and many more…..


Let me know your interest, so that I can send you few sample data for your reference, which will be at no cost.

Target Industry:  _____________ ;     Target Geography:  ______________;     Target Job Title:  _________________
 
You can send Pre-Show Invitation mailers using these lists or we can help you schedule email campaigns to this list. We can even build any custom database that you might be looking for and that too based on your targeted demographics like Industry, SIC code, Employee Size etc. to make your event a grand success.

Please let me know your thoughts on this.

Note: Samples are available as per your request.

Best Regards

Victor Adams
Marketing Manager


If you do not wish to receive future emails from us, please reply as 'leave out'

 

------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Ryu-devel mailing list
Ryu-devel@...
https://lists.sourceforge.net/lists/listinfo/ryu-devel
YAMAMOTO Takashi | 26 Feb 10:08 2015
Picon

[PATCH] ryu.cfg: Use a dedicated ConfigOpt instance

This might be necessary for future vesions of Neutron OVS agent.

1. The agent parses options, including command line options, using
  oslo.config.cfg.CONF ConfigOpt instance.
2. Depending on options, it might lazily import ryu modules.
3. The ryu modules might have import-time register_cli_opts calls
  against ryu.cfg.CONF.
3. As ryu.cfg.CONF is same as oslo.config.cfg.CONF, oslo.config
  raises an exception, complaining register_cli_opts is used after
  parsing command line options.

Signed-off-by: YAMAMOTO Takashi <yamamoto@...>
---
 ryu/cfg.py | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/ryu/cfg.py b/ryu/cfg.py
index ea21ea4..ae1d817 100644
--- a/ryu/cfg.py
+++ b/ryu/cfg.py
 <at>  <at>  -22,17 +22,15  <at>  <at>  import oslo.config.cfg
 #    b. RyuApp.CONF  (preferred way for ryu applications)
 #    c. oslo.config.cfg.CONF
 #
-# Currently all of above shares a single ConfigOpts instance.
-# We will unshare c. (and stop using it) as soon as ofagent neutron agent
-# is updated.
-# We want to avoid using c. for our options as a python program which embeds
-# ryu applications (eg. neutron agent) might want to put its own set of cli
-# options into it, which can conflict with ours.  (Currently there seems
-# no conflict for the neutron agent.  But who knows?)
+# Currently a. and b. shares a single ConfigOpts instance.
+# We intentionally avoid using c. for our options as a python program
+# which embeds ryu applications (eg. neutron agent) might want to put
+# its own set of cli options into it, which can conflict with ours.
+# (Currently there seems no conflict for the neutron agent.  But who knows?)
 # At some point later we might want to unshare a. and b. as well, in order
 # to allow app-specific options.

-CONF = oslo.config.cfg.CONF
+CONF = oslo.config.cfg.ConfigOpts()

 # re-export for convenience

--

-- 
2.1.0

------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
jinxuan wu | 25 Feb 01:36 2015
Picon

Set up rules to modify ipv4_dst in Ryu

Hello,

I’m new to Ryu controller, currently I’m trying to add a small function to the simple_switch_l3.py in ryu app.  Testbed I'm using is mininet + openvswitch + openflow 1.3.

Function I want to implement is write a rule to modify the destination ip address for matching packet(Match packet whose destination ip add is 10.0.4 and rewrite that to 10.0.0.3). I'm trying to implement this based on existing simple_switch_13.py code. But now I get a error which indicate the rules is unable to write into the switch.

    <at> set_ev_cls(ofp_event.EventOFPSwitchFeatures, CONFIG_DISPATCHER)
    def switch_features_handler(self, ev):
        datapath = ev.msg.datapath
        ofproto = datapath.ofproto
        parser = datapath.ofproto_parser

        match = parser.OFPMatch()
        actions = [parser.OFPActionOutput(ofproto.OFPP_CONTROLLER,
                                          ofproto.OFPCML_NO_BUFFER)]
        self.add_flow(datapath, 0, match, actions)

#Here is what I add 
        match1 = parser.OFPMatch(ipv4_dst="10.0.0.5")
        action1 = [parser.OFPActionSetField(ipv4_dst="10.0.0.3")]
        
        self.add_flow(datapath, 2, match1, action1)

    def add_flow(self, datapath, priority, match, actions):
        ofproto = datapath.ofproto
        parser = datapath.ofproto_parser

        inst = [parser.OFPInstructionActions(ofproto.OFPIT_APPLY_ACTIONS,
                                             actions)]

        mod = parser.OFPFlowMod(datapath=datapath, priority=priority,
                                match=match, instructions=inst)
        datapath.send_msg(mod)

After I run this code I get 

error msg ev version: 0x4 msg_type 0x1 xid 0x9168c30a OFPErrorMsg(code=9,data='\x04\x0e\x00X\x91h\xc3\n\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x0c\x80\x00\x18\x04\n\x00\x00\x05\x00\x00\x00\x00',type=4) type 0x4 code 0x9 0x4 0xe 0x0 0x58 0x91 0x68 0xc3 0xa 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x1 0xff 0xff 0xff 0xff 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x1 0x0 0xc 0x80 0x0 0x18 0x4 0xa 0x0 0x0 0x5 0x0 0x0 0x0 0x0

Anyone could tell me how can I correctly write this rule to openvswitch in Ryu?

Thank you very much!

------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Ryu-devel mailing list
Ryu-devel@...
https://lists.sourceforge.net/lists/listinfo/ryu-devel
Clément Rault | 25 Feb 18:03 2015
Picon

Problem with group table entry?

Hi all,

I am trying to change the behaviour of the forwarding depending on the status of a port.

Therefore I wrote the following group table entry:

curl -X POST -d '{             
    "dpid": 1,
    "type": "SELECT",
    "group_id": 1,
    "buckets": [
        {
            "weight": 1000,
            "watch_port": 2,
            "actions": [
                {
                    "type": "OUTPUT",
                    "port": 2
                }
            ]
        },
        {
            "weight": 1,
            "watch_port": 3,
            "actions": [
                            {
                            "type": "PUSH_VLAN",     
                            "ethertype": 33024       
                            },
                            {
                            "type": "SET_FIELD",
                            "field": "vlan_vid",     
                            "value": 4097            
                            },
                            {
                            "type":"OUTPUT",
                            "port": 3
                            }
                        ]
        }
    ]

so that if port 2 is down then the packet go through port 3 and the vlan id is set to 1.

But unfortunately it's not working (I try it with ping) and I don't understand why :/.

Because when I remove the actions about the vlan like below it's working (with the ping).

curl -X POST -d '{             
    "dpid": 1,
    "type": "SELECT",
    "group_id": 1,
    "buckets": [
        {
            "weight": 1000,
            "watch_port": 2,
            "actions": [
                {
                    "type": "OUTPUT",
                    "port": 2
                }
            ]
        },
        {
            "weight": 1,
            "watch_port": 3,
            "actions": [
                            
                            {
                            "type":"OUTPUT",
                            "port": 3
                            }

                        ]
        }
    ]

Do you have an idea what I'm doing wrong?

Thanks!

Best,
Clément
------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Ryu-devel mailing list
Ryu-devel@...
https://lists.sourceforge.net/lists/listinfo/ryu-devel
saman biook aghazadeh | 24 Feb 08:42 2015
Picon

Pipeline example in RYU?

Hello everyone,

I'm looking for a RYU code example, which uses the Pipeline processing feature of the switch,  but I couldn't find one. Could somebody provide a simple code which shows how to do pipelining?

Thanks,
Saman
------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Ryu-devel mailing list
Ryu-devel@...
https://lists.sourceforge.net/lists/listinfo/ryu-devel
Ruchika Luthra | 23 Feb 14:07 2015

Understanding ARP Request Handling by Ryu controller

Hello,

I am a newbie to Ryu SDN Controller. I am trying to understand the handling of ARP Requests and generation of ARP Replies by RYU controller. As per my understanding:

1.When ARP request arrives at the switch, there is no flow registrations in switch to forward ARP Packets.
2. ARP Packets are then sent to the controller.
3. Now at the controller side, I found this code for handling the ARP requests:
def _handle_arp(self, datapath, port, pkt_ethernet, pkt_arp):
if pkt_arp.opcode != arp.ARP_REQUEST:
return
pkt = packet.Packet()
pkt.add_protocol(ethernet.ethernet(ethertype=pkt_ethernet.ethertype,
dst=pkt_ethernet.src,
src=self.hw_addr))
pkt.add_protocol(arp.arp(opcode=arp.ARP_REPLY,
src_mac=self.hw_addr,
src_ip=self.ip_addr,
dst_mac=pkt_arp.src_mac,
dst_ip=pkt_arp.src_ip))
self._send_packet(datapath, port, pkt)
 where it is constructing ARP replies. Now my question is, when and where is the mapping between IP and MAC stored at the controller side. When does the controller figure out the mapping, at ARP request or is it known already to the controller? And which data structure is used to store this mapping?

** If you can point out the exact structure to represent ARP Cache, it would be great**

Thank you



Ruchika Luthra
------------------------------------------------------------------------------
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=190641631&iu=/4140/ostg.clktrk
_______________________________________________
Ryu-devel mailing list
Ryu-devel@...
https://lists.sourceforge.net/lists/listinfo/ryu-devel

Gmane