All, Please ignore, I figured it out I needed to specify the following in the matches:
eth_type=ether_types.ETH_TYPE_IP eth_type=ether_types.ETH_TYPE_IPV6 For anyone else who comes across this problem. It is not enough to have the IP addresses specified in the match as *ipv4_dst *and* ipv6_dst* but the type much be specified as well. Don't know why the switch cannot figure this out from the variable name that is passed as it is type specific. DATAPATH ID:176199429686713 RESULT: True version=0x4,msg_type=0xe,msg_len=0x70,xid=0xf2ac7e99,OFPFlowMod(buffer_id=261,command=0,cookie=0,cookie_mask=0,flags=0,hard_timeout=0,idle_timeout=0,instructions=[OFPInstructionActions(actions=[OFPActionOutput(len=16,max_len=65509,port=23,type=0)],len=24,type=4)],match=OFPMatch(oxm_fields={'in_port': 1, 'eth_src': '00:16:3e:66:dd:28',* 'eth_type': 2048*,* 'ipv4_dst': '199.9.9.22'*}),out_group=0,out_port=0,priority=100,table_id=0) DATAPATH ID:176199429686713 RESULT: True version=0x4,msg_type=0xe,msg_len=0x78,xid=0xf2ac7e9f,OFPFlowMod(buffer_id=357,command=0,cookie=0,cookie_mask=0,flags=0,hard_timeout=0,idle_timeout=0,instructions=[OFPInstructionActions(actions=[OFPActionOutput(len=16,max_len=65509,port=1,type=0)],len=24,type=4)],match=OFPMatch(oxm_fields={'in_port': 23, 'eth_src': '00:1e:be:17:eb:9a',* 'eth_type': 34525*, *'ipv6_dst': 'ff02::1:ff00:233'*}),out_group=0,out_port=0,priority=100,table_id=0) DATAPATH ID:176199429686713 RESULT: True version=0x4,msg_type=0xe,msg_len=0x78,xid=0xf2ac7ea0,OFPFlowMod(buffer_id=401,command=0,cookie=0,cookie_mask=0,flags=0,hard_timeout=0,idle_timeout=0,instructions=[OFPInstructionActions(actions=[OFPActionOutput(len=16,max_len=65509,port=24,type=0)],len=24,type=4)],match=OFPMatch(oxm_fields={'in_port': 1, 'eth_src': '00:16:3e:a6:e3:c3',* 'eth_type': 34525*, *'ipv6_dst': 'ff02::1:ff00:33'*}),out_group=0,out_port=0,priority=100,table_id=0) Flows accepted by the switch now. ~$ *curl -X GET http://localhost:8080/stats/flow/176199429686713 <http://localhost:8080/stats/flow/176199429686713>; echo* {"176199429686713": [{"priority": 0, "cookie": 0, "idle_timeout": 0, "hard_timeout": 0, "byte_count": 5583846, "duration_sec": 25, "duration_nsec": 175000000, "packet_count": 77674, "length": 80, "flags": 0, "actions": ["OUTPUT:CONTROLLER"], "match": {}, "table_id": 0}, {"priority": 100, "cookie": 0, "idle_timeout": 0, "hard_timeout": 0, "byte_count": 0, "duration_sec": 10, "duration_nsec": 168000000, "packet_count": 0, "length": 120, "flags": 0, "actions": ["OUTPUT:1"], "match": {"in_port": 23, "dl_src": "00:1e:be:17:eb:9a", "dl_type": 34525, "ipv6_dst": "ff02::1:ff00:233"}, "table_id": 0}, {"priority": 100, "cookie": 0, "idle_timeout": 0, "hard_timeout": 0, "byte_count": 0, "duration_sec": 20, "duration_nsec": 150000000, "packet_count": 0, "length": 120, "flags": 0, "actions": ["OUTPUT:24"], "match": {"in_port": 1, "dl_src": "00:16:3e:35:d7:55", "dl_type": 34525, "ipv6_dst": "ff02::1:ff00:33"}, "table_id": 0}, {"priority": 100, "cookie": 0, "idle_timeout": 0, "hard_timeout": 0, "byte_count": 0, "duration_sec": 20, "duration_nsec": 165000000, "packet_count": 0, "length": 120, "flags": 0, "actions": ["OUTPUT:1"], "match": {"in_port": 24, "dl_src": "c4:71:fe:10:fe:00", "dl_type": 34525, "ipv6_dst": "ff02::1:ff00:1"}, "table_id": 0}, {"priority": 100, "cookie": 0, "idle_timeout": 0, "hard_timeout": 0, "byte_count": 270, "duration_sec": 20, "duration_nsec": 160000000, "packet_count": 3, "length": 120, "flags": 0, "actions": ["OUTPUT:22"], "match": {"in_port": 1, "dl_src": "00:16:3e:66:dd:28", "dl_type": 34525, "ipv6_dst": "ff02::1:ff00:11"}, "table_id": 0}, {"priority": 100, "cookie": 0, "idle_timeout": 0, "hard_timeout": 0, "byte_count": 0, "duration_sec": 20, "duration_nsec": 160000000, "packet_count": 0, "length": 120, "flags": 0, "actions": ["OUTPUT:1"], "match": {"in_port": 22, "dl_src": "00:23:5e:0e:68:16", "dl_type": 34525, "ipv6_dst": "ff02::1:ff00:234"}, "table_id": 0}, {"priority": 100, "cookie": 0, "idle_timeout": 0, "hard_timeout": 0, "byte_count": 180, "duration_sec": 5, "duration_nsec": 167000000, "packet_count": 2, "length": 120, "flags": 0, "actions": ["OUTPUT:24"], "match": {"in_port": 1, "dl_src": "00:16:3e:a6:e3:c3", "dl_type": 34525, "ipv6_dst": "ff02::1:ff00:33"}, "table_id": 0}, {"priority": 100, "cookie": 0, "idle_timeout": 0, "hard_timeout": 0, "byte_count": 0, "duration_sec": 25, "duration_nsec": 169000000, "packet_count": 0, "length": 112, "flags": 0, "actions": ["OUTPUT:24"], "match": {"in_port": 1, "dl_src": "00:16:3e:35:d7:55", "dl_type": 2048, "nw_dst": "199.9.9.33"}, "table_id": 0}, {"priority": 100, "cookie": 0, "idle_timeout": 0, "hard_timeout": 0, "byte_count": 0, "duration_sec": 20, "duration_nsec": 161000000, "packet_count": 0, "length": 112, "flags": 0, "actions": ["OUTPUT:23"], "match": {"in_port": 1, "dl_src": "00:16:3e:a6:e3:c3", "dl_type": 2048, "nw_dst": "199.9.9.22"}, "table_id": 0}, {"priority": 100, "cookie": 0, "idle_timeout": 0, "hard_timeout": 0, "byte_count": 0, "duration_sec": 25, "duration_nsec": 169000000, "packet_count": 0, "length": 112, "flags": 0, "actions": ["OUTPUT:23"], "match": {"in_port": 1, "dl_src": "00:16:3e:66:dd:28", "dl_type": 2048, "nw_dst": "199.9.9.22"}, "table_id": 0}]} -- *Irish by birth, located in Uganda but Munster by the grace of God.* On Sun, 3 Mar 2019 at 13:05, Diarmuid O Briain <diarm...@obriain.com> wrote: > Hi, > > I have written an app for Ryu that is pushing flows (see output of a print > of the "mod" variable at the end of the "add_flow" method). I added a > result variable to see that the 'datapath.send_msg' executed successfully. > However as you can see from the cURL output at the bottom, there are no > flows actually injected. The switch is reporting a "OFPBMC_BAD_PREREQ" > error in response to the FLOW_MOD attempts and is only accepting the > generic OUTPUT:CONTROLLER one. > > {extract from the end of "add_flow" method, only changes are in blue} > result = datapath.send_msg(mod) > print(f"DATAPATH ID:{datapath.id}") > print(f"RESULT: {result}") > print(mod, '\n') > > DATAPATH ID:176199429686713 > RESULT: True > > version=0x4,msg_type=0xe,msg_len=0x50,xid=0xe59050d2,OFPFlowMod(buffer_id=4294967295,command=0,cookie=0,cookie_mask=0,flags=0,hard_timeout=0,idle_timeout=0,instructions=[OFPInstructionActions(actions=[OFPActionOutput(len=16,max_len=65535,port=4294967293,type=0)],len=24,type=4)],match=OFPMatch(oxm_fields={}),out_group=0,out_port=0,priority=0,table_id=0) > > DATAPATH ID:176199429686713 > RESULT: True > version=0x4,msg_type=0xe,msg_len=0x78,xid=0xe59050d3,OFPFlowMod(buffer_id=256,command=0,cookie=0,cookie_mask=0,flags=0,hard_timeout=0,idle_timeout=0,instructions=[OFPInstructionActions(actions=[OFPActionOutput(len=16,max_len=65509,port=1,type=0)],len=24,type=4)],match=OFPMatch(oxm_fields={'in_port': > 24, 'eth_src': 'c4:71:fe:10:fe:00', 'ipv6_dst': > 'ff02::1:ff00:234'}),out_group=0,out_port=0,priority=100,table_id=0) > > DATAPATH ID:176199429686713 > RESULT: True > version=0x4,msg_type=0xe,msg_len=0x68,xid=0xe59050d4,OFPFlowMod(buffer_id=258,command=0,cookie=0,cookie_mask=0,flags=0,hard_timeout=0,idle_timeout=0,instructions=[OFPInstructionActions(actions=[OFPActionOutput(len=16,max_len=65509,port=24,type=0)],len=24,type=4)],match=OFPMatch(oxm_fields={'in_port': > 1, 'eth_src': '00:16:3e:66:dd:28', 'ipv4_dst': > '199.9.9.33'}),out_group=0,out_port=0,priority=100,table_id=0) > > DATAPATH ID:176199429686713 > RESULT: True > version=0x4,msg_type=0xe,msg_len=0x78,xid=0xe59050d5,OFPFlowMod(buffer_id=261,command=0,cookie=0,cookie_mask=0,flags=0,hard_timeout=0,idle_timeout=0,instructions=[OFPInstructionActions(actions=[OFPActionOutput(len=16,max_len=65509,port=1,type=0)],len=24,type=4)],match=OFPMatch(oxm_fields={'in_port': > 22, 'eth_src': '00:23:5e:0e:68:16', 'ipv6_dst': > 'ff02::1:ff00:1'}),out_group=0,out_port=0,priority=100,table_id=0) > > DATAPATH ID:176199429686713 > RESULT: True > version=0x4,msg_type=0xe,msg_len=0x78,xid=0xe59050d6,OFPFlowMod(buffer_id=262,command=0,cookie=0,cookie_mask=0,flags=0,hard_timeout=0,idle_timeout=0,instructions=[OFPInstructionActions(actions=[OFPActionOutput(len=16,max_len=65509,port=24,type=0)],len=24,type=4)],match=OFPMatch(oxm_fields={'in_port': > 1, 'eth_src': '00:16:3e:66:dd:28', 'ipv6_dst': > 'ff02::1:ff00:33'}),out_group=0,out_port=0,priority=100,table_id=0) > > DATAPATH ID:176199429686713 > RESULT: True > version=0x4,msg_type=0xe,msg_len=0x68,xid=0xe59050d7,OFPFlowMod(buffer_id=263,command=0,cookie=0,cookie_mask=0,flags=0,hard_timeout=0,idle_timeout=0,instructions=[OFPInstructionActions(actions=[OFPActionOutput(len=16,max_len=65509,port=23,type=0)],len=24,type=4)],match=OFPMatch(oxm_fields={'in_port': > 1, 'eth_src': '00:16:3e:a6:e3:c3', 'ipv4_dst': > '199.9.9.22'}),out_group=0,out_port=0,priority=100,table_id=0) > > DATAPATH ID:176199429686713 > RESULT: True > version=0x4,msg_type=0xe,msg_len=0x78,xid=0xe59050d8,OFPFlowMod(buffer_id=265,command=0,cookie=0,cookie_mask=0,flags=0,hard_timeout=0,idle_timeout=0,instructions=[OFPInstructionActions(actions=[OFPActionOutput(len=16,max_len=65509,port=23,type=0)],len=24,type=4)],match=OFPMatch(oxm_fields={'in_port': > 1, 'eth_src': '00:16:3e:35:d7:55', 'ipv6_dst': > 'ff02::1:ff00:22'}),out_group=0,out_port=0,priority=100,table_id=0) > > DATAPATH ID:176199429686713 > RESULT: True > version=0x4,msg_type=0xe,msg_len=0x68,xid=0xe59050d9,OFPFlowMod(buffer_id=269,command=0,cookie=0,cookie_mask=0,flags=0,hard_timeout=0,idle_timeout=0,instructions=[OFPInstructionActions(actions=[OFPActionOutput(len=16,max_len=65509,port=23,type=0)],len=24,type=4)],match=OFPMatch(oxm_fields={'in_port': > 1, 'eth_src': '00:16:3e:35:d7:55', 'ipv4_dst': > '199.9.9.22'}),out_group=0,out_port=0,priority=100,table_id=0) > > DATAPATH ID:176199429686713 > RESULT: True > version=0x4,msg_type=0xe,msg_len=0x78,xid=0xe59050da,OFPFlowMod(buffer_id=277,command=0,cookie=0,cookie_mask=0,flags=0,hard_timeout=0,idle_timeout=0,instructions=[OFPInstructionActions(actions=[OFPActionOutput(len=16,max_len=65509,port=1,type=0)],len=24,type=4)],match=OFPMatch(oxm_fields={'in_port': > 23, 'eth_src': '00:1e:be:17:eb:9a', 'ipv6_dst': > 'ff02::1:ff00:234'}),out_group=0,out_port=0,priority=100,table_id=0) > > DATAPATH ID:176199429686713 > RESULT: True > version=0x4,msg_type=0xe,msg_len=0x78,xid=0xe59050db,OFPFlowMod(buffer_id=307,command=0,cookie=0,cookie_mask=0,flags=0,hard_timeout=0,idle_timeout=0,instructions=[OFPInstructionActions(actions=[OFPActionOutput(len=16,max_len=65509,port=22,type=0)],len=24,type=4)],match=OFPMatch(oxm_fields={'in_port': > 1, 'eth_src': '00:16:3e:a6:e3:c3', 'ipv6_dst': > 'ff02::1:ff00:11'}),out_group=0,out_port=0,priority=100,table_id=0) > > ~$ curl -X GET http://localhost:8080/stats/flow/176199429686713; echo > {"176199429686713": [{"priority": 0, "cookie": 0, "idle_timeout": 0, > "hard_timeout": 0, "byte_count": 4127479, "duration_sec": 26, > "duration_nsec": 829000000, "packet_count": 57209, "length": 80, "flags": > 0, "actions": ["OUTPUT:CONTROLLER"], "match": {}, "table_id": 0}]} > > The switch is reporting the following errors. > > 1970-01-01T02:46:36Z|00775|connmgr|INFO|ofswitch<->tcp:198.8.8.235:6633: > sending OFPBMC_BAD_PREREQ error reply to OFPT_FLOW_MOD message > 1970-01-01T02:46:36Z|00776|connmgr|INFO|ofswitch<->tcp:198.8.8.235:6633: > sending OFPBMC_BAD_PREREQ error reply to OFPT_FLOW_MOD message > 1970-01-01T02:46:36Z|00777|connmgr|INFO|ofswitch<->tcp:198.8.8.235:6633: > sending OFPBMC_BAD_PREREQ error reply to OFPT_FLOW_MOD message > 1970-01-01T02:46:36Z|00778|connmgr|INFO|ofswitch<->tcp:198.8.8.235:6633: > sending OFPBMC_BAD_PREREQ error reply to OFPT_FLOW_MOD message > 1970-01-01T02:46:36Z|00779|connmgr|INFO|ofswitch<->tcp:198.8.8.235:6633: > sending OFPBMC_BAD_PREREQ error reply to OFPT_FLOW_MOD message > 1970-01-01T02:46:36Z|00780|connmgr|INFO|ofswitch<->tcp:198.8.8.235:6633: > sending OFPBMC_BAD_PREREQ error reply to OFPT_FLOW_MOD message > 1970-01-01T02:46:36Z|00781|connmgr|INFO|ofswitch<->tcp:198.8.8.235:6633: > sending OFPBMC_BAD_PREREQ error reply to OFPT_FLOW_MOD message > 1970-01-01T02:46:36Z|00782|connmgr|INFO|ofswitch<->tcp:198.8.8.235:6633: > sending OFPBMC_BAD_PREREQ error reply to OFPT_FLOW_MOD message > 1970-01-01T02:46:36Z|00783|connmgr|INFO|ofswitch<->tcp:198.8.8.235:6633: > sending OFPBMC_BAD_PREREQ error reply to OFPT_FLOW_MOD message > -- > > *Irish by birth, located in Uganda but Munster by the grace of God.* > > >
_______________________________________________ Ryu-devel mailing list Ryu-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/ryu-devel