Maurizio Marrocco | 27 Jun 10:09 2016
Picon

How to identify LLDP packets, only these, and forward to port N?

Hi to everyone.


I am using simple_switch_13.py file on RYU

I would like to identify LLDP packets and forward them to port N

I am using import ryu.topology.api for topology discovery module, It is right?

The question is: What match field(s) I must use to identify an LLDP pkts and install rule to forward, only these, to port 3?


Thanks for future reply

Maurizio.

------------------------------------------------------------------------------
Attend Shape: An AT&T Tech Expo July 15-16. Meet us at AT&T Park in San
Francisco, CA to explore cutting-edge tech and listen to tech luminaries
present their vision of the future. This family event has something for
everyone, including kids. Get more information and register today.
http://sdm.link/attshape
_______________________________________________
Ryu-devel mailing list
Ryu-devel@...
https://lists.sourceforge.net/lists/listinfo/ryu-devel
Tanvir.Ulhuque | 27 Jun 07:36 2016
Picon
Picon

specify the datapath ID


Hi


I have three questions.


Question 1: I want to add a data flow in a specific switch among available switches in the network.  


I have used the following code with that intention that it will add a data flow in the switch 4 (datapath=000000000004). Is this code ok, specifically the matching field? 

.....

..........

match = parser.OFPMatch(in_port=1, eth_dst='00:00:00:00:00:07', eth_src='00:00:00:00:00:04', datapath=000000000004)  
actions = [parser.OFPActionOutput(ofp.OFPP_NORMAL, ofproto.OFPCML_NO_BUFFER)]
inst = [parser.OFPInstructionActions(ofp.OFPIT_APPLY_ACTIONS,actions)]
self.add_flow(datapath=datapath, command=ofp.OFPFC_ADD, priority=1, out_port=3, match=match, instructions=inst)

........

....


Question 2: What will be happened to other switches if this matching becomes partially true of them ? 

                        because in other switches first three fields (in_port=1, eth_dst='00:00:00:00:00:07', eth_src='00:00:00:00:00:04')  will be the same.   


Question 3: How to verify that the switch is sending the flows or not ?

                     I used "ovs-ofctl -O OpenFlow13 dump-flows s4", but it does not show the continuous monitoring. I am expecting something which will continuously show the updates of that switch. 

 



Thanks

-Tanvir


For your kind info, here is the used code....  [there are 4 switches (0...04, 0...05, 0...06, 0...07) in a SDN network. This code will add a flow from  0...04 to 0...07]


from operator import attrgetter
from ryu.base import app_manager
from ryu.controller import ofp_event
from ryu.controller.handler import CONFIG_DISPATCHER, MAIN_DISPATCHER, DEAD_DISPATCHER
from ryu.controller.handler import set_ev_cls
from ryu.ofproto import (ofproto_v1_3, ether)
from ryu.lib import hub
from ryu.topology import event
from ryu.lib.packet import (packet, ethernet, arp, icmp, ipv4)
from ryu.lib.packet import ether_types
from ryu.app.wsgi import ControllerBase, WSGIApplication, route
from webob import Response

import time

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

        def __init__(self, *args, **kwargs):
                super(SimpleSW, self).__init__(*args, **kwargs)
                


        # a function that will send flows from switch to switch
def add_flow(self, datapath, command, priority, out_port, match, instructions):
ofproto = datapath.ofproto
ofp = datapath.ofproto
        parser = datapath.ofproto_parser
flow_add = parser.OFPFlowMod(datapath=datapath, table_id=1, command=command, buffer_id=ofp.OFP_NO_BUFFER, priority=priority, out_port=out_port,  match=match, instructions=instructions)
         datapath.send_msg(flow_add)


       # a function that will delete flows from switch to switch
def delete_flow(self, datapath, priority, match, out_port, out_group, instructions ):
     ofproto = datapath.ofproto
ofp = datapath.ofproto
     parser = datapath.ofproto_parser
          flow_del = parser.OFPFlowMod(datapath=datapath, priority=priority, match=match, table_id=1, command=ofproto.OFPFC_DELETE, buffer_id= ofp.OFP_NO_BUFFER, out_port=ofproto.OFPP_ANY, out_group=ofproto.OFPG_ANY, instructions=instructions)
     datapath.send_msg(flow_del)



        # the packet handled by the controller
<at> set_ev_cls(ofp_event.EventOFPPacketIn, MAIN_DISPATCHER)
     def _packet_in_handler(self, ev):
msg = ev.msg
         datapath = msg.datapath
         ofproto = datapath.ofproto
ofp = datapath.ofproto
         parser = datapath.ofproto_parser
         in_port = msg.match['in_port']
# out_port = msg.match['out_port']

         pkt = packet.Packet(msg.data)
         eth = pkt.get_protocols(ethernet.ethernet)[0]
         dst = eth.dst
         src = eth.src



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

mat00 = parser.OFPMatch(in_port=1, eth_dst='00:00:00:00:00:07', eth_src='00:00:00:00:00:04', datapath=000000000004)  
actions = [parser.OFPActionOutput(ofp.OFPP_NORMAL, ofproto.OFPCML_NO_BUFFER)]
inst = [parser.OFPInstructionActions(ofp.OFPIT_APPLY_ACTIONS,actions)]
self.add_flow(datapath=datapath, command=ofp.OFPFC_ADD, priority=1, out_port=3, match=mat00, instructions=inst)
# hub.sleep(2)


















 

------------------------------------------------------------------------------
Attend Shape: An AT&T Tech Expo July 15-16. Meet us at AT&T Park in San
Francisco, CA to explore cutting-edge tech and listen to tech luminaries
present their vision of the future. This family event has something for
everyone, including kids. Get more information and register today.
http://sdm.link/attshape
_______________________________________________
Ryu-devel mailing list
Ryu-devel@...
https://lists.sourceforge.net/lists/listinfo/ryu-devel
邱彥鈞 | 27 Jun 05:37 2016
Picon

add flow entry to egress table

Hi,

As the title says,
I tried to add a flow entry to an egress table with ryu controller,
but I can't find how to do it in ryu documentation.

I found that only openflow 1.5 support egress table.
I am using mininet 2.2.1 with openvswitch 2.5,
which should support openflow 1.5.
Should I config anything to use egress table? 
Or any help please?

thx



------------------------------------------------------------------------------
Attend Shape: An AT&T Tech Expo July 15-16. Meet us at AT&T Park in San
Francisco, CA to explore cutting-edge tech and listen to tech luminaries
present their vision of the future. This family event has something for
everyone, including kids. Get more information and register today.
http://sdm.link/attshape
_______________________________________________
Ryu-devel mailing list
Ryu-devel@...
https://lists.sourceforge.net/lists/listinfo/ryu-devel
wesam kh | 24 Jun 12:40 2016
Picon

path of switch

Hi every one
I need to specify the path of packet from h1 to h4 and passing through to s1 and s3 and s4 without passing s2 as shown in picture 

 
how can I doing that by using ryu controller ?
thank you in advanced





Wisam Maala

------------------------------------------------------------------------------
Attend Shape: An AT&T Tech Expo July 15-16. Meet us at AT&T Park in San
Francisco, CA to explore cutting-edge tech and listen to tech luminaries
present their vision of the future. This family event has something for
everyone, including kids. Get more information and register today.
http://sdm.link/attshape
_______________________________________________
Ryu-devel mailing list
Ryu-devel@...
https://lists.sourceforge.net/lists/listinfo/ryu-devel
alan_fordyce | 24 Jun 08:42 2016

KeyboardInterrupt (ctrl-c) and RYU

Hi All,

 

I am new to RYU having previously been using POX as my SDN Controller. One of the first things that I’ve noticed when running RYU from my linux command line is that when I quit RYU with Ctrl-C I get the following exception reported back…

 

[root <at> localhost bin]# /usr/local/bin/ryu-manager

loading app ryu.controller.ofp_handler

instantiating app ryu.controller.ofp_handler of OFPHandler

^CTraceback (most recent call last):

  File "/usr/local/bin/ryu-manager", line 11, in <module>

    sys.exit(main())

  File "/usr/local/lib/python2.7/site-packages/ryu/cmd/manager.py", line 99, in main

    hub.joinall(services)

  File "/usr/local/lib/python2.7/site-packages/ryu/lib/hub.py", line 97, in joinall

    t.wait()

  File "/usr/local/lib/python2.7/site-packages/eventlet/greenthread.py", line 175, in wait

    return self._exit_event.wait()

  File "/usr/local/lib/python2.7/site-packages/eventlet/event.py", line 121, in wait

    return hubs.get_hub().switch()

  File "/usr/local/lib/python2.7/site-packages/eventlet/hubs/hub.py", line 294, in switch

    return self.greenlet.switch()

  File "/usr/local/lib/python2.7/site-packages/eventlet/hubs/hub.py", line 346, in run

    self.wait(sleep_time)

  File "/usr/local/lib/python2.7/site-packages/eventlet/hubs/poll.py", line 85, in wait

    presult = self.do_poll(seconds)

  File "/usr/local/lib/python2.7/site-packages/eventlet/hubs/epolls.py", line 62, in do_poll

    return self.poll.poll(seconds)

KeyboardInterrupt

[root <at> localhost bin]#

 

RYU doesn’t appear to have any handling for the KeyboardInterrupt signal. Is this correct or is there a better way to shutdown RYU? I’d rather not see an exception on program close.

 

Regards,

Alan.

------------------------------------------------------------------------------
Attend Shape: An AT&T Tech Expo July 15-16. Meet us at AT&T Park in San
Francisco, CA to explore cutting-edge tech and listen to tech luminaries
present their vision of the future. This family event has something for
everyone, including kids. Get more information and register today.
http://sdm.link/attshape
_______________________________________________
Ryu-devel mailing list
Ryu-devel@...
https://lists.sourceforge.net/lists/listinfo/ryu-devel
Zara larsson Larsson | 23 Jun 09:03 2016

Fitness and Wellness Industry Buyers & Decision Makers List

 

 

Hi,

 

I am Zara Larsson, hope you are doing well!

 

We are the leading providers of Extensive Permission Based Email List across the USA, UK and Australia. We can help you to reach your Prospective Target audience.

 

So, would you be interested in using our newly updated Potential Customers List which can help you in reaching Fitness and Wellness Industry Buyers & Decision Makers which can increase your profits.

 

Titles:

  • Owners/Executives/Facility managers

  • Diet and Nutrition consultants

  • Fitness Technology Provider/Managing Director

  • Sports Medicine/Clubs/Pool owners

  • Doctors, Physiotherapists

  • Program Directors and Managers

  • Massage Therapists/chiropractors/kinesiologists

  • Athletic Therapists, exercise physiologists

  • Cosmeticians, Hotel Owners

  • Group Exercise Instructors/Personal Trainers

  • Sales and Marketing Personnel

  • Sports Medicine Specialists

  • Fitness-Studio Owners/Training Centre Owners

  • Fitness and Rehabilitation Dealers

  • Representatives of health institutions

  • Mind-Body Instructors (yoga, palates)

  • Retailers/Wholesalers/Distributors/Manufacturers

  • Suppliers and Buyers of fitness equipments

 

Sectors:

  • Rehabilitation Center/E-Commerce

  • GYM’s and Fitness Centers/Spa/Lodging and Resorts

  • Retail health/Food Service/Clinical nutrition

  • Gym and Fitness Centers

  • Body Building and Dieting

  • Yoga and Medication

  • Personal Training, Consulting and Club Management

Our list includes: Name, Job title, Company Name, Permission Based E-mail address, Contact number, Physical address and many more.

Please send me your exact target audience, so that I can send you few sample records, which will be at no cost.

Target Job title : _________  Target Industry : ______________   Target Geography :_____________

  

Look forward to your response. Thank you so much for reading my email even in your busy schedule.

 

Regards,

Zara Larsson

Marketing Executive                     

US Data - European Data -  Email Append - Data Append - Technology Specific Data - Email Marketing.

12840 NE 21st Place, Bellevue, WA 98005, United States

If this message is of no use to you,reply with ‘Leave Out’

 

------------------------------------------------------------------------------
Attend Shape: An AT&T Tech Expo July 15-16. Meet us at AT&T Park in San
Francisco, CA to explore cutting-edge tech and listen to tech luminaries
present their vision of the future. This family event has something for
everyone, including kids. Get more information and register today.
http://sdm.link/attshape
_______________________________________________
Ryu-devel mailing list
Ryu-devel@...
https://lists.sourceforge.net/lists/listinfo/ryu-devel
Johanes Lim | 22 Jun 10:16 2016
Picon

Craft ICMP Unreachable Message, source host received but can't shown

Hi,

I'm trying to build Ryu application, and in one part of my application I need to make the controller sends ICMP Unreachable to the host whenever the controller receive PACKET_IN contain ICMP Echo request.

The problem is in the source host prompt, it will never show the destination IP address is unreachable, but I check the source host using tcpdump and I found that it indeed received the ICMP Unreachable message but the problem is the IP listed in that message is NOT the destination IP in the ping, I already try ping from h1 to h2 and also h3 to h4, the IP address listed in the ICMP unreachable message is the same which is 16.17.18.19, I don't know this IP address at all.



I want to ask how to set the destination IP in the ICMP Destination Unreachable message?
I'm sure the ICMP is received by the source host as shown by tcpdump, but didn't shown in the terminal because the IP listed (16.17.18.19) isn't the same with the destination IP the source host want to ping.

Let say I want ping to IP address 10.0.0.2, the message I want to receive in terminal will be:
From 10.0.0.2 icmp_seq=<seq_number> Destination Host Unreachable

because I see in the function below, the data parameter is assigned with pkt_icmp.data while pkt.icmp = pkt.get_protocol(icmp.icmp), I don't find any documentation about how to set the data in order to set the correct destination IP.

    def _handle_icmp(self, datapath, port, pkt_ethernet, pkt_ipv4, pkt_icmp):
     ....
        pkt.add_protocol(icmp.icmp(type_=icmp.ICMP_DEST_UNREACH,
                                   code=1,
                                   csum=0,
                                   data=pkt_icmp.data
                                   ))
        self._send_packet(datapath, port, pkt)

when I try to print the data / pkt_icmp.data , following is the result:

echo(data='\x16AjW\x00\x00\x00\x00\x11\'\x0f\x00\x00\x00\x00\x00\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f !"#$%&\'()*+,-./01234567',id=23419,seq=24)

how can I set the data, or more precisely the destination IP address the source host intend to ping?

Thanks & Best Regards,
Johanes.
------------------------------------------------------------------------------
Attend Shape: An AT&T Tech Expo July 15-16. Meet us at AT&T Park in San
Francisco, CA to explore cutting-edge tech and listen to tech luminaries
present their vision of the future. This family event has something for
everyone, including kids. Get more information and register today.
http://sdm.link/attshape
_______________________________________________
Ryu-devel mailing list
Ryu-devel@...
https://lists.sourceforge.net/lists/listinfo/ryu-devel
Pynbiang Hadem | 21 Jun 14:06 2016
Picon

IPs and Switch-interfaces in RYU rest_router.py

Dear All,

I executed the following commands for rest_router.py:

After which my AddressData object for switch_id:1 looks like:
#    key,   address_id, nw_addr, netmask, default_gw
---------------------------------------------------------------------------
1)('10.0.1.0/24',    1,    '10.0.1.0',     24,   '10.0.1.100')
2)('10.10.10.0/24', 2,   '10.10.10.0',  24,   '10.10.10.1')

How can i get the information of which IP is assigned to which interface of switch_id:1?

Would really appreciate your help on this.

Thanks
Hadem
------------------------------------------------------------------------------
Attend Shape: An AT&T Tech Expo July 15-16. Meet us at AT&T Park in San
Francisco, CA to explore cutting-edge tech and listen to tech luminaries
present their vision of the future. This family event has something for
everyone, including kids. Get more information and register today.
http://sdm.link/attshape
_______________________________________________
Ryu-devel mailing list
Ryu-devel@...
https://lists.sourceforge.net/lists/listinfo/ryu-devel
Edgar G. Acela | 20 Jun 23:08 2016
Picon

RYU Rest Router IPv6

Hello everyone.

I'm trying, through MiniNet and Ryu, to use an OpenFlow switch as a router to handle IPv6 addresses.
I've been watching the rest_router.py Ryu and see that only supports IPv4 addresses.
Any suggestions to achieve this? because it is not enough to change the variables of IPv4 by IPv6 variables library.
I'm very confused.

Thanks for any help,

Edgar.
------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are 
consuming the most bandwidth. Provides multi-vendor support for NetFlow, 
J-Flow, sFlow and other flows. Make informed decisions using capacity planning
reports. http://sdm.link/zohomanageengine
_______________________________________________
Ryu-devel mailing list
Ryu-devel@...
https://lists.sourceforge.net/lists/listinfo/ryu-devel
Maurizio Marrocco | 20 Jun 17:24 2016
Picon

File simple_switch_13.py modified witch OpenState goes in loop

Hi to everyone, 

I'm currently work on my thesis, and I modified the simple_switch_13 program to simulate a DoS attack, and after with help of a Finite State Machine, avoid them.

To implement the simulation of a DoS attack, I used the following algorithm: Each time the controller sends the PktOut message, it sends k (k = 3).
To prevent this attack (i.e. the switch must pass only the first packetOut and do not run duplicates) I implemented a state machine with the following algorithm:
‐ state 0: default, switch no received packet yet
‐ state 1: switch received 1 PacketOut
‐ the transaction 0‐>1 is performed when switch received PacketOut msg 
- IF(RECEIVE PACKETOUT)   (i.e match = parser.OFPMatch(in_port=ofproto.OFPP_CONTROLLER, state=0)
    change state and forward to mirror port 3.
‐ If switch received another PacktOut, it remains in state 1 but now drop this packet
‐ I return to state 0 (DEFAULT) 

----- code---
match = ofparser.OFPMatch(in_port=ofproto.OFPP_CONTROLLER, state=0)
mirror_port = 3
print match
actions = [osparser.OFPExpActionSetState(state=1, table_id=0), ofparser.OFPActionOutput(mirror_port)]
      self.add_flow(datapath,1, match, actions)
match = ofparser.OFPMatch(in_port=ofproto.OFPP_CONTROLLER, state=1)
print match
actions = [osparser.OFPExpActionSetState(state=1, table_id=0)]
      self.add_flow(datapath,1, match, actions)


------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are 
consuming the most bandwidth. Provides multi-vendor support for NetFlow, 
J-Flow, sFlow and other flows. Make informed decisions using capacity planning
reports. http://sdm.link/zohomanageengine
_______________________________________________
Ryu-devel mailing list
Ryu-devel@...
https://lists.sourceforge.net/lists/listinfo/ryu-devel
Martinez Yelmo Isaias | 20 Jun 13:46 2016
Picon

Ryu performance on PYPY

Hello everybody. 

We are working with Ryu and we have some performance issues that we want to solve using pypy. Is there any recommendation for launching  Ryu after its installation using peppy? Unfortunately, right now, we are not finding any improvement.

Best regards,

Isaías Martínez Yelmo 
--
Dr. Isaías Martínez Yelmo
Universidad de Alcalá de Henares
Escuela Politécnica - Dpto. Automática
Campus Universitario N-II, km. 32
Sector Verde. Planta 2. Despacho E-243
28871 Alcalá de Henares Madrid
Spain

E-mail: isaias.martinezy <at> uah.es

Web: http://www.uah.es/pdi/isaias_martinezy

------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are 
consuming the most bandwidth. Provides multi-vendor support for NetFlow, 
J-Flow, sFlow and other flows. Make informed decisions using capacity planning
reports. http://sdm.link/zohomanageengine
_______________________________________________
Ryu-devel mailing list
Ryu-devel@...
https://lists.sourceforge.net/lists/listinfo/ryu-devel

Gmane