Hi,

On 2014年11月12日 08:51, lbo.xidian wrote:
> Hi,
>    I want to modify the dscp field of each TCP flow at first and forward it 
> base on the dscp field,  and  I try to use  openflow pipeline processing to 
> realize this idea. The related program which I used in below:
> ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
>                         # for TCP flows, modify dscp field
>                         table_id = 1
>                         priority = 43
>                         match = parser.OFPMatch(eth_type=0x0800, 
> in_port=inpot, ipv4_dst=dstip, ip_proto=6)
>                         actions = []
>                         actions.append(parser.OFPActionSetField(ip_dscp=1))
>                         instructions = []
>                         
> instructions.append(parser.OFPInstructionActions(ofproto.OFPIT_WRITE_ACTIONS, 
> actions))
>                         instructions.append(parser.OFPInstructionGotoTable(2))
>                         self.add_flow(datapath,table_id, priority, match, 
> instructions)

Which OpenFlow switch do you use?
If you use OVS, OFPIT_WRITE_ACTIONS is NOT supported in OVS.
So you need to use OFPIT_APPLY_ACTIONS instead.

For more details, please refer to the Ryu-Book.
  http://osrg.github.io/ryu-book/en/html/openflow_protocol.html#instruction


>  
>                         # forwarding
>                         table_id2 = 2
>                         priority2 = 42
>                         match1 = parser.OFPMatch(eth_type=0x0800, 
> in_port=inpot, ipv4_dst=dstip)
>                         actions1 = [parser.OFPActionOutput(outpot)]
>                         instructions1 = 
> [parser.OFPInstructionActions(ofproto.OFPIT_APPLY_ACTIONS, actions1)]
>                         self.add_flow(datapath, table_id2, priority2,  
> match1, instructions1)
>  
>     def add_flow(self, datapath, table_id, priority, match, instructions, 
> buffer_id=None):
>         datapath = datapath
>         ofproto = datapath.ofproto
>         parser = datapath.ofproto_parser
>         cookie = cookie_mask = 0
>         table_id = table_id
>         idle_timeout = 60
>         hard_timeout = 120
>         priority = priority
>         instructions = instructions
>         buffer_id = ofproto.OFP_NO_BUFFER
>         match = match
>         if buffer_id:
>             mod = parser.OFPFlowMod(datapath = datapath,
>                                 cookie = cookie,
>                                 cookie_mask = cookie_mask,
>                                 table_id = table_id,
>                                 command = ofproto.OFPFC_ADD,
>                                 idle_timeout = idle_timeout,
>                                 hard_timeout = hard_timeout,
>                                 priority = priority,
>                                 buffer_id = buffer_id,
>                                 match = match,
>                                 instructions = instructions)
>         else:
>             mod = parser.OFPFlowMod(datapath = datapath,
>                                 cookie = cookie,
>                                 cookie_mask = cookie_mask,
>                                 table_id = table_id,
>                                 command = ofproto.OFPFC_ADD,
>                                 idle_timeout = idle_timeout,
>                                 hard_timeout = hard_timeout,
>                                 priority = priority,
>                                 match = match,
>                                 instructions = instructions)
>         datapath.send_msg(mod)
> /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
>     I find that the flow table with 'priority = 43' (modify dscp field 
> action) can't install successful, but the flow table with 'priority = 42' 
> (forward action) install successful. However, there is no packets received  
> in testing ping reachability for each host pair. When I just use the forward 
> function, all the packets in testing ping reachability are received. I don't 
> know how to deal with this issue, can you give me  some help?
>     Any help would be appreciated! Thank you very much.   
>     Regards,
>     Bo Liu
> 
> 
> 
> 
> 
> 
> ------------------------------------------------------------------------------
> Comprehensive Server Monitoring with Site24x7.
> Monitor 10 servers for $9/Month.
> Get alerted through email, SMS, voice calls or mobile push notifications.
> Take corrective actions from your mobile device.
> http://pubads.g.doubleclick.net/gampad/clk?id=154624111&iu=/4140/ostg.clktrk
> 
> 
> 
> _______________________________________________
> Ryu-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/ryu-devel
> 

------------------------------------------------------------------------------
Comprehensive Server Monitoring with Site24x7.
Monitor 10 servers for $9/Month.
Get alerted through email, SMS, voice calls or mobile push notifications.
Take corrective actions from your mobile device.
http://pubads.g.doubleclick.net/gampad/clk?id=154624111&iu=/4140/ostg.clktrk
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel

Reply via email to