Hi Daniel, On 2015年09月15日 07:12, Daniel Herrmann wrote: > Hey all, > > I am using Ryu with OVS and I want to use the NXActionResubmitTable to > re-submit a packet to table 0. > > As I found no documentation about this specific Action, I used this > example as a starting point: > > https://github.com/osrg/ryu/blob/master/ryu/app/gre_tunnel.py#L575 > > My code looks as follows: > > --- > # If the MPLS label is assigned to the local device -> pop label and > resubmit to table 0 > match = parser.OFPMatch(eth_type=ether.ETH_TYPE_MPLS, mpls_label=123) > actions = [ > parser.OFPActionPopMpls(), > parser.NXActionResubmitTable(in_port=ofproto.OFPP_IN_PORT, table_id=0) > ] > self.add_flow(datapath, 1000, match, actions) > --- > > This however results in the following exception: > > --- > hub: uncaught exception: Traceback (most recent call last): > File "/usr/local/lib/python2.7/dist-packages/ryu/lib/hub.py", line 52, > in _launch > func(*args, **kwargs) > File "/usr/local/lib/python2.7/dist-packages/ryu/base/app_manager.py", > line 276, in _event_loop > handler(ev) > File "/root/SegmentRoutingController.py", line 67, in get_topology_data > self._initialize(switches) > File "/root/SegmentRoutingController.py", line 106, in _initialize > self.add_flow(datapath, 1000, match, actions) > File "/root/SegmentRoutingController.py", line 190, in add_flow > datapath.send_msg(mod) > File > "/usr/local/lib/python2.7/dist-packages/ryu/controller/controller.py", > line 235, in send_msg > msg.serialize() > File > "/usr/local/lib/python2.7/dist-packages/ryu/ofproto/ofproto_parser.py", > line 212, in serialize > self._serialize_body() > File > "/usr/local/lib/python2.7/dist-packages/ryu/ofproto/ofproto_v1_3_parser.py", > line 2616, in _serialize_body > inst.serialize(self.buf, offset) > File > "/usr/local/lib/python2.7/dist-packages/ryu/ofproto/ofproto_v1_3_parser.py", > line 2755, in serialize > a.serialize(buf, action_offset) > File > "/usr/local/lib/python2.7/dist-packages/ryu/ofproto/nx_actions.py", line > 409, in serialize > self.table_id) > File "/usr/local/lib/python2.7/dist-packages/ryu/lib/pack_utils.py", > line 25, in msg_pack_into > buf += struct.pack(fmt, *args) > error: 'H' format requires 0 <= number <= 65535 > --- > > The value of ofproto.OFPP_IN_PORT is 0xfffffff8 (4294967288) which for > sure is >65535. > > What to use as in_port argument? I am not using the in_port in any match > statement, so I basically don't care how in_port is set during resubmission.
OVS have all port numbers fall into the 16-bit range, because OpenFlow 1.0 has 16-bit port numbers and later OpenFlow versions have 32-bit port numbers. For more details, please refer to 'Port numbering' on the OVS GitHub page. https://github.com/openvswitch/ovs/blob/master/OPENFLOW-1.1%2B.md So, if you want to specify OFPP_IN_PORT, how about using '0xfff8' instead? For the port numbering of OVS, please refer to this page. https://github.com/openvswitch/ovs/blob/master/include/openflow/openflow-1.0.h#L24-L47 Thanks, Iwase > > Thanks and best > Daniel > > ------------------------------------------------------------------------------ > _______________________________________________ > Ryu-devel mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/ryu-devel > ------------------------------------------------------------------------------ _______________________________________________ Ryu-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/ryu-devel
