Re: [Ryu-devel] All the links of the topology not getting discovered.

2018-03-26 Thread Taha Khan
Thanks for sharing this link.

On Sun, Mar 25, 2018 at 9:49 PM, Iwase Yusuke <iwase.yusu...@gmail.com>
wrote:

> Hi Taha,
>
> Hmmm... I haven't tried yet though, the following parameters seems to be
> configured. But sorry I don't know those parameters meanings further...
> https://github.com/osrg/ryu/blob/master/ryu/topology/switches.py#L509-L513
>
> Thanks,
> Iwase
>
> On 2018年03月26日 10:45, Taha Khan wrote:
>
>> Well, What I observed is - Number of Nodes: 13, Number of Edges:21.
>> Is there a way this could be increased in terms of number of edges and
>> nodes?
>>
>>
>> Thanks!
>> Taha
>>
>>
>> On Sun, Mar 25, 2018 at 7:33 PM, Iwase Yusuke <iwase.yusu...@gmail.com
>> <mailto:iwase.yusu...@gmail.com>> wrote:
>>
>> Hi Taha,
>>
>> > But do you have any rough idea, how many links should a topology
>> have to not
>> > hit performance limit?
>>
>> Sorry, I don't have any idea...
>>
>> Thanks,
>> Iwase
>>
>>
>> On 2018年03月24日 11:07, Taha Khan wrote:
>>
>> Thanks for the reply.
>> But do you have any rough idea, how many links should a topology
>> have to
>> not hit performance limit?
>> This is my systems specs.
>> I need EventLinkAdd and EventLinkDelete to work properly as I am
>> planning to introduce multiple link failures from mininet.
>>
>> I started with 62 nodes, 107 links and trimmed my topology to 30
>> Nodes
>> and 43 Links(86 bi-directional) and found, I was able to discover
>> the
>> full topology but EventLinkDelete wasn't triggering when I tried
>> with mininet (link down command).
>> Now I have 30 Nodes, 32 Links and still EventLinkDelte is not
>> getting
>> triggered though I see the full topology information in my
>> structures
>> storing their information in RYU controller.
>>
>>
>>
>>
>>
>>
>>
>>
>> Thanks!
>> Taha
>>
>>
>> On Fri, Mar 23, 2018 at 3:45 AM, Iwase Yusuke <
>> iwase.yusu...@gmail.com
>> <mailto:iwase.yusu...@gmail.com> <mailto:iwase.yusu...@gmail.com
>>
>> <mailto:iwase.yusu...@gmail.com>>> wrote:
>>
>>  Hi Taha,
>>
>>  IIRC, the similar problems had reported before on this
>> mailing list.
>>  I think you hit the performance limit of "single" controller
>> in
>> order to use
>>  topology discovery feature against such many switches.
>>
>>  For handling such large topology, how about splitting your
>> topology
>> into some
>>  sub-topology and having multiple controllers?
>>
>>  Thanks,
>>  Iwase
>>
>>
>>
>>  On 2018年03月23日 16:07, Taha Khan wrote:
>>
>>  Hi
>>
>>  I am using RYU-4.23 and Mininet OVS.
>>  I have a 62 Node topology. When I run my RYU application
>> I
>> noticed that
>>  RYU is not able to discover all the datapaths and links
>> everytime I run
>>  my code. And also when I run (link down command ) in
>> mininet CLI,
>>  EventLinkDelete is not getting triggered everytime I did
>> it.
>> Few times I
>>  was actually able to discover the full topology and
>> EventLinkDelete was
>>  also getting triggered.
>>  Can you please suggest why is this so. I have attached
>> codes below.
>>
>>
>>  Thanks!
>>  Taha
>>
>>
>> --
>> 
>>  Check out the vibrant tech community on one of the
>> world's most
>>  engaging tech sites, Slashdot.org!
>> http://sdm.link/slashdot
>>
>>
>>
>>  ___
>>  Ryu-devel mailing list
>> Ryu-devel@lists.sourceforge.net <mailto:Ryu-devel@lists.source
>> forge.net>
>> <mailto:Ryu-devel@lists.sourceforge.net
>> <mailto:Ryu-devel@lists.sourceforge.net>>
>&g

Re: [Ryu-devel] All the links of the topology not getting discovered.

2018-03-25 Thread Taha Khan
Well, What I observed is - Number of Nodes: 13, Number of Edges:21.
Is there a way this could be increased in terms of number of edges and
nodes?


Thanks!
Taha


On Sun, Mar 25, 2018 at 7:33 PM, Iwase Yusuke <iwase.yusu...@gmail.com>
wrote:

> Hi Taha,
>
> > But do you have any rough idea, how many links should a topology have to
> not
> > hit performance limit?
>
> Sorry, I don't have any idea...
>
> Thanks,
> Iwase
>
>
> On 2018年03月24日 11:07, Taha Khan wrote:
>
>> Thanks for the reply.
>> But do you have any rough idea, how many links should a topology have to
>> not hit performance limit?
>> This is my systems specs.
>> I need EventLinkAdd and EventLinkDelete to work properly as I am planning
>> to introduce multiple link failures from mininet.
>>
>> I started with 62 nodes, 107 links and trimmed my topology to 30 Nodes
>> and 43 Links(86 bi-directional) and found, I was able to discover the full
>> topology but EventLinkDelete wasn't triggering when I tried
>> with mininet (link down command).
>> Now I have 30 Nodes, 32 Links and still EventLinkDelte is not getting
>> triggered though I see the full topology information in my structures
>> storing their information in RYU controller.
>>
>>
>>
>>
>>
>>
>>
>>
>> Thanks!
>> Taha
>>
>>
>> On Fri, Mar 23, 2018 at 3:45 AM, Iwase Yusuke <iwase.yusu...@gmail.com
>> <mailto:iwase.yusu...@gmail.com>> wrote:
>>
>> Hi Taha,
>>
>> IIRC, the similar problems had reported before on this mailing list.
>> I think you hit the performance limit of "single" controller in order
>> to use
>> topology discovery feature against such many switches.
>>
>> For handling such large topology, how about splitting your topology
>> into some
>> sub-topology and having multiple controllers?
>>
>> Thanks,
>> Iwase
>>
>>
>>
>> On 2018年03月23日 16:07, Taha Khan wrote:
>>
>> Hi
>>
>> I am using RYU-4.23 and Mininet OVS.
>> I have a 62 Node topology. When I run my RYU application I
>> noticed that
>> RYU is not able to discover all the datapaths and links everytime
>> I run
>> my code. And also when I run (link down command ) in mininet CLI,
>> EventLinkDelete is not getting triggered everytime I did it. Few
>> times I
>> was actually able to discover the full topology and
>> EventLinkDelete was
>> also getting triggered.
>> Can you please suggest why is this so. I have attached codes
>> below.
>>
>>
>> Thanks!
>> Taha
>>
>>
>> 
>> --
>> Check out the vibrant tech community on one of the world's most
>> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
>>
>>
>>
>> ___
>> Ryu-devel mailing list
>> Ryu-devel@lists.sourceforge.net <mailto:Ryu-devel@lists.source
>> forge.net>
>> https://lists.sourceforge.net/lists/listinfo/ryu-devel
>> <https://lists.sourceforge.net/lists/listinfo/ryu-devel>
>>
>>
>>
>>
>> 
>> --
>> Check out the vibrant tech community on one of the world's most
>> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
>>
>>
>>
>> ___
>> Ryu-devel mailing list
>> Ryu-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/ryu-devel
>>
>>
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
Ryu-devel mailing list
Ryu-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ryu-devel


Re: [Ryu-devel] All the links of the topology not getting discovered.

2018-03-23 Thread Taha Khan
Thanks for the reply.
But do you have any rough idea, how many links should a topology have to
not hit performance limit?
This is my systems specs.
I need EventLinkAdd and  EventLinkDelete to work properly as I am planning
to introduce multiple link failures from mininet.

I started with 62 nodes, 107 links and trimmed my topology to 30 Nodes and
43 Links(86 bi-directional) and found, I was able to discover the full
topology but EventLinkDelete wasn't triggering when I tried
with mininet (link down command).
Now I have 30 Nodes, 32 Links and still EventLinkDelte is not getting
triggered though I see the full topology information in my structures
storing their information in RYU controller.








Thanks!
Taha

On Fri, Mar 23, 2018 at 3:45 AM, Iwase Yusuke <iwase.yusu...@gmail.com>
wrote:

> Hi Taha,
>
> IIRC, the similar problems had reported before on this mailing list.
> I think you hit the performance limit of "single" controller in order to
> use
> topology discovery feature against such many switches.
>
> For handling such large topology, how about splitting your topology into
> some
> sub-topology and having multiple controllers?
>
> Thanks,
> Iwase
>
>
>
> On 2018年03月23日 16:07, Taha Khan wrote:
>
>> Hi
>>
>> I am using RYU-4.23 and Mininet OVS.
>> I have a 62 Node topology. When I run my RYU application I noticed that
>> RYU is not able to discover all the datapaths and links everytime I run my
>> code. And also when I run (link down command ) in mininet CLI,
>> EventLinkDelete is not getting triggered everytime I did it. Few times I
>> was actually able to discover the full topology and EventLinkDelete was
>> also getting triggered.
>> Can you please suggest why is this so. I have attached codes below.
>>
>>
>> Thanks!
>> Taha
>>
>>
>> 
>> --
>> Check out the vibrant tech community on one of the world's most
>> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
>>
>>
>>
>> ___
>> Ryu-devel mailing list
>> Ryu-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/ryu-devel
>>
>>
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
Ryu-devel mailing list
Ryu-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ryu-devel


[Ryu-devel] All the links of the topology not getting discovered.

2018-03-23 Thread Taha Khan
Hi

I am using RYU-4.23 and Mininet OVS.
I have a 62 Node topology. When I run my RYU application I noticed that RYU
is not able to discover all the datapaths and links everytime I run my
code. And also when I run (link down command ) in mininet CLI,
EventLinkDelete is not getting triggered everytime I did it. Few times I
was actually able to discover the full topology and EventLinkDelete was
also getting triggered.
Can you please suggest why is this so. I have attached codes below.


Thanks!
Taha
from mininet.net import Mininet
from mininet.node import Controller, RemoteController
from mininet.cli import CLI
from mininet.log import setLogLevel, info
from time import sleep

Nodes=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
   17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29,
   30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
   45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62]

Links=[[1, 2], [1, 3], [3, 4], [3, 5], [6, 7], [6, 8], [4, 9], [10, 9], [10, 11],
   [5, 12], [5, 7], [5, 11], [5, 9], [5, 13], [9, 14], [9, 15],
   [9, 16], [9, 17], [15, 18], [19, 20], [19, 21], [19, 22],
   [23, 24], [23, 25], [25, 26], [25, 20], [25, 27], [28, 29],
   [28, 30], [29, 31], [29, 32], [29, 33], [29, 30], [29, 34],
   [35, 36], [35, 37], [37, 38], [37, 30], [38, 39], [39, 25],
   [25, 30], [30, 40], [30, 26], [30, 33], [30, 41], [30, 42],
   [30, 43], [30, 44], [45, 46], [45, 47], [45, 41], [45, 44],
   [27, 40], [27, 20], [27, 48], [27, 21], [48, 49], [48, 50],
   [32, 26], [41, 47], [16, 33], [16, 51], [16, 52], [16, 21],
   [49, 40], [22, 20], [53, 24], [53, 54], [24, 26], [43, 40],
   [31, 54], [42, 40], [40, 46], [40, 33], [40, 50], [55, 56],
   [55, 21], [34, 33], [51, 57], [51, 21], [56, 33], [21, 57],
   [21, 26], [21, 33], [21, 20], [54, 26], [36, 46], [7, 33],
   [7, 58], [12, 52], [12, 8], [13, 17], [46, 33], [46, 59],
   [46, 58], [59, 58], [58, 33], [33, 60], [33, 8], [8, 61],
   [8, 2], [52, 14], [52, 18], [52, 62], [62, 14], [14, 18], [60, 61]]



def emptyNet():
"Create an empty network and add nodes to it."

net = Mininet(controller=RemoteController)

info('*** Adding controller\n')
net.addController('c0', controller=RemoteController, ip='127.0.0.1', port=6633)


info('*** Adding hosts\n')
h = []
for i in Nodes:
host = 'h' + str(i)
h.append(net.addHost(host))

info('*** Adding switch\n')
s = []
for j in Nodes:
switch = 's' + str(j)
s.append(net.addSwitch(switch))
"""print(s)"""

info('*** Creating links\n')
## One host at each switch
for index in range(0,len(Nodes)):
net.addLink(s[index], h[index])

i=0;

for link_pair in Links:
i=i+1;
net.addLink('s'+str(link_pair[0]), 's'+str(link_pair[1]))
print('s'+str(link_pair[0]), 's'+str(link_pair[1]), i)


info('*** Starting network\n')
net.start()

for i in s:
	i.cmd('ovs-vsctl set bridge', i ,'protocols=OpenFlow13')

info('*** Running CLI\n')
CLI(net)
#sleep(2)
#net.pingAll()

info('*** Stopping network')
net.stop()


if __name__ == '__main__':
setLogLevel('info')
emptyNet()



# Copyright (C) 2011 Nippon Telegraph and Telephone Corporation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
# implied.
# See the License for the specific language governing permissions and
# limitations under the License.

from ryu.base import app_manager
from ryu.controller import ofp_event
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 ether_types
import logging
import struct
from ryu.controller.handler import MAIN_DISPATCHER, DEAD_DISPATCHER, CONFIG_DISPATCHER
from ryu.lib.packet import ipv4
from ryu.lib import mac
from ryu.lib.packet import arp
from ryu.topology import event, switches
from ryu.topology.api import get_switch, get_link
from ryu.controller import dpset
from ryu.lib import dpid
from ryu.controller import handler
from threading import Timer


class SimpleSwitch14(app_manager.RyuApp):
OFP_VERSIONS = [ofproto_v1_3.OFP_VERSION]
_CONTEXTS = {'dpset': dpset.DPSet}

def __init__(self, *args, **kwargs):
super(SimpleSwitch14, self).__init__(*args, **kwargs)
self.topology_api_app = self
self.mac_to_port = {}
self.switch_port_table = {}
self.link_to_port = {}
self.interior_ports = {}

Re: [Ryu-devel] Fwd: Event_Link_Delete triggering

2018-03-05 Thread Taha Khan
Thanks Iwase for taking time to fix the indentation error. I would try
autopep8, in my environment code was running for some reason.
Looks like the issue that I am having is not there in your environment.
I am using RYU-4.21, and OVS-2.5.2. May be i need to upgrade my setup.

Thanks!
Taha

On Sun, Mar 4, 2018 at 9:08 PM, Iwase Yusuke 
wrote:

> Hi Taha,
>
> I couldn't launch your Ryu application on my environment...
>
>
> (py27) $ ryu-manager shared_arp.py
> loading app shared_arp.py
> Traceback (most recent call last):
>   File "/home/iwase/ryu/.tox/py27/bin/ryu-manager", line 11, in 
> load_entry_point('ryu==4.23', 'console_scripts', 'ryu-manager')()
>   File 
> "/home/iwase/ryu/.tox/py27/local/lib/python2.7/site-packages/ryu/cmd/manager.py",
> line 98, in main
> app_mgr.load_apps(app_lists)
>   File 
> "/home/iwase/ryu/.tox/py27/local/lib/python2.7/site-packages/ryu/base/app_manager.py",
> line 415, in load_apps
> cls = self.load_app(app_cls_name)
>   File 
> "/home/iwase/ryu/.tox/py27/local/lib/python2.7/site-packages/ryu/base/app_manager.py",
> line 392, in load_app
> mod = utils.import_module(name)
>   File 
> "/home/iwase/ryu/.tox/py27/local/lib/python2.7/site-packages/ryu/utils.py",
> line 104, in import_module
> return importlib.import_module(modname)
>   File "/usr/lib/python2.7/importlib/__init__.py", line 37, in
> import_module
> __import__(name)
>   File "/home/iwase/ryu/shared_arp.py", line 171
> switch_list = get_switch(self.topology_api_app, None)
> ^
> IndentationError: unexpected indent
>
>
> I tried to fix this indentation error, similar errors ware shown.
> I recommend to sort out indentations. "autopep8" is very helpful!
>
> After my fixation, I couldn't reproduce the issue you mentioned.
> Ryu was running on the stable state as following.
>
>
> $ ryu-manager shared_arp.py
> loading app shared_arp.py
> loading app ryu.topology.switches
> loading app ryu.controller.ofp_handler
> instantiating app None of DPSet
> creating context dpset
> instantiating app ryu.topology.switches of Switches
> instantiating app shared_arp.py of SimpleSwitch14
> instantiating app ryu.controller.ofp_handler of OFPHandler
> dpid Join SW {6:  0x7f0b7293b2d0>}
> port state change event triggered
> Switch_Enter : 

Re: [Ryu-devel] Fwd: Event_Link_Delete triggering

2018-03-04 Thread Taha Khan
Hi Iwase,

Even I don't know, why is that happening.
When I added the separate handler for EventLinkDelete it is getting
triggered when I see no reason to for it to trigger.
I think there is a bug in EventLinkDelete handler.
You can reproduce it by running two files attached.
Could you please suggest what might be wrong here. It would be great lead .

Thanks!
Taha.


On Tue, Feb 27, 2018 at 11:45 PM, Iwase Yusuke <iwase.yusu...@gmail.com>
wrote:

> Hi Taha,
>
> I couldn't investigate why, but on your attached log messages,
> "EventSwitchLeave" are shown. Datapath might be disconnected for some
> reason,
> then "EventLinkDelete" occurred.
>
> Thanks,
> Iwase
>
>
> On 2018年02月28日 00:13, Taha Khan wrote:
>
>>
>> Hi,
>>
>> I added EventLinkDelete in my code. And noticed EventLinkDelete is
>> getting triggered, while discovering the topology, although I am installing
>> flow rules in the switch those are getting installed successfully.
>> I am confused why the delete event is getting triggered at the first
>> place or should I ignore it.
>>
>> I am sending this email second time because I received HTTP error 550
>> earlier.
>>
>> Thanks!
>> Taha
>>
>>
>>
>> 
>> --
>> Check out the vibrant tech community on one of the world's most
>> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
>>
>>
>>
>> ___
>> Ryu-devel mailing list
>> Ryu-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/ryu-devel
>>
>>
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
Ryu-devel mailing list
Ryu-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ryu-devel


[Ryu-devel] Unique Flow_ID on datapath

2018-02-06 Thread Taha Khan
Hi,

Is there any unique (flow-name or id) to differentiate between flows on a
particular datapath ?
In my application I need to take actions on particular flow entries and not
all of them, it would be helpful if there is something like this. I looked
up at RYU documentation but was unable to find any.

Thanks!
Taha
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
Ryu-devel mailing list
Ryu-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ryu-devel


[Ryu-devel] Issues in topology Discover

2017-12-31 Thread Taha Khan
Hi Every One,

I am trying to write an application that does topology discovery.
I added the a function def get_topology_data at the end of my application
I ran the controller with the command: "ryu-manager ryu.app.myswitch
--observe-links" and then the mininet with my custom. However, the event
EventSwitchEnter is never triggered. Can you please let me know if i am
missing something here?

My code is as follows:


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 ether_types
from ryu import utils
from ryu.lib.packet import ipv6
from ryu.lib import mac
from ryu.topology import event,switches
from ryu.topology.api import get_switch, get_link
import copy

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 = {}

@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
msg=ev.msg

#self.logger.info("Packet data: {}".format(msg))
# install table-miss flow entry
#
# We specify NO BUFFER to max_len of the output action due to
# OVS bug. At this moment, if we specify a lesser number, e.g.,
# 128, OVS will send Packet-In with invalid buffer_id and
# truncated packet data. In that case, we cannot output packets
# correctly.  The bug has been fixed in OVS v2.1.0.
match = parser.OFPMatch()
actions = [parser.OFPActionOutput(ofproto.OFPP_CONTROLLER,
  ofproto.OFPCML_NO_BUFFER)]
self.add_flow(datapath, 0, match, actions)
#self.logger.info("Switch: {}".format(datapath.id))

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

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

@set_ev_cls(ofp_event.EventOFPPacketIn, MAIN_DISPATCHER)
def _packet_in_handler(self, ev):
# If you hit this you might want to increase
# the "miss_send_length" of your switch
if ev.msg.msg_len < ev.msg.total_len:
self.logger.debug("packet truncated: only %s of %s bytes",
  ev.msg.msg_len, ev.msg.total_len)
msg = ev.msg
datapath = msg.datapath
#self.logger.info('Datapath: {}'.format(datapath.id))
ofproto = datapath.ofproto

parser = datapath.ofproto_parser
#self.logger.info('Parser: {}'.format(parser))


if msg.reason == ofproto.OFPR_NO_MATCH:
reason = 'NO MATCH'
elif msg.reason == ofproto.OFPR_ACTION:
reason = 'ACTION'
elif msg.reason == ofproto.OFPR_INVALID_TTL:
reason = 'INVALID TTL'
#self.logger.info('OFPPacketIn received: buffer_id=%x total_len=%d
reason=%s table_id=%d cookie=%d match=%s', msg.buffer_id, msg.total_len,
reason, msg.table_id, msg.cookie, msg.match)
in_port = msg.match['in_port']

#open flow headers are parsed already

pkt = packet.Packet(msg.data)
#self.logger.info('Packet information {}'.format(pkt))
eth = pkt.get_protocols(ethernet.ethernet)[0]
dst = eth.dst
src = eth.src

dpid = datapath.id

if eth.ethertype == ether_types.ETH_TYPE_LLDP:  # ignore lldp packet
#self.logger.info("LLDP packet in %s %s %s %s", dpid, src, dst,
in_port)
return



self.mac_to_port.setdefault(dpid, {})

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

if dst[:5] == "33:33":  # ignore IPV6 multicast packet
 match = parser.OFPMatch(in_port=in_port,eth_dst=dst)
actions=[]
self.add_flow(datapath, 1 , match, actions)
return

if  dst==mac.BROADCAST_STR: # Handle ARP broadcast
self.logger.info('This is ARP broadcast received at port {} of
switch {}'.format(in_port, datapath.id) )
#self.send_arpproxy()

  # This event is not triggered at all.
@set_ev_cls(event.EventSwitchEnter)
def get_topology_data(self, ev):
# The 

[Ryu-devel] STP- Blocking - Static Routing

2017-11-28 Thread Taha Khan
Hello,

I am working on mesh topology and my application gives static routing
paths, but due to to STP blocking, I am not able to routes according to my
application.
Is it possible to stop port blocking due to STP.? So that I can use all
ports in routers.

Thanks!
Taha
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
Ryu-devel mailing list
Ryu-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ryu-devel


[Ryu-devel] Default Routes in Loop Topology

2017-11-24 Thread Taha Khan
Hi Iwase,

Sorry for my last email I accidentally send it.

I have a triangular topology as shown below. I have followed steps as shown
in RYU documentation, interface addresses are also same except, I have
added a link between s1  to s3 as shown below.

[image: Inline image 1]

Router Port 1
Port 2 Port 3
s1 172.16.20.1  172.16.40.1 
172.16.30.30 
s2 172.16.10.1 172.16.30.1 192.168.10.1
s3 192.168.30.1 172.16.40.2 192.168.10.20

Flows Installed in the following manner-
*For Router S1 *
"route": [
{
"route_id": 3,
"destination": "0.0.0.0/0",
"gateway": "172.16.40.2"
},
{
"route_id": 2,
"destination": "172.16.10.0/24",
"gateway": "172.16.30.1"
}
],

*Router S2 --*
"route": [
{
"route_id": 1,
"destination": "0.0.0.0/0",
"gateway": "172.16.30.30"
},
{
"route_id": 2,
"destination": "192.168.30.0/24
",
"gateway": "192.168.10.20"
}
],



*Router S3 -- *
"route": [
{
"route_id": 1,
"destination": "0.0.0.0/0",
"gateway": "172.16.40.1"
},
{
"route_id": 2,
"destination": "172.16.10.10/24
",
"gateway": "192.168.10.1"
}
],

>From the above configuration, I should be able to ping s3 from s1 and s1
should directly send packets to s3 (*not through s2*), but it takes the
path through s2 although its not configured.
>From the s1 router configuration above- if the destination ip of s3 is
given as s1, it should be sent through gateway 172.16.40.2.

I am wondering
1. if link between s1 to s3 is in block state due to STP then why it is
blocking the ICMP packets instead of ARP?
2. If the STP is not the real issue what else it would be?

I started the controller using - *ryu-manager ryu.app.rest_router
ryu.app.simple_switch_stp_13 ryu.app.ofctl_rest*

Thanks!
Taha
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
Ryu-devel mailing list
Ryu-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ryu-devel


Re: [Ryu-devel] Setting Default Routes in Custom Topology with Loop

2017-11-24 Thread Taha Khan
Please Ignore this email
Its not complete.

Thanks!


On Fri, Nov 24, 2017 at 10:41 PM, Taha Khan <mailfort...@gmail.com> wrote:

> Hi Iwase,
>
> I have a triangle topology as shown below. I have followed steps as shown
> in RYU documentation and the interface router addresses are also same
> except I have added a link between s1 [2]  to s3[2] interfaces as shown
> below.
>
> [image: Inline image 1]
>
> Router Interface 1 Interface 2 Interface 3
> s1 172.16.20.1/24 172.16.40.1/24 172.16.30.30/24
> s2 172.16.10.1 172.16.30.1 192.168.10.1
> s3 192.168.30.1 172.16.40.2 192.168.10.20
>
> I have configured routes as following so that router s1 to s3 should be
> able to route via link between them as shown below.
> *For Router S1 --*
> "route": [
> {
> "route_id": 3,
> "destination": "0.0.0.0/0",
> "gateway": "172.16.40.2"
> },
> {
> "route_id": 2,
> "destination": "172.16.10.0/24",
> "gateway": "172.16.30.1"
> }
> ],
>   *For Router S2*
>
>
>
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
Ryu-devel mailing list
Ryu-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ryu-devel


[Ryu-devel] Setting Default Routes in Custom Topology with Loop

2017-11-24 Thread Taha Khan
Hi Iwase,

I have a triangle topology as shown below. I have followed steps as shown
in RYU documentation and the interface router addresses are also same
except I have added a link between s1 [2]  to s3[2] interfaces as shown
below.

[image: Inline image 1]

Router Interface 1 Interface 2 Interface 3
s1 172.16.20.1/24 172.16.40.1/24 172.16.30.30/24
s2 172.16.10.1 172.16.30.1 192.168.10.1
s3 192.168.30.1 172.16.40.2 192.168.10.20

I have configured routes as following so that router s1 to s3 should be
able to route via link between them as shown below.
*For Router S1 --*
"route": [
{
"route_id": 3,
"destination": "0.0.0.0/0",
"gateway": "172.16.40.2"
},
{
"route_id": 2,
"destination": "172.16.10.0/24",
"gateway": "172.16.30.1"
}
],
  *For Router S2*
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
Ryu-devel mailing list
Ryu-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ryu-devel


Re: [Ryu-devel] Setting Default Routes in custom topology.

2017-11-22 Thread Taha Khan
Thank you very much Iwase for your suggestion.

I tried to do the same. I used "s1.cmd('ovs-vsctl set bridge s1
protocols=OpenFlow13 stp-enable=true')" to enable the STP in Mininet. And
started controller using "ryu-manager ryupp.rest_router ".
I am still not able to ping hosts and the packets are dropped in the
middle.
I checked the flows at the routers using POSTMAN, but I see flows from
host1 to host 2 but not vice versa, although I have set the routes for h2
to h1 as well.

I am *setting the interfaces addresses* *Example (there are 3 interfaces at
router s1 in my topology).*

# ==s1===
url = 'http://localhost:8080/router/0001'
payload = {"address":"172.16.20.1/24"}
r = requests.post(url, data=json.dumps(payload))

print (r.status_code)

url = 'http://localhost:8080/router/0001'
payload = {'address':'172.16.30.1/30'}
r = requests.post(url, data=json.dumps(payload))

print (r.status_code)

url = 'http://localhost:8080/router/0001'
payload = {'address':'172.10.10.1/30'}
r = requests.post(url, data=json.dumps(payload))

print (r.status_code)



I am *setting the routes* using requests for *Example:*
s1-
#*s1(router s1) *
"url = 'http://localhost:8080/router/0001'
payload = {'destination': '192.168.30.0/24', 'gateway': '172.16.30.2' }
r = requests.post(url, data=json.dumps(payload))


url = 'http://localhost:8080/router/0003'
payload = {'destination': '172.16.20.0/24','gateway': '172.16.20.1' }
r = requests.post(url, data=json.dumps(payload))"



## where h1: '172.16.20.0/24'
  h2: '192.168.30.0/24'

My *requests statuscode* are *success* every time.
Could you suggest what could possibly is going wrong.

Thanks!
Taha


On Tue, Nov 21, 2017 at 9:16 PM, Iwase Yusuke <iwase.yusu...@gmail.com>
wrote:

> Hi Taha,
>
> I haven't investigate the further though...
> If simple_switch_stp_13 can work on the Flow Table 0 and then rest_router
> can work on the Table 1,
> they can work together, but we need to implement them to do so.
>
> BTW, if you just need to avoid the topology loop, how about using the STP
> features of switch side?
> OVS can handle the STP with "stp_enable" option for its Bridge and Port.
>
> Thanks,
> Iwase
>
>
> On 2017年11月22日 01:35, Taha Khan wrote:
>
>>
>>Hi Iwase, Thanks for the reply.
>>
>> But Sometimes i was able to ping the interfaces two hops away from
>> source but later it fades
>> away. Also, I was not able to see the routes set but  only addresses
>> using the API
>> call(/8080/router/0001). I also doubt the conflict
>> because stp is layer 2 whereas
>> rest_router is layer3, hence I assume they should act independently.
>> Although, if that’s the
>> case what could be the alternative?
>>
>> Thanks!
>>
>>
>>  Original message 
>> From: Iwase Yusuke <iwase.yusu...@gmail.com > iwase.yusu...@gmail.com>>
>> Date: 2017/11/21 01:38 (GMT-05:00)
>> To: mailfort...@gmail.com <mailto:mailfort...@gmail.com>
>> Cc: ryu-devel@lists.sourceforge.net <mailto:ryu-devel@lists.source
>> forge.net>
>> Subject: Re: [Ryu-devel] Setting Default Routes in custom topology.
>>
>> Hi Taha,
>>
>> I guess simple_switch_stp_13 and rest_router cannot work together
>> because these apps are just
>> sample applications for Ryu-Book (http://osrg.github.io/ryu-boo
>> k/en/html/index.html
>> <http://osrg.github.io/ryu-book/en/html/index.html>).
>> For example, rest_router assumes packets should be process in the
>> pipeline, but does not aware
>> of the flow entries of the other applications and might conflict with
>> each other.
>>
>> Thanks,
>> Iwase
>>
>> On 2017年11月21日 15:29, Taha Khan wrote:
>>  > Hi,
>>  > I am trying to set default routes in routers in my custom
>> topology. My topology has loops, so to
>>  > start the controller in using the command "ryu-manager
>> ryu.app.simple_switch_stp_13
>>  > ryu.app.rest_router  ryu.app.ofctl_rest"
>>  >
>>  > I am using python requests to make REST requests, specifying the
>> destination ip address and the
>>  > gateway address in each router in my topology.
>>  >
>>  > While pinging hosts ( 2 host in my custom topolog

Re: [Ryu-devel] Setting Default Routes in custom topology.

2017-11-21 Thread Taha Khan
  Hi Iwase, Thanks for the reply.

But Sometimes i was able to ping the interfaces two hops away from source
> but later it fades away. Also, I was not able to see the routes set but
>  only addresses using the API call(/8080/router/0001). I also
> doubt the conflict because stp is layer 2 whereas rest_router is layer3,
> hence I assume they should act independently. Although, if that’s the case
> what could be the alternative?
>
> Thanks!
>

 Original message 
> From: Iwase Yusuke <iwase.yusu...@gmail.com>
> Date: 2017/11/21 01:38 (GMT-05:00)
> To: mailfort...@gmail.com
> Cc: ryu-devel@lists.sourceforge.net
> Subject: Re: [Ryu-devel] Setting Default Routes in custom topology.
>
> Hi Taha,
>
> I guess simple_switch_stp_13 and rest_router cannot work together because
> these apps are just
> sample applications for Ryu-Book (http://osrg.github.io/ryu-boo
> k/en/html/index.html).
> For example, rest_router assumes packets should be process in the
> pipeline, but does not aware
> of the flow entries of the other applications and might conflict with each
> other.
>
> Thanks,
> Iwase
>
> On 2017年11月21日 15:29, Taha Khan wrote:
> > Hi,
> > I am trying to set default routes in routers in my custom topology. My
> topology has loops, so to
> > start the controller in using the command "ryu-manager
> ryu.app.simple_switch_stp_13
> > ryu.app.rest_router  ryu.app.ofctl_rest"
> >
> > I am using python requests to make REST requests, specifying the
> destination ip address and the
> > gateway address in each router in my topology.
> >
> > While pinging hosts ( 2 host in my custom topology)  I am not able to
> ping and the packets are lost
> > in the middle (checked using ip traceroute).
> >
> > Can you please suggest what could have possibly gone wrong.
> >
> > Thanks!
> > Taha.
> >
> >
> > --
>
> > Check out the vibrant tech community on one of the world's most
> > engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> >
> >
> >
> > ___
> > Ryu-devel mailing list
> > Ryu-devel@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/ryu-devel
> >
>
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
Ryu-devel mailing list
Ryu-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ryu-devel


[Ryu-devel] Setting Default Routes in custom topology.

2017-11-20 Thread Taha Khan
Hi,
I am trying to set default routes in routers in my custom topology. My
topology has loops, so to start the controller in using the command
"ryu-manager ryu.app.simple_switch_stp_13 ryu.app.rest_router
ryu.app.ofctl_rest"

I am using python requests to make REST requests, specifying the
destination ip address and the gateway address in each router in my
topology.

While pinging hosts ( 2 host in my custom topology)  I am not able to ping
and the packets are lost in the middle (checked using ip traceroute).

Can you please suggest what could have possibly gone wrong.

Thanks!
Taha.
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
Ryu-devel mailing list
Ryu-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ryu-devel


Re: [Ryu-devel] Multiple different Controllers

2017-10-18 Thread Taha Khan
Hi Iwase,

I am planning to work on RYU controller and my application would be
something like- multiple controllers controlling a single network topology.
Its my academic project.
Thats why, I asked is there a possibility of connecting different
controllers.


Thanks!
Taha.


On Wed, Oct 18, 2017 at 8:04 PM, Iwase Yusuke <iwase.yusu...@gmail.com>
wrote:

> Hi Taha,
>
> What's the purpose of connecting Ryu to OpenDaylight?
> Clustering with OpenDaylight, for example?
> If so, it is depending on your Ryu application implementation.
> Ryu does not defined the standard way for clustering.
>
> Or, you have already your network managed by OpenDaylight and you want to
> join Ryu as
> a new controller, right?
> In this case, I guess your switches should have the IP address of
> OpenDaylight like;
>
> $ ovs-vsctl show
>   ...(snip)...
> Bridge "s1"
> Controller "tcp::6653"
> fail_mode: secure
>   ...(snip)...
>
> To add Ryu as a new controller, please add the IP address of Ryu like;
>
> $ ovs-vsctl set-controller  "tcp::6653"
> "tcp::6653"
>
> Then, your switches will start trying to connect to Ryu.
> (If you are using other OpenFlow switch implementation than OVS, please
> refer to its
> documentation.)
>
> Thanks,
> Iwase
>
>
> On 2017年10月19日 03:58, Taha Khan wrote:
>
>> Hi,
>>
>> I would like to know how can we connect two or more different controllers
>> with RYU.
>> Example- RYU connected to OpenDaylight managing a network.
>>
>> Thanks!
>> Taha
>>
>>
>> 
>> --
>> Check out the vibrant tech community on one of the world's most
>> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
>>
>>
>>
>> ___
>> Ryu-devel mailing list
>> Ryu-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/ryu-devel
>>
>>
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
Ryu-devel mailing list
Ryu-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ryu-devel


Re: [Ryu-devel] Multiple Controllers

2017-10-18 Thread Taha Khan
Thanks Iwase.

On Wed, Oct 18, 2017 at 2:09 AM, Iwase Yusuke <iwase.yusu...@gmail.com>
wrote:

> Hi Taha,
>
> The following post might be helpful for you. Please check it.
>   https://www.mail-archive.com/ryu-devel@lists.sourceforge.net
> /msg14074.html
>
> Thanks,
> Iwase
>
>
> On 2017年10月18日 14:57, Taha Khan wrote:
>
>> Hi
>>
>> I would like to know how can I connect multiple instance of controllers
>> controlling (adding rules on same network topology)  the same network
>> topology ( ~~ some thing similar to ONOS).
>>
>> Thanks!
>> Taha
>>
>>
>> 
>> --
>> Check out the vibrant tech community on one of the world's most
>> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
>>
>>
>>
>> ___
>> Ryu-devel mailing list
>> Ryu-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/ryu-devel
>>
>>
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
Ryu-devel mailing list
Ryu-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ryu-devel


[Ryu-devel] Multiple different Controllers

2017-10-18 Thread Taha Khan
Hi,

I would like to know how can we connect two or more different controllers
with RYU.
Example- RYU connected to OpenDaylight managing a network.

Thanks!
Taha
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
Ryu-devel mailing list
Ryu-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ryu-devel


[Ryu-devel] Multiple Controllers

2017-10-17 Thread Taha Khan
Hi

I would like to know how can I connect multiple instance of controllers
controlling (adding rules on same network topology)  the same network
topology ( ~~ some thing similar to ONOS).

Thanks!
Taha
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
Ryu-devel mailing list
Ryu-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ryu-devel