Re: [Ryu-devel] REST router and firewall running together

2016-09-23 Thread Luis Zárate
Hi,  I agree with renanrb,  I am trying to implement L3 service as a
service without ryu openstack agent so I have the same problem, I need to
run firewall, router, nat in the same datapath manage by rest API.

So how I can run all services with precedence order ?  renanrb are you
interested in implement a rest_router_firewall public?



2016-09-19 23:04 GMT-06:00 Iwase Yusuke :

> Hi,
>
> On 2016年09月14日 22:33, rena...@ime.usp.br wrote:
> >
> > Hello,
> >
> > I have tried to run rest_router and rest_firewall at the same time, so
> > my ovs could act as both. However, I promptly realized the need to put
> > the firewall rules in a flow table and the routing stuff in a
> > subsequent one.
> >
> > 1. How can I change the tables where the rules go?
>
> rest_router and rest_firewall install the flow entry to the table 0.
> Because the both applications does not specify any "table_id" field,
> so the default table_id=0 should be used.
>
> For example,
> - rest_router:
>https://github.com/osrg/ryu/blob/master/ryu/app/rest_
> router.py#L1767-L1769
>
> - rest_firewall:
>https://github.com/osrg/ryu/blob/master/ryu/app/rest_firewall.py#L730
>
> >
> > 2. Besides that, how is routing implemented overall in rest_router?
> > Understanding the idea would help me writing my own router-firewall
> > without using the already existing applications.
>
> Sorry, I don't know further, I can't explain it.
>
> Thanks,
> Iwase
>
>
> >
> > Thanks in advance,
> >
> > []s
> > Renan R.
> >
> >
> > 
> --
> > ___
> > Ryu-devel mailing list
> > Ryu-devel@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/ryu-devel
> >
>
> 
> --
> ___
> Ryu-devel mailing list
> Ryu-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/ryu-devel
>



-- 
"La utopía sirve para caminar" Fernando Birri
--
___
Ryu-devel mailing list
Ryu-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ryu-devel


Re: [Ryu-devel] Query regarding the Statistics Trigger Instruction -- OFPInstructionStatTrigger

2016-09-23 Thread Poonam Ghosh
Additionally if you see the Specification requirement for the EXT-335 :
Instruction: Stat-Trigger stat thresholds: Generate an event to the 
controller if some of the flow statistics cross one of the stat threshold 
values.
Which is what is the part which we wanted to check from the Unit test case 
in ryu supporting this feature.

We agree with you that the OFPStats compose the values w.r.t the below 
parameters but it is equally important to understand that if controller is 
looking for the Extensible statistics (unlike the one which is done in 
OXM) so does that mean switch will internally compare these values from 
the stats and trigger an EVENT to encode or prepare an OXS message format 
after every X times the request is received (as part of the FLOW_MOD) from 
the controller . What are your thoughts for the same? 

Argument
Value
Description
duration
Integer 32bit*2
Time flow entry has been alive. This field is a tuple of two Integer 
32bit. The first value is duration_sec and the second is duration_nsec.
idle_time
Integer 32bit*2
Time flow entry has been idle.
flow_count
Integer 32bit
Number of aggregated flow entries.
packet_count
Integer 64bit
Number of packets matched by a flow entry.
byte_count
Integer 64bit
Number of bytes matched by a flow entry.

Thanks & Regards
Poonam Ghosh
Technical Architect
TCS


From:   Poonam Ghosh/BLR/TCS
To: Ryu-devel , Iwase Yusuke 

Date:   09/22/2016 11:50 PM
Subject:Re: [Ryu-devel] Query regarding the Statistics Trigger 
Instruction -- OFPInstructionStatTrigger


First of all thanks Iwase for your reply to this thread.

Yes, currently we do not have a functional code which supports all the 
features supporting the OF version 1.5.
And that is the reason we are planning to implement the EXT features to 
support the handling of Flow statistics for flexible encoding fro Egress 
tables which is currently not been supported.

I have gone through the OFV1.5 Specification for EXT-334 and EXT-335 and 
started with prototyping the features requirement code and will share with 
you once the patch with the EXT-335 is available.
The idea is to test the RYU controller with the EXT-335 switch 
functionality so that it becomes easy to validate the requirement and to 
check how the statistics is responded to the controller.

The below query was to understand on the bitmap flags and how are the 
thresholds been calculated to decide on the setting of the bitmap flags 
and under what conditions the OXS stats are responded as part of the FLOW 
STATS REPLY (for the corresponding FLOW_MOD).

Primarily i will keep this thread of technical discussion Open for 
discussing the RYU v1.5 changes and how can we leverage the controller 
behavior to be tested with the switch functionality.

Thanks & Regards,
Poonam Ghosh
Technical Architect,TCS




From:   Iwase Yusuke 
To: poonam.gh...@tcs.com
Cc: ryu-devel@lists.sourceforge.net
Date:   09/22/2016 06:07 AM
Subject:Re: [Ryu-devel] Query regarding the Statistics Trigger 
Instruction -- OFPInstructionStatTrigger



Hi,


On 2016年09月22日 17:08, Poonam Ghosh wrote:
> Hello,
> 
> We have been referring the RYU source code to understand the OF Specific 
instructions primarily OFV1.1, OFV1.2, OFV1.3,OFV1.4 and OFV1.5.
> Currently while simulating the tests with Instruction 
OFPIT_STAT_TRIGGER(Specification EXT-335) we got couple of Open points to 
understand more on the implementation part which needs more clarity to 
understand.
> 
> As part of the Specification details for the EXT-335 we understand that 
"This Instruction is primarily required to send out Openflow Extensible 
stats (as part of flexible encoding) to Controller based on certain 
thresholds which are user defined". Please correct my understanding for 
the same?
> 
> So this is how the Instruction looks  with the bitmap Flags shown below:
> 
> enum ofp_stat_trigger_flags {
> OFPSTF_PERIODIC = 1 << 0,   /* Trigger for all multiples of thresholds. 
*/
> OFPSTF_ONLY_FIRST = 1 << 1, /* Trigger on only first reach threshold. */
> };
> /* Instruction structure for OFPIT_STAT_TRIGGER */
> struct ofp_instruction_stat_trigger {
> uint16_t type; /* *OFPIT_STAT_TRIGGER* */
> uint16_t len;
> uint32_t flags;
> struct ofp_stats thresholds;
> };
> OFP_ASSERT(sizeof(struct ofp_instruction_stat_trigger) == 16);
> 
> Based on the above understanding and the current RYU implementation it 
is unclear of how the Flags and thresholds are derived and based on what?
> Because if we really see the RYU python scripts for VERSION1.5 we see 
the hardcoded values for duration, idle_time , flow_count, packet_count, 
and byte_count as part of the OXS fields filling.

What do you exactly mean "hardcoded"?
"OFPStats" class can compose the arbitrary flow stats fields which are 
defined in OpneFlow 1.5.
And the API is similar to OFPMatch.
  
http://ryu.readthedocs.io/en/latest/ofproto_v1_5_ref.html#ryu.ofproto.ofproto_v1_5_parser.OFPStats


> For our understanding we are not clear on how can we