Hi, ​Fujimoto

Thank you very much for the prompt reply. It works.

But I have another problem in developing my app. In my app when I'm
installing rules on tables, I have a rule for two situations in a switch:
1. when a packet is incoming to in_port_1 and will go to out_port_2
2. when a packet is incoming to in_port_2 and will go to out_port_2

should I have two separate rules for these situations? May I have a common
action for them? Is there any ryu action for changing the input_port field
in ovs switch, like this:

» ovs-ofctl add-flow br0 in_port=2,actions=load:0->NXM_OF_IN_PORT[],2

Thanks

On Thu, Jun 22, 2017 at 12:25 PM, Fujimoto Satoshi <
satoshi.fujimo...@gmail.com> wrote:

> Hi, Mahdieh
>
> You can use "ofproto.OFPP_IN_PORT" to do it.
>
>     actions = [parser.OFPActionOutput(ofproto.OFPP_IN_PORT)]
>     self.add_flow(datapath, 0, match, actions)
>
> Then, the flow shown below will be installed.
>
>     $ovs-ofctl -O OpenFlow13 dump-flows s1
>     OFPST_FLOW reply (OF1.3) (xid=0x2): cookie=0x0, duration=2.975s,
> table=0, n_packets=13, n_bytes=1026, priority=0 actions=IN_PORT
>
>
> Thanks,
> Fujimoto
>
>
> On 2017年06月22日 16:30, Mahdieh Shariat wrote:
>
> Hi,
> I want an ovs switch outputs a packet to its receiving port, but in ovs
> doc I read:
>
> actions=[action][,action...]
>               port
>               output:port
>                      Outputs the packet to OpenFlow port number port.  If
> port is the packet's input port, the packet is not output.
>
> so with bellow Ryu code:
> »   actions = [ofproto_parser.OFPActionOutput(output_port)]
> when input_port== output_port, the packet is dropped.
>
> I find a new action in ovs :
>               in_port
>                      Outputs  the  packet  on  the  port  from  which  it
> was
>                      received.
> but I can't find this action in Ryu... could you please help me to write a
> code like this:
> » if (in_port == port):
>     actions=[ofproto_parser.OFPActionInPort()]
>
> I'm using ovs 2.7 and openflow 1.3
>
> Thanks in advance
>
>
> ------------------------------------------------------------------------------
> 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 
> listRyu-devel@lists.sourceforge.nethttps://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

Reply via email to