OpendayLight:如何指定stream表的目的IP地址

我使用OpendayLightCarbon SR1 )将stream表发送到交换机,除了使用set-nw-dst-action-case指令外,一切正常。 一旦我使用这个指令,stream程就不能被正确地切换(通过http://opendaylight_ip:8181/restconf/operational/opendaylight-inventory:nodes/node/openflow:1/flow-node-inventory:table/0 ),这是我的json代码来设置stream量:

 { "flow": [ { "id": "test", "match": { "ethernet-match": { "ethernet-destination": { "address": "02:42:4a:46:fc:02" } } }, "instructions": { "instruction": [ { "order": "0", "apply-actions": { "action": [ { "order": "0", "set-nw-dst-action": { "_Opps": "Remove this action goes normal" "ipv4-address": "192.168.1.3/32" } }, { "order": "1", "set-dl-dst-action": { "address": "02:42:4a:46:fc:03" } }, { "order": "2", "output-action": { "output-node-connector": "3", "max-length": "65535" } } ] } } ] }, "priority": "16", "table_id": "0" } ] } 

上面的json代码遵循OpendayLight规范,但是我在Open vSwitch日志中发现了这条消息:

2017-09-07T16:35:26.713Z|00103|ofp_actions|WARN|set_field ip_dst lacks correct prerequisities

这个问题与我的相似。 我已经尝试添加与ovs-ofctl工具stream和成功,有没有办法在OpendayLight添加set-nw-dst-action-case指令OpendayLight

ps ovs-ofctl命令让:

 ovs-ofctl add-flow s1 "table=0,dl_dst=02:42:4a:46:fc:02,priority=12,action=mod_dl_dst:02:42:4a:46:fc:03,mod_nw_dst:192.168.1.3,output:3" 

编辑 (2017-9-8 21:14 GMT + 8)
我试图匹配ip标准和ovs日志抱怨这个:

 2017-09-08T12:49:30.567Z|00032|nx_match|WARN|Rejecting NXM/OXM entry 0:32768:12:1:8 with 1-bits in value for bits wildcarded by the mask. 2017-09-08T12:49:30.567Z|00033|ofp_actions|WARN|bad action at offset 0 (OFPBMC_BAD_WILDCARDS): 00000000 00 19 00 10 80 00 19 08-0a 00 00 03 ff 00 00 00 2017-09-08T12:49:30.567Z|00034|connmgr|INFO|s1<->tcp:192.168.43.171:6633: sending OFPBMC_BAD_WILDCARDS error reply to OFPT_FLOW_MOD message 2017-09-08T12:49:30.567Z|00035|ofp_actions|WARN|set_field ip_dst lacks correct prerequisities 

我用这个json代码(OpendayLight杨UI通过):

 { "flow": [ { "id": "bwt", "match": { "ethernet-match": { "ethernet-destination": { "address": "02:42:4a:46:fc:02" } }, "ipv4-destination": "192.168.1.2/32" }, "instructions": { "instruction": [ { "order": "0", "apply-actions": { "action": [ { "order": "0", "set-dl-dst-action": { "address": "02:42:4a:46:fc:03" } }, { "order": "1", "set-nw-src-action": { "ipv4-address": "192.168.1.3/32" } }, { "order": "2", "output-action": { "output-node-connector": "3", "max-length": "65535" } } ] } } ] }, "priority": "12", "table_id": "0" } ] } 

编辑 (2017-9-9 23:48 GMT + 8)
问题已经解决了,看我的答案。

检查openflow规范第7.2.3.8节,表13(OXM_OF_IPV4_DST)和ovs日志中描述的错误,需要在设置操作目标ip之前匹配ipv4的包types。

样品stream程

 ovs-ofctl add-flow s1 -O OpenFlow13 "table=0,ip,dl_dst=02:42:4a:46:fc:02,priority=12,action=set_field:02:42:4a:46:fc:03->eth_dst,set_field:192.168.1.3->ip_dst,output:3" 

规范

根据OpenFlow交换机规范版本1.3.5(协议版本0x04)的第7.2.3.6节“ stream匹配字段先决条件”和第7.2.3.8节标题匹配字段 ,修改IP地址( dst_ipsrc_ip )的stream程必须:
1.将ethernet-destination-maskff:ff:ff:ff:ff:ff
2. ethernet-type-type0x0800
3. ipv4的掩码应该是255.255.255.255ip_addr / 32

OpendayLight平台的有效stream程json代码如下( Carbon SR1opendaylight-inventory rev.2013-08-19 ):

 { "flow": [ { "id": "bwt", "match": { "ethernet-match": { "ethernet-destination": { "address": "02:42:4a:46:fc:01", "mask": "ff:ff:ff:ff:ff:ff" }, "ethernet-type": { "type": "0x0800" } }, "ipv4-destination": "192.168.1.2/32" }, "instructions": { "instruction": [ { "order": "0", "apply-actions": { "action": [ { "order": "0", "set-dl-dst-action": { "address": "02:42:4a:46:fc:03" } }, { "order": "1", "set-nw-dst-action": { "ipv4-address": "192.168.1.3/32" } }, { "order": "2", "output-action": { "output-node-connector": "3", "max-length": "65535" } } ] } } ] }, "priority": "12", "table_id": "0" } ] } 

承认

感谢指导我阅读规范的Karthik Prasad和遇到与我相同问题的Peder Zickler