diff options
author | Yuichi Ito <ito.yuichi0@gmail.com> | 2014-06-23 14:45:08 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2014-06-23 17:10:25 +0900 |
commit | f333b94368c65c2371cec7883622936c5b74ccc8 (patch) | |
tree | 5ea5b28e5c932ea39c99e5e11045fd1f38eae6ad | |
parent | 947465e4de245fd77ba9ea220ed3676c521534cd (diff) |
sw test tool: Add default test files (of14: action with set-field only)
These test files aim to examine 'set-field action' of FlowMod message.
This patch only copies ryu/tests/switch/of13/action/25_SET_FIELD.
Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
45 files changed, 14763 insertions, 0 deletions
diff --git a/ryu/tests/switch/of14/action/25_SET_FIELD/03_ETH_DST.json b/ryu/tests/switch/of14/action/25_SET_FIELD/03_ETH_DST.json new file mode 100644 index 00000000..0a2fe33b --- /dev/null +++ b/ryu/tests/switch/of14/action/25_SET_FIELD/03_ETH_DST.json @@ -0,0 +1,187 @@ +[ + "action: set_field: 03_ETH_DST", + { + "description": "ethernet(dst='22:22:22:22:22:22')/ipv4/tcp-->'eth_dst=22:22:22:22:22:22,actions=set_field:ba:bb:bb:bb:bb:bb->eth_dst,output:2'", + "prerequisite":[ + { + "OFPFlowMod":{ + "table_id":0, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_dst", + "value":"22:22:22:22:22:22" + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionSetField":{ + "field":{ + "OXMTlv":{ + "field":"eth_dst", + "value":"ba:bb:bb:bb:bb:bb" + } + } + } + }, + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=2048)", + "ipv4(tos=32, proto=6, src='192.168.10.10', dst='192.168.20.20', ttl=64)", + "tcp(dst_port=2222, option=str('\\x00' * 4), src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ], + "egress":[ + "ethernet(dst='ba:bb:bb:bb:bb:bb', src='12:11:11:11:11:11', ethertype=2048)", + "ipv4(tos=32, proto=6, src='192.168.10.10', dst='192.168.20.20', ttl=64)", + "tcp(dst_port=2222, option=str('\\x00' * 4), src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ] + } + ] + }, + { + "description": "ethernet(dst='22:22:22:22:22:22')/ipv6/tcp-->'eth_dst=22:22:22:22:22:22,actions=set_field:ba:bb:bb:bb:bb:bb->eth_dst,output:2'", + "prerequisite":[ + { + "OFPFlowMod":{ + "table_id":0, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_dst", + "value":"22:22:22:22:22:22" + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionSetField":{ + "field":{ + "OXMTlv":{ + "field":"eth_dst", + "value":"ba:bb:bb:bb:bb:bb" + } + } + } + }, + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=34525)", + "ipv6(dst='20::20', flow_label=100, src='10::10', nxt=6, hop_limit=64, traffic_class=32)", + "tcp(dst_port=2222, option=str('\\x00' * 4), src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ], + "egress":[ + "ethernet(dst='ba:bb:bb:bb:bb:bb', src='12:11:11:11:11:11', ethertype=34525)", + "ipv6(dst='20::20', flow_label=100, src='10::10', nxt=6, hop_limit=64, traffic_class=32)", + "tcp(dst_port=2222, option=str('\\x00' * 4), src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ] + } + ] + }, + { + "description": "ethernet(dst='22:22:22:22:22:22')/arp-->'eth_dst=22:22:22:22:22:22,actions=set_field:ba:bb:bb:bb:bb:bb->eth_dst,output:2'", + "prerequisite":[ + { + "OFPFlowMod":{ + "table_id":0, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_dst", + "value":"22:22:22:22:22:22" + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionSetField":{ + "field":{ + "OXMTlv":{ + "field":"eth_dst", + "value":"ba:bb:bb:bb:bb:bb" + } + } + } + }, + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=2054)", + "arp(dst_ip='192.168.20.20',dst_mac='22:22:22:22:22:22', opcode=1, src_ip='192.168.10.10',src_mac='12:11:11:11:11:11')", + "str('\\x00' * (60 - 42))" + ], + "egress":[ + "ethernet(dst='ba:bb:bb:bb:bb:bb', src='12:11:11:11:11:11', ethertype=2054)", + "arp(dst_ip='192.168.20.20',dst_mac='22:22:22:22:22:22', opcode=1, src_ip='192.168.10.10',src_mac='12:11:11:11:11:11')", + "str('\\x00' * (60 - 42))" + ] + } + ] + } +] diff --git a/ryu/tests/switch/of14/action/25_SET_FIELD/04_ETH_SRC.json b/ryu/tests/switch/of14/action/25_SET_FIELD/04_ETH_SRC.json new file mode 100644 index 00000000..7416364a --- /dev/null +++ b/ryu/tests/switch/of14/action/25_SET_FIELD/04_ETH_SRC.json @@ -0,0 +1,187 @@ +[ + "action: set_field: 04_ETH_SRC", + { + "description": "ethernet(src='12:11:11:11:11:11')/ipv4/tcp-->'eth_src=12:11:11:11:11:11,actions=set_field:aa:aa:aa:aa:aa:aa->eth_src,output:2'", + "prerequisite":[ + { + "OFPFlowMod":{ + "table_id":0, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_src", + "value":"12:11:11:11:11:11" + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionSetField":{ + "field":{ + "OXMTlv":{ + "field":"eth_src", + "value":"aa:aa:aa:aa:aa:aa" + } + } + } + }, + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=2048)", + "ipv4(tos=32, proto=6, src='192.168.10.10', dst='192.168.20.20', ttl=64)", + "tcp(dst_port=2222, option=str('\\x00' * 4), src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ], + "egress":[ + "ethernet(dst='22:22:22:22:22:22', src='aa:aa:aa:aa:aa:aa', ethertype=2048)", + "ipv4(tos=32, proto=6, src='192.168.10.10', dst='192.168.20.20', ttl=64)", + "tcp(dst_port=2222, option=str('\\x00' * 4), src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ] + } + ] + }, + { + "description": "ethernet(src='12:11:11:11:11:11')/ipv6/tcp-->'eth_src=12:11:11:11:11:11,actions=set_field:aa:aa:aa:aa:aa:aa->eth_src,output:2'", + "prerequisite":[ + { + "OFPFlowMod":{ + "table_id":0, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_src", + "value":"12:11:11:11:11:11" + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionSetField":{ + "field":{ + "OXMTlv":{ + "field":"eth_src", + "value":"aa:aa:aa:aa:aa:aa" + } + } + } + }, + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=34525)", + "ipv6(dst='20::20', flow_label=100, src='10::10', nxt=6, hop_limit=64, traffic_class=32)", + "tcp(dst_port=2222, option=str('\\x00' * 4), src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ], + "egress":[ + "ethernet(dst='22:22:22:22:22:22', src='aa:aa:aa:aa:aa:aa', ethertype=34525)", + "ipv6(dst='20::20', flow_label=100, src='10::10', nxt=6, hop_limit=64, traffic_class=32)", + "tcp(dst_port=2222, option=str('\\x00' * 4), src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ] + } + ] + }, + { + "description": "ethernet(src='12:11:11:11:11:11')/arp-->'eth_src=12:11:11:11:11:11,actions=set_field:aa:aa:aa:aa:aa:aa->eth_src,output:2'", + "prerequisite":[ + { + "OFPFlowMod":{ + "table_id":0, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_src", + "value":"12:11:11:11:11:11" + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionSetField":{ + "field":{ + "OXMTlv":{ + "field":"eth_src", + "value":"aa:aa:aa:aa:aa:aa" + } + } + } + }, + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=2054)", + "arp(dst_ip='192.168.20.20',dst_mac='22:22:22:22:22:22', opcode=1, src_ip='192.168.10.10',src_mac='12:11:11:11:11:11')", + "str('\\x00' * (60 - 42))" + ], + "egress":[ + "ethernet(dst='22:22:22:22:22:22', src='aa:aa:aa:aa:aa:aa', ethertype=2054)", + "arp(dst_ip='192.168.20.20',dst_mac='22:22:22:22:22:22', opcode=1, src_ip='192.168.10.10',src_mac='12:11:11:11:11:11')", + "str('\\x00' * (60 - 42))" + ] + } + ] + } +] diff --git a/ryu/tests/switch/of14/action/25_SET_FIELD/05_ETH_TYPE.json b/ryu/tests/switch/of14/action/25_SET_FIELD/05_ETH_TYPE.json new file mode 100644 index 00000000..0fd5bf3a --- /dev/null +++ b/ryu/tests/switch/of14/action/25_SET_FIELD/05_ETH_TYPE.json @@ -0,0 +1,187 @@ +[ + "action: set_field: 05_ETH_TYPE", + { + "description": "ethernet(ethertype=0x0800)/ipv4/tcp-->'eth_type=0x0800,actions=set_field:0x8848->eth_type,output:2'", + "prerequisite":[ + { + "OFPFlowMod":{ + "table_id":0, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":2048 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionSetField":{ + "field":{ + "OXMTlv":{ + "field":"eth_type", + "value":34888 + } + } + } + }, + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=2048)", + "ipv4(tos=32, proto=6, src='192.168.10.10', dst='192.168.20.20', ttl=64)", + "tcp(dst_port=2222, option=str('\\x00' * 4), src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ], + "egress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=34888)", + "ipv4(tos=32, proto=6, src='192.168.10.10', dst='192.168.20.20', ttl=64)", + "tcp(dst_port=2222, option=str('\\x00' * 4), src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ] + } + ] + }, + { + "description": "ethernet(ethertype=0x86dd)/ipv6/tcp-->'eth_type=0x86dd,actions=set_field:0x8848->eth_type,output:2'", + "prerequisite":[ + { + "OFPFlowMod":{ + "table_id":0, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":34525 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionSetField":{ + "field":{ + "OXMTlv":{ + "field":"eth_type", + "value":34888 + } + } + } + }, + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=34525)", + "ipv6(dst='20::20', flow_label=100, src='10::10', nxt=6, hop_limit=64, traffic_class=32)", + "tcp(dst_port=2222, option=str('\\x00' * 4), src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ], + "egress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=34888)", + "ipv6(dst='20::20', flow_label=100, src='10::10', nxt=6, hop_limit=64, traffic_class=32)", + "tcp(dst_port=2222, option=str('\\x00' * 4), src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ] + } + ] + }, + { + "description": "ethernet(ethertype=0x0806)/arp-->'eth_type=0x0806,actions=set_field:0x8848->eth_type,output:2'", + "prerequisite":[ + { + "OFPFlowMod":{ + "table_id":0, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":2054 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionSetField":{ + "field":{ + "OXMTlv":{ + "field":"eth_type", + "value":34888 + } + } + } + }, + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=2054)", + "arp(dst_ip='192.168.20.20',dst_mac='22:22:22:22:22:22', opcode=1, src_ip='192.168.10.10',src_mac='12:11:11:11:11:11')", + "str('\\x00' * (60 - 42))" + ], + "egress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=34888)", + "arp(dst_ip='192.168.20.20',dst_mac='22:22:22:22:22:22', opcode=1, src_ip='192.168.10.10',src_mac='12:11:11:11:11:11')", + "str('\\x00' * (60 - 42))" + ] + } + ] + } +] diff --git a/ryu/tests/switch/of14/action/25_SET_FIELD/06_VLAN_VID.json b/ryu/tests/switch/of14/action/25_SET_FIELD/06_VLAN_VID.json new file mode 100644 index 00000000..092003c3 --- /dev/null +++ b/ryu/tests/switch/of14/action/25_SET_FIELD/06_VLAN_VID.json @@ -0,0 +1,193 @@ +[ + "action: set_field: 06_VLAN_VID", + { + "description": "ethernet/vlan(vid=100)/ipv4/tcp-->'vlan_vid=100,actions=set_field:203->vlan_vid,output:2'", + "prerequisite":[ + { + "OFPFlowMod":{ + "table_id":0, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"vlan_vid", + "value":4196 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionSetField":{ + "field":{ + "OXMTlv":{ + "field":"vlan_vid", + "value":4299 + } + } + } + }, + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=33024)", + "vlan(pcp=3, cfi=0, vid=100, ethertype=2048)", + "ipv4(tos=32, proto=6, src='192.168.10.10', dst='192.168.20.20', ttl=64)", + "tcp(dst_port=2222, option=str('\\x00' * 4), src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ], + "egress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=33024)", + "vlan(pcp=3, cfi=0, vid=203, ethertype=2048)", + "ipv4(tos=32, proto=6, src='192.168.10.10', dst='192.168.20.20', ttl=64)", + "tcp(dst_port=2222, option=str('\\x00' * 4), src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ] + } + ] + }, + { + "description": "ethernet/vlan(vid=100)/ipv6/tcp-->'vlan_vid=100,actions=set_field:203->vlan_vid,output:2'", + "prerequisite":[ + { + "OFPFlowMod":{ + "table_id":0, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"vlan_vid", + "value":4196 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionSetField":{ + "field":{ + "OXMTlv":{ + "field":"vlan_vid", + "value":4299 + } + } + } + }, + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=33024)", + "vlan(pcp=3, cfi=0, vid=100, ethertype=34525)", + "ipv6(dst='20::20', flow_label=100, src='10::10', nxt=6, hop_limit=64, traffic_class=32)", + "tcp(dst_port=2222, option=str('\\x00' * 4), src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ], + "egress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=33024)", + "vlan(pcp=3, cfi=0, vid=203, ethertype=34525)", + "ipv6(dst='20::20', flow_label=100, src='10::10', nxt=6, hop_limit=64, traffic_class=32)", + "tcp(dst_port=2222, option=str('\\x00' * 4), src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ] + } + ] + }, + { + "description": "ethernet/vlan(vid=100)/arp-->'vlan_vid=100,actions=set_field:203->vlan_vid,output:2'", + "prerequisite":[ + { + "OFPFlowMod":{ + "table_id":0, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"vlan_vid", + "value":4196 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionSetField":{ + "field":{ + "OXMTlv":{ + "field":"vlan_vid", + "value":4299 + } + } + } + }, + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=33024)", + "vlan(pcp=3, cfi=0, vid=100, ethertype=2054)", + "arp(dst_ip='192.168.20.20',dst_mac='22:22:22:22:22:22', opcode=1, src_ip='192.168.10.10',src_mac='12:11:11:11:11:11')", + "str('\\x00' * 30)" + ], + "egress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=33024)", + "vlan(pcp=3, cfi=0, vid=203, ethertype=2054)", + "arp(dst_ip='192.168.20.20',dst_mac='22:22:22:22:22:22', opcode=1, src_ip='192.168.10.10',src_mac='12:11:11:11:11:11')", + "str('\\x00' * 30)" + ] + } + ] + } +] diff --git a/ryu/tests/switch/of14/action/25_SET_FIELD/07_VLAN_PCP.json b/ryu/tests/switch/of14/action/25_SET_FIELD/07_VLAN_PCP.json new file mode 100644 index 00000000..92343700 --- /dev/null +++ b/ryu/tests/switch/of14/action/25_SET_FIELD/07_VLAN_PCP.json @@ -0,0 +1,211 @@ +[ + "action: set_field: 07_VLAN_PCP", + { + "description": "ethernet/vlan(pcp=3)/ipv4/tcp-->'vlan_pcp=3,actions=set_field:5->vlan_pcp,output:2'", + "prerequisite":[ + { + "OFPFlowMod":{ + "table_id":0, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"vlan_vid", + "value":4196 + } + }, + { + "OXMTlv":{ + "field":"vlan_pcp", + "value":3 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionSetField":{ + "field":{ + "OXMTlv":{ + "field":"vlan_pcp", + "value":5 + } + } + } + }, + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=33024)", + "vlan(pcp=3, cfi=0, vid=100, ethertype=2048)", + "ipv4(tos=32, proto=6, src='192.168.10.10', dst='192.168.20.20', ttl=64)", + "tcp(dst_port=2222, option=str('\\x00' * 4), src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ], + "egress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=33024)", + "vlan(pcp=5, cfi=0, vid=100, ethertype=2048)", + "ipv4(tos=32, proto=6, src='192.168.10.10', dst='192.168.20.20', ttl=64)", + "tcp(dst_port=2222, option=str('\\x00' * 4), src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ] + } + ] + }, + { + "description": "ethernet/vlan(pcp=3)/ipv6/tcp-->'vlan_pcp=3,actions=set_field:5->vlan_pcp,output:2'", + "prerequisite":[ + { + "OFPFlowMod":{ + "table_id":0, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"vlan_vid", + "value":4196 + } + }, + { + "OXMTlv":{ + "field":"vlan_pcp", + "value":3 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionSetField":{ + "field":{ + "OXMTlv":{ + "field":"vlan_pcp", + "value":5 + } + } + } + }, + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=33024)", + "vlan(pcp=3, cfi=0, vid=100, ethertype=34525)", + "ipv6(dst='20::20', flow_label=100, src='10::10', nxt=6, hop_limit=64, traffic_class=32)", + "tcp(dst_port=2222, option=str('\\x00' * 4), src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ], + "egress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=33024)", + "vlan(pcp=5, cfi=0, vid=100, ethertype=34525)", + "ipv6(dst='20::20', flow_label=100, src='10::10', nxt=6, hop_limit=64, traffic_class=32)", + "tcp(dst_port=2222, option=str('\\x00' * 4), src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ] + } + ] + }, + { + "description": "ethernet/vlan(pcp=3)/arp-->'vlan_pcp=3,actions=set_field:5->vlan_pcp,output:2'", + "prerequisite":[ + { + "OFPFlowMod":{ + "table_id":0, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"vlan_vid", + "value":4196 + } + }, + { + "OXMTlv":{ + "field":"vlan_pcp", + "value":3 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionSetField":{ + "field":{ + "OXMTlv":{ + "field":"vlan_pcp", + "value":5 + } + } + } + }, + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=33024)", + "vlan(pcp=3, cfi=0, vid=100, ethertype=2054)", + "arp(dst_ip='192.168.20.20',dst_mac='22:22:22:22:22:22', opcode=1, src_ip='192.168.10.10',src_mac='12:11:11:11:11:11')", + "str('\\x00' * 30)" + ], + "egress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=33024)", + "vlan(pcp=5, cfi=0, vid=100, ethertype=2054)", + "arp(dst_ip='192.168.20.20',dst_mac='22:22:22:22:22:22', opcode=1, src_ip='192.168.10.10',src_mac='12:11:11:11:11:11')", + "str('\\x00' * 30)" + ] + } + ] + } +] diff --git a/ryu/tests/switch/of14/action/25_SET_FIELD/08_IP_DSCP_IPv4.json b/ryu/tests/switch/of14/action/25_SET_FIELD/08_IP_DSCP_IPv4.json new file mode 100644 index 00000000..5127614f --- /dev/null +++ b/ryu/tests/switch/of14/action/25_SET_FIELD/08_IP_DSCP_IPv4.json @@ -0,0 +1,350 @@ +[ + "action: set_field: 08_IP_DSCP (IPv4)", + { + "description": "ethernet/ipv4(tos=32)/tcp-->'ip_dscp=8,actions=set_field:16->ip_dscp,output:2'", + "prerequisite":[ + { + "OFPFlowMod":{ + "table_id":0, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":2048 + } + }, + { + "OXMTlv":{ + "field":"ip_dscp", + "value":8 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionSetField":{ + "field":{ + "OXMTlv":{ + "field":"ip_dscp", + "value":16 + } + } + } + }, + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=2048)", + "ipv4(tos=32, proto=6, src='192.168.10.10', dst='192.168.20.20', ttl=64)", + "tcp(dst_port=2222, option=str('\\x00' * 4), src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ], + "egress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=2048)", + "ipv4(tos=64, proto=6, src='192.168.10.10', dst='192.168.20.20', ttl=64)", + "tcp(dst_port=2222, option=str('\\x00' * 4), src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ] + } + ] + }, + { + "description": "ethernet/vlan/ipv4(tos=32)/tcp-->'ip_dscp=8,actions=set_field:16->ip_dscp,output:2'", + "prerequisite":[ + { + "OFPFlowMod":{ + "table_id":0, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":2048 + } + }, + { + "OXMTlv":{ + "field":"ip_dscp", + "value":8 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionSetField":{ + "field":{ + "OXMTlv":{ + "field":"ip_dscp", + "value":16 + } + } + } + }, + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=33024)", + "vlan(pcp=3, cfi=0, vid=100, ethertype=2048)", + "ipv4(tos=32, proto=6, src='192.168.10.10', dst='192.168.20.20', ttl=64)", + "tcp(dst_port=2222, option=str('\\x00' * 4), src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ], + "egress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=33024)", + "vlan(pcp=3, cfi=0, vid=100, ethertype=2048)", + "ipv4(tos=64, proto=6, src='192.168.10.10', dst='192.168.20.20', ttl=64)", + "tcp(dst_port=2222, option=str('\\x00' * 4), src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ] + } + ] + }, + { + "description": "ethernet/mpls/ipv4(tos=32)/tcp-->'actions=pop_mpls:0x0800,goto_table:1','table_id:1,ip_dscp=8,actions=set_field:16->ip_dscp,output:2'", + "prerequisite":[ + { + "OFPFlowMod":{ + "table_id":0, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":34887 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionPopMpls":{ + "ethertype":2048 + } + } + ], + "type":4 + } + }, + { + "OFPInstructionGotoTable":{ + "table_id":1 + } + } + ] + } + }, + { + "OFPFlowMod":{ + "table_id":1, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":2048 + } + }, + { + "OXMTlv":{ + "field":"ip_dscp", + "value":8 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionSetField":{ + "field":{ + "OXMTlv":{ + "field":"ip_dscp", + "value":16 + } + } + } + }, + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=34887)", + "mpls(bsb=1, label=100, exp=3, ttl=64)", + "ipv4(tos=32, proto=6, src='192.168.10.10', dst='192.168.20.20', ttl=64)", + "tcp(dst_port=2222, option=str('\\x00' * 4), src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ], + "egress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=2048)", + "ipv4(tos=64, proto=6, src='192.168.10.10', dst='192.168.20.20', ttl=64)", + "tcp(dst_port=2222, option=str('\\x00' * 4), src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ] + } + ] + }, + { + "description": "ethernet/itag/ethernet/ipv4(tos=32)/tcp-->'actions=pop_pbb,goto_table:1','table_id:1,ip_dscp=8,actions=set_field:16->ip_dscp,output:2'", + "prerequisite":[ + { + "OFPFlowMod":{ + "table_id":0, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":35047 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionPopPbb":{} + } + ], + "type":4 + } + }, + { + "OFPInstructionGotoTable":{ + "table_id":1 + } + } + ] + } + }, + { + "OFPFlowMod":{ + "table_id":1, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":2048 + } + }, + { + "OXMTlv":{ + "field":"ip_dscp", + "value":8 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionSetField":{ + "field":{ + "OXMTlv":{ + "field":"ip_dscp", + "value":16 + } + } + } + }, + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=35047)", + "itag(sid=100)", + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=2048)", + "ipv4(tos=32, proto=6, src='192.168.10.10', dst='192.168.20.20', ttl=64)", + "tcp(dst_port=2222, option=str('\\x00' * 4), src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ], + "egress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=2048)", + "ipv4(tos=64, proto=6, src='192.168.10.10', dst='192.168.20.20', ttl=64)", + "tcp(dst_port=2222, option=str('\\x00' * 4), src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ] + } + ] + } +] diff --git a/ryu/tests/switch/of14/action/25_SET_FIELD/08_IP_DSCP_IPv6.json b/ryu/tests/switch/of14/action/25_SET_FIELD/08_IP_DSCP_IPv6.json new file mode 100644 index 00000000..c23a224e --- /dev/null +++ b/ryu/tests/switch/of14/action/25_SET_FIELD/08_IP_DSCP_IPv6.json @@ -0,0 +1,350 @@ +[ + "action: set_field: 08_IP_DSCP (IPv6)", + { + "description": "ethernet/ipv6(traffic_class=32)/tcp-->'ip_dscp=8,actions=set_field:16->ip_dscp,output:2'", + "prerequisite":[ + { + "OFPFlowMod":{ + "table_id":0, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":34525 + } + }, + { + "OXMTlv":{ + "field":"ip_dscp", + "value":8 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionSetField":{ + "field":{ + "OXMTlv":{ + "field":"ip_dscp", + "value":16 + } + } + } + }, + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=34525)", + "ipv6(dst='20::20', flow_label=100, src='10::10', nxt=6, hop_limit=64, traffic_class=32)", + "tcp(dst_port=2222, option=str('\\x00' * 4), src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ], + "egress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=34525)", + "ipv6(dst='20::20', flow_label=100, src='10::10', nxt=6, hop_limit=64, traffic_class=64)", + "tcp(dst_port=2222, option=str('\\x00' * 4), src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ] + } + ] + }, + { + "description": "ethernet/vlan/ipv6(traffic_class=32)/tcp-->'ip_dscp=8,actions=set_field:16->ip_dscp,output:2'", + "prerequisite":[ + { + "OFPFlowMod":{ + "table_id":0, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":34525 + } + }, + { + "OXMTlv":{ + "field":"ip_dscp", + "value":8 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionSetField":{ + "field":{ + "OXMTlv":{ + "field":"ip_dscp", + "value":16 + } + } + } + }, + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=33024)", + "vlan(pcp=3, cfi=0, vid=100, ethertype=34525)", + "ipv6(dst='20::20', flow_label=100, src='10::10', nxt=6, hop_limit=64, traffic_class=32)", + "tcp(dst_port=2222, option=str('\\x00' * 4), src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ], + "egress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=33024)", + "vlan(pcp=3, cfi=0, vid=100, ethertype=34525)", + "ipv6(dst='20::20', flow_label=100, src='10::10', nxt=6, hop_limit=64, traffic_class=64)", + "tcp(dst_port=2222, option=str('\\x00' * 4), src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ] + } + ] + }, + { + "description": "ethernet/mpls/ipv6(traffic_class=32)/tcp-->'actions=pop_mpls:0x86dd,goto_table:1','table_id:1,ip_dscp=8,actions=set_field:16->ip_dscp,output:2'", + "prerequisite":[ + { + "OFPFlowMod":{ + "table_id":0, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":34887 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionPopMpls":{ + "ethertype":34525 + } + } + ], + "type":4 + } + }, + { + "OFPInstructionGotoTable":{ + "table_id":1 + } + } + ] + } + }, + { + "OFPFlowMod":{ + "table_id":1, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":34525 + } + }, + { + "OXMTlv":{ + "field":"ip_dscp", + "value":8 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionSetField":{ + "field":{ + "OXMTlv":{ + "field":"ip_dscp", + "value":16 + } + } + } + }, + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=34887)", + "mpls(bsb=1, label=100, exp=3, ttl=64)", + "ipv6(dst='20::20', flow_label=100, src='10::10', nxt=6, hop_limit=64, traffic_class=32)", + "tcp(dst_port=2222, option=str('\\x00' * 4), src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ], + "egress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=34525)", + "ipv6(dst='20::20', flow_label=100, src='10::10', nxt=6, hop_limit=64, traffic_class=64)", + "tcp(dst_port=2222, option=str('\\x00' * 4), src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ] + } + ] + }, + { + "description": "ethernet/itag/ethernet/ipv6(traffic_class=32)/tcp-->'actions=pop_pbb,goto_table:1','table_id:1,ip_dscp=8,actions=set_field:16->ip_dscp,output:2'", + "prerequisite":[ + { + "OFPFlowMod":{ + "table_id":0, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":35047 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionPopPbb":{} + } + ], + "type":4 + } + }, + { + "OFPInstructionGotoTable":{ + "table_id":1 + } + } + ] + } + }, + { + "OFPFlowMod":{ + "table_id":1, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":34525 + } + }, + { + "OXMTlv":{ + "field":"ip_dscp", + "value":8 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionSetField":{ + "field":{ + "OXMTlv":{ + "field":"ip_dscp", + "value":16 + } + } + } + }, + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=35047)", + "itag(sid=100)", + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=34525)", + "ipv6(dst='20::20', flow_label=100, src='10::10', nxt=6, hop_limit=64, traffic_class=32)", + "tcp(dst_port=2222, option=str('\\x00' * 4), src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ], + "egress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=34525)", + "ipv6(dst='20::20', flow_label=100, src='10::10', nxt=6, hop_limit=64, traffic_class=64)", + "tcp(dst_port=2222, option=str('\\x00' * 4), src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ] + } + ] + } +] diff --git a/ryu/tests/switch/of14/action/25_SET_FIELD/09_IP_ECN_IPv4.json b/ryu/tests/switch/of14/action/25_SET_FIELD/09_IP_ECN_IPv4.json new file mode 100644 index 00000000..a262e06b --- /dev/null +++ b/ryu/tests/switch/of14/action/25_SET_FIELD/09_IP_ECN_IPv4.json @@ -0,0 +1,350 @@ +[ + "action: set_field: 09_IP_ECN (IPv4)", + { + "description": "ethernet/ipv4(tos=32)/tcp-->'ip_ecn=0,actions=set_field:1->ip_ecn,output:2'", + "prerequisite":[ + { + "OFPFlowMod":{ + "table_id":0, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":2048 + } + }, + { + "OXMTlv":{ + "field":"ip_ecn", + "value":0 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionSetField":{ + "field":{ + "OXMTlv":{ + "field":"ip_ecn", + "value":1 + } + } + } + }, + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=2048)", + "ipv4(tos=32, proto=6, src='192.168.10.10', dst='192.168.20.20', ttl=64)", + "tcp(dst_port=2222, option=str('\\x00' * 4), src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ], + "egress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=2048)", + "ipv4(tos=33, proto=6, src='192.168.10.10', dst='192.168.20.20', ttl=64)", + "tcp(dst_port=2222, option=str('\\x00' * 4), src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ] + } + ] + }, + { + "description": "ethernet/vlan/ipv4(tos=32)/tcp-->'ip_ecn=0,actions=set_field:1->ip_ecn,output:2'", + "prerequisite":[ + { + "OFPFlowMod":{ + "table_id":0, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":2048 + } + }, + { + "OXMTlv":{ + "field":"ip_ecn", + "value":0 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionSetField":{ + "field":{ + "OXMTlv":{ + "field":"ip_ecn", + "value":1 + } + } + } + }, + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=33024)", + "vlan(pcp=3, cfi=0, vid=100, ethertype=2048)", + "ipv4(tos=32, proto=6, src='192.168.10.10', dst='192.168.20.20', ttl=64)", + "tcp(dst_port=2222, option=str('\\x00' * 4), src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ], + "egress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=33024)", + "vlan(pcp=3, cfi=0, vid=100, ethertype=2048)", + "ipv4(tos=33, proto=6, src='192.168.10.10', dst='192.168.20.20', ttl=64)", + "tcp(dst_port=2222, option=str('\\x00' * 4), src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ] + } + ] + }, + { + "description": "ethernet/mpls/ipv4(tos=32)/tcp-->'actions=pop_mpls:0x0800,goto_table:1','table_id:1,ip_ecn=0,actions=set_field:1->ip_ecn,output:2'", + "prerequisite":[ + { + "OFPFlowMod":{ + "table_id":0, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":34887 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionPopMpls":{ + "ethertype":2048 + } + } + ], + "type":4 + } + }, + { + "OFPInstructionGotoTable":{ + "table_id":1 + } + } + ] + } + }, + { + "OFPFlowMod":{ + "table_id":1, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":2048 + } + }, + { + "OXMTlv":{ + "field":"ip_ecn", + "value":0 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionSetField":{ + "field":{ + "OXMTlv":{ + "field":"ip_ecn", + "value":1 + } + } + } + }, + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=34887)", + "mpls(bsb=1, label=100, exp=3, ttl=64)", + "ipv4(tos=32, proto=6, src='192.168.10.10', dst='192.168.20.20', ttl=64)", + "tcp(dst_port=2222, option=str('\\x00' * 4), src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ], + "egress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=2048)", + "ipv4(tos=33, proto=6, src='192.168.10.10', dst='192.168.20.20', ttl=64)", + "tcp(dst_port=2222, option=str('\\x00' * 4), src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ] + } + ] + }, + { + "description": "ethernet/itag/ethernet/ipv4(tos=32)/tcp-->'actions=pop_pbb,goto_table:1','table_id:1,ip_ecn=0,actions=set_field:1->ip_ecn,output:2'", + "prerequisite":[ + { + "OFPFlowMod":{ + "table_id":0, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":35047 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionPopPbb":{} + } + ], + "type":4 + } + }, + { + "OFPInstructionGotoTable":{ + "table_id":1 + } + } + ] + } + }, + { + "OFPFlowMod":{ + "table_id":1, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":2048 + } + }, + { + "OXMTlv":{ + "field":"ip_ecn", + "value":0 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionSetField":{ + "field":{ + "OXMTlv":{ + "field":"ip_ecn", + "value":1 + } + } + } + }, + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=35047)", + "itag(sid=100)", + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=2048)", + "ipv4(tos=32, proto=6, src='192.168.10.10', dst='192.168.20.20', ttl=64)", + "tcp(dst_port=2222, option=str('\\x00' * 4), src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ], + "egress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=2048)", + "ipv4(tos=33, proto=6, src='192.168.10.10', dst='192.168.20.20', ttl=64)", + "tcp(dst_port=2222, option=str('\\x00' * 4), src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ] + } + ] + } +] diff --git a/ryu/tests/switch/of14/action/25_SET_FIELD/09_IP_ECN_IPv6.json b/ryu/tests/switch/of14/action/25_SET_FIELD/09_IP_ECN_IPv6.json new file mode 100644 index 00000000..1efff538 --- /dev/null +++ b/ryu/tests/switch/of14/action/25_SET_FIELD/09_IP_ECN_IPv6.json @@ -0,0 +1,350 @@ +[ + "action: set_field: 09_IP_ECN (IPv6)", + { + "description": "ethernet/ipv6(traffic_class=32)/tcp-->'ip_ecn=0,actions=set_field:1->ip_ecn,output:2'", + "prerequisite":[ + { + "OFPFlowMod":{ + "table_id":0, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":34525 + } + }, + { + "OXMTlv":{ + "field":"ip_ecn", + "value":0 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionSetField":{ + "field":{ + "OXMTlv":{ + "field":"ip_ecn", + "value":1 + } + } + } + }, + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=34525)", + "ipv6(dst='20::20', flow_label=100, src='10::10', nxt=6, hop_limit=64, traffic_class=32)", + "tcp(dst_port=2222, option=str('\\x00' * 4), src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ], + "egress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=34525)", + "ipv6(dst='20::20', flow_label=100, src='10::10', nxt=6, hop_limit=64, traffic_class=33)", + "tcp(dst_port=2222, option=str('\\x00' * 4), src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ] + } + ] + }, + { + "description": "ethernet/vlan/ipv6(traffic_class=32)/tcp-->'ip_ecn=0,actions=set_field:1->ip_ecn,output:2'", + "prerequisite":[ + { + "OFPFlowMod":{ + "table_id":0, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":34525 + } + }, + { + "OXMTlv":{ + "field":"ip_ecn", + "value":0 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionSetField":{ + "field":{ + "OXMTlv":{ + "field":"ip_ecn", + "value":1 + } + } + } + }, + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=33024)", + "vlan(pcp=3, cfi=0, vid=100, ethertype=34525)", + "ipv6(dst='20::20', flow_label=100, src='10::10', nxt=6, hop_limit=64, traffic_class=32)", + "tcp(dst_port=2222, option=str('\\x00' * 4), src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ], + "egress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=33024)", + "vlan(pcp=3, cfi=0, vid=100, ethertype=34525)", + "ipv6(dst='20::20', flow_label=100, src='10::10', nxt=6, hop_limit=64, traffic_class=33)", + "tcp(dst_port=2222, option=str('\\x00' * 4), src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ] + } + ] + }, + { + "description": "ethernet/mpls/ipv6(traffic_class=32)/tcp-->'actions=pop_mpls:0x86dd,goto_table:1','table_id:1,ip_ecn=0,actions=set_field:1->ip_ecn,output:2'", + "prerequisite":[ + { + "OFPFlowMod":{ + "table_id":0, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":34887 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionPopMpls":{ + "ethertype":34525 + } + } + ], + "type":4 + } + }, + { + "OFPInstructionGotoTable":{ + "table_id":1 + } + } + ] + } + }, + { + "OFPFlowMod":{ + "table_id":1, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":34525 + } + }, + { + "OXMTlv":{ + "field":"ip_ecn", + "value":0 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionSetField":{ + "field":{ + "OXMTlv":{ + "field":"ip_ecn", + "value":1 + } + } + } + }, + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=34887)", + "mpls(bsb=1, label=100, exp=3, ttl=64)", + "ipv6(dst='20::20', flow_label=100, src='10::10', nxt=6, hop_limit=64, traffic_class=32)", + "tcp(dst_port=2222, option=str('\\x00' * 4), src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ], + "egress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=34525)", + "ipv6(dst='20::20', flow_label=100, src='10::10', nxt=6, hop_limit=64, traffic_class=33)", + "tcp(dst_port=2222, option=str('\\x00' * 4), src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ] + } + ] + }, + { + "description": "ethernet/itag/ethernet/ipv6(traffic_class=32)/tcp-->'actions=pop_pbb,goto_table:1','table_id:1,ip_ecn=0,actions=set_field:1->ip_ecn,output:2'", + "prerequisite":[ + { + "OFPFlowMod":{ + "table_id":0, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":35047 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionPopPbb":{} + } + ], + "type":4 + } + }, + { + "OFPInstructionGotoTable":{ + "table_id":1 + } + } + ] + } + }, + { + "OFPFlowMod":{ + "table_id":1, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":34525 + } + }, + { + "OXMTlv":{ + "field":"ip_ecn", + "value":0 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionSetField":{ + "field":{ + "OXMTlv":{ + "field":"ip_ecn", + "value":1 + } + } + } + }, + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=35047)", + "itag(sid=100)", + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=34525)", + "ipv6(dst='20::20', flow_label=100, src='10::10', nxt=6, hop_limit=64, traffic_class=32)", + "tcp(dst_port=2222, option=str('\\x00' * 4), src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ], + "egress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=34525)", + "ipv6(dst='20::20', flow_label=100, src='10::10', nxt=6, hop_limit=64, traffic_class=33)", + "tcp(dst_port=2222, option=str('\\x00' * 4), src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ] + } + ] + } +] diff --git a/ryu/tests/switch/of14/action/25_SET_FIELD/10_IP_PROTO_IPv4.json b/ryu/tests/switch/of14/action/25_SET_FIELD/10_IP_PROTO_IPv4.json new file mode 100644 index 00000000..d208f625 --- /dev/null +++ b/ryu/tests/switch/of14/action/25_SET_FIELD/10_IP_PROTO_IPv4.json @@ -0,0 +1,350 @@ +[ + "action: set_field: 10_IP_PROTO (IPv4)", + { + "description": "ethernet/ipv4(proto=6)/tcp-->'ip_proto=6,actions=set_field:17->ip_proto,output:2'", + "prerequisite":[ + { + "OFPFlowMod":{ + "table_id":0, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":2048 + } + }, + { + "OXMTlv":{ + "field":"ip_proto", + "value":6 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionSetField":{ + "field":{ + "OXMTlv":{ + "field":"ip_proto", + "value":17 + } + } + } + }, + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=2048)", + "ipv4(tos=32, proto=6, src='192.168.10.10', dst='192.168.20.20', ttl=64)", + "tcp(dst_port=2222, option=str('\\x00' * 4), src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ], + "egress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=2048)", + "ipv4(tos=32, proto=17, src='192.168.10.10', dst='192.168.20.20', ttl=64)", + "tcp(dst_port=2222, option=str('\\x00' * 4), src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ] + } + ] + }, + { + "description": "ethernet/vlan/ipv4(proto=6)/tcp-->'ip_proto=6,actions=set_field:17->ip_proto,output:2'", + "prerequisite":[ + { + "OFPFlowMod":{ + "table_id":0, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":2048 + } + }, + { + "OXMTlv":{ + "field":"ip_proto", + "value":6 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionSetField":{ + "field":{ + "OXMTlv":{ + "field":"ip_proto", + "value":17 + } + } + } + }, + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=33024)", + "vlan(pcp=3, cfi=0, vid=100, ethertype=2048)", + "ipv4(tos=32, proto=6, src='192.168.10.10', dst='192.168.20.20', ttl=64)", + "tcp(dst_port=2222, option=str('\\x00' * 4), src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ], + "egress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=33024)", + "vlan(pcp=3, cfi=0, vid=100, ethertype=2048)", + "ipv4(tos=32, proto=17, src='192.168.10.10', dst='192.168.20.20', ttl=64)", + "tcp(dst_port=2222, option=str('\\x00' * 4), src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ] + } + ] + }, + { + "description": "ethernet/mpls/ipv4(proto=6)/tcp-->'actions=pop_mpls:0x0800,goto_table:1','table_id:1,ip_proto=6,actions=set_field:17->ip_proto,output:2'", + "prerequisite":[ + { + "OFPFlowMod":{ + "table_id":0, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":34887 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionPopMpls":{ + "ethertype":2048 + } + } + ], + "type":4 + } + }, + { + "OFPInstructionGotoTable":{ + "table_id":1 + } + } + ] + } + }, + { + "OFPFlowMod":{ + "table_id":1, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":2048 + } + }, + { + "OXMTlv":{ + "field":"ip_proto", + "value":6 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionSetField":{ + "field":{ + "OXMTlv":{ + "field":"ip_proto", + "value":17 + } + } + } + }, + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=34887)", + "mpls(bsb=1, label=100, exp=3, ttl=64)", + "ipv4(tos=32, proto=6, src='192.168.10.10', dst='192.168.20.20', ttl=64)", + "tcp(dst_port=2222, option=str('\\x00' * 4), src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ], + "egress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=2048)", + "ipv4(tos=32, proto=17, src='192.168.10.10', dst='192.168.20.20', ttl=64)", + "tcp(dst_port=2222, option=str('\\x00' * 4), src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ] + } + ] + }, + { + "description": "ethernet/itag/ethernet/ipv4(proto=6)/tcp-->'actions=pop_pbb,goto_table:1','table_id:1,ip_proto=6,actions=set_field:17->ip_proto,output:2'", + "prerequisite":[ + { + "OFPFlowMod":{ + "table_id":0, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":35047 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionPopPbb":{} + } + ], + "type":4 + } + }, + { + "OFPInstructionGotoTable":{ + "table_id":1 + } + } + ] + } + }, + { + "OFPFlowMod":{ + "table_id":1, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":2048 + } + }, + { + "OXMTlv":{ + "field":"ip_proto", + "value":6 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionSetField":{ + "field":{ + "OXMTlv":{ + "field":"ip_proto", + "value":17 + } + } + } + }, + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=35047)", + "itag(sid=100)", + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=2048)", + "ipv4(tos=32, proto=6, src='192.168.10.10', dst='192.168.20.20', ttl=64)", + "tcp(dst_port=2222, option=str('\\x00' * 4), src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ], + "egress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=2048)", + "ipv4(tos=32, proto=17, src='192.168.10.10', dst='192.168.20.20', ttl=64)", + "tcp(dst_port=2222, option=str('\\x00' * 4), src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ] + } + ] + } +] diff --git a/ryu/tests/switch/of14/action/25_SET_FIELD/10_IP_PROTO_IPv6.json b/ryu/tests/switch/of14/action/25_SET_FIELD/10_IP_PROTO_IPv6.json new file mode 100644 index 00000000..c3e0a66a --- /dev/null +++ b/ryu/tests/switch/of14/action/25_SET_FIELD/10_IP_PROTO_IPv6.json @@ -0,0 +1,350 @@ +[ + "action: set_field: 10_IP_PROTO (IPv6)", + { + "description": "ethernet/ipv6(nxt=6)/tcp-->'ip_proto=6,actions=set_field:17->ip_proto,output:2'", + "prerequisite":[ + { + "OFPFlowMod":{ + "table_id":0, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":34525 + } + }, + { + "OXMTlv":{ + "field":"ip_proto", + "value":6 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionSetField":{ + "field":{ + "OXMTlv":{ + "field":"ip_proto", + "value":17 + } + } + } + }, + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=34525)", + "ipv6(dst='20::20', flow_label=100, src='10::10', nxt=6, hop_limit=64, traffic_class=32)", + "tcp(dst_port=2222, option=str('\\x00' * 4), src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ], + "egress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=34525)", + "ipv6(dst='20::20', flow_label=100, src='10::10', nxt=17, hop_limit=64, traffic_class=32)", + "tcp(dst_port=2222, option=str('\\x00' * 4), src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ] + } + ] + }, + { + "description": "ethernet/vlan/ipv6(nxt=6)/tcp-->'ip_proto=6,actions=set_field:17->ip_proto,output:2'", + "prerequisite":[ + { + "OFPFlowMod":{ + "table_id":0, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":34525 + } + }, + { + "OXMTlv":{ + "field":"ip_proto", + "value":6 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionSetField":{ + "field":{ + "OXMTlv":{ + "field":"ip_proto", + "value":17 + } + } + } + }, + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=33024)", + "vlan(pcp=3, cfi=0, vid=100, ethertype=34525)", + "ipv6(dst='20::20', flow_label=100, src='10::10', nxt=6, hop_limit=64, traffic_class=32)", + "tcp(dst_port=2222, option=str('\\x00' * 4), src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ], + "egress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=33024)", + "vlan(pcp=3, cfi=0, vid=100, ethertype=34525)", + "ipv6(dst='20::20', flow_label=100, src='10::10', nxt=17, hop_limit=64, traffic_class=32)", + "tcp(dst_port=2222, option=str('\\x00' * 4), src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ] + } + ] + }, + { + "description": "ethernet/mpls/ipv6(nxt=6)/tcp-->'actions=pop_mpls:0x86dd,goto_table:1','table_id:1,ip_proto=6,actions=set_field:17->ip_proto,output:2'", + "prerequisite":[ + { + "OFPFlowMod":{ + "table_id":0, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":34887 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionPopMpls":{ + "ethertype":34525 + } + } + ], + "type":4 + } + }, + { + "OFPInstructionGotoTable":{ + "table_id":1 + } + } + ] + } + }, + { + "OFPFlowMod":{ + "table_id":1, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":34525 + } + }, + { + "OXMTlv":{ + "field":"ip_proto", + "value":6 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionSetField":{ + "field":{ + "OXMTlv":{ + "field":"ip_proto", + "value":17 + } + } + } + }, + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=34887)", + "mpls(bsb=1, label=100, exp=3, ttl=64)", + "ipv6(dst='20::20', flow_label=100, src='10::10', nxt=6, hop_limit=64, traffic_class=32)", + "tcp(dst_port=2222, option=str('\\x00' * 4), src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ], + "egress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=34525)", + "ipv6(dst='20::20', flow_label=100, src='10::10', nxt=17, hop_limit=64, traffic_class=32)", + "tcp(dst_port=2222, option=str('\\x00' * 4), src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ] + } + ] + }, + { + "description": "ethernet/itag/ethernet/ipv6(nxt=6)/tcp-->'actions=pop_pbb,goto_table:1','table_id:1,ip_proto=6,actions=set_field:17->ip_proto,output:2'", + "prerequisite":[ + { + "OFPFlowMod":{ + "table_id":0, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":35047 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionPopPbb":{} + } + ], + "type":4 + } + }, + { + "OFPInstructionGotoTable":{ + "table_id":1 + } + } + ] + } + }, + { + "OFPFlowMod":{ + "table_id":1, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":34525 + } + }, + { + "OXMTlv":{ + "field":"ip_proto", + "value":6 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionSetField":{ + "field":{ + "OXMTlv":{ + "field":"ip_proto", + "value":17 + } + } + } + }, + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=35047)", + "itag(sid=100)", + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=34525)", + "ipv6(dst='20::20', flow_label=100, src='10::10', nxt=6, hop_limit=64, traffic_class=32)", + "tcp(dst_port=2222, option=str('\\x00' * 4), src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ], + "egress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=34525)", + "ipv6(dst='20::20', flow_label=100, src='10::10', nxt=17, hop_limit=64, traffic_class=32)", + "tcp(dst_port=2222, option=str('\\x00' * 4), src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ] + } + ] + } +] diff --git a/ryu/tests/switch/of14/action/25_SET_FIELD/11_IPV4_SRC.json b/ryu/tests/switch/of14/action/25_SET_FIELD/11_IPV4_SRC.json new file mode 100644 index 00000000..af7a048a --- /dev/null +++ b/ryu/tests/switch/of14/action/25_SET_FIELD/11_IPV4_SRC.json @@ -0,0 +1,350 @@ +[ + "action: set_field: 11_IPV4_SRC", + { + "description": "ethernet/ipv4(src='192.168.10.10')/tcp-->'ipv4_src=192.168.10.10,actions=set_field:10.10.10.10->ipv4_src,output:2'", + "prerequisite":[ + { + "OFPFlowMod":{ + "table_id":0, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":2048 + } + }, + { + "OXMTlv":{ + "field":"ipv4_src", + "value":"192.168.10.10" + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionSetField":{ + "field":{ + "OXMTlv":{ + "field":"ipv4_src", + "value":"10.10.10.10" + } + } + } + }, + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=2048)", + "ipv4(tos=32, proto=6, src='192.168.10.10', dst='192.168.20.20', ttl=64)", + "tcp(dst_port=2222, option=str('\\x00' * 4), src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ], + "egress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=2048)", + "ipv4(tos=32, proto=6, src='10.10.10.10', dst='192.168.20.20', ttl=64)", + "tcp(dst_port=2222, option=str('\\x00' * 4), src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ] + } + ] + }, + { + "description": "ethernet/vlan/ipv4(src='192.168.10.10')/tcp-->'ipv4_src=192.168.10.10,actions=set_field:10.10.10.10->ipv4_src,output:2'", + "prerequisite":[ + { + "OFPFlowMod":{ + "table_id":0, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":2048 + } + }, + { + "OXMTlv":{ + "field":"ipv4_src", + "value":"192.168.10.10" + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionSetField":{ + "field":{ + "OXMTlv":{ + "field":"ipv4_src", + "value":"10.10.10.10" + } + } + } + }, + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=33024)", + "vlan(pcp=3, cfi=0, vid=100, ethertype=2048)", + "ipv4(tos=32, proto=6, src='192.168.10.10', dst='192.168.20.20', ttl=64)", + "tcp(dst_port=2222, option=str('\\x00' * 4), src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ], + "egress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=33024)", + "vlan(pcp=3, cfi=0, vid=100, ethertype=2048)", + "ipv4(tos=32, proto=6, src='10.10.10.10', dst='192.168.20.20', ttl=64)", + "tcp(dst_port=2222, option=str('\\x00' * 4), src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ] + } + ] + }, + { + "description": "ethernet/mpls/ipv4(src='192.168.10.10')/tcp-->'actions=pop_mpls:0x0800,goto_table:1','table_id:1,ipv4_src=192.168.10.10,actions=set_field:10.10.10.10->ipv4_src,output:2'", + "prerequisite":[ + { + "OFPFlowMod":{ + "table_id":0, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":34887 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionPopMpls":{ + "ethertype":2048 + } + } + ], + "type":4 + } + }, + { + "OFPInstructionGotoTable":{ + "table_id":1 + } + } + ] + } + }, + { + "OFPFlowMod":{ + "table_id":1, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":2048 + } + }, + { + "OXMTlv":{ + "field":"ipv4_src", + "value":"192.168.10.10" + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionSetField":{ + "field":{ + "OXMTlv":{ + "field":"ipv4_src", + "value":"10.10.10.10" + } + } + } + }, + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=34887)", + "mpls(bsb=1, label=100, exp=3, ttl=64)", + "ipv4(tos=32, proto=6, src='192.168.10.10', dst='192.168.20.20', ttl=64)", + "tcp(dst_port=2222, option=str('\\x00' * 4), src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ], + "egress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=2048)", + "ipv4(tos=32, proto=6, src='10.10.10.10', dst='192.168.20.20', ttl=64)", + "tcp(dst_port=2222, option=str('\\x00' * 4), src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ] + } + ] + }, + { + "description": "ethernet/itag/ethernet/ipv4(src='192.168.10.10')/tcp-->'actions=pop_pbb,goto_table:1','table_id:1,ipv4_src=192.168.10.10,actions=set_field:10.10.10.10->ipv4_src,output:2'", + "prerequisite":[ + { + "OFPFlowMod":{ + "table_id":0, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":35047 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionPopPbb":{} + } + ], + "type":4 + } + }, + { + "OFPInstructionGotoTable":{ + "table_id":1 + } + } + ] + } + }, + { + "OFPFlowMod":{ + "table_id":1, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":2048 + } + }, + { + "OXMTlv":{ + "field":"ipv4_src", + "value":"192.168.10.10" + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionSetField":{ + "field":{ + "OXMTlv":{ + "field":"ipv4_src", + "value":"10.10.10.10" + } + } + } + }, + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=35047)", + "itag(sid=100)", + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=2048)", + "ipv4(tos=32, proto=6, src='192.168.10.10', dst='192.168.20.20', ttl=64)", + "tcp(dst_port=2222, option=str('\\x00' * 4), src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ], + "egress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=2048)", + "ipv4(tos=32, proto=6, src='10.10.10.10', dst='192.168.20.20', ttl=64)", + "tcp(dst_port=2222, option=str('\\x00' * 4), src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ] + } + ] + } +] diff --git a/ryu/tests/switch/of14/action/25_SET_FIELD/12_IPV4_DST.json b/ryu/tests/switch/of14/action/25_SET_FIELD/12_IPV4_DST.json new file mode 100644 index 00000000..c476c8bf --- /dev/null +++ b/ryu/tests/switch/of14/action/25_SET_FIELD/12_IPV4_DST.json @@ -0,0 +1,350 @@ +[ + "action: set_field: 12_IPV4_DST", + { + "description": "ethernet/ipv4(dst='192.168.20.20')/tcp-->'ipv4_dst=192.168.20.20,actions=set_field:10.10.20.20->ipv4_dst,output:2'", + "prerequisite":[ + { + "OFPFlowMod":{ + "table_id":0, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":2048 + } + }, + { + "OXMTlv":{ + "field":"ipv4_dst", + "value":"192.168.20.20" + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionSetField":{ + "field":{ + "OXMTlv":{ + "field":"ipv4_dst", + "value":"10.10.20.20" + } + } + } + }, + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=2048)", + "ipv4(tos=32, proto=6, src='192.168.10.10', dst='192.168.20.20', ttl=64)", + "tcp(dst_port=2222, option=str('\\x00' * 4), src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ], + "egress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=2048)", + "ipv4(tos=32, proto=6, src='192.168.10.10', dst='10.10.20.20', ttl=64)", + "tcp(dst_port=2222, option=str('\\x00' * 4), src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ] + } + ] + }, + { + "description": "ethernet/vlan/ipv4(dst='192.168.20.20')/tcp-->'ipv4_dst=192.168.20.20,actions=set_field:10.10.20.20->ipv4_dst,output:2'", + "prerequisite":[ + { + "OFPFlowMod":{ + "table_id":0, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":2048 + } + }, + { + "OXMTlv":{ + "field":"ipv4_dst", + "value":"192.168.20.20" + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionSetField":{ + "field":{ + "OXMTlv":{ + "field":"ipv4_dst", + "value":"10.10.20.20" + } + } + } + }, + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=33024)", + "vlan(pcp=3, cfi=0, vid=100, ethertype=2048)", + "ipv4(tos=32, proto=6, src='192.168.10.10', dst='192.168.20.20', ttl=64)", + "tcp(dst_port=2222, option=str('\\x00' * 4), src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ], + "egress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=33024)", + "vlan(pcp=3, cfi=0, vid=100, ethertype=2048)", + "ipv4(tos=32, proto=6, src='192.168.10.10', dst='10.10.20.20', ttl=64)", + "tcp(dst_port=2222, option=str('\\x00' * 4), src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ] + } + ] + }, + { + "description": "ethernet/mpls/ipv4(dst='192.168.20.20')/tcp-->'actions=pop_mpls:0x0800,goto_table:1','table_id:1,ipv4_dst=192.168.20.20,actions=set_field:10.10.20.20->ipv4_dst,output:2'", + "prerequisite":[ + { + "OFPFlowMod":{ + "table_id":0, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":34887 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionPopMpls":{ + "ethertype":2048 + } + } + ], + "type":4 + } + }, + { + "OFPInstructionGotoTable":{ + "table_id":1 + } + } + ] + } + }, + { + "OFPFlowMod":{ + "table_id":1, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":2048 + } + }, + { + "OXMTlv":{ + "field":"ipv4_dst", + "value":"192.168.20.20" + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionSetField":{ + "field":{ + "OXMTlv":{ + "field":"ipv4_dst", + "value":"10.10.20.20" + } + } + } + }, + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=34887)", + "mpls(bsb=1, label=100, exp=3, ttl=64)", + "ipv4(tos=32, proto=6, src='192.168.10.10', dst='192.168.20.20', ttl=64)", + "tcp(dst_port=2222, option=str('\\x00' * 4), src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ], + "egress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=2048)", + "ipv4(tos=32, proto=6, src='192.168.10.10', dst='10.10.20.20', ttl=64)", + "tcp(dst_port=2222, option=str('\\x00' * 4), src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ] + } + ] + }, + { + "description": "ethernet/itag/ethernet/ipv4(dst='192.168.20.20')/tcp-->'actions=pop_pbb,goto_table:1','table_id:1,ipv4_dst=192.168.20.20,actions=set_field:10.10.20.20->ipv4_dst,output:2'", + "prerequisite":[ + { + "OFPFlowMod":{ + "table_id":0, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":35047 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionPopPbb":{} + } + ], + "type":4 + } + }, + { + "OFPInstructionGotoTable":{ + "table_id":1 + } + } + ] + } + }, + { + "OFPFlowMod":{ + "table_id":1, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":2048 + } + }, + { + "OXMTlv":{ + "field":"ipv4_dst", + "value":"192.168.20.20" + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionSetField":{ + "field":{ + "OXMTlv":{ + "field":"ipv4_dst", + "value":"10.10.20.20" + } + } + } + }, + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=35047)", + "itag(sid=100)", + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=2048)", + "ipv4(tos=32, proto=6, src='192.168.10.10', dst='192.168.20.20', ttl=64)", + "tcp(dst_port=2222, option=str('\\x00' * 4), src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ], + "egress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=2048)", + "ipv4(tos=32, proto=6, src='192.168.10.10', dst='10.10.20.20', ttl=64)", + "tcp(dst_port=2222, option=str('\\x00' * 4), src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ] + } + ] + } +] diff --git a/ryu/tests/switch/of14/action/25_SET_FIELD/13_TCP_SRC_IPv4.json b/ryu/tests/switch/of14/action/25_SET_FIELD/13_TCP_SRC_IPv4.json new file mode 100644 index 00000000..420ce485 --- /dev/null +++ b/ryu/tests/switch/of14/action/25_SET_FIELD/13_TCP_SRC_IPv4.json @@ -0,0 +1,374 @@ +[ + "action: set_field: 13_TCP_SRC (IPv4)", + { + "description": "ethernet/ipv4/tcp(src_port=11111)-->'tcp_src=11111,actions=set_field:12345->tcp_src,output:2'", + "prerequisite":[ + { + "OFPFlowMod":{ + "table_id":0, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":2048 + } + }, + { + "OXMTlv":{ + "field":"ip_proto", + "value":6 + } + }, + { + "OXMTlv":{ + "field":"tcp_src", + "value":11111 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionSetField":{ + "field":{ + "OXMTlv":{ + "field":"tcp_src", + "value":12345 + } + } + } + }, + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=2048)", + "ipv4(tos=32, proto=6, src='192.168.10.10', dst='192.168.20.20', ttl=64)", + "tcp(dst_port=2222, option=str('\\x00' * 4), src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ], + "egress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=2048)", + "ipv4(tos=32, proto=6, src='192.168.10.10', dst='192.168.20.20', ttl=64)", + "tcp(dst_port=2222, option=str('\\x00' * 4), src_port=12345)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ] + } + ] + }, + { + "description": "ethernet/vlan/ipv4/tcp(src_port=11111)-->'tcp_src=11111,actions=set_field:12345->tcp_src,output:2'", + "prerequisite":[ + { + "OFPFlowMod":{ + "table_id":0, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":2048 + } + }, + { + "OXMTlv":{ + "field":"ip_proto", + "value":6 + } + }, + { + "OXMTlv":{ + "field":"tcp_src", + "value":11111 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionSetField":{ + "field":{ + "OXMTlv":{ + "field":"tcp_src", + "value":12345 + } + } + } + }, + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=33024)", + "vlan(pcp=3, cfi=0, vid=100, ethertype=2048)", + "ipv4(tos=32, proto=6, src='192.168.10.10', dst='192.168.20.20', ttl=64)", + "tcp(dst_port=2222, option=str('\\x00' * 4), src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ], + "egress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=33024)", + "vlan(pcp=3, cfi=0, vid=100, ethertype=2048)", + "ipv4(tos=32, proto=6, src='192.168.10.10', dst='192.168.20.20', ttl=64)", + "tcp(dst_port=2222, option=str('\\x00' * 4), src_port=12345)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ] + } + ] + }, + { + "description": "ethernet/mpls/ipv4/tcp(src_port=11111)-->'actions=pop_mpls:0x0800,goto_table:1','table_id:1,tcp_src=11111,actions=set_field:12345->tcp_src,output:2'", + "prerequisite":[ + { + "OFPFlowMod":{ + "table_id":0, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":34887 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionPopMpls":{ + "ethertype":2048 + } + } + ], + "type":4 + } + }, + { + "OFPInstructionGotoTable":{ + "table_id":1 + } + } + ] + } + }, + { + "OFPFlowMod":{ + "table_id":1, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":2048 + } + }, + { + "OXMTlv":{ + "field":"ip_proto", + "value":6 + } + }, + { + "OXMTlv":{ + "field":"tcp_src", + "value":11111 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionSetField":{ + "field":{ + "OXMTlv":{ + "field":"tcp_src", + "value":12345 + } + } + } + }, + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=34887)", + "mpls(bsb=1, label=100, exp=3, ttl=64)", + "ipv4(tos=32, proto=6, src='192.168.10.10', dst='192.168.20.20', ttl=64)", + "tcp(dst_port=2222, option=str('\\x00' * 4), src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ], + "egress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=2048)", + "ipv4(tos=32, proto=6, src='192.168.10.10', dst='192.168.20.20', ttl=64)", + "tcp(dst_port=2222, option=str('\\x00' * 4), src_port=12345)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ] + } + ] + }, + { + "description": "ethernet/itag/ethernet/ipv4/tcp(src_port=11111)-->'actions=pop_pbb,goto_table:1','table_id:1,tcp_src=11111,actions=set_field:12345->tcp_src,output:2'", + "prerequisite":[ + { + "OFPFlowMod":{ + "table_id":0, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":35047 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionPopPbb":{} + } + ], + "type":4 + } + }, + { + "OFPInstructionGotoTable":{ + "table_id":1 + } + } + ] + } + }, + { + "OFPFlowMod":{ + "table_id":1, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":2048 + } + }, + { + "OXMTlv":{ + "field":"ip_proto", + "value":6 + } + }, + { + "OXMTlv":{ + "field":"tcp_src", + "value":11111 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionSetField":{ + "field":{ + "OXMTlv":{ + "field":"tcp_src", + "value":12345 + } + } + } + }, + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=35047)", + "itag(sid=100)", + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=2048)", + "ipv4(tos=32, proto=6, src='192.168.10.10', dst='192.168.20.20', ttl=64)", + "tcp(dst_port=2222, option=str('\\x00' * 4), src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ], + "egress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=2048)", + "ipv4(tos=32, proto=6, src='192.168.10.10', dst='192.168.20.20', ttl=64)", + "tcp(dst_port=2222, option=str('\\x00' * 4), src_port=12345)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ] + } + ] + } +] diff --git a/ryu/tests/switch/of14/action/25_SET_FIELD/13_TCP_SRC_IPv6.json b/ryu/tests/switch/of14/action/25_SET_FIELD/13_TCP_SRC_IPv6.json new file mode 100644 index 00000000..9e17530f --- /dev/null +++ b/ryu/tests/switch/of14/action/25_SET_FIELD/13_TCP_SRC_IPv6.json @@ -0,0 +1,374 @@ +[ + "action: set_field: 13_TCP_SRC (IPv6)", + { + "description": "ethernet/ipv6/tcp(src_port=11111)-->'tcp_src=11111,actions=set_field:12345->tcp_src,output:2'", + "prerequisite":[ + { + "OFPFlowMod":{ + "table_id":0, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":34525 + } + }, + { + "OXMTlv":{ + "field":"ip_proto", + "value":6 + } + }, + { + "OXMTlv":{ + "field":"tcp_src", + "value":11111 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionSetField":{ + "field":{ + "OXMTlv":{ + "field":"tcp_src", + "value":12345 + } + } + } + }, + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=34525)", + "ipv6(dst='20::20', flow_label=100, src='10::10', nxt=6, hop_limit=64, traffic_class=32)", + "tcp(dst_port=2222, option=str('\\x00' * 4), src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ], + "egress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=34525)", + "ipv6(dst='20::20', flow_label=100, src='10::10', nxt=6, hop_limit=64, traffic_class=32)", + "tcp(dst_port=2222, option=str('\\x00' * 4), src_port=12345)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ] + } + ] + }, + { + "description": "ethernet/vlan/ipv6/tcp(src_port=11111)-->'tcp_src=11111,actions=set_field:12345->tcp_src,output:2'", + "prerequisite":[ + { + "OFPFlowMod":{ + "table_id":0, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":34525 + } + }, + { + "OXMTlv":{ + "field":"ip_proto", + "value":6 + } + }, + { + "OXMTlv":{ + "field":"tcp_src", + "value":11111 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionSetField":{ + "field":{ + "OXMTlv":{ + "field":"tcp_src", + "value":12345 + } + } + } + }, + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=33024)", + "vlan(pcp=3, cfi=0, vid=100, ethertype=34525)", + "ipv6(dst='20::20', flow_label=100, src='10::10', nxt=6, hop_limit=64, traffic_class=32)", + "tcp(dst_port=2222, option=str('\\x00' * 4), src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ], + "egress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=33024)", + "vlan(pcp=3, cfi=0, vid=100, ethertype=34525)", + "ipv6(dst='20::20', flow_label=100, src='10::10', nxt=6, hop_limit=64, traffic_class=32)", + "tcp(dst_port=2222, option=str('\\x00' * 4), src_port=12345)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ] + } + ] + }, + { + "description": "ethernet/mpls/ipv6/tcp(src_port=11111)-->'actions=pop_mpls:0x86dd,goto_table:1','table_id:1,tcp_src=11111,actions=set_field:12345->tcp_src,output:2'", + "prerequisite":[ + { + "OFPFlowMod":{ + "table_id":0, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":34887 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionPopMpls":{ + "ethertype":34525 + } + } + ], + "type":4 + } + }, + { + "OFPInstructionGotoTable":{ + "table_id":1 + } + } + ] + } + }, + { + "OFPFlowMod":{ + "table_id":1, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":34525 + } + }, + { + "OXMTlv":{ + "field":"ip_proto", + "value":6 + } + }, + { + "OXMTlv":{ + "field":"tcp_src", + "value":11111 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionSetField":{ + "field":{ + "OXMTlv":{ + "field":"tcp_src", + "value":12345 + } + } + } + }, + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=34887)", + "mpls(bsb=1, label=100, exp=3, ttl=64)", + "ipv6(dst='20::20', flow_label=100, src='10::10', nxt=6, hop_limit=64, traffic_class=32)", + "tcp(dst_port=2222, option=str('\\x00' * 4), src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ], + "egress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=34525)", + "ipv6(dst='20::20', flow_label=100, src='10::10', nxt=6, hop_limit=64, traffic_class=32)", + "tcp(dst_port=2222, option=str('\\x00' * 4), src_port=12345)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ] + } + ] + }, + { + "description": "ethernet/itag/ethernet/ipv6/tcp(src_port=11111)-->'actions=pop_pbb,goto_table:1','table_id:1,tcp_src=11111,actions=set_field:12345->tcp_src,output:2'", + "prerequisite":[ + { + "OFPFlowMod":{ + "table_id":0, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":35047 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionPopPbb":{} + } + ], + "type":4 + } + }, + { + "OFPInstructionGotoTable":{ + "table_id":1 + } + } + ] + } + }, + { + "OFPFlowMod":{ + "table_id":1, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":34525 + } + }, + { + "OXMTlv":{ + "field":"ip_proto", + "value":6 + } + }, + { + "OXMTlv":{ + "field":"tcp_src", + "value":11111 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionSetField":{ + "field":{ + "OXMTlv":{ + "field":"tcp_src", + "value":12345 + } + } + } + }, + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=35047)", + "itag(sid=100)", + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=34525)", + "ipv6(dst='20::20', flow_label=100, src='10::10', nxt=6, hop_limit=64, traffic_class=32)", + "tcp(dst_port=2222, option=str('\\x00' * 4), src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ], + "egress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=34525)", + "ipv6(dst='20::20', flow_label=100, src='10::10', nxt=6, hop_limit=64, traffic_class=32)", + "tcp(dst_port=2222, option=str('\\x00' * 4), src_port=12345)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ] + } + ] + } +] diff --git a/ryu/tests/switch/of14/action/25_SET_FIELD/14_TCP_DST_IPv4.json b/ryu/tests/switch/of14/action/25_SET_FIELD/14_TCP_DST_IPv4.json new file mode 100644 index 00000000..a89f8257 --- /dev/null +++ b/ryu/tests/switch/of14/action/25_SET_FIELD/14_TCP_DST_IPv4.json @@ -0,0 +1,374 @@ +[ + "action: set_field: 14_TCP_DST (IPv4)", + { + "description": "ethernet/ipv4/tcp(dst_port=2222)-->'tcp_dst=2222,actions=set_field:6789->tcp_dst,output:2'", + "prerequisite":[ + { + "OFPFlowMod":{ + "table_id":0, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":2048 + } + }, + { + "OXMTlv":{ + "field":"ip_proto", + "value":6 + } + }, + { + "OXMTlv":{ + "field":"tcp_dst", + "value":2222 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionSetField":{ + "field":{ + "OXMTlv":{ + "field":"tcp_dst", + "value":6789 + } + } + } + }, + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=2048)", + "ipv4(tos=32, proto=6, src='192.168.10.10', dst='192.168.20.20', ttl=64)", + "tcp(dst_port=2222, option=str('\\x00' * 4), src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ], + "egress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=2048)", + "ipv4(tos=32, proto=6, src='192.168.10.10', dst='192.168.20.20', ttl=64)", + "tcp(dst_port=6789, option=str('\\x00' * 4), src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ] + } + ] + }, + { + "description": "ethernet/vlan/ipv4/tcp(dst_port=2222)-->'tcp_dst=2222,actions=set_field:6789->tcp_dst,output:2'", + "prerequisite":[ + { + "OFPFlowMod":{ + "table_id":0, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":2048 + } + }, + { + "OXMTlv":{ + "field":"ip_proto", + "value":6 + } + }, + { + "OXMTlv":{ + "field":"tcp_dst", + "value":2222 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionSetField":{ + "field":{ + "OXMTlv":{ + "field":"tcp_dst", + "value":6789 + } + } + } + }, + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=33024)", + "vlan(pcp=3, cfi=0, vid=100, ethertype=2048)", + "ipv4(tos=32, proto=6, src='192.168.10.10', dst='192.168.20.20', ttl=64)", + "tcp(dst_port=2222, option=str('\\x00' * 4), src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ], + "egress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=33024)", + "vlan(pcp=3, cfi=0, vid=100, ethertype=2048)", + "ipv4(tos=32, proto=6, src='192.168.10.10', dst='192.168.20.20', ttl=64)", + "tcp(dst_port=6789, option=str('\\x00' * 4), src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ] + } + ] + }, + { + "description": "ethernet/mpls/ipv4/tcp(dst_port=2222)-->'actions=pop_mpls:0x0800,goto_table:1','table_id:1,tcp_dst=2222,actions=set_field:6789->tcp_dst,output:2'", + "prerequisite":[ + { + "OFPFlowMod":{ + "table_id":0, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":34887 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionPopMpls":{ + "ethertype":2048 + } + } + ], + "type":4 + } + }, + { + "OFPInstructionGotoTable":{ + "table_id":1 + } + } + ] + } + }, + { + "OFPFlowMod":{ + "table_id":1, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":2048 + } + }, + { + "OXMTlv":{ + "field":"ip_proto", + "value":6 + } + }, + { + "OXMTlv":{ + "field":"tcp_dst", + "value":2222 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionSetField":{ + "field":{ + "OXMTlv":{ + "field":"tcp_dst", + "value":6789 + } + } + } + }, + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=34887)", + "mpls(bsb=1, label=100, exp=3, ttl=64)", + "ipv4(tos=32, proto=6, src='192.168.10.10', dst='192.168.20.20', ttl=64)", + "tcp(dst_port=2222, option=str('\\x00' * 4), src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ], + "egress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=2048)", + "ipv4(tos=32, proto=6, src='192.168.10.10', dst='192.168.20.20', ttl=64)", + "tcp(dst_port=6789, option=str('\\x00' * 4), src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ] + } + ] + }, + { + "description": "ethernet/itag/ethernet/ipv4/tcp(dst_port=2222)-->'actions=pop_pbb,goto_table:1','table_id:1,tcp_dst=2222,actions=set_field:6789->tcp_dst,output:2'", + "prerequisite":[ + { + "OFPFlowMod":{ + "table_id":0, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":35047 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionPopPbb":{} + } + ], + "type":4 + } + }, + { + "OFPInstructionGotoTable":{ + "table_id":1 + } + } + ] + } + }, + { + "OFPFlowMod":{ + "table_id":1, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":2048 + } + }, + { + "OXMTlv":{ + "field":"ip_proto", + "value":6 + } + }, + { + "OXMTlv":{ + "field":"tcp_dst", + "value":2222 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionSetField":{ + "field":{ + "OXMTlv":{ + "field":"tcp_dst", + "value":6789 + } + } + } + }, + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=35047)", + "itag(sid=100)", + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=2048)", + "ipv4(tos=32, proto=6, src='192.168.10.10', dst='192.168.20.20', ttl=64)", + "tcp(dst_port=2222, option=str('\\x00' * 4), src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ], + "egress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=2048)", + "ipv4(tos=32, proto=6, src='192.168.10.10', dst='192.168.20.20', ttl=64)", + "tcp(dst_port=6789, option=str('\\x00' * 4), src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ] + } + ] + } +] diff --git a/ryu/tests/switch/of14/action/25_SET_FIELD/14_TCP_DST_IPv6.json b/ryu/tests/switch/of14/action/25_SET_FIELD/14_TCP_DST_IPv6.json new file mode 100644 index 00000000..d045801c --- /dev/null +++ b/ryu/tests/switch/of14/action/25_SET_FIELD/14_TCP_DST_IPv6.json @@ -0,0 +1,374 @@ +[ + "action: set_field: 14_TCP_DST (IPv6)", + { + "description": "ethernet/ipv6/tcp(dst_port=2222)-->'tcp_dst=2222,actions=set_field:6789->tcp_dst,output:2'", + "prerequisite":[ + { + "OFPFlowMod":{ + "table_id":0, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":34525 + } + }, + { + "OXMTlv":{ + "field":"ip_proto", + "value":6 + } + }, + { + "OXMTlv":{ + "field":"tcp_dst", + "value":2222 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionSetField":{ + "field":{ + "OXMTlv":{ + "field":"tcp_dst", + "value":6789 + } + } + } + }, + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=34525)", + "ipv6(dst='20::20', flow_label=100, src='10::10', nxt=6, hop_limit=64, traffic_class=32)", + "tcp(dst_port=2222, option=str('\\x00' * 4), src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ], + "egress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=34525)", + "ipv6(dst='20::20', flow_label=100, src='10::10', nxt=6, hop_limit=64, traffic_class=32)", + "tcp(dst_port=6789, option=str('\\x00' * 4), src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ] + } + ] + }, + { + "description": "ethernet/vlan/ipv6/tcp(dst_port=2222)-->'tcp_dst=2222,actions=set_field:6789->tcp_dst,output:2'", + "prerequisite":[ + { + "OFPFlowMod":{ + "table_id":0, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":34525 + } + }, + { + "OXMTlv":{ + "field":"ip_proto", + "value":6 + } + }, + { + "OXMTlv":{ + "field":"tcp_dst", + "value":2222 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionSetField":{ + "field":{ + "OXMTlv":{ + "field":"tcp_dst", + "value":6789 + } + } + } + }, + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=33024)", + "vlan(pcp=3, cfi=0, vid=100, ethertype=34525)", + "ipv6(dst='20::20', flow_label=100, src='10::10', nxt=6, hop_limit=64, traffic_class=32)", + "tcp(dst_port=2222, option=str('\\x00' * 4), src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ], + "egress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=33024)", + "vlan(pcp=3, cfi=0, vid=100, ethertype=34525)", + "ipv6(dst='20::20', flow_label=100, src='10::10', nxt=6, hop_limit=64, traffic_class=32)", + "tcp(dst_port=6789, option=str('\\x00' * 4), src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ] + } + ] + }, + { + "description": "ethernet/mpls/ipv6/tcp(dst_port=2222)-->'actions=pop_mpls:0x86dd,goto_table:1','table_id:1,tcp_dst=2222,actions=set_field:6789->tcp_dst,output:2'", + "prerequisite":[ + { + "OFPFlowMod":{ + "table_id":0, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":34887 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionPopMpls":{ + "ethertype":34525 + } + } + ], + "type":4 + } + }, + { + "OFPInstructionGotoTable":{ + "table_id":1 + } + } + ] + } + }, + { + "OFPFlowMod":{ + "table_id":1, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":34525 + } + }, + { + "OXMTlv":{ + "field":"ip_proto", + "value":6 + } + }, + { + "OXMTlv":{ + "field":"tcp_dst", + "value":2222 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionSetField":{ + "field":{ + "OXMTlv":{ + "field":"tcp_dst", + "value":6789 + } + } + } + }, + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=34887)", + "mpls(bsb=1, label=100, exp=3, ttl=64)", + "ipv6(dst='20::20', flow_label=100, src='10::10', nxt=6, hop_limit=64, traffic_class=32)", + "tcp(dst_port=2222, option=str('\\x00' * 4), src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ], + "egress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=34525)", + "ipv6(dst='20::20', flow_label=100, src='10::10', nxt=6, hop_limit=64, traffic_class=32)", + "tcp(dst_port=6789, option=str('\\x00' * 4), src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ] + } + ] + }, + { + "description": "ethernet/itag/ethernet/ipv6/tcp(dst_port=2222)-->'actions=pop_pbb,goto_table:1','table_id:1,tcp_dst=2222,actions=set_field:6789->tcp_dst,output:2'", + "prerequisite":[ + { + "OFPFlowMod":{ + "table_id":0, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":35047 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionPopPbb":{} + } + ], + "type":4 + } + }, + { + "OFPInstructionGotoTable":{ + "table_id":1 + } + } + ] + } + }, + { + "OFPFlowMod":{ + "table_id":1, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":34525 + } + }, + { + "OXMTlv":{ + "field":"ip_proto", + "value":6 + } + }, + { + "OXMTlv":{ + "field":"tcp_dst", + "value":2222 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionSetField":{ + "field":{ + "OXMTlv":{ + "field":"tcp_dst", + "value":6789 + } + } + } + }, + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=35047)", + "itag(sid=100)", + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=34525)", + "ipv6(dst='20::20', flow_label=100, src='10::10', nxt=6, hop_limit=64, traffic_class=32)", + "tcp(dst_port=2222, option=str('\\x00' * 4), src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ], + "egress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=34525)", + "ipv6(dst='20::20', flow_label=100, src='10::10', nxt=6, hop_limit=64, traffic_class=32)", + "tcp(dst_port=6789, option=str('\\x00' * 4), src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ] + } + ] + } +] diff --git a/ryu/tests/switch/of14/action/25_SET_FIELD/15_UDP_SRC_IPv4.json b/ryu/tests/switch/of14/action/25_SET_FIELD/15_UDP_SRC_IPv4.json new file mode 100644 index 00000000..7a654351 --- /dev/null +++ b/ryu/tests/switch/of14/action/25_SET_FIELD/15_UDP_SRC_IPv4.json @@ -0,0 +1,374 @@ +[ + "action: set_field: 15_UDP_SRC (IPv4)", + { + "description": "ethernet/ipv4/udp(src_port=11111)-->'udp_src=11111,actions=set_field:12345->udp_src,output:2'", + "prerequisite":[ + { + "OFPFlowMod":{ + "table_id":0, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":2048 + } + }, + { + "OXMTlv":{ + "field":"ip_proto", + "value":17 + } + }, + { + "OXMTlv":{ + "field":"udp_src", + "value":11111 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionSetField":{ + "field":{ + "OXMTlv":{ + "field":"udp_src", + "value":12345 + } + } + } + }, + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=2048)", + "ipv4(tos=32, proto=17, src='192.168.10.10', dst='192.168.20.20', ttl=64)", + "udp(dst_port=2222, src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ], + "egress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=2048)", + "ipv4(tos=32, proto=17, src='192.168.10.10', dst='192.168.20.20', ttl=64)", + "udp(dst_port=2222, src_port=12345)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ] + } + ] + }, + { + "description": "ethernet/vlan/ipv4/udp(src_port=11111)-->'udp_src=11111,actions=set_field:12345->udp_src,output:2'", + "prerequisite":[ + { + "OFPFlowMod":{ + "table_id":0, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":2048 + } + }, + { + "OXMTlv":{ + "field":"ip_proto", + "value":17 + } + }, + { + "OXMTlv":{ + "field":"udp_src", + "value":11111 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionSetField":{ + "field":{ + "OXMTlv":{ + "field":"udp_src", + "value":12345 + } + } + } + }, + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=33024)", + "vlan(pcp=3, cfi=0, vid=100, ethertype=2048)", + "ipv4(tos=32, proto=17, src='192.168.10.10', dst='192.168.20.20', ttl=64)", + "udp(dst_port=2222, src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ], + "egress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=33024)", + "vlan(pcp=3, cfi=0, vid=100, ethertype=2048)", + "ipv4(tos=32, proto=17, src='192.168.10.10', dst='192.168.20.20', ttl=64)", + "udp(dst_port=2222, src_port=12345)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ] + } + ] + }, + { + "description": "ethernet/mpls/ipv4/udp(src_port=11111)-->'actions=pop_mpls:0x0800,goto_table:1','table_id:1,udp_src=11111,actions=set_field:12345->udp_src,output:2'", + "prerequisite":[ + { + "OFPFlowMod":{ + "table_id":0, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":34887 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionPopMpls":{ + "ethertype":2048 + } + } + ], + "type":4 + } + }, + { + "OFPInstructionGotoTable":{ + "table_id":1 + } + } + ] + } + }, + { + "OFPFlowMod":{ + "table_id":1, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":2048 + } + }, + { + "OXMTlv":{ + "field":"ip_proto", + "value":17 + } + }, + { + "OXMTlv":{ + "field":"udp_src", + "value":11111 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionSetField":{ + "field":{ + "OXMTlv":{ + "field":"udp_src", + "value":12345 + } + } + } + }, + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=34887)", + "mpls(bsb=1, label=100, exp=3, ttl=64)", + "ipv4(tos=32, proto=17, src='192.168.10.10', dst='192.168.20.20', ttl=64)", + "udp(dst_port=2222, src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ], + "egress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=2048)", + "ipv4(tos=32, proto=17, src='192.168.10.10', dst='192.168.20.20', ttl=64)", + "udp(dst_port=2222, src_port=12345)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ] + } + ] + }, + { + "description": "ethernet/itag/ethernet/ipv4/udp(src_port=11111)-->'actions=pop_pbb,goto_table:1','table_id:1,udp_src=11111,actions=set_field:12345->udp_src,output:2'", + "prerequisite":[ + { + "OFPFlowMod":{ + "table_id":0, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":35047 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionPopPbb":{} + } + ], + "type":4 + } + }, + { + "OFPInstructionGotoTable":{ + "table_id":1 + } + } + ] + } + }, + { + "OFPFlowMod":{ + "table_id":1, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":2048 + } + }, + { + "OXMTlv":{ + "field":"ip_proto", + "value":17 + } + }, + { + "OXMTlv":{ + "field":"udp_src", + "value":11111 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionSetField":{ + "field":{ + "OXMTlv":{ + "field":"udp_src", + "value":12345 + } + } + } + }, + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=35047)", + "itag(sid=100)", + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=2048)", + "ipv4(tos=32, proto=17, src='192.168.10.10', dst='192.168.20.20', ttl=64)", + "udp(dst_port=2222, src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ], + "egress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=2048)", + "ipv4(tos=32, proto=17, src='192.168.10.10', dst='192.168.20.20', ttl=64)", + "udp(dst_port=2222, src_port=12345)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ] + } + ] + } +] diff --git a/ryu/tests/switch/of14/action/25_SET_FIELD/15_UDP_SRC_IPv6.json b/ryu/tests/switch/of14/action/25_SET_FIELD/15_UDP_SRC_IPv6.json new file mode 100644 index 00000000..183c958e --- /dev/null +++ b/ryu/tests/switch/of14/action/25_SET_FIELD/15_UDP_SRC_IPv6.json @@ -0,0 +1,374 @@ +[ + "action: set_field: 15_UDP_SRC (IPv6)", + { + "description": "ethernet/ipv6/udp(src_port=11111)-->'udp_src=11111,actions=set_field:12345->udp_src,output:2'", + "prerequisite":[ + { + "OFPFlowMod":{ + "table_id":0, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":34525 + } + }, + { + "OXMTlv":{ + "field":"ip_proto", + "value":17 + } + }, + { + "OXMTlv":{ + "field":"udp_src", + "value":11111 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionSetField":{ + "field":{ + "OXMTlv":{ + "field":"udp_src", + "value":12345 + } + } + } + }, + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=34525)", + "ipv6(dst='20::20', flow_label=100, src='10::10', nxt=17, hop_limit=64, traffic_class=32)", + "udp(dst_port=2222, src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ], + "egress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=34525)", + "ipv6(dst='20::20', flow_label=100, src='10::10', nxt=17, hop_limit=64, traffic_class=32)", + "udp(dst_port=2222, src_port=12345)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ] + } + ] + }, + { + "description": "ethernet/vlan/ipv6/udp(src_port=11111)-->'udp_src=11111,actions=set_field:12345->udp_src,output:2'", + "prerequisite":[ + { + "OFPFlowMod":{ + "table_id":0, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":34525 + } + }, + { + "OXMTlv":{ + "field":"ip_proto", + "value":17 + } + }, + { + "OXMTlv":{ + "field":"udp_src", + "value":11111 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionSetField":{ + "field":{ + "OXMTlv":{ + "field":"udp_src", + "value":12345 + } + } + } + }, + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=33024)", + "vlan(pcp=3, cfi=0, vid=100, ethertype=34525)", + "ipv6(dst='20::20', flow_label=100, src='10::10', nxt=17, hop_limit=64, traffic_class=32)", + "udp(dst_port=2222, src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ], + "egress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=33024)", + "vlan(pcp=3, cfi=0, vid=100, ethertype=34525)", + "ipv6(dst='20::20', flow_label=100, src='10::10', nxt=17, hop_limit=64, traffic_class=32)", + "udp(dst_port=2222, src_port=12345)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ] + } + ] + }, + { + "description": "ethernet/mpls/ipv6/udp(src_port=11111)-->'actions=pop_mpls:0x86dd,goto_table:1','table_id:1,udp_src=11111,actions=set_field:12345->udp_src,output:2'", + "prerequisite":[ + { + "OFPFlowMod":{ + "table_id":0, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":34887 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionPopMpls":{ + "ethertype":34525 + } + } + ], + "type":4 + } + }, + { + "OFPInstructionGotoTable":{ + "table_id":1 + } + } + ] + } + }, + { + "OFPFlowMod":{ + "table_id":1, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":34525 + } + }, + { + "OXMTlv":{ + "field":"ip_proto", + "value":17 + } + }, + { + "OXMTlv":{ + "field":"udp_src", + "value":11111 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionSetField":{ + "field":{ + "OXMTlv":{ + "field":"udp_src", + "value":12345 + } + } + } + }, + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=34887)", + "mpls(bsb=1, label=100, exp=3, ttl=64)", + "ipv6(dst='20::20', flow_label=100, src='10::10', nxt=17, hop_limit=64, traffic_class=32)", + "udp(dst_port=2222, src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ], + "egress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=34525)", + "ipv6(dst='20::20', flow_label=100, src='10::10', nxt=17, hop_limit=64, traffic_class=32)", + "udp(dst_port=2222, src_port=12345)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ] + } + ] + }, + { + "description": "ethernet/itag/ethernet/ipv6/udp(src_port=11111)-->'actions=pop_pbb,goto_table:1','table_id:1,udp_src=11111,actions=set_field:12345->udp_src,output:2'", + "prerequisite":[ + { + "OFPFlowMod":{ + "table_id":0, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":35047 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionPopPbb":{} + } + ], + "type":4 + } + }, + { + "OFPInstructionGotoTable":{ + "table_id":1 + } + } + ] + } + }, + { + "OFPFlowMod":{ + "table_id":1, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":34525 + } + }, + { + "OXMTlv":{ + "field":"ip_proto", + "value":17 + } + }, + { + "OXMTlv":{ + "field":"udp_src", + "value":11111 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionSetField":{ + "field":{ + "OXMTlv":{ + "field":"udp_src", + "value":12345 + } + } + } + }, + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=35047)", + "itag(sid=100)", + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=34525)", + "ipv6(dst='20::20', flow_label=100, src='10::10', nxt=17, hop_limit=64, traffic_class=32)", + "udp(dst_port=2222, src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ], + "egress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=34525)", + "ipv6(dst='20::20', flow_label=100, src='10::10', nxt=17, hop_limit=64, traffic_class=32)", + "udp(dst_port=2222, src_port=12345)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ] + } + ] + } +] diff --git a/ryu/tests/switch/of14/action/25_SET_FIELD/16_UDP_DST_IPv4.json b/ryu/tests/switch/of14/action/25_SET_FIELD/16_UDP_DST_IPv4.json new file mode 100644 index 00000000..3aec5174 --- /dev/null +++ b/ryu/tests/switch/of14/action/25_SET_FIELD/16_UDP_DST_IPv4.json @@ -0,0 +1,374 @@ +[ + "action: set_field: 16_UDP_DST (IPv4)", + { + "description": "ethernet/ipv4/udp(dst_port=2222)-->'udp_dst=2222,actions=set_field:6789->udp_dst,output:2'", + "prerequisite":[ + { + "OFPFlowMod":{ + "table_id":0, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":2048 + } + }, + { + "OXMTlv":{ + "field":"ip_proto", + "value":17 + } + }, + { + "OXMTlv":{ + "field":"udp_dst", + "value":2222 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionSetField":{ + "field":{ + "OXMTlv":{ + "field":"udp_dst", + "value":6789 + } + } + } + }, + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=2048)", + "ipv4(tos=32, proto=17, src='192.168.10.10', dst='192.168.20.20', ttl=64)", + "udp(dst_port=2222, src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ], + "egress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=2048)", + "ipv4(tos=32, proto=17, src='192.168.10.10', dst='192.168.20.20', ttl=64)", + "udp(dst_port=6789, src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ] + } + ] + }, + { + "description": "ethernet/vlan/ipv4/udp(dst_port=2222)-->'udp_dst=2222,actions=set_field:6789->udp_dst,output:2'", + "prerequisite":[ + { + "OFPFlowMod":{ + "table_id":0, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":2048 + } + }, + { + "OXMTlv":{ + "field":"ip_proto", + "value":17 + } + }, + { + "OXMTlv":{ + "field":"udp_dst", + "value":2222 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionSetField":{ + "field":{ + "OXMTlv":{ + "field":"udp_dst", + "value":6789 + } + } + } + }, + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=33024)", + "vlan(pcp=3, cfi=0, vid=100, ethertype=2048)", + "ipv4(tos=32, proto=17, src='192.168.10.10', dst='192.168.20.20', ttl=64)", + "udp(dst_port=2222, src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ], + "egress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=33024)", + "vlan(pcp=3, cfi=0, vid=100, ethertype=2048)", + "ipv4(tos=32, proto=17, src='192.168.10.10', dst='192.168.20.20', ttl=64)", + "udp(dst_port=6789, src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ] + } + ] + }, + { + "description": "ethernet/mpls/ipv4/udp(dst_port=2222)-->'actions=pop_mpls:0x0800,goto_table:1','table_id:1,udp_dst=2222,actions=set_field:6789->udp_dst,output:2'", + "prerequisite":[ + { + "OFPFlowMod":{ + "table_id":0, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":34887 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionPopMpls":{ + "ethertype":2048 + } + } + ], + "type":4 + } + }, + { + "OFPInstructionGotoTable":{ + "table_id":1 + } + } + ] + } + }, + { + "OFPFlowMod":{ + "table_id":1, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":2048 + } + }, + { + "OXMTlv":{ + "field":"ip_proto", + "value":17 + } + }, + { + "OXMTlv":{ + "field":"udp_dst", + "value":2222 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionSetField":{ + "field":{ + "OXMTlv":{ + "field":"udp_dst", + "value":6789 + } + } + } + }, + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=34887)", + "mpls(bsb=1, label=100, exp=3, ttl=64)", + "ipv4(tos=32, proto=17, src='192.168.10.10', dst='192.168.20.20', ttl=64)", + "udp(dst_port=2222, src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ], + "egress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=2048)", + "ipv4(tos=32, proto=17, src='192.168.10.10', dst='192.168.20.20', ttl=64)", + "udp(dst_port=6789, src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ] + } + ] + }, + { + "description": "ethernet/itag/ethernet/ipv4/udp(dst_port=2222)-->'actions=pop_pbb,goto_table:1','table_id:1,udp_dst=2222,actions=set_field:6789->udp_dst,output:2'", + "prerequisite":[ + { + "OFPFlowMod":{ + "table_id":0, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":35047 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionPopPbb":{} + } + ], + "type":4 + } + }, + { + "OFPInstructionGotoTable":{ + "table_id":1 + } + } + ] + } + }, + { + "OFPFlowMod":{ + "table_id":1, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":2048 + } + }, + { + "OXMTlv":{ + "field":"ip_proto", + "value":17 + } + }, + { + "OXMTlv":{ + "field":"udp_dst", + "value":2222 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionSetField":{ + "field":{ + "OXMTlv":{ + "field":"udp_dst", + "value":6789 + } + } + } + }, + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=35047)", + "itag(sid=100)", + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=2048)", + "ipv4(tos=32, proto=17, src='192.168.10.10', dst='192.168.20.20', ttl=64)", + "udp(dst_port=2222, src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ], + "egress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=2048)", + "ipv4(tos=32, proto=17, src='192.168.10.10', dst='192.168.20.20', ttl=64)", + "udp(dst_port=6789, src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ] + } + ] + } +] diff --git a/ryu/tests/switch/of14/action/25_SET_FIELD/16_UDP_DST_IPv6.json b/ryu/tests/switch/of14/action/25_SET_FIELD/16_UDP_DST_IPv6.json new file mode 100644 index 00000000..1d11978d --- /dev/null +++ b/ryu/tests/switch/of14/action/25_SET_FIELD/16_UDP_DST_IPv6.json @@ -0,0 +1,374 @@ +[ + "action: set_field: 16_UDP_DST (IPv6)", + { + "description": "ethernet/ipv6/udp(dst_port=2222)-->'udp_dst=2222,actions=set_field:6789->udp_dst,output:2'", + "prerequisite":[ + { + "OFPFlowMod":{ + "table_id":0, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":34525 + } + }, + { + "OXMTlv":{ + "field":"ip_proto", + "value":17 + } + }, + { + "OXMTlv":{ + "field":"udp_dst", + "value":2222 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionSetField":{ + "field":{ + "OXMTlv":{ + "field":"udp_dst", + "value":6789 + } + } + } + }, + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=34525)", + "ipv6(dst='20::20', flow_label=100, src='10::10', nxt=17, hop_limit=64, traffic_class=32)", + "udp(dst_port=2222, src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ], + "egress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=34525)", + "ipv6(dst='20::20', flow_label=100, src='10::10', nxt=17, hop_limit=64, traffic_class=32)", + "udp(dst_port=6789, src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ] + } + ] + }, + { + "description": "ethernet/vlan/ipv6/udp(dst_port=2222)-->'udp_dst=2222,actions=set_field:6789->udp_dst,output:2'", + "prerequisite":[ + { + "OFPFlowMod":{ + "table_id":0, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":34525 + } + }, + { + "OXMTlv":{ + "field":"ip_proto", + "value":17 + } + }, + { + "OXMTlv":{ + "field":"udp_dst", + "value":2222 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionSetField":{ + "field":{ + "OXMTlv":{ + "field":"udp_dst", + "value":6789 + } + } + } + }, + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=33024)", + "vlan(pcp=3, cfi=0, vid=100, ethertype=34525)", + "ipv6(dst='20::20', flow_label=100, src='10::10', nxt=17, hop_limit=64, traffic_class=32)", + "udp(dst_port=2222, src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ], + "egress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=33024)", + "vlan(pcp=3, cfi=0, vid=100, ethertype=34525)", + "ipv6(dst='20::20', flow_label=100, src='10::10', nxt=17, hop_limit=64, traffic_class=32)", + "udp(dst_port=6789, src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ] + } + ] + }, + { + "description": "ethernet/mpls/ipv6/udp(dst_port=2222)-->'actions=pop_mpls:0x86dd,goto_table:1','table_id:1,udp_dst=2222,actions=set_field:6789->udp_dst,output:2'", + "prerequisite":[ + { + "OFPFlowMod":{ + "table_id":0, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":34887 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionPopMpls":{ + "ethertype":34525 + } + } + ], + "type":4 + } + }, + { + "OFPInstructionGotoTable":{ + "table_id":1 + } + } + ] + } + }, + { + "OFPFlowMod":{ + "table_id":1, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":34525 + } + }, + { + "OXMTlv":{ + "field":"ip_proto", + "value":17 + } + }, + { + "OXMTlv":{ + "field":"udp_dst", + "value":2222 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionSetField":{ + "field":{ + "OXMTlv":{ + "field":"udp_dst", + "value":6789 + } + } + } + }, + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=34887)", + "mpls(bsb=1, label=100, exp=3, ttl=64)", + "ipv6(dst='20::20', flow_label=100, src='10::10', nxt=17, hop_limit=64, traffic_class=32)", + "udp(dst_port=2222, src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ], + "egress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=34525)", + "ipv6(dst='20::20', flow_label=100, src='10::10', nxt=17, hop_limit=64, traffic_class=32)", + "udp(dst_port=6789, src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ] + } + ] + }, + { + "description": "ethernet/itag/ethernet/ipv6/udp(dst_port=2222)-->'actions=pop_pbb,goto_table:1','table_id:1,udp_dst=2222,actions=set_field:6789->udp_dst,output:2'", + "prerequisite":[ + { + "OFPFlowMod":{ + "table_id":0, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":35047 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionPopPbb":{} + } + ], + "type":4 + } + }, + { + "OFPInstructionGotoTable":{ + "table_id":1 + } + } + ] + } + }, + { + "OFPFlowMod":{ + "table_id":1, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":34525 + } + }, + { + "OXMTlv":{ + "field":"ip_proto", + "value":17 + } + }, + { + "OXMTlv":{ + "field":"udp_dst", + "value":2222 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionSetField":{ + "field":{ + "OXMTlv":{ + "field":"udp_dst", + "value":6789 + } + } + } + }, + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=35047)", + "itag(sid=100)", + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=34525)", + "ipv6(dst='20::20', flow_label=100, src='10::10', nxt=17, hop_limit=64, traffic_class=32)", + "udp(dst_port=2222, src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ], + "egress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=34525)", + "ipv6(dst='20::20', flow_label=100, src='10::10', nxt=17, hop_limit=64, traffic_class=32)", + "udp(dst_port=6789, src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ] + } + ] + } +] diff --git a/ryu/tests/switch/of14/action/25_SET_FIELD/17_SCTP_SRC_IPv4.json b/ryu/tests/switch/of14/action/25_SET_FIELD/17_SCTP_SRC_IPv4.json new file mode 100644 index 00000000..0875888f --- /dev/null +++ b/ryu/tests/switch/of14/action/25_SET_FIELD/17_SCTP_SRC_IPv4.json @@ -0,0 +1,366 @@ +[ + "action: set_field: 17_SCTP_SRC (IPv4)", + { + "description": "ethernet/ipv4/sctp(src_port=11111)-->'sctp_src=11111,actions=set_field:12345->sctp_src,output:2'", + "prerequisite":[ + { + "OFPFlowMod":{ + "table_id":0, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":2048 + } + }, + { + "OXMTlv":{ + "field":"ip_proto", + "value":132 + } + }, + { + "OXMTlv":{ + "field":"sctp_src", + "value":11111 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionSetField":{ + "field":{ + "OXMTlv":{ + "field":"sctp_src", + "value":12345 + } + } + } + }, + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=2048)", + "ipv4(tos=32, proto=132, src='192.168.10.10', dst='192.168.20.20', ttl=64)", + "sctp(chunks=[chunk_data(payload_data='0123456789abcdefghijklmnopqrstuvwxyz')], dst_port=2222, src_port=11111)" + ], + "egress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=2048)", + "ipv4(tos=32, proto=132, src='192.168.10.10', dst='192.168.20.20', ttl=64)", + "sctp(chunks=[chunk_data(payload_data='0123456789abcdefghijklmnopqrstuvwxyz')], dst_port=2222, src_port=12345)" + ] + } + ] + }, + { + "description": "ethernet/vlan/ipv4/sctp(src_port=11111)-->'sctp_src=11111,actions=set_field:12345->sctp_src,output:2'", + "prerequisite":[ + { + "OFPFlowMod":{ + "table_id":0, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":2048 + } + }, + { + "OXMTlv":{ + "field":"ip_proto", + "value":132 + } + }, + { + "OXMTlv":{ + "field":"sctp_src", + "value":11111 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionSetField":{ + "field":{ + "OXMTlv":{ + "field":"sctp_src", + "value":12345 + } + } + } + }, + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=33024)", + "vlan(pcp=3, cfi=0, vid=100, ethertype=2048)", + "ipv4(tos=32, proto=132, src='192.168.10.10', dst='192.168.20.20', ttl=64)", + "sctp(chunks=[chunk_data(payload_data='0123456789abcdefghijklmnopqrstuvwxyz')], dst_port=2222, src_port=11111)" + ], + "egress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=33024)", + "vlan(pcp=3, cfi=0, vid=100, ethertype=2048)", + "ipv4(tos=32, proto=132, src='192.168.10.10', dst='192.168.20.20', ttl=64)", + "sctp(chunks=[chunk_data(payload_data='0123456789abcdefghijklmnopqrstuvwxyz')], dst_port=2222, src_port=12345)" + ] + } + ] + }, + { + "description": "ethernet/mpls/ipv4/sctp(src_port=11111)-->'actions=pop_mpls:0x0800,goto_table:1','table_id:1,sctp_src=11111,actions=set_field:12345->sctp_src,output:2'", + "prerequisite":[ + { + "OFPFlowMod":{ + "table_id":0, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":34887 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionPopMpls":{ + "ethertype":2048 + } + } + ], + "type":4 + } + }, + { + "OFPInstructionGotoTable":{ + "table_id":1 + } + } + ] + } + }, + { + "OFPFlowMod":{ + "table_id":1, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":2048 + } + }, + { + "OXMTlv":{ + "field":"ip_proto", + "value":132 + } + }, + { + "OXMTlv":{ + "field":"sctp_src", + "value":11111 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionSetField":{ + "field":{ + "OXMTlv":{ + "field":"sctp_src", + "value":12345 + } + } + } + }, + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=34887)", + "mpls(bsb=1, label=100, exp=3, ttl=64)", + "ipv4(tos=32, proto=132, src='192.168.10.10', dst='192.168.20.20', ttl=64)", + "sctp(chunks=[chunk_data(payload_data='0123456789abcdefghijklmnopqrstuvwxyz')], dst_port=2222, src_port=11111)" + ], + "egress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=2048)", + "ipv4(tos=32, proto=132, src='192.168.10.10', dst='192.168.20.20', ttl=64)", + "sctp(chunks=[chunk_data(payload_data='0123456789abcdefghijklmnopqrstuvwxyz')], dst_port=2222, src_port=12345)" + ] + } + ] + }, + { + "description": "ethernet/itag/ethernet/ipv4/sctp(src_port=11111)-->'actions=pop_pbb,goto_table:1','table_id:1,sctp_src=11111,actions=set_field:12345->sctp_src,output:2'", + "prerequisite":[ + { + "OFPFlowMod":{ + "table_id":0, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":35047 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionPopPbb":{} + } + ], + "type":4 + } + }, + { + "OFPInstructionGotoTable":{ + "table_id":1 + } + } + ] + } + }, + { + "OFPFlowMod":{ + "table_id":1, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":2048 + } + }, + { + "OXMTlv":{ + "field":"ip_proto", + "value":132 + } + }, + { + "OXMTlv":{ + "field":"sctp_src", + "value":11111 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionSetField":{ + "field":{ + "OXMTlv":{ + "field":"sctp_src", + "value":12345 + } + } + } + }, + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=35047)", + "itag(sid=100)", + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=2048)", + "ipv4(tos=32, proto=132, src='192.168.10.10', dst='192.168.20.20', ttl=64)", + "sctp(chunks=[chunk_data(payload_data='0123456789abcdefghijklmnopqrstuvwxyz')], dst_port=2222, src_port=11111)" + ], + "egress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=2048)", + "ipv4(tos=32, proto=132, src='192.168.10.10', dst='192.168.20.20', ttl=64)", + "sctp(chunks=[chunk_data(payload_data='0123456789abcdefghijklmnopqrstuvwxyz')], dst_port=2222, src_port=12345)" + ] + } + ] + } +] diff --git a/ryu/tests/switch/of14/action/25_SET_FIELD/17_SCTP_SRC_IPv6.json b/ryu/tests/switch/of14/action/25_SET_FIELD/17_SCTP_SRC_IPv6.json new file mode 100644 index 00000000..7b0f9a7e --- /dev/null +++ b/ryu/tests/switch/of14/action/25_SET_FIELD/17_SCTP_SRC_IPv6.json @@ -0,0 +1,366 @@ +[ + "action: set_field: 17_SCTP_SRC (IPv6)", + { + "description": "ethernet/ipv6/udp(sctp_port=11111)-->'sctp_src=11111,actions=set_field:12345->sctp_src,output:2'", + "prerequisite":[ + { + "OFPFlowMod":{ + "table_id":0, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":34525 + } + }, + { + "OXMTlv":{ + "field":"ip_proto", + "value":132 + } + }, + { + "OXMTlv":{ + "field":"sctp_src", + "value":11111 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionSetField":{ + "field":{ + "OXMTlv":{ + "field":"sctp_src", + "value":12345 + } + } + } + }, + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=34525)", + "ipv6(dst='20::20', flow_label=100, src='10::10', nxt=132, hop_limit=64, traffic_class=32)", + "sctp(chunks=[chunk_data(payload_data='0123456789abcdefghijklmnopqrstuvwxyz')], dst_port=2222, src_port=11111)" + ], + "egress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=34525)", + "ipv6(dst='20::20', flow_label=100, src='10::10', nxt=132, hop_limit=64, traffic_class=32)", + "sctp(chunks=[chunk_data(payload_data='0123456789abcdefghijklmnopqrstuvwxyz')], dst_port=2222, src_port=12345)" + ] + } + ] + }, + { + "description": "ethernet/vlan/ipv6/sctp(src_port=11111)-->'sctp_src=11111,actions=set_field:12345->sctp_src,output:2'", + "prerequisite":[ + { + "OFPFlowMod":{ + "table_id":0, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":34525 + } + }, + { + "OXMTlv":{ + "field":"ip_proto", + "value":132 + } + }, + { + "OXMTlv":{ + "field":"sctp_src", + "value":11111 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionSetField":{ + "field":{ + "OXMTlv":{ + "field":"sctp_src", + "value":12345 + } + } + } + }, + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=33024)", + "vlan(pcp=3, cfi=0, vid=100, ethertype=34525)", + "ipv6(dst='20::20', flow_label=100, src='10::10', nxt=132, hop_limit=64, traffic_class=32)", + "sctp(chunks=[chunk_data(payload_data='0123456789abcdefghijklmnopqrstuvwxyz')], dst_port=2222, src_port=11111)" + ], + "egress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=33024)", + "vlan(pcp=3, cfi=0, vid=100, ethertype=34525)", + "ipv6(dst='20::20', flow_label=100, src='10::10', nxt=132, hop_limit=64, traffic_class=32)", + "sctp(chunks=[chunk_data(payload_data='0123456789abcdefghijklmnopqrstuvwxyz')], dst_port=2222, src_port=12345)" + ] + } + ] + }, + { + "description": "ethernet/mpls/ipv6/sctp(src_port=11111)-->'actions=pop_mpls:0x86dd,goto_table:1','table_id:1,sctp_src=11111,actions=set_field:12345->sctp_src,output:2'", + "prerequisite":[ + { + "OFPFlowMod":{ + "table_id":0, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":34887 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionPopMpls":{ + "ethertype":34525 + } + } + ], + "type":4 + } + }, + { + "OFPInstructionGotoTable":{ + "table_id":1 + } + } + ] + } + }, + { + "OFPFlowMod":{ + "table_id":1, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":34525 + } + }, + { + "OXMTlv":{ + "field":"ip_proto", + "value":132 + } + }, + { + "OXMTlv":{ + "field":"sctp_src", + "value":11111 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionSetField":{ + "field":{ + "OXMTlv":{ + "field":"sctp_src", + "value":12345 + } + } + } + }, + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=34887)", + "mpls(bsb=1, label=100, exp=3, ttl=64)", + "ipv6(dst='20::20', flow_label=100, src='10::10', nxt=132, hop_limit=64, traffic_class=32)", + "sctp(chunks=[chunk_data(payload_data='0123456789abcdefghijklmnopqrstuvwxyz')], dst_port=2222, src_port=11111)" + ], + "egress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=34525)", + "ipv6(dst='20::20', flow_label=100, src='10::10', nxt=132, hop_limit=64, traffic_class=32)", + "sctp(chunks=[chunk_data(payload_data='0123456789abcdefghijklmnopqrstuvwxyz')], dst_port=2222, src_port=12345)" + ] + } + ] + }, + { + "description": "ethernet/itag/ethernet/ipv6/sctp(src_port=11111)-->'actions=pop_pbb,goto_table:1','table_id:1,sctp_src=11111,actions=set_field:12345->sctp_src,output:2'", + "prerequisite":[ + { + "OFPFlowMod":{ + "table_id":0, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":35047 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionPopPbb":{} + } + ], + "type":4 + } + }, + { + "OFPInstructionGotoTable":{ + "table_id":1 + } + } + ] + } + }, + { + "OFPFlowMod":{ + "table_id":1, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":34525 + } + }, + { + "OXMTlv":{ + "field":"ip_proto", + "value":132 + } + }, + { + "OXMTlv":{ + "field":"sctp_src", + "value":11111 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionSetField":{ + "field":{ + "OXMTlv":{ + "field":"sctp_src", + "value":12345 + } + } + } + }, + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=35047)", + "itag(sid=100)", + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=34525)", + "ipv6(dst='20::20', flow_label=100, src='10::10', nxt=132, hop_limit=64, traffic_class=32)", + "sctp(chunks=[chunk_data(payload_data='0123456789abcdefghijklmnopqrstuvwxyz')], dst_port=2222, src_port=11111)" + ], + "egress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=34525)", + "ipv6(dst='20::20', flow_label=100, src='10::10', nxt=132, hop_limit=64, traffic_class=32)", + "sctp(chunks=[chunk_data(payload_data='0123456789abcdefghijklmnopqrstuvwxyz')], dst_port=2222, src_port=12345)" + ] + } + ] + } +] diff --git a/ryu/tests/switch/of14/action/25_SET_FIELD/18_SCTP_DST_IPv4.json b/ryu/tests/switch/of14/action/25_SET_FIELD/18_SCTP_DST_IPv4.json new file mode 100644 index 00000000..50a7d4c6 --- /dev/null +++ b/ryu/tests/switch/of14/action/25_SET_FIELD/18_SCTP_DST_IPv4.json @@ -0,0 +1,366 @@ +[ + "action: set_field: 18_SCTP_DST (IPv4)", + { + "description": "ethernet/ipv4/sctp(dst_port=2222)-->'sctp_dst=2222,actions=set_field:6789->sctp_dst,output:2'", + "prerequisite":[ + { + "OFPFlowMod":{ + "table_id":0, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":2048 + } + }, + { + "OXMTlv":{ + "field":"ip_proto", + "value":132 + } + }, + { + "OXMTlv":{ + "field":"sctp_dst", + "value":2222 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionSetField":{ + "field":{ + "OXMTlv":{ + "field":"sctp_dst", + "value":6789 + } + } + } + }, + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=2048)", + "ipv4(tos=32, proto=132, src='192.168.10.10', dst='192.168.20.20', ttl=64)", + "sctp(chunks=[chunk_data(payload_data='0123456789abcdefghijklmnopqrstuvwxyz')], dst_port=2222, src_port=11111)" + ], + "egress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=2048)", + "ipv4(tos=32, proto=132, src='192.168.10.10', dst='192.168.20.20', ttl=64)", + "sctp(chunks=[chunk_data(payload_data='0123456789abcdefghijklmnopqrstuvwxyz')], dst_port=6789, src_port=11111)" + ] + } + ] + }, + { + "description": "ethernet/vlan/ipv4/sctp(dst_port=2222)-->'sctp_dst=2222,actions=set_field:6789->sctp_dst,output:2'", + "prerequisite":[ + { + "OFPFlowMod":{ + "table_id":0, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":2048 + } + }, + { + "OXMTlv":{ + "field":"ip_proto", + "value":132 + } + }, + { + "OXMTlv":{ + "field":"sctp_dst", + "value":2222 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionSetField":{ + "field":{ + "OXMTlv":{ + "field":"sctp_dst", + "value":6789 + } + } + } + }, + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=33024)", + "vlan(pcp=3, cfi=0, vid=100, ethertype=2048)", + "ipv4(tos=32, proto=132, src='192.168.10.10', dst='192.168.20.20', ttl=64)", + "sctp(chunks=[chunk_data(payload_data='0123456789abcdefghijklmnopqrstuvwxyz')], dst_port=2222, src_port=11111)" + ], + "egress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=33024)", + "vlan(pcp=3, cfi=0, vid=100, ethertype=2048)", + "ipv4(tos=32, proto=132, src='192.168.10.10', dst='192.168.20.20', ttl=64)", + "sctp(chunks=[chunk_data(payload_data='0123456789abcdefghijklmnopqrstuvwxyz')], dst_port=6789, src_port=11111)" + ] + } + ] + }, + { + "description": "ethernet/mpls/ipv4/sctp(dst_port=2222)-->'actions=pop_mpls:0x0800,goto_table:1','table_id:1,sctp_dst=2222,actions=set_field:6789->sctp_dst,output:2'", + "prerequisite":[ + { + "OFPFlowMod":{ + "table_id":0, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":34887 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionPopMpls":{ + "ethertype":2048 + } + } + ], + "type":4 + } + }, + { + "OFPInstructionGotoTable":{ + "table_id":1 + } + } + ] + } + }, + { + "OFPFlowMod":{ + "table_id":1, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":2048 + } + }, + { + "OXMTlv":{ + "field":"ip_proto", + "value":132 + } + }, + { + "OXMTlv":{ + "field":"sctp_dst", + "value":2222 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionSetField":{ + "field":{ + "OXMTlv":{ + "field":"sctp_dst", + "value":6789 + } + } + } + }, + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=34887)", + "mpls(bsb=1, label=100, exp=3, ttl=64)", + "ipv4(tos=32, proto=132, src='192.168.10.10', dst='192.168.20.20', ttl=64)", + "sctp(chunks=[chunk_data(payload_data='0123456789abcdefghijklmnopqrstuvwxyz')], dst_port=2222, src_port=11111)" + ], + "egress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=2048)", + "ipv4(tos=32, proto=132, src='192.168.10.10', dst='192.168.20.20', ttl=64)", + "sctp(chunks=[chunk_data(payload_data='0123456789abcdefghijklmnopqrstuvwxyz')], dst_port=6789, src_port=11111)" + ] + } + ] + }, + { + "description": "ethernet/itag/ethernet/ipv4/sctp(dst_port=2222)-->'actions=pop_pbb,goto_table:1','table_id:1,sctp_dst=2222,actions=set_field:6789->sctp_dst,output:2'", + "prerequisite":[ + { + "OFPFlowMod":{ + "table_id":0, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":35047 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionPopPbb":{} + } + ], + "type":4 + } + }, + { + "OFPInstructionGotoTable":{ + "table_id":1 + } + } + ] + } + }, + { + "OFPFlowMod":{ + "table_id":1, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":2048 + } + }, + { + "OXMTlv":{ + "field":"ip_proto", + "value":132 + } + }, + { + "OXMTlv":{ + "field":"sctp_dst", + "value":2222 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionSetField":{ + "field":{ + "OXMTlv":{ + "field":"sctp_dst", + "value":6789 + } + } + } + }, + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=35047)", + "itag(sid=100)", + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=2048)", + "ipv4(tos=32, proto=132, src='192.168.10.10', dst='192.168.20.20', ttl=64)", + "sctp(chunks=[chunk_data(payload_data='0123456789abcdefghijklmnopqrstuvwxyz')], dst_port=2222, src_port=11111)" + ], + "egress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=2048)", + "ipv4(tos=32, proto=132, src='192.168.10.10', dst='192.168.20.20', ttl=64)", + "sctp(chunks=[chunk_data(payload_data='0123456789abcdefghijklmnopqrstuvwxyz')], dst_port=6789, src_port=11111)" + ] + } + ] + } +] diff --git a/ryu/tests/switch/of14/action/25_SET_FIELD/18_SCTP_DST_IPv6.json b/ryu/tests/switch/of14/action/25_SET_FIELD/18_SCTP_DST_IPv6.json new file mode 100644 index 00000000..8716f57c --- /dev/null +++ b/ryu/tests/switch/of14/action/25_SET_FIELD/18_SCTP_DST_IPv6.json @@ -0,0 +1,366 @@ +[ + "action: set_field: 18_SCTP_DST (IPv6)", + { + "description": "ethernet/ipv6/sctp(dst_port=2222)-->'sctp_dst=2222,actions=set_field:6789->sctp_dst,output:2'", + "prerequisite":[ + { + "OFPFlowMod":{ + "table_id":0, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":34525 + } + }, + { + "OXMTlv":{ + "field":"ip_proto", + "value":132 + } + }, + { + "OXMTlv":{ + "field":"sctp_dst", + "value":2222 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionSetField":{ + "field":{ + "OXMTlv":{ + "field":"sctp_dst", + "value":6789 + } + } + } + }, + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=34525)", + "ipv6(dst='20::20', flow_label=100, src='10::10', nxt=132, hop_limit=64, traffic_class=32)", + "sctp(chunks=[chunk_data(payload_data='0123456789abcdefghijklmnopqrstuvwxyz')], dst_port=2222, src_port=11111)" + ], + "egress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=34525)", + "ipv6(dst='20::20', flow_label=100, src='10::10', nxt=132, hop_limit=64, traffic_class=32)", + "sctp(chunks=[chunk_data(payload_data='0123456789abcdefghijklmnopqrstuvwxyz')], dst_port=6789, src_port=11111)" + ] + } + ] + }, + { + "description": "ethernet/vlan/ipv6/sctp(dst_port=2222)-->'sctp_dst=2222,actions=set_field:6789->sctp_dst,output:2'", + "prerequisite":[ + { + "OFPFlowMod":{ + "table_id":0, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":34525 + } + }, + { + "OXMTlv":{ + "field":"ip_proto", + "value":132 + } + }, + { + "OXMTlv":{ + "field":"sctp_dst", + "value":2222 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionSetField":{ + "field":{ + "OXMTlv":{ + "field":"sctp_dst", + "value":6789 + } + } + } + }, + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=33024)", + "vlan(pcp=3, cfi=0, vid=100, ethertype=34525)", + "ipv6(dst='20::20', flow_label=100, src='10::10', nxt=132, hop_limit=64, traffic_class=32)", + "sctp(chunks=[chunk_data(payload_data='0123456789abcdefghijklmnopqrstuvwxyz')], dst_port=2222, src_port=11111)" + ], + "egress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=33024)", + "vlan(pcp=3, cfi=0, vid=100, ethertype=34525)", + "ipv6(dst='20::20', flow_label=100, src='10::10', nxt=132, hop_limit=64, traffic_class=32)", + "sctp(chunks=[chunk_data(payload_data='0123456789abcdefghijklmnopqrstuvwxyz')], dst_port=6789, src_port=11111)" + ] + } + ] + }, + { + "description": "ethernet/mpls/ipv6/sctp(dst_port=2222)-->'actions=pop_mpls:0x86dd,goto_table:1','table_id:1,sctp_dst=2222,actions=set_field:6789->sctp_dst,output:2'", + "prerequisite":[ + { + "OFPFlowMod":{ + "table_id":0, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":34887 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionPopMpls":{ + "ethertype":34525 + } + } + ], + "type":4 + } + }, + { + "OFPInstructionGotoTable":{ + "table_id":1 + } + } + ] + } + }, + { + "OFPFlowMod":{ + "table_id":1, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":34525 + } + }, + { + "OXMTlv":{ + "field":"ip_proto", + "value":132 + } + }, + { + "OXMTlv":{ + "field":"sctp_dst", + "value":2222 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionSetField":{ + "field":{ + "OXMTlv":{ + "field":"sctp_dst", + "value":6789 + } + } + } + }, + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=34887)", + "mpls(bsb=1, label=100, exp=3, ttl=64)", + "ipv6(dst='20::20', flow_label=100, src='10::10', nxt=132, hop_limit=64, traffic_class=32)", + "sctp(chunks=[chunk_data(payload_data='0123456789abcdefghijklmnopqrstuvwxyz')], dst_port=2222, src_port=11111)" + ], + "egress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=34525)", + "ipv6(dst='20::20', flow_label=100, src='10::10', nxt=132, hop_limit=64, traffic_class=32)", + "sctp(chunks=[chunk_data(payload_data='0123456789abcdefghijklmnopqrstuvwxyz')], dst_port=6789, src_port=11111)" + ] + } + ] + }, + { + "description": "ethernet/itag/ethernet/ipv6/sctp(dst_port=2222)-->'actions=pop_pbb,goto_table:1','table_id:1,sctp_dst=2222,actions=set_field:6789->sctp_dst,output:2'", + "prerequisite":[ + { + "OFPFlowMod":{ + "table_id":0, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":35047 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionPopPbb":{} + } + ], + "type":4 + } + }, + { + "OFPInstructionGotoTable":{ + "table_id":1 + } + } + ] + } + }, + { + "OFPFlowMod":{ + "table_id":1, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":34525 + } + }, + { + "OXMTlv":{ + "field":"ip_proto", + "value":132 + } + }, + { + "OXMTlv":{ + "field":"sctp_dst", + "value":2222 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionSetField":{ + "field":{ + "OXMTlv":{ + "field":"sctp_dst", + "value":6789 + } + } + } + }, + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=35047)", + "itag(sid=100)", + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=34525)", + "ipv6(dst='20::20', flow_label=100, src='10::10', nxt=132, hop_limit=64, traffic_class=32)", + "sctp(chunks=[chunk_data(payload_data='0123456789abcdefghijklmnopqrstuvwxyz')], dst_port=2222, src_port=11111)" + ], + "egress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=34525)", + "ipv6(dst='20::20', flow_label=100, src='10::10', nxt=132, hop_limit=64, traffic_class=32)", + "sctp(chunks=[chunk_data(payload_data='0123456789abcdefghijklmnopqrstuvwxyz')], dst_port=6789, src_port=11111)" + ] + } + ] + } +] diff --git a/ryu/tests/switch/of14/action/25_SET_FIELD/19_ICMPV4_TYPE.json b/ryu/tests/switch/of14/action/25_SET_FIELD/19_ICMPV4_TYPE.json new file mode 100644 index 00000000..469716a6 --- /dev/null +++ b/ryu/tests/switch/of14/action/25_SET_FIELD/19_ICMPV4_TYPE.json @@ -0,0 +1,366 @@ +[ + "action: set_field: 19_ICMPV4_TYPE", + { + "description": "ethernet/ipv4/icmp(type=8)-->'icmpv4_type=8,actions=set_field:0->icmpv4_type,output:2'", + "prerequisite":[ + { + "OFPFlowMod":{ + "table_id":0, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":2048 + } + }, + { + "OXMTlv":{ + "field":"ip_proto", + "value":1 + } + }, + { + "OXMTlv":{ + "field":"icmpv4_type", + "value":8 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionSetField":{ + "field":{ + "OXMTlv":{ + "field":"icmpv4_type", + "value":0 + } + } + } + }, + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=2048)", + "ipv4(tos=32, proto=1, src='192.168.10.10', dst='192.168.20.20', ttl=64)", + "icmp(code=0,csum=0,data=echo(data='0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKL'),type_=8)" + ], + "egress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=2048)", + "ipv4(tos=32, proto=1, src='192.168.10.10', dst='192.168.20.20', ttl=64)", + "icmp(code=0,csum=0,data=echo(data='0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKL'),type_=0)" + ] + } + ] + }, + { + "description": "ethernet/vlan/ipv4/icmp(type=8)-->'icmpv4_type=8,actions=set_field:0->icmpv4_type,output:2'", + "prerequisite":[ + { + "OFPFlowMod":{ + "table_id":0, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":2048 + } + }, + { + "OXMTlv":{ + "field":"ip_proto", + "value":1 + } + }, + { + "OXMTlv":{ + "field":"icmpv4_type", + "value":8 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionSetField":{ + "field":{ + "OXMTlv":{ + "field":"icmpv4_type", + "value":0 + } + } + } + }, + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=33024)", + "vlan(pcp=3, cfi=0, vid=100, ethertype=2048)", + "ipv4(tos=32, proto=1, src='192.168.10.10', dst='192.168.20.20', ttl=64)", + "icmp(code=0,csum=0,data=echo(data='0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKL'),type_=8)" + ], + "egress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=33024)", + "vlan(pcp=3, cfi=0, vid=100, ethertype=2048)", + "ipv4(tos=32, proto=1, src='192.168.10.10', dst='192.168.20.20', ttl=64)", + "icmp(code=0,csum=0,data=echo(data='0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKL'),type_=0)" + ] + } + ] + }, + { + "description": "ethernet/mpls/ipv4/icmp(type=8)-->'actions=pop_mpls:0x0800,goto_table:1','table_id:1,icmpv4_type=8,actions=set_field:0->icmpv4_type,output:2'", + "prerequisite":[ + { + "OFPFlowMod":{ + "table_id":0, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":34887 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionPopMpls":{ + "ethertype":2048 + } + } + ], + "type":4 + } + }, + { + "OFPInstructionGotoTable":{ + "table_id":1 + } + } + ] + } + }, + { + "OFPFlowMod":{ + "table_id":1, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":2048 + } + }, + { + "OXMTlv":{ + "field":"ip_proto", + "value":1 + } + }, + { + "OXMTlv":{ + "field":"icmpv4_type", + "value":8 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionSetField":{ + "field":{ + "OXMTlv":{ + "field":"icmpv4_type", + "value":0 + } + } + } + }, + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=34887)", + "mpls(bsb=1, label=100, exp=3, ttl=64)", + "ipv4(tos=32, proto=1, src='192.168.10.10', dst='192.168.20.20', ttl=64)", + "icmp(code=0,csum=0,data=echo(data='0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKL'),type_=8)" + ], + "egress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=2048)", + "ipv4(tos=32, proto=1, src='192.168.10.10', dst='192.168.20.20', ttl=64)", + "icmp(code=0,csum=0,data=echo(data='0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKL'),type_=0)" + ] + } + ] + }, + { + "description": "ethernet/itag/ethernet/ipv4/icmp(type=8)-->'actions=pop_pbb,goto_table:1','table_id:1,icmpv4_type=8,actions=set_field:0->icmpv4_type,output:2'", + "prerequisite":[ + { + "OFPFlowMod":{ + "table_id":0, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":35047 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionPopPbb":{} + } + ], + "type":4 + } + }, + { + "OFPInstructionGotoTable":{ + "table_id":1 + } + } + ] + } + }, + { + "OFPFlowMod":{ + "table_id":1, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":2048 + } + }, + { + "OXMTlv":{ + "field":"ip_proto", + "value":1 + } + }, + { + "OXMTlv":{ + "field":"icmpv4_type", + "value":8 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionSetField":{ + "field":{ + "OXMTlv":{ + "field":"icmpv4_type", + "value":0 + } + } + } + }, + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=35047)", + "itag(sid=100)", + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=2048)", + "ipv4(tos=32, proto=1, src='192.168.10.10', dst='192.168.20.20', ttl=64)", + "icmp(code=0,csum=0,data=echo(data='0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKL'),type_=8)" + ], + "egress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=2048)", + "ipv4(tos=32, proto=1, src='192.168.10.10', dst='192.168.20.20', ttl=64)", + "icmp(code=0,csum=0,data=echo(data='0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKL'),type_=0)" + ] + } + ] + } +] diff --git a/ryu/tests/switch/of14/action/25_SET_FIELD/20_ICMPV4_CODE.json b/ryu/tests/switch/of14/action/25_SET_FIELD/20_ICMPV4_CODE.json new file mode 100644 index 00000000..3b525e0e --- /dev/null +++ b/ryu/tests/switch/of14/action/25_SET_FIELD/20_ICMPV4_CODE.json @@ -0,0 +1,366 @@ +[ + "action: set_field: 20_ICMPV4_CODE", + { + "description": "ethernet/ipv4/icmp(code=0)-->'icmpv4_code=0,actions=set_field:10->icmpv4_code,output:2'", + "prerequisite":[ + { + "OFPFlowMod":{ + "table_id":0, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":2048 + } + }, + { + "OXMTlv":{ + "field":"ip_proto", + "value":1 + } + }, + { + "OXMTlv":{ + "field":"icmpv4_code", + "value":0 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionSetField":{ + "field":{ + "OXMTlv":{ + "field":"icmpv4_code", + "value":10 + } + } + } + }, + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=2048)", + "ipv4(tos=32, proto=1, src='192.168.10.10', dst='192.168.20.20', ttl=64)", + "icmp(code=0,csum=0,data=echo(data='0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKL'),type_=8)" + ], + "egress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=2048)", + "ipv4(tos=32, proto=1, src='192.168.10.10', dst='192.168.20.20', ttl=64)", + "icmp(code=10,csum=0,data=echo(data='0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKL'),type_=8)" + ] + } + ] + }, + { + "description": "ethernet/vlan/ipv4/icmp(code=0)-->'icmpv4_code=0,actions=set_field:10->icmpv4_code,output:2'", + "prerequisite":[ + { + "OFPFlowMod":{ + "table_id":0, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":2048 + } + }, + { + "OXMTlv":{ + "field":"ip_proto", + "value":1 + } + }, + { + "OXMTlv":{ + "field":"icmpv4_code", + "value":0 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionSetField":{ + "field":{ + "OXMTlv":{ + "field":"icmpv4_code", + "value":10 + } + } + } + }, + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=33024)", + "vlan(pcp=3, cfi=0, vid=100, ethertype=2048)", + "ipv4(tos=32, proto=1, src='192.168.10.10', dst='192.168.20.20', ttl=64)", + "icmp(code=0,csum=0,data=echo(data='0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKL'),type_=8)" + ], + "egress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=33024)", + "vlan(pcp=3, cfi=0, vid=100, ethertype=2048)", + "ipv4(tos=32, proto=1, src='192.168.10.10', dst='192.168.20.20', ttl=64)", + "icmp(code=10,csum=0,data=echo(data='0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKL'),type_=8)" + ] + } + ] + }, + { + "description": "ethernet/mpls/ipv4/icmp(code=0)-->'actions=pop_mpls:0x0800,goto_table:1','table_id:1,icmpv4_code=0,actions=set_field:10->icmpv4_code,output:2'", + "prerequisite":[ + { + "OFPFlowMod":{ + "table_id":0, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":34887 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionPopMpls":{ + "ethertype":2048 + } + } + ], + "type":4 + } + }, + { + "OFPInstructionGotoTable":{ + "table_id":1 + } + } + ] + } + }, + { + "OFPFlowMod":{ + "table_id":1, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":2048 + } + }, + { + "OXMTlv":{ + "field":"ip_proto", + "value":1 + } + }, + { + "OXMTlv":{ + "field":"icmpv4_code", + "value":0 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionSetField":{ + "field":{ + "OXMTlv":{ + "field":"icmpv4_code", + "value":10 + } + } + } + }, + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=34887)", + "mpls(bsb=1, label=100, exp=3, ttl=64)", + "ipv4(tos=32, proto=1, src='192.168.10.10', dst='192.168.20.20', ttl=64)", + "icmp(code=0,csum=0,data=echo(data='0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKL'),type_=8)" + ], + "egress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=2048)", + "ipv4(tos=32, proto=1, src='192.168.10.10', dst='192.168.20.20', ttl=64)", + "icmp(code=10,csum=0,data=echo(data='0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKL'),type_=8)" + ] + } + ] + }, + { + "description": "ethernet/itag/ethernet/ipv4/icmp(code=0)-->'actions=pop_pbb,goto_table:1','table_id:1,icmpv4_code=0,actions=set_field:10->icmpv4_code,output:2'", + "prerequisite":[ + { + "OFPFlowMod":{ + "table_id":0, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":35047 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionPopPbb":{} + } + ], + "type":4 + } + }, + { + "OFPInstructionGotoTable":{ + "table_id":1 + } + } + ] + } + }, + { + "OFPFlowMod":{ + "table_id":1, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":2048 + } + }, + { + "OXMTlv":{ + "field":"ip_proto", + "value":1 + } + }, + { + "OXMTlv":{ + "field":"icmpv4_code", + "value":0 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionSetField":{ + "field":{ + "OXMTlv":{ + "field":"icmpv4_code", + "value":10 + } + } + } + }, + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=35047)", + "itag(sid=100)", + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=2048)", + "ipv4(tos=32, proto=1, src='192.168.10.10', dst='192.168.20.20', ttl=64)", + "icmp(code=0,csum=0,data=echo(data='0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKL'),type_=8)" + ], + "egress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=2048)", + "ipv4(tos=32, proto=1, src='192.168.10.10', dst='192.168.20.20', ttl=64)", + "icmp(code=10,csum=0,data=echo(data='0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKL'),type_=8)" + ] + } + ] + } +] diff --git a/ryu/tests/switch/of14/action/25_SET_FIELD/21_ARP_OP.json b/ryu/tests/switch/of14/action/25_SET_FIELD/21_ARP_OP.json new file mode 100644 index 00000000..75c237b8 --- /dev/null +++ b/ryu/tests/switch/of14/action/25_SET_FIELD/21_ARP_OP.json @@ -0,0 +1,342 @@ +[ + "action: set_field: 21_ARP_OP", + { + "description": "ethernet/arp(opcode=1)-->'arp_op=1,actions=set_field:2->arp_op,output:2'", + "prerequisite":[ + { + "OFPFlowMod":{ + "table_id":0, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":2054 + } + }, + { + "OXMTlv":{ + "field":"arp_op", + "value":1 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionSetField":{ + "field":{ + "OXMTlv":{ + "field":"arp_op", + "value":2 + } + } + } + }, + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=2054)", + "arp(dst_ip='192.168.20.20',dst_mac='22:22:22:22:22:22', opcode=1, src_ip='192.168.10.10',src_mac='12:11:11:11:11:11')", + "str('\\x00' * (60 - 42))" + ], + "egress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=2054)", + "arp(dst_ip='192.168.20.20',dst_mac='22:22:22:22:22:22', opcode=2, src_ip='192.168.10.10',src_mac='12:11:11:11:11:11')", + "str('\\x00' * (60 - 42))" + ] + } + ] + }, + { + "description": "ethernet/vlan/arp(opcode=1)-->'arp_op=1,actions=set_field:2->arp_op,output:2'", + "prerequisite":[ + { + "OFPFlowMod":{ + "table_id":0, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":2054 + } + }, + { + "OXMTlv":{ + "field":"arp_op", + "value":1 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionSetField":{ + "field":{ + "OXMTlv":{ + "field":"arp_op", + "value":2 + } + } + } + }, + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=33024)", + "vlan(pcp=3, cfi=0, vid=100, ethertype=2054)", + "arp(dst_ip='192.168.20.20',dst_mac='22:22:22:22:22:22', opcode=1, src_ip='192.168.10.10',src_mac='12:11:11:11:11:11')", + "str('\\x00' * 30)" + ], + "egress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=33024)", + "vlan(pcp=3, cfi=0, vid=100, ethertype=2054)", + "arp(dst_ip='192.168.20.20',dst_mac='22:22:22:22:22:22', opcode=2, src_ip='192.168.10.10',src_mac='12:11:11:11:11:11')", + "str('\\x00' * 30)" + ] + } + ] + }, + { + "description": "ethernet/mpls/arp(opcode=1)-->'actions=pop_mpls:0x0800,goto_table:1','table_id:1,arp_op=1,actions=set_field:2->arp_op,output:2'", + "prerequisite":[ + { + "OFPFlowMod":{ + "table_id":0, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":34887 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionPopMpls":{ + "ethertype":2054 + } + } + ], + "type":4 + } + }, + { + "OFPInstructionGotoTable":{ + "table_id":1 + } + } + ] + } + }, + { + "OFPFlowMod":{ + "table_id":1, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":2054 + } + }, + { + "OXMTlv":{ + "field":"arp_op", + "value":1 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionSetField":{ + "field":{ + "OXMTlv":{ + "field":"arp_op", + "value":2 + } + } + } + }, + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=34887)", + "mpls(bsb=1, label=100, exp=3, ttl=64)", + "arp(dst_ip='192.168.20.20',dst_mac='22:22:22:22:22:22', opcode=1, src_ip='192.168.10.10',src_mac='12:11:11:11:11:11')", + "str('\\x00' * (60 - 42))" + ], + "egress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=2054)", + "arp(dst_ip='192.168.20.20',dst_mac='22:22:22:22:22:22', opcode=2, src_ip='192.168.10.10',src_mac='12:11:11:11:11:11')", + "str('\\x00' * (60 - 42))" + ] + } + ] + }, + { + "description": "ethernet/itag/ethernet/arp(opcode=1)-->'actions=pop_pbb,goto_table:1','table_id:1,arp_op=1,actions=set_field:2->arp_op,output:2'", + "prerequisite":[ + { + "OFPFlowMod":{ + "table_id":0, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":35047 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionPopPbb":{} + } + ], + "type":4 + } + }, + { + "OFPInstructionGotoTable":{ + "table_id":1 + } + } + ] + } + }, + { + "OFPFlowMod":{ + "table_id":1, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":2054 + } + }, + { + "OXMTlv":{ + "field":"arp_op", + "value":1 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionSetField":{ + "field":{ + "OXMTlv":{ + "field":"arp_op", + "value":2 + } + } + } + }, + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=35047)", + "itag(sid=100)", + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=2054)", + "arp(dst_ip='192.168.20.20',dst_mac='22:22:22:22:22:22', opcode=1, src_ip='192.168.10.10',src_mac='12:11:11:11:11:11')", + "str('\\x00' * (60 - 42))" + ], + "egress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=2054)", + "arp(dst_ip='192.168.20.20',dst_mac='22:22:22:22:22:22', opcode=2, src_ip='192.168.10.10',src_mac='12:11:11:11:11:11')", + "str('\\x00' * (60 - 42))" + ] + } + ] + } +] diff --git a/ryu/tests/switch/of14/action/25_SET_FIELD/22_ARP_SPA.json b/ryu/tests/switch/of14/action/25_SET_FIELD/22_ARP_SPA.json new file mode 100644 index 00000000..991eb6c1 --- /dev/null +++ b/ryu/tests/switch/of14/action/25_SET_FIELD/22_ARP_SPA.json @@ -0,0 +1,342 @@ +[ + "action: set_field: 22_ARP_SPA", + { + "description": "ethernet/arp(src_ip='192.168.10.10')-->'arp_spa=192.168.10.10,actions=set_field:10.10.10.10->arp_spa,output:2'", + "prerequisite":[ + { + "OFPFlowMod":{ + "table_id":0, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":2054 + } + }, + { + "OXMTlv":{ + "field":"arp_spa", + "value":"192.168.10.10" + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionSetField":{ + "field":{ + "OXMTlv":{ + "field":"arp_spa", + "value":"10.10.10.10" + } + } + } + }, + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=2054)", + "arp(dst_ip='192.168.20.20',dst_mac='22:22:22:22:22:22', opcode=1, src_ip='192.168.10.10',src_mac='12:11:11:11:11:11')", + "str('\\x00' * (60 - 42))" + ], + "egress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=2054)", + "arp(dst_ip='192.168.20.20',dst_mac='22:22:22:22:22:22', opcode=1, src_ip='10.10.10.10',src_mac='12:11:11:11:11:11')", + "str('\\x00' * (60 - 42))" + ] + } + ] + }, + { + "description": "ethernet/vlan/arp(src_ip='192.168.10.10')-->'arp_spa=192.168.10.10,actions=set_field:10.10.10.10->arp_spa,output:2'", + "prerequisite":[ + { + "OFPFlowMod":{ + "table_id":0, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":2054 + } + }, + { + "OXMTlv":{ + "field":"arp_spa", + "value":"192.168.10.10" + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionSetField":{ + "field":{ + "OXMTlv":{ + "field":"arp_spa", + "value":"10.10.10.10" + } + } + } + }, + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=33024)", + "vlan(pcp=3, cfi=0, vid=100, ethertype=2054)", + "arp(dst_ip='192.168.20.20',dst_mac='22:22:22:22:22:22', opcode=1, src_ip='192.168.10.10',src_mac='12:11:11:11:11:11')", + "str('\\x00' * 30)" + ], + "egress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=33024)", + "vlan(pcp=3, cfi=0, vid=100, ethertype=2054)", + "arp(dst_ip='192.168.20.20',dst_mac='22:22:22:22:22:22', opcode=1, src_ip='10.10.10.10',src_mac='12:11:11:11:11:11')", + "str('\\x00' * 30)" + ] + } + ] + }, + { + "description": "ethernet/mpls/arp(src_ip='192.168.10.10')-->'actions=pop_mpls:0x0800,goto_table:1','table_id:1,arp_spa=192.168.10.10,actions=set_field:10.10.10.10->arp_spa,output:2'", + "prerequisite":[ + { + "OFPFlowMod":{ + "table_id":0, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":34887 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionPopMpls":{ + "ethertype":2054 + } + } + ], + "type":4 + } + }, + { + "OFPInstructionGotoTable":{ + "table_id":1 + } + } + ] + } + }, + { + "OFPFlowMod":{ + "table_id":1, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":2054 + } + }, + { + "OXMTlv":{ + "field":"arp_spa", + "value":"192.168.10.10" + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionSetField":{ + "field":{ + "OXMTlv":{ + "field":"arp_spa", + "value":"10.10.10.10" + } + } + } + }, + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=34887)", + "mpls(bsb=1, label=100, exp=3, ttl=64)", + "arp(dst_ip='192.168.20.20',dst_mac='22:22:22:22:22:22', opcode=1, src_ip='192.168.10.10',src_mac='12:11:11:11:11:11')", + "str('\\x00' * (60 - 42))" + ], + "egress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=2054)", + "arp(dst_ip='192.168.20.20',dst_mac='22:22:22:22:22:22', opcode=1, src_ip='10.10.10.10',src_mac='12:11:11:11:11:11')", + "str('\\x00' * (60 - 42))" + ] + } + ] + }, + { + "description": "ethernet/itag/ethernet/arp(src_ip='192.168.10.10')-->'actions=pop_pbb,goto_table:1','table_id:1,arp_spa=192.168.10.10,actions=set_field:10.10.10.10->arp_spa,output:2'", + "prerequisite":[ + { + "OFPFlowMod":{ + "table_id":0, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":35047 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionPopPbb":{} + } + ], + "type":4 + } + }, + { + "OFPInstructionGotoTable":{ + "table_id":1 + } + } + ] + } + }, + { + "OFPFlowMod":{ + "table_id":1, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":2054 + } + }, + { + "OXMTlv":{ + "field":"arp_spa", + "value":"192.168.10.10" + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionSetField":{ + "field":{ + "OXMTlv":{ + "field":"arp_spa", + "value":"10.10.10.10" + } + } + } + }, + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=35047)", + "itag(sid=100)", + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=2054)", + "arp(dst_ip='192.168.20.20',dst_mac='22:22:22:22:22:22', opcode=1, src_ip='192.168.10.10',src_mac='12:11:11:11:11:11')", + "str('\\x00' * (60 - 42))" + ], + "egress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=2054)", + "arp(dst_ip='192.168.20.20',dst_mac='22:22:22:22:22:22', opcode=1, src_ip='10.10.10.10',src_mac='12:11:11:11:11:11')", + "str('\\x00' * (60 - 42))" + ] + } + ] + } +] diff --git a/ryu/tests/switch/of14/action/25_SET_FIELD/23_ARP_TPA.json b/ryu/tests/switch/of14/action/25_SET_FIELD/23_ARP_TPA.json new file mode 100644 index 00000000..f9f34485 --- /dev/null +++ b/ryu/tests/switch/of14/action/25_SET_FIELD/23_ARP_TPA.json @@ -0,0 +1,342 @@ +[ + "action: set_field: 23_ARP_TPA", + { + "description": "ethernet/arp(dst_ip='192.168.20.20')-->'arp_tpa=192.168.20.20,actions=set_field:10.10.20.20->arp_tpa,output:2'", + "prerequisite":[ + { + "OFPFlowMod":{ + "table_id":0, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":2054 + } + }, + { + "OXMTlv":{ + "field":"arp_tpa", + "value":"192.168.20.20" + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionSetField":{ + "field":{ + "OXMTlv":{ + "field":"arp_tpa", + "value":"10.10.20.20" + } + } + } + }, + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=2054)", + "arp(dst_ip='192.168.20.20',dst_mac='22:22:22:22:22:22', opcode=1, src_ip='192.168.10.10',src_mac='12:11:11:11:11:11')", + "str('\\x00' * (60 - 42))" + ], + "egress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=2054)", + "arp(dst_ip='10.10.20.20',dst_mac='22:22:22:22:22:22', opcode=1, src_ip='192.168.10.10',src_mac='12:11:11:11:11:11')", + "str('\\x00' * (60 - 42))" + ] + } + ] + }, + { + "description": "ethernet/vlan/arp(dst_ip='192.168.20.20')-->'arp_tpa=192.168.20.20,actions=set_field:10.10.20.20->arp_tpa,output:2'", + "prerequisite":[ + { + "OFPFlowMod":{ + "table_id":0, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":2054 + } + }, + { + "OXMTlv":{ + "field":"arp_tpa", + "value":"192.168.20.20" + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionSetField":{ + "field":{ + "OXMTlv":{ + "field":"arp_tpa", + "value":"10.10.20.20" + } + } + } + }, + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=33024)", + "vlan(pcp=3, cfi=0, vid=100, ethertype=2054)", + "arp(dst_ip='192.168.20.20',dst_mac='22:22:22:22:22:22', opcode=1, src_ip='192.168.10.10',src_mac='12:11:11:11:11:11')", + "str('\\x00' * 30)" + ], + "egress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=33024)", + "vlan(pcp=3, cfi=0, vid=100, ethertype=2054)", + "arp(dst_ip='10.10.20.20',dst_mac='22:22:22:22:22:22', opcode=1, src_ip='192.168.10.10',src_mac='12:11:11:11:11:11')", + "str('\\x00' * 30)" + ] + } + ] + }, + { + "description": "ethernet/mpls/arp(dst_ip='192.168.20.20')-->'actions=pop_mpls:0x0800,goto_table:1','table_id:1,arp_tpa=192.168.20.20,actions=set_field:10.10.20.20->arp_tpa,output:2'", + "prerequisite":[ + { + "OFPFlowMod":{ + "table_id":0, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":34887 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionPopMpls":{ + "ethertype":2054 + } + } + ], + "type":4 + } + }, + { + "OFPInstructionGotoTable":{ + "table_id":1 + } + } + ] + } + }, + { + "OFPFlowMod":{ + "table_id":1, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":2054 + } + }, + { + "OXMTlv":{ + "field":"arp_tpa", + "value":"192.168.20.20" + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionSetField":{ + "field":{ + "OXMTlv":{ + "field":"arp_tpa", + "value":"10.10.20.20" + } + } + } + }, + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=34887)", + "mpls(bsb=1, label=100, exp=3, ttl=64)", + "arp(dst_ip='192.168.20.20',dst_mac='22:22:22:22:22:22', opcode=1, src_ip='192.168.10.10',src_mac='12:11:11:11:11:11')", + "str('\\x00' * (60 - 42))" + ], + "egress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=2054)", + "arp(dst_ip='10.10.20.20',dst_mac='22:22:22:22:22:22', opcode=1, src_ip='192.168.10.10',src_mac='12:11:11:11:11:11')", + "str('\\x00' * (60 - 42))" + ] + } + ] + }, + { + "description": "ethernet/itag/ethernet/arp(dst_ip='192.168.20.20')-->'actions=pop_pbb,goto_table:1','table_id:1,arp_tpa=192.168.20.20,actions=set_field:10.10.20.20->arp_tpa,output:2'", + "prerequisite":[ + { + "OFPFlowMod":{ + "table_id":0, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":35047 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionPopPbb":{} + } + ], + "type":4 + } + }, + { + "OFPInstructionGotoTable":{ + "table_id":1 + } + } + ] + } + }, + { + "OFPFlowMod":{ + "table_id":1, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":2054 + } + }, + { + "OXMTlv":{ + "field":"arp_tpa", + "value":"192.168.20.20" + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionSetField":{ + "field":{ + "OXMTlv":{ + "field":"arp_tpa", + "value":"10.10.20.20" + } + } + } + }, + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=35047)", + "itag(sid=100)", + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=2054)", + "arp(dst_ip='192.168.20.20',dst_mac='22:22:22:22:22:22', opcode=1, src_ip='192.168.10.10',src_mac='12:11:11:11:11:11')", + "str('\\x00' * (60 - 42))" + ], + "egress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=2054)", + "arp(dst_ip='10.10.20.20',dst_mac='22:22:22:22:22:22', opcode=1, src_ip='192.168.10.10',src_mac='12:11:11:11:11:11')", + "str('\\x00' * (60 - 42))" + ] + } + ] + } +] diff --git a/ryu/tests/switch/of14/action/25_SET_FIELD/24_ARP_SHA.json b/ryu/tests/switch/of14/action/25_SET_FIELD/24_ARP_SHA.json new file mode 100644 index 00000000..4f845721 --- /dev/null +++ b/ryu/tests/switch/of14/action/25_SET_FIELD/24_ARP_SHA.json @@ -0,0 +1,342 @@ +[ + "action: set_field: 24_ARP_SHA", + { + "description": "ethernet/arp(src_mac='12:11:11:11:11:11')-->'arp_sha=12:11:11:11:11:11,actions=set_field:aa:aa:aa:aa:aa:aa->arp_sha,output:2'", + "prerequisite":[ + { + "OFPFlowMod":{ + "table_id":0, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":2054 + } + }, + { + "OXMTlv":{ + "field":"arp_sha", + "value":"12:11:11:11:11:11" + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionSetField":{ + "field":{ + "OXMTlv":{ + "field":"arp_sha", + "value":"aa:aa:aa:aa:aa:aa" + } + } + } + }, + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=2054)", + "arp(dst_ip='192.168.20.20',dst_mac='22:22:22:22:22:22', opcode=1, src_ip='192.168.10.10',src_mac='12:11:11:11:11:11')", + "str('\\x00' * (60 - 42))" + ], + "egress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=2054)", + "arp(dst_ip='192.168.20.20',dst_mac='22:22:22:22:22:22', opcode=1, src_ip='192.168.10.10',src_mac='aa:aa:aa:aa:aa:aa')", + "str('\\x00' * (60 - 42))" + ] + } + ] + }, + { + "description": "ethernet/vlan/arp(src_mac='12:11:11:11:11:11')-->'arp_sha=12:11:11:11:11:11,actions=set_field:aa:aa:aa:aa:aa:aa->arp_sha,output:2'", + "prerequisite":[ + { + "OFPFlowMod":{ + "table_id":0, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":2054 + } + }, + { + "OXMTlv":{ + "field":"arp_sha", + "value":"12:11:11:11:11:11" + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionSetField":{ + "field":{ + "OXMTlv":{ + "field":"arp_sha", + "value":"aa:aa:aa:aa:aa:aa" + } + } + } + }, + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=33024)", + "vlan(pcp=3, cfi=0, vid=100, ethertype=2054)", + "arp(dst_ip='192.168.20.20',dst_mac='22:22:22:22:22:22', opcode=1, src_ip='192.168.10.10',src_mac='12:11:11:11:11:11')", + "str('\\x00' * 30)" + ], + "egress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=33024)", + "vlan(pcp=3, cfi=0, vid=100, ethertype=2054)", + "arp(dst_ip='192.168.20.20',dst_mac='22:22:22:22:22:22', opcode=1, src_ip='192.168.10.10',src_mac='aa:aa:aa:aa:aa:aa')", + "str('\\x00' * 30)" + ] + } + ] + }, + { + "description": "ethernet/mpls/arp(src_mac='12:11:11:11:11:11')-->'actions=pop_mpls:0x0800,goto_table:1','table_id:1,arp_sha=12:11:11:11:11:11,actions=set_field:aa:aa:aa:aa:aa:aa->arp_sha,output:2'", + "prerequisite":[ + { + "OFPFlowMod":{ + "table_id":0, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":34887 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionPopMpls":{ + "ethertype":2054 + } + } + ], + "type":4 + } + }, + { + "OFPInstructionGotoTable":{ + "table_id":1 + } + } + ] + } + }, + { + "OFPFlowMod":{ + "table_id":1, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":2054 + } + }, + { + "OXMTlv":{ + "field":"arp_sha", + "value":"12:11:11:11:11:11" + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionSetField":{ + "field":{ + "OXMTlv":{ + "field":"arp_sha", + "value":"aa:aa:aa:aa:aa:aa" + } + } + } + }, + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=34887)", + "mpls(bsb=1, label=100, exp=3, ttl=64)", + "arp(dst_ip='192.168.20.20',dst_mac='22:22:22:22:22:22', opcode=1, src_ip='192.168.10.10',src_mac='12:11:11:11:11:11')", + "str('\\x00' * (60 - 42))" + ], + "egress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=2054)", + "arp(dst_ip='192.168.20.20',dst_mac='22:22:22:22:22:22', opcode=1, src_ip='192.168.10.10',src_mac='aa:aa:aa:aa:aa:aa')", + "str('\\x00' * (60 - 42))" + ] + } + ] + }, + { + "description": "ethernet/itag/ethernet/arp(src_mac='12:11:11:11:11:11')-->'actions=pop_pbb,goto_table:1','table_id:1,arp_sha=12:11:11:11:11:11,actions=set_field:aa:aa:aa:aa:aa:aa->arp_sha,output:2'", + "prerequisite":[ + { + "OFPFlowMod":{ + "table_id":0, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":35047 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionPopPbb":{} + } + ], + "type":4 + } + }, + { + "OFPInstructionGotoTable":{ + "table_id":1 + } + } + ] + } + }, + { + "OFPFlowMod":{ + "table_id":1, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":2054 + } + }, + { + "OXMTlv":{ + "field":"arp_sha", + "value":"12:11:11:11:11:11" + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionSetField":{ + "field":{ + "OXMTlv":{ + "field":"arp_sha", + "value":"aa:aa:aa:aa:aa:aa" + } + } + } + }, + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=35047)", + "itag(sid=100)", + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=2054)", + "arp(dst_ip='192.168.20.20',dst_mac='22:22:22:22:22:22', opcode=1, src_ip='192.168.10.10',src_mac='12:11:11:11:11:11')", + "str('\\x00' * (60 - 42))" + ], + "egress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=2054)", + "arp(dst_ip='192.168.20.20',dst_mac='22:22:22:22:22:22', opcode=1, src_ip='192.168.10.10',src_mac='aa:aa:aa:aa:aa:aa')", + "str('\\x00' * (60 - 42))" + ] + } + ] + } +] diff --git a/ryu/tests/switch/of14/action/25_SET_FIELD/25_ARP_THA.json b/ryu/tests/switch/of14/action/25_SET_FIELD/25_ARP_THA.json new file mode 100644 index 00000000..88a879c6 --- /dev/null +++ b/ryu/tests/switch/of14/action/25_SET_FIELD/25_ARP_THA.json @@ -0,0 +1,342 @@ +[ + "action: set_field: 25_ARP_THA", + { + "description": "ethernet/arp(dst_mac='22:22:22:22:22:22')-->'arp_tha=22:22:22:22:22:22,actions=set_field:ba:bb:bb:bb:bb:bb->arp_tha,output:2'", + "prerequisite":[ + { + "OFPFlowMod":{ + "table_id":0, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":2054 + } + }, + { + "OXMTlv":{ + "field":"arp_tha", + "value":"22:22:22:22:22:22" + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionSetField":{ + "field":{ + "OXMTlv":{ + "field":"arp_tha", + "value":"ba:bb:bb:bb:bb:bb" + } + } + } + }, + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=2054)", + "arp(dst_ip='192.168.20.20',dst_mac='22:22:22:22:22:22', opcode=1, src_ip='192.168.10.10',src_mac='12:11:11:11:11:11')", + "str('\\x00' * (60 - 42))" + ], + "egress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=2054)", + "arp(dst_ip='192.168.20.20',dst_mac='ba:bb:bb:bb:bb:bb', opcode=1, src_ip='192.168.10.10',src_mac='12:11:11:11:11:11')", + "str('\\x00' * (60 - 42))" + ] + } + ] + }, + { + "description": "ethernet/vlan/arp(dst_mac='22:22:22:22:22:22')-->'arp_tha=22:22:22:22:22:22,actions=set_field:ba:bb:bb:bb:bb:bb->arp_tha,output:2'", + "prerequisite":[ + { + "OFPFlowMod":{ + "table_id":0, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":2054 + } + }, + { + "OXMTlv":{ + "field":"arp_tha", + "value":"22:22:22:22:22:22" + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionSetField":{ + "field":{ + "OXMTlv":{ + "field":"arp_tha", + "value":"ba:bb:bb:bb:bb:bb" + } + } + } + }, + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=33024)", + "vlan(pcp=3, cfi=0, vid=100, ethertype=2054)", + "arp(dst_ip='192.168.20.20',dst_mac='22:22:22:22:22:22', opcode=1, src_ip='192.168.10.10',src_mac='12:11:11:11:11:11')", + "str('\\x00' * 30)" + ], + "egress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=33024)", + "vlan(pcp=3, cfi=0, vid=100, ethertype=2054)", + "arp(dst_ip='192.168.20.20',dst_mac='ba:bb:bb:bb:bb:bb', opcode=1, src_ip='192.168.10.10',src_mac='12:11:11:11:11:11')", + "str('\\x00' * 30)" + ] + } + ] + }, + { + "description": "ethernet/mpls/arp(dst_mac='22:22:22:22:22:22')-->'actions=pop_mpls:0x0800,goto_table:1','table_id:1,arp_tha=22:22:22:22:22:22,actions=set_field:ba:bb:bb:bb:bb:bb->arp_tha,output:2'", + "prerequisite":[ + { + "OFPFlowMod":{ + "table_id":0, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":34887 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionPopMpls":{ + "ethertype":2054 + } + } + ], + "type":4 + } + }, + { + "OFPInstructionGotoTable":{ + "table_id":1 + } + } + ] + } + }, + { + "OFPFlowMod":{ + "table_id":1, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":2054 + } + }, + { + "OXMTlv":{ + "field":"arp_tha", + "value":"22:22:22:22:22:22" + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionSetField":{ + "field":{ + "OXMTlv":{ + "field":"arp_tha", + "value":"ba:bb:bb:bb:bb:bb" + } + } + } + }, + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=34887)", + "mpls(bsb=1, label=100, exp=3, ttl=64)", + "arp(dst_ip='192.168.20.20',dst_mac='22:22:22:22:22:22', opcode=1, src_ip='192.168.10.10',src_mac='12:11:11:11:11:11')", + "str('\\x00' * (60 - 42))" + ], + "egress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=2054)", + "arp(dst_ip='192.168.20.20',dst_mac='ba:bb:bb:bb:bb:bb', opcode=1, src_ip='192.168.10.10',src_mac='12:11:11:11:11:11')", + "str('\\x00' * (60 - 42))" + ] + } + ] + }, + { + "description": "ethernet/itag/ethernet/arp(dst_mac='22:22:22:22:22:22')-->'actions=pop_pbb,goto_table:1','table_id:1,arp_tha=22:22:22:22:22:22,actions=set_field:ba:bb:bb:bb:bb:bb->arp_tha,output:2'", + "prerequisite":[ + { + "OFPFlowMod":{ + "table_id":0, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":35047 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionPopPbb":{} + } + ], + "type":4 + } + }, + { + "OFPInstructionGotoTable":{ + "table_id":1 + } + } + ] + } + }, + { + "OFPFlowMod":{ + "table_id":1, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":2054 + } + }, + { + "OXMTlv":{ + "field":"arp_tha", + "value":"22:22:22:22:22:22" + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionSetField":{ + "field":{ + "OXMTlv":{ + "field":"arp_tha", + "value":"ba:bb:bb:bb:bb:bb" + } + } + } + }, + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=35047)", + "itag(sid=100)", + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=2054)", + "arp(dst_ip='192.168.20.20',dst_mac='22:22:22:22:22:22', opcode=1, src_ip='192.168.10.10',src_mac='12:11:11:11:11:11')", + "str('\\x00' * (60 - 42))" + ], + "egress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=2054)", + "arp(dst_ip='192.168.20.20',dst_mac='ba:bb:bb:bb:bb:bb', opcode=1, src_ip='192.168.10.10',src_mac='12:11:11:11:11:11')", + "str('\\x00' * (60 - 42))" + ] + } + ] + } +] diff --git a/ryu/tests/switch/of14/action/25_SET_FIELD/26_IPV6_SRC.json b/ryu/tests/switch/of14/action/25_SET_FIELD/26_IPV6_SRC.json new file mode 100644 index 00000000..2ae45a91 --- /dev/null +++ b/ryu/tests/switch/of14/action/25_SET_FIELD/26_IPV6_SRC.json @@ -0,0 +1,350 @@ +[ + "action: set_field: 26_IPV6_SRC", + { + "description": "ethernet/ipv6(src='10::10')/tcp-->'ipv6_src=10::10,actions=set_field:a0::a0->ipv6_src,output:2'", + "prerequisite":[ + { + "OFPFlowMod":{ + "table_id":0, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":34525 + } + }, + { + "OXMTlv":{ + "field":"ipv6_src", + "value":"10::10" + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionSetField":{ + "field":{ + "OXMTlv":{ + "field":"ipv6_src", + "value":"a0::a0" + } + } + } + }, + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=34525)", + "ipv6(dst='20::20', flow_label=100, src='10::10', nxt=6, hop_limit=64, traffic_class=32)", + "tcp(dst_port=2222, option=str('\\x00' * 4), src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ], + "egress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=34525)", + "ipv6(dst='20::20', flow_label=100, src='a0::a0', nxt=6, hop_limit=64, traffic_class=32)", + "tcp(dst_port=2222, option=str('\\x00' * 4), src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ] + } + ] + }, + { + "description": "ethernet/vlan/ipv6(src='10::10')/tcp-->'ipv6_src=10::10,actions=set_field:a0::a0->ipv6_src,output:2'", + "prerequisite":[ + { + "OFPFlowMod":{ + "table_id":0, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":34525 + } + }, + { + "OXMTlv":{ + "field":"ipv6_src", + "value":"10::10" + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionSetField":{ + "field":{ + "OXMTlv":{ + "field":"ipv6_src", + "value":"a0::a0" + } + } + } + }, + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=33024)", + "vlan(pcp=3, cfi=0, vid=100, ethertype=34525)", + "ipv6(dst='20::20', flow_label=100, src='10::10', nxt=6, hop_limit=64, traffic_class=32)", + "tcp(dst_port=2222, option=str('\\x00' * 4), src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ], + "egress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=33024)", + "vlan(pcp=3, cfi=0, vid=100, ethertype=34525)", + "ipv6(dst='20::20', flow_label=100, src='a0::a0', nxt=6, hop_limit=64, traffic_class=32)", + "tcp(dst_port=2222, option=str('\\x00' * 4), src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ] + } + ] + }, + { + "description": "ethernet/mpls/ipv6(src='10::10')/tcp-->'actions=pop_mpls:0x86dd,goto_table:1','table_id:1,ipv6_src=10::10,actions=set_field:a0::a0->ipv6_src,output:2'", + "prerequisite":[ + { + "OFPFlowMod":{ + "table_id":0, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":34887 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionPopMpls":{ + "ethertype":34525 + } + } + ], + "type":4 + } + }, + { + "OFPInstructionGotoTable":{ + "table_id":1 + } + } + ] + } + }, + { + "OFPFlowMod":{ + "table_id":1, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":34525 + } + }, + { + "OXMTlv":{ + "field":"ipv6_src", + "value":"10::10" + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionSetField":{ + "field":{ + "OXMTlv":{ + "field":"ipv6_src", + "value":"a0::a0" + } + } + } + }, + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=34887)", + "mpls(bsb=1, label=100, exp=3, ttl=64)", + "ipv6(dst='20::20', flow_label=100, src='10::10', nxt=6, hop_limit=64, traffic_class=32)", + "tcp(dst_port=2222, option=str('\\x00' * 4), src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ], + "egress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=34525)", + "ipv6(dst='20::20', flow_label=100, src='a0::a0', nxt=6, hop_limit=64, traffic_class=32)", + "tcp(dst_port=2222, option=str('\\x00' * 4), src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ] + } + ] + }, + { + "description": "ethernet/itag/ethernet/ipv6(src='10::10')/tcp-->'actions=pop_pbb,goto_table:1','table_id:1,ipv6_src=10::10,actions=set_field:a0::a0->ipv6_src,output:2'", + "prerequisite":[ + { + "OFPFlowMod":{ + "table_id":0, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":35047 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionPopPbb":{} + } + ], + "type":4 + } + }, + { + "OFPInstructionGotoTable":{ + "table_id":1 + } + } + ] + } + }, + { + "OFPFlowMod":{ + "table_id":1, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":34525 + } + }, + { + "OXMTlv":{ + "field":"ipv6_src", + "value":"10::10" + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionSetField":{ + "field":{ + "OXMTlv":{ + "field":"ipv6_src", + "value":"a0::a0" + } + } + } + }, + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=35047)", + "itag(sid=100)", + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=34525)", + "ipv6(dst='20::20', flow_label=100, src='10::10', nxt=6, hop_limit=64, traffic_class=32)", + "tcp(dst_port=2222, option=str('\\x00' * 4), src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ], + "egress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=34525)", + "ipv6(dst='20::20', flow_label=100, src='a0::a0', nxt=6, hop_limit=64, traffic_class=32)", + "tcp(dst_port=2222, option=str('\\x00' * 4), src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ] + } + ] + } +] diff --git a/ryu/tests/switch/of14/action/25_SET_FIELD/27_IPV6_DST.json b/ryu/tests/switch/of14/action/25_SET_FIELD/27_IPV6_DST.json new file mode 100644 index 00000000..c2e4cef6 --- /dev/null +++ b/ryu/tests/switch/of14/action/25_SET_FIELD/27_IPV6_DST.json @@ -0,0 +1,350 @@ +[ + "action: set_field: 27_IPV6_DST", + { + "description": "ethernet/ipv6(dst='20::20')/tcp-->'ipv6_dst=20::20,actions=set_field:b0::b0->ipv6_dst,output:2'", + "prerequisite":[ + { + "OFPFlowMod":{ + "table_id":0, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":34525 + } + }, + { + "OXMTlv":{ + "field":"ipv6_dst", + "value":"20::20" + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionSetField":{ + "field":{ + "OXMTlv":{ + "field":"ipv6_dst", + "value":"b0::b0" + } + } + } + }, + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=34525)", + "ipv6(dst='20::20', flow_label=100, src='10::10', nxt=6, hop_limit=64, traffic_class=32)", + "tcp(dst_port=2222, option=str('\\x00' * 4), src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ], + "egress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=34525)", + "ipv6(dst='b0::b0', flow_label=100, src='10::10', nxt=6, hop_limit=64, traffic_class=32)", + "tcp(dst_port=2222, option=str('\\x00' * 4), src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ] + } + ] + }, + { + "description": "ethernet/vlan/ipv6(dst='20::20')/tcp-->'ipv6_dst=20::20,actions=set_field:b0::b0->ipv6_dst,output:2'", + "prerequisite":[ + { + "OFPFlowMod":{ + "table_id":0, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":34525 + } + }, + { + "OXMTlv":{ + "field":"ipv6_dst", + "value":"20::20" + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionSetField":{ + "field":{ + "OXMTlv":{ + "field":"ipv6_dst", + "value":"b0::b0" + } + } + } + }, + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=33024)", + "vlan(pcp=3, cfi=0, vid=100, ethertype=34525)", + "ipv6(dst='20::20', flow_label=100, src='10::10', nxt=6, hop_limit=64, traffic_class=32)", + "tcp(dst_port=2222, option=str('\\x00' * 4), src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ], + "egress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=33024)", + "vlan(pcp=3, cfi=0, vid=100, ethertype=34525)", + "ipv6(dst='b0::b0', flow_label=100, src='10::10', nxt=6, hop_limit=64, traffic_class=32)", + "tcp(dst_port=2222, option=str('\\x00' * 4), src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ] + } + ] + }, + { + "description": "ethernet/mpls/ipv6(dst='20::20')/tcp-->'actions=pop_mpls:0x86dd,goto_table:1','table_id:1,ipv6_dst=20::20,actions=set_field:b0::b0->ipv6_dst,output:2'", + "prerequisite":[ + { + "OFPFlowMod":{ + "table_id":0, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":34887 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionPopMpls":{ + "ethertype":34525 + } + } + ], + "type":4 + } + }, + { + "OFPInstructionGotoTable":{ + "table_id":1 + } + } + ] + } + }, + { + "OFPFlowMod":{ + "table_id":1, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":34525 + } + }, + { + "OXMTlv":{ + "field":"ipv6_dst", + "value":"20::20" + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionSetField":{ + "field":{ + "OXMTlv":{ + "field":"ipv6_dst", + "value":"b0::b0" + } + } + } + }, + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=34887)", + "mpls(bsb=1, label=100, exp=3, ttl=64)", + "ipv6(dst='20::20', flow_label=100, src='10::10', nxt=6, hop_limit=64, traffic_class=32)", + "tcp(dst_port=2222, option=str('\\x00' * 4), src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ], + "egress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=34525)", + "ipv6(dst='b0::b0', flow_label=100, src='10::10', nxt=6, hop_limit=64, traffic_class=32)", + "tcp(dst_port=2222, option=str('\\x00' * 4), src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ] + } + ] + }, + { + "description": "ethernet/itag/ethernet/ipv6(dst='20::20')/tcp--->'actions=pop_pbb,goto_table:1','table_id:1,ipv6_dst=20::20,actions=set_field:b0::b0->ipv6_dst,output:2'", + "prerequisite":[ + { + "OFPFlowMod":{ + "table_id":0, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":35047 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionPopPbb":{} + } + ], + "type":4 + } + }, + { + "OFPInstructionGotoTable":{ + "table_id":1 + } + } + ] + } + }, + { + "OFPFlowMod":{ + "table_id":1, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":34525 + } + }, + { + "OXMTlv":{ + "field":"ipv6_dst", + "value":"20::20" + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionSetField":{ + "field":{ + "OXMTlv":{ + "field":"ipv6_dst", + "value":"b0::b0" + } + } + } + }, + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=35047)", + "itag(sid=100)", + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=34525)", + "ipv6(dst='20::20', flow_label=100, src='10::10', nxt=6, hop_limit=64, traffic_class=32)", + "tcp(dst_port=2222, option=str('\\x00' * 4), src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ], + "egress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=34525)", + "ipv6(dst='b0::b0', flow_label=100, src='10::10', nxt=6, hop_limit=64, traffic_class=32)", + "tcp(dst_port=2222, option=str('\\x00' * 4), src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ] + } + ] + } +] diff --git a/ryu/tests/switch/of14/action/25_SET_FIELD/28_IPV6_FLABEL.json b/ryu/tests/switch/of14/action/25_SET_FIELD/28_IPV6_FLABEL.json new file mode 100644 index 00000000..b77a9ebe --- /dev/null +++ b/ryu/tests/switch/of14/action/25_SET_FIELD/28_IPV6_FLABEL.json @@ -0,0 +1,350 @@ +[ + "action: set_field: 28_IPV6_FLABEL", + { + "description": "ethernet/ipv6(flow_label=100)/tcp-->'ipv6_flabel=100,actions=set_field:203->ipv6_flabel,output:2'", + "prerequisite":[ + { + "OFPFlowMod":{ + "table_id":0, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":34525 + } + }, + { + "OXMTlv":{ + "field":"ipv6_flabel", + "value":100 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionSetField":{ + "field":{ + "OXMTlv":{ + "field":"ipv6_flabel", + "value":203 + } + } + } + }, + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=34525)", + "ipv6(dst='20::20', flow_label=100, src='10::10', nxt=6, hop_limit=64, traffic_class=32)", + "tcp(dst_port=2222, option=str('\\x00' * 4), src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ], + "egress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=34525)", + "ipv6(dst='20::20', flow_label=203, src='10::10', nxt=6, hop_limit=64, traffic_class=32)", + "tcp(dst_port=2222, option=str('\\x00' * 4), src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ] + } + ] + }, + { + "description": "ethernet/vlan/ipv6(flow_label=100)/tcp-->'ipv6_flabel=100,actions=set_field:203->ipv6_flabel,output:2'", + "prerequisite":[ + { + "OFPFlowMod":{ + "table_id":0, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":34525 + } + }, + { + "OXMTlv":{ + "field":"ipv6_flabel", + "value":100 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionSetField":{ + "field":{ + "OXMTlv":{ + "field":"ipv6_flabel", + "value":203 + } + } + } + }, + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=33024)", + "vlan(pcp=3, cfi=0, vid=100, ethertype=34525)", + "ipv6(dst='20::20', flow_label=100, src='10::10', nxt=6, hop_limit=64, traffic_class=32)", + "tcp(dst_port=2222, option=str('\\x00' * 4), src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ], + "egress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=33024)", + "vlan(pcp=3, cfi=0, vid=100, ethertype=34525)", + "ipv6(dst='20::20', flow_label=203, src='10::10', nxt=6, hop_limit=64, traffic_class=32)", + "tcp(dst_port=2222, option=str('\\x00' * 4), src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ] + } + ] + }, + { + "description": "ethernet/mpls/ipv6(flow_label=100)/tcp-->'actions=pop_mpls:0x86dd,goto_table:1','table_id:1,ipv6_flabel=100,actions=set_field:203->ipv6_flabel,output:2'", + "prerequisite":[ + { + "OFPFlowMod":{ + "table_id":0, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":34887 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionPopMpls":{ + "ethertype":34525 + } + } + ], + "type":4 + } + }, + { + "OFPInstructionGotoTable":{ + "table_id":1 + } + } + ] + } + }, + { + "OFPFlowMod":{ + "table_id":1, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":34525 + } + }, + { + "OXMTlv":{ + "field":"ipv6_flabel", + "value":100 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionSetField":{ + "field":{ + "OXMTlv":{ + "field":"ipv6_flabel", + "value":203 + } + } + } + }, + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=34887)", + "mpls(bsb=1, label=100, exp=3, ttl=64)", + "ipv6(dst='20::20', flow_label=100, src='10::10', nxt=6, hop_limit=64, traffic_class=32)", + "tcp(dst_port=2222, option=str('\\x00' * 4), src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ], + "egress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=34525)", + "ipv6(dst='20::20', flow_label=203, src='10::10', nxt=6, hop_limit=64, traffic_class=32)", + "tcp(dst_port=2222, option=str('\\x00' * 4), src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ] + } + ] + }, + { + "description": "ethernet/itag/ethernet/ipv6(flow_label=100)/tcp-->'actions=pop_pbb,goto_table:1','table_id:1,ipv6_flabel=100,actions=set_field:203->ipv6_flabel,output:2'", + "prerequisite":[ + { + "OFPFlowMod":{ + "table_id":0, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":35047 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionPopPbb":{} + } + ], + "type":4 + } + }, + { + "OFPInstructionGotoTable":{ + "table_id":1 + } + } + ] + } + }, + { + "OFPFlowMod":{ + "table_id":1, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":34525 + } + }, + { + "OXMTlv":{ + "field":"ipv6_flabel", + "value":100 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionSetField":{ + "field":{ + "OXMTlv":{ + "field":"ipv6_flabel", + "value":203 + } + } + } + }, + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=35047)", + "itag(sid=100)", + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=34525)", + "ipv6(dst='20::20', flow_label=100, src='10::10', nxt=6, hop_limit=64, traffic_class=32)", + "tcp(dst_port=2222, option=str('\\x00' * 4), src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ], + "egress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=34525)", + "ipv6(dst='20::20', flow_label=203, src='10::10', nxt=6, hop_limit=64, traffic_class=32)", + "tcp(dst_port=2222, option=str('\\x00' * 4), src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ] + } + ] + } +] diff --git a/ryu/tests/switch/of14/action/25_SET_FIELD/29_ICMPV6_TYPE.json b/ryu/tests/switch/of14/action/25_SET_FIELD/29_ICMPV6_TYPE.json new file mode 100644 index 00000000..60f8da4f --- /dev/null +++ b/ryu/tests/switch/of14/action/25_SET_FIELD/29_ICMPV6_TYPE.json @@ -0,0 +1,366 @@ +[ + "action: set_field: 29_ICMPV6_TYPE", + { + "description": "ethernet/ipv6/icmpv6(type=128)-->'icmpv6_type=128,actions=set_field:135->icmpv6_type,output:2'", + "prerequisite":[ + { + "OFPFlowMod":{ + "table_id":0, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":34525 + } + }, + { + "OXMTlv":{ + "field":"ip_proto", + "value":58 + } + }, + { + "OXMTlv":{ + "field":"icmpv6_type", + "value":128 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionSetField":{ + "field":{ + "OXMTlv":{ + "field":"icmpv6_type", + "value":135 + } + } + } + }, + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=34525)", + "ipv6(dst='20::20', flow_label=100, src='10::10', nxt=58, hop_limit=64, traffic_class=32)", + "icmpv6(code=0,data=echo(data='\\x00\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f !\"#$%&\\'()*+,-./0123'),type_=128)" + ], + "egress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=34525)", + "ipv6(dst='20::20', flow_label=100, src='10::10', nxt=58, hop_limit=64, traffic_class=32)", + "icmpv6(code=0,data=echo(data='\\x00\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f !\"#$%&\\'()*+,-./0123'),type_=135)" + ] + } + ] + }, + { + "description": "ethernet/vlan/ipv6/icmpv6(type=128)-->'icmpv6_type=128,actions=set_field:135->icmpv6_type,output:2'", + "prerequisite":[ + { + "OFPFlowMod":{ + "table_id":0, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":34525 + } + }, + { + "OXMTlv":{ + "field":"ip_proto", + "value":58 + } + }, + { + "OXMTlv":{ + "field":"icmpv6_type", + "value":128 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionSetField":{ + "field":{ + "OXMTlv":{ + "field":"icmpv6_type", + "value":135 + } + } + } + }, + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=33024)", + "vlan(pcp=3, cfi=0, vid=100, ethertype=34525)", + "ipv6(dst='20::20', flow_label=100, src='10::10', nxt=58, hop_limit=64, traffic_class=32)", + "icmpv6(code=0,data=echo(data='\\x00\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f !\"#$%&\\'()*+,-./0123'),type_=128)" + ], + "egress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=33024)", + "vlan(pcp=3, cfi=0, vid=100, ethertype=34525)", + "ipv6(dst='20::20', flow_label=100, src='10::10', nxt=58, hop_limit=64, traffic_class=32)", + "icmpv6(code=0,data=echo(data='\\x00\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f !\"#$%&\\'()*+,-./0123'),type_=135)" + ] + } + ] + }, + { + "description": "ethernet/mpls/ipv6/icmpv6(type=128)-->'actions=pop_mpls:0x86dd,goto_table:1','table_id:1,icmpv6_type=128,actions=set_field:135->icmpv6_type,output:2'", + "prerequisite":[ + { + "OFPFlowMod":{ + "table_id":0, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":34887 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionPopMpls":{ + "ethertype":34525 + } + } + ], + "type":4 + } + }, + { + "OFPInstructionGotoTable":{ + "table_id":1 + } + } + ] + } + }, + { + "OFPFlowMod":{ + "table_id":1, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":34525 + } + }, + { + "OXMTlv":{ + "field":"ip_proto", + "value":58 + } + }, + { + "OXMTlv":{ + "field":"icmpv6_type", + "value":128 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionSetField":{ + "field":{ + "OXMTlv":{ + "field":"icmpv6_type", + "value":135 + } + } + } + }, + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=34887)", + "mpls(bsb=1, label=100, exp=3, ttl=64)", + "ipv6(dst='20::20', flow_label=100, src='10::10', nxt=58, hop_limit=64, traffic_class=32)", + "icmpv6(code=0,data=echo(data='\\x00\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f !\"#$%&\\'()*+,-./0123'),type_=128)" + ], + "egress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=34525)", + "ipv6(dst='20::20', flow_label=100, src='10::10', nxt=58, hop_limit=64, traffic_class=32)", + "icmpv6(code=0,data=echo(data='\\x00\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f !\"#$%&\\'()*+,-./0123'),type_=135)" + ] + } + ] + }, + { + "description": "ethernet/itag/ethernet/ipv6/icmpv6(type=128)-->'actions=pop_pbb,goto_table:1','table_id:1,icmpv6_type=128,actions=set_field:135->icmpv6_type,output:2'", + "prerequisite":[ + { + "OFPFlowMod":{ + "table_id":0, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":35047 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionPopPbb":{} + } + ], + "type":4 + } + }, + { + "OFPInstructionGotoTable":{ + "table_id":1 + } + } + ] + } + }, + { + "OFPFlowMod":{ + "table_id":1, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":34525 + } + }, + { + "OXMTlv":{ + "field":"ip_proto", + "value":58 + } + }, + { + "OXMTlv":{ + "field":"icmpv6_type", + "value":128 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionSetField":{ + "field":{ + "OXMTlv":{ + "field":"icmpv6_type", + "value":135 + } + } + } + }, + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=35047)", + "itag(sid=100)", + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=34525)", + "ipv6(dst='20::20', flow_label=100, src='10::10', nxt=58, hop_limit=64, traffic_class=32)", + "icmpv6(code=0,data=echo(data='\\x00\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f !\"#$%&\\'()*+,-./0123'),type_=128)" + ], + "egress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=34525)", + "ipv6(dst='20::20', flow_label=100, src='10::10', nxt=58, hop_limit=64, traffic_class=32)", + "icmpv6(code=0,data=echo(data='\\x00\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f !\"#$%&\\'()*+,-./0123'),type_=135)" + ] + } + ] + } +] diff --git a/ryu/tests/switch/of14/action/25_SET_FIELD/30_ICMPV6_CODE.json b/ryu/tests/switch/of14/action/25_SET_FIELD/30_ICMPV6_CODE.json new file mode 100644 index 00000000..7fee676c --- /dev/null +++ b/ryu/tests/switch/of14/action/25_SET_FIELD/30_ICMPV6_CODE.json @@ -0,0 +1,366 @@ +[ + "action: set_field: 30_ICMPV6_CODE", + { + "description": "ethernet/ipv6/icmpv6(code=0)-->'icmpv6_code=0,actions=set_field:1->icmpv6_code,output:2'", + "prerequisite":[ + { + "OFPFlowMod":{ + "table_id":0, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":34525 + } + }, + { + "OXMTlv":{ + "field":"ip_proto", + "value":58 + } + }, + { + "OXMTlv":{ + "field":"icmpv6_code", + "value":0 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionSetField":{ + "field":{ + "OXMTlv":{ + "field":"icmpv6_code", + "value":1 + } + } + } + }, + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=34525)", + "ipv6(dst='20::20', flow_label=100, src='10::10', nxt=58, hop_limit=64, traffic_class=32)", + "icmpv6(code=0,data=echo(data='\\x00\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f !\"#$%&\\'()*+,-./0123'),type_=128)" + ], + "egress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=34525)", + "ipv6(dst='20::20', flow_label=100, src='10::10', nxt=58, hop_limit=64, traffic_class=32)", + "icmpv6(code=1,data=echo(data='\\x00\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f !\"#$%&\\'()*+,-./0123'),type_=128)" + ] + } + ] + }, + { + "description": "ethernet/vlan/ipv6/icmpv6(code=0)-->'icmpv6_code=0,actions=set_field:1->icmpv6_code,output:2'", + "prerequisite":[ + { + "OFPFlowMod":{ + "table_id":0, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":34525 + } + }, + { + "OXMTlv":{ + "field":"ip_proto", + "value":58 + } + }, + { + "OXMTlv":{ + "field":"icmpv6_code", + "value":0 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionSetField":{ + "field":{ + "OXMTlv":{ + "field":"icmpv6_code", + "value":1 + } + } + } + }, + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=33024)", + "vlan(pcp=3, cfi=0, vid=100, ethertype=34525)", + "ipv6(dst='20::20', flow_label=100, src='10::10', nxt=58, hop_limit=64, traffic_class=32)", + "icmpv6(code=0,data=echo(data='\\x00\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f !\"#$%&\\'()*+,-./0123'),type_=128)" + ], + "egress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=33024)", + "vlan(pcp=3, cfi=0, vid=100, ethertype=34525)", + "ipv6(dst='20::20', flow_label=100, src='10::10', nxt=58, hop_limit=64, traffic_class=32)", + "icmpv6(code=1,data=echo(data='\\x00\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f !\"#$%&\\'()*+,-./0123'),type_=128)" + ] + } + ] + }, + { + "description": "ethernet/mpls/ipv6/icmpv6(code=0)-->'actions=pop_mpls:0x86dd,goto_table:1','table_id:1,icmpv6_code=0,actions=set_field:1->icmpv6_code,output:2'", + "prerequisite":[ + { + "OFPFlowMod":{ + "table_id":0, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":34887 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionPopMpls":{ + "ethertype":34525 + } + } + ], + "type":4 + } + }, + { + "OFPInstructionGotoTable":{ + "table_id":1 + } + } + ] + } + }, + { + "OFPFlowMod":{ + "table_id":1, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":34525 + } + }, + { + "OXMTlv":{ + "field":"ip_proto", + "value":58 + } + }, + { + "OXMTlv":{ + "field":"icmpv6_code", + "value":0 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionSetField":{ + "field":{ + "OXMTlv":{ + "field":"icmpv6_code", + "value":1 + } + } + } + }, + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=34887)", + "mpls(bsb=1, label=100, exp=3, ttl=64)", + "ipv6(dst='20::20', flow_label=100, src='10::10', nxt=58, hop_limit=64, traffic_class=32)", + "icmpv6(code=0,data=echo(data='\\x00\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f !\"#$%&\\'()*+,-./0123'),type_=128)" + ], + "egress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=34525)", + "ipv6(dst='20::20', flow_label=100, src='10::10', nxt=58, hop_limit=64, traffic_class=32)", + "icmpv6(code=1,data=echo(data='\\x00\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f !\"#$%&\\'()*+,-./0123'),type_=128)" + ] + } + ] + }, + { + "description": "ethernet/itag/ethernet/ipv6/icmpv6(code=0)-->'actions=pop_pbb,goto_table:1','table_id:1,icmpv6_code=0,actions=set_field:1->icmpv6_code,output:2'", + "prerequisite":[ + { + "OFPFlowMod":{ + "table_id":0, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":35047 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionPopPbb":{} + } + ], + "type":4 + } + }, + { + "OFPInstructionGotoTable":{ + "table_id":1 + } + } + ] + } + }, + { + "OFPFlowMod":{ + "table_id":1, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":34525 + } + }, + { + "OXMTlv":{ + "field":"ip_proto", + "value":58 + } + }, + { + "OXMTlv":{ + "field":"icmpv6_code", + "value":0 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionSetField":{ + "field":{ + "OXMTlv":{ + "field":"icmpv6_code", + "value":1 + } + } + } + }, + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=35047)", + "itag(sid=100)", + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=34525)", + "ipv6(dst='20::20', flow_label=100, src='10::10', nxt=58, hop_limit=64, traffic_class=32)", + "icmpv6(code=0,data=echo(data='\\x00\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f !\"#$%&\\'()*+,-./0123'),type_=128)" + ], + "egress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=34525)", + "ipv6(dst='20::20', flow_label=100, src='10::10', nxt=58, hop_limit=64, traffic_class=32)", + "icmpv6(code=1,data=echo(data='\\x00\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f !\"#$%&\\'()*+,-./0123'),type_=128)" + ] + } + ] + } +] diff --git a/ryu/tests/switch/of14/action/25_SET_FIELD/31_IPV6_ND_TARGET.json b/ryu/tests/switch/of14/action/25_SET_FIELD/31_IPV6_ND_TARGET.json new file mode 100644 index 00000000..521c98d6 --- /dev/null +++ b/ryu/tests/switch/of14/action/25_SET_FIELD/31_IPV6_ND_TARGET.json @@ -0,0 +1,390 @@ +[ + "action: set_field: 31_IPV6_ND_TARGET", + { + "description": "ethernet/ipv6/icmpv6(data=nd_neighbor(dst='20::20'))-->'ipv6_nd_target=20::20,actions=set_field:a0::a0->ipv6_nd_target,output:2'", + "prerequisite":[ + { + "OFPFlowMod":{ + "table_id":0, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":34525 + } + }, + { + "OXMTlv":{ + "field":"ip_proto", + "value":58 + } + }, + { + "OXMTlv":{ + "field":"icmpv6_type", + "value":135 + } + }, + { + "OXMTlv":{ + "field":"ipv6_nd_target", + "value":"20::20" + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionSetField":{ + "field":{ + "OXMTlv":{ + "field":"ipv6_nd_target", + "value":"a0::a0" + } + } + } + }, + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=34525)", + "ipv6(dst='20::20', flow_label=100, src='10::10', nxt=58, hop_limit=64, traffic_class=32)", + "icmpv6(code=0,data=nd_neighbor(option=nd_option_sla(hw_src='12:11:11:11:11:11'),dst='20::20'),type_=135)" + ], + "egress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=34525)", + "ipv6(dst='20::20', flow_label=100, src='10::10', nxt=58, hop_limit=64, traffic_class=32)", + "icmpv6(code=0,data=nd_neighbor(option=nd_option_sla(hw_src='12:11:11:11:11:11'),dst='a0::a0'),type_=135)" + ] + } + ] + }, + { + "description": "ethernet/vlan/ipv6/icmpv6(data=nd_neighbor(dst='20::20'))-->'ipv6_nd_target=20::20,actions=set_field:a0::a0->ipv6_nd_target,output:2'", + "prerequisite":[ + { + "OFPFlowMod":{ + "table_id":0, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":34525 + } + }, + { + "OXMTlv":{ + "field":"ip_proto", + "value":58 + } + }, + { + "OXMTlv":{ + "field":"icmpv6_type", + "value":135 + } + }, + { + "OXMTlv":{ + "field":"ipv6_nd_target", + "value":"20::20" + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionSetField":{ + "field":{ + "OXMTlv":{ + "field":"ipv6_nd_target", + "value":"a0::a0" + } + } + } + }, + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=33024)", + "vlan(pcp=3, cfi=0, vid=100, ethertype=34525)", + "ipv6(dst='20::20', flow_label=100, src='10::10', nxt=58, hop_limit=64, traffic_class=32)", + "icmpv6(code=0,data=nd_neighbor(option=nd_option_sla(hw_src='12:11:11:11:11:11'),dst='20::20'),type_=135)" + ], + "egress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=33024)", + "vlan(pcp=3, cfi=0, vid=100, ethertype=34525)", + "ipv6(dst='20::20', flow_label=100, src='10::10', nxt=58, hop_limit=64, traffic_class=32)", + "icmpv6(code=0,data=nd_neighbor(option=nd_option_sla(hw_src='12:11:11:11:11:11'),dst='a0::a0'),type_=135)" + ] + } + ] + }, + { + "description": "ethernet/mpls/ipv6/icmpv6(data=nd_neighbor(dst='20::20'))-->'actions=pop_mpls:0x86dd,goto_table:1','table_id:1,ipv6_nd_target=20::20,actions=set_field:a0::a0->ipv6_nd_target,output:2'", + "prerequisite":[ + { + "OFPFlowMod":{ + "table_id":0, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":34887 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionPopMpls":{ + "ethertype":34525 + } + } + ], + "type":4 + } + }, + { + "OFPInstructionGotoTable":{ + "table_id":1 + } + } + ] + } + }, + { + "OFPFlowMod":{ + "table_id":1, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":34525 + } + }, + { + "OXMTlv":{ + "field":"ip_proto", + "value":58 + } + }, + { + "OXMTlv":{ + "field":"icmpv6_type", + "value":135 + } + }, + { + "OXMTlv":{ + "field":"ipv6_nd_target", + "value":"20::20" + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionSetField":{ + "field":{ + "OXMTlv":{ + "field":"ipv6_nd_target", + "value":"a0::a0" + } + } + } + }, + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=34887)", + "mpls(bsb=1, label=100, exp=3, ttl=64)", + "ipv6(dst='20::20', flow_label=100, src='10::10', nxt=58, hop_limit=64, traffic_class=32)", + "icmpv6(code=0,data=nd_neighbor(option=nd_option_sla(hw_src='12:11:11:11:11:11'),dst='20::20'),type_=135)" + ], + "egress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=34525)", + "ipv6(dst='20::20', flow_label=100, src='10::10', nxt=58, hop_limit=64, traffic_class=32)", + "icmpv6(code=0,data=nd_neighbor(option=nd_option_sla(hw_src='12:11:11:11:11:11'),dst='a0::a0'),type_=135)" + ] + } + ] + }, + { + "description": "ethernet/itag/ethernet/ipv6/icmpv6(data=nd_neighbor(dst='20::20'))-->'actions=pop_pbb,goto_table:1','table_id:1,ipv6_nd_target=20::20,actions=set_field:a0::a0->ipv6_nd_target,output:2'", + "prerequisite":[ + { + "OFPFlowMod":{ + "table_id":0, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":35047 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionPopPbb":{} + } + ], + "type":4 + } + }, + { + "OFPInstructionGotoTable":{ + "table_id":1 + } + } + ] + } + }, + { + "OFPFlowMod":{ + "table_id":1, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":34525 + } + }, + { + "OXMTlv":{ + "field":"ip_proto", + "value":58 + } + }, + { + "OXMTlv":{ + "field":"icmpv6_type", + "value":135 + } + }, + { + "OXMTlv":{ + "field":"ipv6_nd_target", + "value":"20::20" + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionSetField":{ + "field":{ + "OXMTlv":{ + "field":"ipv6_nd_target", + "value":"a0::a0" + } + } + } + }, + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=35047)", + "itag(sid=100)", + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=34525)", + "ipv6(dst='20::20', flow_label=100, src='10::10', nxt=58, hop_limit=64, traffic_class=32)", + "icmpv6(code=0,data=nd_neighbor(option=nd_option_sla(hw_src='12:11:11:11:11:11'),dst='20::20'),type_=135)" + ], + "egress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=34525)", + "ipv6(dst='20::20', flow_label=100, src='10::10', nxt=58, hop_limit=64, traffic_class=32)", + "icmpv6(code=0,data=nd_neighbor(option=nd_option_sla(hw_src='12:11:11:11:11:11'),dst='a0::a0'),type_=135)" + ] + } + ] + } +] diff --git a/ryu/tests/switch/of14/action/25_SET_FIELD/32_IPV6_ND_SLL.json b/ryu/tests/switch/of14/action/25_SET_FIELD/32_IPV6_ND_SLL.json new file mode 100644 index 00000000..9577cf6e --- /dev/null +++ b/ryu/tests/switch/of14/action/25_SET_FIELD/32_IPV6_ND_SLL.json @@ -0,0 +1,390 @@ +[ + "action: set_field: 32_IPV6_ND_SLL", + { + "description": "ethernet/ipv6/icmpv6(data=nd_neighbor(option=nd_option_sla(hw_src='22:22:22:22:22:22')))-->'ipv6_nd_sll=22:22:22:22:22:22,actions=set_field:aa:aa:aa:aa:aa:aa->ipv6_nd_sll,output:2'", + "prerequisite":[ + { + "OFPFlowMod":{ + "table_id":0, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":34525 + } + }, + { + "OXMTlv":{ + "field":"ip_proto", + "value":58 + } + }, + { + "OXMTlv":{ + "field":"icmpv6_type", + "value":135 + } + }, + { + "OXMTlv":{ + "field":"ipv6_nd_sll", + "value":"22:22:22:22:22:22" + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionSetField":{ + "field":{ + "OXMTlv":{ + "field":"ipv6_nd_sll", + "value":"aa:aa:aa:aa:aa:aa" + } + } + } + }, + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=34525)", + "ipv6(dst='20::20', flow_label=100, src='10::10', nxt=58, hop_limit=64, traffic_class=32)", + "icmpv6(code=0,data=nd_neighbor(option=nd_option_sla(hw_src='22:22:22:22:22:22'),dst='20::20'),type_=135)" + ], + "egress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=34525)", + "ipv6(dst='20::20', flow_label=100, src='10::10', nxt=58, hop_limit=64, traffic_class=32)", + "icmpv6(code=0,data=nd_neighbor(option=nd_option_sla(hw_src='aa:aa:aa:aa:aa:aa'),dst='20::20'),type_=135)" + ] + } + ] + }, + { + "description": "ethernet/vlan/ipv6/icmpv6(data=nd_neighbor(option=nd_option_sla(hw_src='22:22:22:22:22:22')))-->'ipv6_nd_sll=12:11:11:11:11,actions=set_field:aa:aa:aa:aa:aa:aa->ipv6_nd_sll,output:2'", + "prerequisite":[ + { + "OFPFlowMod":{ + "table_id":0, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":34525 + } + }, + { + "OXMTlv":{ + "field":"ip_proto", + "value":58 + } + }, + { + "OXMTlv":{ + "field":"icmpv6_type", + "value":135 + } + }, + { + "OXMTlv":{ + "field":"ipv6_nd_sll", + "value":"22:22:22:22:22:22" + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionSetField":{ + "field":{ + "OXMTlv":{ + "field":"ipv6_nd_sll", + "value":"aa:aa:aa:aa:aa:aa" + } + } + } + }, + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=33024)", + "vlan(pcp=3, cfi=0, vid=100, ethertype=34525)", + "ipv6(dst='20::20', flow_label=100, src='10::10', nxt=58, hop_limit=64, traffic_class=32)", + "icmpv6(code=0,data=nd_neighbor(option=nd_option_sla(hw_src='22:22:22:22:22:22'),dst='20::20'),type_=135)" + ], + "egress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=33024)", + "vlan(pcp=3, cfi=0, vid=100, ethertype=34525)", + "ipv6(dst='20::20', flow_label=100, src='10::10', nxt=58, hop_limit=64, traffic_class=32)", + "icmpv6(code=0,data=nd_neighbor(option=nd_option_sla(hw_src='aa:aa:aa:aa:aa:aa'),dst='20::20'),type_=135)" + ] + } + ] + }, + { + "description": "ethernet/mpls/ipv6/icmpv6(data=nd_neighbor(option=nd_option_sla(hw_src='22:22:22:22:22:22')))-->'actions=pop_mpls:0x86dd,goto_table:1','table_id:1,ipv6_nd_sll=22:22:22:22:22:22,actions=set_field:aa:aa:aa:aa:aa:aa->ipv6_nd_sll,output:2'", + "prerequisite":[ + { + "OFPFlowMod":{ + "table_id":0, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":34887 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionPopMpls":{ + "ethertype":34525 + } + } + ], + "type":4 + } + }, + { + "OFPInstructionGotoTable":{ + "table_id":1 + } + } + ] + } + }, + { + "OFPFlowMod":{ + "table_id":1, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":34525 + } + }, + { + "OXMTlv":{ + "field":"ip_proto", + "value":58 + } + }, + { + "OXMTlv":{ + "field":"icmpv6_type", + "value":135 + } + }, + { + "OXMTlv":{ + "field":"ipv6_nd_sll", + "value":"22:22:22:22:22:22" + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionSetField":{ + "field":{ + "OXMTlv":{ + "field":"ipv6_nd_sll", + "value":"aa:aa:aa:aa:aa:aa" + } + } + } + }, + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=34887)", + "mpls(bsb=1, label=100, exp=3, ttl=64)", + "ipv6(dst='20::20', flow_label=100, src='10::10', nxt=58, hop_limit=64, traffic_class=32)", + "icmpv6(code=0,data=nd_neighbor(option=nd_option_sla(hw_src='22:22:22:22:22:22'),dst='20::20'),type_=135)" + ], + "egress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=34525)", + "ipv6(dst='20::20', flow_label=100, src='10::10', nxt=58, hop_limit=64, traffic_class=32)", + "icmpv6(code=0,data=nd_neighbor(option=nd_option_sla(hw_src='aa:aa:aa:aa:aa:aa'),dst='20::20'),type_=135)" + ] + } + ] + }, + { + "description": "ethernet/itag/ethernet/ipv6/icmpv6(data=nd_neighbor(option=nd_option_sla(hw_src='22:22:22:22:22:22')))-->'actions=pop_pbb,goto_table:1','table_id:1,ipv6_nd_sll=22:22:22:22:22:22,actions=set_field:aa:aa:aa:aa:aa:aa->ipv6_nd_sll,output:2'", + "prerequisite":[ + { + "OFPFlowMod":{ + "table_id":0, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":35047 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionPopPbb":{} + } + ], + "type":4 + } + }, + { + "OFPInstructionGotoTable":{ + "table_id":1 + } + } + ] + } + }, + { + "OFPFlowMod":{ + "table_id":1, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":34525 + } + }, + { + "OXMTlv":{ + "field":"ip_proto", + "value":58 + } + }, + { + "OXMTlv":{ + "field":"icmpv6_type", + "value":135 + } + }, + { + "OXMTlv":{ + "field":"ipv6_nd_sll", + "value":"22:22:22:22:22:22" + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionSetField":{ + "field":{ + "OXMTlv":{ + "field":"ipv6_nd_sll", + "value":"aa:aa:aa:aa:aa:aa" + } + } + } + }, + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=35047)", + "itag(sid=100)", + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=34525)", + "ipv6(dst='20::20', flow_label=100, src='10::10', nxt=58, hop_limit=64, traffic_class=32)", + "icmpv6(code=0,data=nd_neighbor(option=nd_option_sla(hw_src='22:22:22:22:22:22'),dst='20::20'),type_=135)" + ], + "egress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=34525)", + "ipv6(dst='20::20', flow_label=100, src='10::10', nxt=58, hop_limit=64, traffic_class=32)", + "icmpv6(code=0,data=nd_neighbor(option=nd_option_sla(hw_src='aa:aa:aa:aa:aa:aa'),dst='20::20'),type_=135)" + ] + } + ] + } +] diff --git a/ryu/tests/switch/of14/action/25_SET_FIELD/33_IPV6_ND_TLL.json b/ryu/tests/switch/of14/action/25_SET_FIELD/33_IPV6_ND_TLL.json new file mode 100644 index 00000000..4985fe0c --- /dev/null +++ b/ryu/tests/switch/of14/action/25_SET_FIELD/33_IPV6_ND_TLL.json @@ -0,0 +1,390 @@ +[ + "action: set_field: 33_IPV6_ND_TLL", + { + "description": "ethernet/ipv6/icmpv6(data=nd_neighbor(option=nd_option_tla(hw_src='22:22:22:22:22:22')))-->'ipv6_nd_tll=22:22:22:22:22:22,actions=set_field:aa:aa:aa:aa:aa:aa->ipv6_nd_tll,output:2'", + "prerequisite":[ + { + "OFPFlowMod":{ + "table_id":0, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":34525 + } + }, + { + "OXMTlv":{ + "field":"ip_proto", + "value":58 + } + }, + { + "OXMTlv":{ + "field":"icmpv6_type", + "value":136 + } + }, + { + "OXMTlv":{ + "field":"ipv6_nd_tll", + "value":"22:22:22:22:22:22" + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionSetField":{ + "field":{ + "OXMTlv":{ + "field":"ipv6_nd_tll", + "value":"aa:aa:aa:aa:aa:aa" + } + } + } + }, + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=34525)", + "ipv6(dst='20::20', flow_label=100, src='10::10', nxt=58, hop_limit=64, traffic_class=32)", + "icmpv6(code=0,data=nd_neighbor(option=nd_option_tla(hw_src='22:22:22:22:22:22'),dst='20::20'),type_=136)" + ], + "egress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=34525)", + "ipv6(dst='20::20', flow_label=100, src='10::10', nxt=58, hop_limit=64, traffic_class=32)", + "icmpv6(code=0,data=nd_neighbor(option=nd_option_tla(hw_src='aa:aa:aa:aa:aa:aa'),dst='20::20'),type_=136)" + ] + } + ] + }, + { + "description": "ethernet/vlan/ipv6/icmpv6(data=nd_neighbor(option=nd_option_tla(hw_src='22:22:22:22:22:22')))-->'ipv6_nd_tll=22:22:22:22:22:22,actions=set_field:aa:aa:aa:aa:aa:aa->ipv6_nd_tll,output:2'", + "prerequisite":[ + { + "OFPFlowMod":{ + "table_id":0, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":34525 + } + }, + { + "OXMTlv":{ + "field":"ip_proto", + "value":58 + } + }, + { + "OXMTlv":{ + "field":"icmpv6_type", + "value":136 + } + }, + { + "OXMTlv":{ + "field":"ipv6_nd_tll", + "value":"22:22:22:22:22:22" + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionSetField":{ + "field":{ + "OXMTlv":{ + "field":"ipv6_nd_tll", + "value":"aa:aa:aa:aa:aa:aa" + } + } + } + }, + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=33024)", + "vlan(pcp=3, cfi=0, vid=100, ethertype=34525)", + "ipv6(dst='20::20', flow_label=100, src='10::10', nxt=58, hop_limit=64, traffic_class=32)", + "icmpv6(code=0,data=nd_neighbor(option=nd_option_tla(hw_src='22:22:22:22:22:22'),dst='20::20'),type_=136)" + ], + "egress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=33024)", + "vlan(pcp=3, cfi=0, vid=100, ethertype=34525)", + "ipv6(dst='20::20', flow_label=100, src='10::10', nxt=58, hop_limit=64, traffic_class=32)", + "icmpv6(code=0,data=nd_neighbor(option=nd_option_tla(hw_src='aa:aa:aa:aa:aa:aa'),dst='20::20'),type_=136)" + ] + } + ] + }, + { + "description": "ethernet/mpls/ipv6/icmpv6(data=nd_neighbor(option=nd_option_tla(hw_src='22:22:22:22:22:22')))-->'actions=pop_mpls:0x86dd,goto_table:1','table_id:1,ipv6_nd_tll=22:22:22:22:22:22,actions=set_field:aa:aa:aa:aa:aa:aa->ipv6_nd_tll,output:2'", + "prerequisite":[ + { + "OFPFlowMod":{ + "table_id":0, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":34887 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionPopMpls":{ + "ethertype":34525 + } + } + ], + "type":4 + } + }, + { + "OFPInstructionGotoTable":{ + "table_id":1 + } + } + ] + } + }, + { + "OFPFlowMod":{ + "table_id":1, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":34525 + } + }, + { + "OXMTlv":{ + "field":"ip_proto", + "value":58 + } + }, + { + "OXMTlv":{ + "field":"icmpv6_type", + "value":136 + } + }, + { + "OXMTlv":{ + "field":"ipv6_nd_tll", + "value":"22:22:22:22:22:22" + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionSetField":{ + "field":{ + "OXMTlv":{ + "field":"ipv6_nd_tll", + "value":"aa:aa:aa:aa:aa:aa" + } + } + } + }, + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=34887)", + "mpls(bsb=1, label=100, exp=3, ttl=64)", + "ipv6(dst='20::20', flow_label=100, src='10::10', nxt=58, hop_limit=64, traffic_class=32)", + "icmpv6(code=0,data=nd_neighbor(option=nd_option_tla(hw_src='22:22:22:22:22:22'),dst='20::20'),type_=136)" + ], + "egress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=34525)", + "ipv6(dst='20::20', flow_label=100, src='10::10', nxt=58, hop_limit=64, traffic_class=32)", + "icmpv6(code=0,data=nd_neighbor(option=nd_option_tla(hw_src='aa:aa:aa:aa:aa:aa'),dst='20::20'),type_=136)" + ] + } + ] + }, + { + "description": "ethernet/itag/ethernet/ipv6/icmpv6(data=nd_neighbor(option=nd_option_tla(hw_src='22:22:22:22:22:22')))-->'actions=pop_pbb,goto_table:1','table_id:1,ipv6_nd_tll=22:22:22:22:22:22,actions=set_field:aa:aa:aa:aa:aa:aa->ipv6_nd_tll,output:2'", + "prerequisite":[ + { + "OFPFlowMod":{ + "table_id":0, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":35047 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionPopPbb":{} + } + ], + "type":4 + } + }, + { + "OFPInstructionGotoTable":{ + "table_id":1 + } + } + ] + } + }, + { + "OFPFlowMod":{ + "table_id":1, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":34525 + } + }, + { + "OXMTlv":{ + "field":"ip_proto", + "value":58 + } + }, + { + "OXMTlv":{ + "field":"icmpv6_type", + "value":136 + } + }, + { + "OXMTlv":{ + "field":"ipv6_nd_tll", + "value":"22:22:22:22:22:22" + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionSetField":{ + "field":{ + "OXMTlv":{ + "field":"ipv6_nd_tll", + "value":"aa:aa:aa:aa:aa:aa" + } + } + } + }, + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=35047)", + "itag(sid=100)", + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=34525)", + "ipv6(dst='20::20', flow_label=100, src='10::10', nxt=58, hop_limit=64, traffic_class=32)", + "icmpv6(code=0,data=nd_neighbor(option=nd_option_tla(hw_src='22:22:22:22:22:22'),dst='20::20'),type_=136)" + ], + "egress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=34525)", + "ipv6(dst='20::20', flow_label=100, src='10::10', nxt=58, hop_limit=64, traffic_class=32)", + "icmpv6(code=0,data=nd_neighbor(option=nd_option_tla(hw_src='aa:aa:aa:aa:aa:aa'),dst='20::20'),type_=136)" + ] + } + ] + } +] diff --git a/ryu/tests/switch/of14/action/25_SET_FIELD/34_MPLS_LABEL.json b/ryu/tests/switch/of14/action/25_SET_FIELD/34_MPLS_LABEL.json new file mode 100644 index 00000000..ac48e12c --- /dev/null +++ b/ryu/tests/switch/of14/action/25_SET_FIELD/34_MPLS_LABEL.json @@ -0,0 +1,211 @@ +[ + "action: set_field: 34_MPLS_LABEL", + { + "description": "ethernet/mpls(label=100)/ipv4/tcp-->'mpls_label=100,actions=set_field:203->mpls_label,output:2'", + "prerequisite":[ + { + "OFPFlowMod":{ + "table_id":0, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":34887 + } + }, + { + "OXMTlv":{ + "field":"mpls_label", + "value":100 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionSetField":{ + "field":{ + "OXMTlv":{ + "field":"mpls_label", + "value":203 + } + } + } + }, + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=34887)", + "mpls(bsb=1, label=100, exp=3, ttl=64)", + "ipv4(tos=32, proto=6, src='192.168.10.10', dst='192.168.20.20', ttl=64)", + "tcp(dst_port=2222, option=str('\\x00' * 4), src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ], + "egress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=34887)", + "mpls(bsb=1, label=203, exp=3, ttl=64)", + "ipv4(tos=32, proto=6, src='192.168.10.10', dst='192.168.20.20', ttl=64)", + "tcp(dst_port=2222, option=str('\\x00' * 4), src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ] + } + ] + }, + { + "description": "ethernet/mpls(label=100)/ipv6/tcp-->'mpls_label=100,actions=set_field:203->mpls_label,output:2'", + "prerequisite":[ + { + "OFPFlowMod":{ + "table_id":0, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":34887 + } + }, + { + "OXMTlv":{ + "field":"mpls_label", + "value":100 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionSetField":{ + "field":{ + "OXMTlv":{ + "field":"mpls_label", + "value":203 + } + } + } + }, + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=34887)", + "mpls(bsb=1, label=100, exp=3, ttl=64)", + "ipv6(dst='20::20', flow_label=100, src='10::10', nxt=6, hop_limit=64, traffic_class=32)", + "tcp(dst_port=2222, option=str('\\x00' * 4), src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ], + "egress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=34887)", + "mpls(bsb=1, label=203, exp=3, ttl=64)", + "ipv6(dst='20::20', flow_label=100, src='10::10', nxt=6, hop_limit=64, traffic_class=32)", + "tcp(dst_port=2222, option=str('\\x00' * 4), src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ] + } + ] + }, + { + "description": "ethernet/mpls(label=100)/arp-->'mpls_label=100,actions=set_field:203->mpls_label,output:2'", + "prerequisite":[ + { + "OFPFlowMod":{ + "table_id":0, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":34887 + } + }, + { + "OXMTlv":{ + "field":"mpls_label", + "value":100 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionSetField":{ + "field":{ + "OXMTlv":{ + "field":"mpls_label", + "value":203 + } + } + } + }, + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=34887)", + "mpls(bsb=1, label=100, exp=3, ttl=64)", + "arp(dst_ip='192.168.20.20',dst_mac='22:22:22:22:22:22', opcode=1, src_ip='192.168.10.10',src_mac='12:11:11:11:11:11')", + "str('\\x00' * 30)" + ], + "egress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=34887)", + "mpls(bsb=1, label=203, exp=3, ttl=64)", + "arp(dst_ip='192.168.20.20',dst_mac='22:22:22:22:22:22', opcode=1, src_ip='192.168.10.10',src_mac='12:11:11:11:11:11')", + "str('\\x00' * 30)" + ] + } + ] + } +] diff --git a/ryu/tests/switch/of14/action/25_SET_FIELD/35_MPLS_TC.json b/ryu/tests/switch/of14/action/25_SET_FIELD/35_MPLS_TC.json new file mode 100644 index 00000000..273c6aaa --- /dev/null +++ b/ryu/tests/switch/of14/action/25_SET_FIELD/35_MPLS_TC.json @@ -0,0 +1,211 @@ +[ + "action: set_field: 35_MPLS_TC", + { + "description": "ethernet/mpls(exp=3)/ipv4/tcp-->'mpls_tc=3,actions=set_field:5->mpls_tc,output:2'", + "prerequisite":[ + { + "OFPFlowMod":{ + "table_id":0, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":34887 + } + }, + { + "OXMTlv":{ + "field":"mpls_tc", + "value":3 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionSetField":{ + "field":{ + "OXMTlv":{ + "field":"mpls_tc", + "value":5 + } + } + } + }, + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=34887)", + "mpls(bsb=1, label=100, exp=3, ttl=64)", + "ipv4(tos=32, proto=6, src='192.168.10.10', dst='192.168.20.20', ttl=64)", + "tcp(dst_port=2222, option=str('\\x00' * 4), src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ], + "egress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=34887)", + "mpls(bsb=1, label=100, exp=5, ttl=64)", + "ipv4(tos=32, proto=6, src='192.168.10.10', dst='192.168.20.20', ttl=64)", + "tcp(dst_port=2222, option=str('\\x00' * 4), src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ] + } + ] + }, + { + "description": "ethernet/mpls(exp=3)/ipv6/tcp-->'mpls_tc=3,actions=set_field:5->mpls_tc,output:2'", + "prerequisite":[ + { + "OFPFlowMod":{ + "table_id":0, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":34887 + } + }, + { + "OXMTlv":{ + "field":"mpls_tc", + "value":3 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionSetField":{ + "field":{ + "OXMTlv":{ + "field":"mpls_tc", + "value":5 + } + } + } + }, + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=34887)", + "mpls(bsb=1, label=100, exp=3, ttl=64)", + "ipv6(dst='20::20', flow_label=100, src='10::10', nxt=6, hop_limit=64, traffic_class=32)", + "tcp(dst_port=2222, option=str('\\x00' * 4), src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ], + "egress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=34887)", + "mpls(bsb=1, label=100, exp=5, ttl=64)", + "ipv6(dst='20::20', flow_label=100, src='10::10', nxt=6, hop_limit=64, traffic_class=32)", + "tcp(dst_port=2222, option=str('\\x00' * 4), src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ] + } + ] + }, + { + "description": "ethernet/mpls(exp=3)/arp-->'mpls_tc=3,actions=set_field:5->mpls_tc,output:2'", + "prerequisite":[ + { + "OFPFlowMod":{ + "table_id":0, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":34887 + } + }, + { + "OXMTlv":{ + "field":"mpls_tc", + "value":3 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionSetField":{ + "field":{ + "OXMTlv":{ + "field":"mpls_tc", + "value":5 + } + } + } + }, + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=34887)", + "mpls(bsb=1, label=100, exp=3, ttl=64)", + "arp(dst_ip='192.168.20.20',dst_mac='22:22:22:22:22:22', opcode=1, src_ip='192.168.10.10',src_mac='12:11:11:11:11:11')", + "str('\\x00' * 30)" + ], + "egress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=34887)", + "mpls(bsb=1, label=100, exp=5, ttl=64)", + "arp(dst_ip='192.168.20.20',dst_mac='22:22:22:22:22:22', opcode=1, src_ip='192.168.10.10',src_mac='12:11:11:11:11:11')", + "str('\\x00' * 30)" + ] + } + ] + } +] diff --git a/ryu/tests/switch/of14/action/25_SET_FIELD/36_MPLS_BOS.json b/ryu/tests/switch/of14/action/25_SET_FIELD/36_MPLS_BOS.json new file mode 100644 index 00000000..0e498336 --- /dev/null +++ b/ryu/tests/switch/of14/action/25_SET_FIELD/36_MPLS_BOS.json @@ -0,0 +1,211 @@ +[ + "action: set_field: 36_MPLS_BOS", + { + "description": "ethernet/mpls(bsb=1)/ipv4/tcp-->'mpls_bos=1,actions=set_field:0->mpls_bos,output:2'", + "prerequisite":[ + { + "OFPFlowMod":{ + "table_id":0, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":34887 + } + }, + { + "OXMTlv":{ + "field":"mpls_bos", + "value":1 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionSetField":{ + "field":{ + "OXMTlv":{ + "field":"mpls_bos", + "value":0 + } + } + } + }, + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=34887)", + "mpls(bsb=1, label=100, exp=3, ttl=64)", + "ipv4(tos=32, proto=6, src='192.168.10.10', dst='192.168.20.20', ttl=64)", + "tcp(dst_port=2222, option=str('\\x00' * 4), src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ], + "egress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=34887)", + "mpls(bsb=0, label=100, exp=3, ttl=64)", + "ipv4(tos=32, proto=6, src='192.168.10.10', dst='192.168.20.20', ttl=64)", + "tcp(dst_port=2222, option=str('\\x00' * 4), src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ] + } + ] + }, + { + "description": "ethernet/mpls(bsb=1)/ipv6/tcp-->'mpls_bos=1,actions=set_field:0->mpls_bos,output:2'", + "prerequisite":[ + { + "OFPFlowMod":{ + "table_id":0, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":34887 + } + }, + { + "OXMTlv":{ + "field":"mpls_bos", + "value":1 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionSetField":{ + "field":{ + "OXMTlv":{ + "field":"mpls_bos", + "value":0 + } + } + } + }, + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=34887)", + "mpls(bsb=1, label=100, exp=3, ttl=64)", + "ipv6(dst='20::20', flow_label=100, src='10::10', nxt=6, hop_limit=64, traffic_class=32)", + "tcp(dst_port=2222, option=str('\\x00' * 4), src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ], + "egress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=34887)", + "mpls(bsb=0, label=100, exp=3, ttl=64)", + "ipv6(dst='20::20', flow_label=100, src='10::10', nxt=6, hop_limit=64, traffic_class=32)", + "tcp(dst_port=2222, option=str('\\x00' * 4), src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ] + } + ] + }, + { + "description": "ethernet/mpls(bsb=1)/arp-->'mpls_bos=1,actions=set_field:0->mpls_bos,output:2'", + "prerequisite":[ + { + "OFPFlowMod":{ + "table_id":0, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":34887 + } + }, + { + "OXMTlv":{ + "field":"mpls_bos", + "value":1 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionSetField":{ + "field":{ + "OXMTlv":{ + "field":"mpls_bos", + "value":0 + } + } + } + }, + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=34887)", + "mpls(bsb=1, label=100, exp=3, ttl=64)", + "arp(dst_ip='192.168.20.20',dst_mac='22:22:22:22:22:22', opcode=1, src_ip='192.168.10.10',src_mac='12:11:11:11:11:11')", + "str('\\x00' * 30)" + ], + "egress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=34887)", + "mpls(bsb=0, label=100, exp=3, ttl=64)", + "arp(dst_ip='192.168.20.20',dst_mac='22:22:22:22:22:22', opcode=1, src_ip='192.168.10.10',src_mac='12:11:11:11:11:11')", + "str('\\x00' * 30)" + ] + } + ] + } +] diff --git a/ryu/tests/switch/of14/action/25_SET_FIELD/37_PBB_ISID.json b/ryu/tests/switch/of14/action/25_SET_FIELD/37_PBB_ISID.json new file mode 100644 index 00000000..78e68301 --- /dev/null +++ b/ryu/tests/switch/of14/action/25_SET_FIELD/37_PBB_ISID.json @@ -0,0 +1,235 @@ +[ + "action: set_field: 37_PBB_ISID", + { + "description": "ethernet/svlan/itag(sid=100)/ethernet/svlan/vlan/ipv4/tcp-->'pbb_itag=100,actions=set_field:203->pbb_itag,output:2'", + "prerequisite":[ + { + "OFPFlowMod":{ + "table_id":0, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":35047 + } + }, + { + "OXMTlv":{ + "field":"pbb_isid", + "value":100 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionSetField":{ + "field":{ + "OXMTlv":{ + "field":"pbb_isid", + "value":203 + } + } + } + }, + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=34984)", + "svlan(ethertype=35047, vid=10)", + "itag(sid=100)", + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=34984)", + "svlan(ethertype=33024, vid=10)", + "vlan(pcp=3, cfi=0, vid=100, ethertype=2048)", + "ipv4(tos=32, proto=6, src='192.168.10.10', dst='192.168.20.20', ttl=64)", + "tcp(dst_port=2222, option=str('\\x00' * 4), src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ], + "egress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=34984)", + "svlan(ethertype=35047, vid=10)", + "itag(sid=203)", + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=34984)", + "svlan(ethertype=33024, vid=10)", + "vlan(pcp=3, cfi=0, vid=100, ethertype=2048)", + "ipv4(tos=32, proto=6, src='192.168.10.10', dst='192.168.20.20', ttl=64)", + "tcp(dst_port=2222, option=str('\\x00' * 4), src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ] + } + ] + }, + { + "description": "ethernet/svlan/itag(sid=100)/ethernet/svlan/vlan/ipv6/tcp-->'pbb_itag=100,actions=set_field:203->pbb_itag,output:2'", + "prerequisite":[ + { + "OFPFlowMod":{ + "table_id":0, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":35047 + } + }, + { + "OXMTlv":{ + "field":"pbb_isid", + "value":100 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionSetField":{ + "field":{ + "OXMTlv":{ + "field":"pbb_isid", + "value":203 + } + } + } + }, + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=34984)", + "svlan(ethertype=35047, vid=10)", + "itag(sid=100)", + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=34984)", + "svlan(ethertype=33024, vid=10)", + "vlan(pcp=3, cfi=0, vid=100, ethertype=34525)", + "ipv6(dst='20::20', flow_label=100, src='10::10', nxt=6, hop_limit=64, traffic_class=32)", + "tcp(dst_port=2222, option=str('\\x00' * 4), src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ], + "egress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=34984)", + "svlan(ethertype=35047, vid=10)", + "itag(sid=203)", + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=34984)", + "svlan(ethertype=33024, vid=10)", + "vlan(pcp=3, cfi=0, vid=100, ethertype=34525)", + "ipv6(dst='20::20', flow_label=100, src='10::10', nxt=6, hop_limit=64, traffic_class=32)", + "tcp(dst_port=2222, option=str('\\x00' * 4), src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ] + } + ] + }, + { + "description": "ethernet/svlan/itag(sid=100)/ethernet/svlan/vlan/arp-->'pbb_itag=100,actions=set_field:203->pbb_itag,output:2'", + "prerequisite":[ + { + "OFPFlowMod":{ + "table_id":0, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"eth_type", + "value":35047 + } + }, + { + "OXMTlv":{ + "field":"pbb_isid", + "value":100 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionSetField":{ + "field":{ + "OXMTlv":{ + "field":"pbb_isid", + "value":203 + } + } + } + }, + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=34984)", + "svlan(ethertype=35047, vid=10)", + "itag(sid=100)", + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=34984)", + "svlan(ethertype=33024, vid=10)", + "vlan(pcp=3, cfi=0, vid=100, ethertype=2054)", + "arp(dst_ip='192.168.20.20',dst_mac='22:22:22:22:22:22', opcode=1, src_ip='192.168.10.10',src_mac='12:11:11:11:11:11')", + "str('\\x00' * 30)" + ], + "egress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=34984)", + "svlan(ethertype=35047, vid=10)", + "itag(sid=203)", + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=34984)", + "svlan(ethertype=33024, vid=10)", + "vlan(pcp=3, cfi=0, vid=100, ethertype=2054)", + "arp(dst_ip='192.168.20.20',dst_mac='22:22:22:22:22:22', opcode=1, src_ip='192.168.10.10',src_mac='12:11:11:11:11:11')", + "str('\\x00' * 30)" + ] + } + ] + } +] diff --git a/ryu/tests/switch/of14/action/25_SET_FIELD/38_TUNNEL_ID.json b/ryu/tests/switch/of14/action/25_SET_FIELD/38_TUNNEL_ID.json new file mode 100644 index 00000000..893b32f0 --- /dev/null +++ b/ryu/tests/switch/of14/action/25_SET_FIELD/38_TUNNEL_ID.json @@ -0,0 +1,280 @@ +[ + "action: set_field: 38_TUNNEL_ID", + { + "description": "ethernet/ipv4/tcp-->'actions=set_field:12345->tunnel_id,goto_table:1','table_id:1,tunnel_id=12345,actions=output:2'", + "prerequisite":[ + { + "OFPFlowMod":{ + "table_id":0, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"in_port", + "value":1 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionSetField":{ + "field":{ + "OXMTlv":{ + "field":"tunnel_id", + "value":12345 + } + } + } + } + ], + "type":4 + } + }, + { + "OFPInstructionGotoTable":{ + "table_id":1 + } + } + ] + } + }, + { + "OFPFlowMod":{ + "table_id":1, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"tunnel_id", + "value":12345 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=2048)", + "ipv4(tos=32, proto=6, src='192.168.10.10', dst='192.168.20.20', ttl=64)", + "tcp(dst_port=2222, option=str('\\x00' * 4), src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ], + "egress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=2048)", + "ipv4(tos=32, proto=6, src='192.168.10.10', dst='192.168.20.20', ttl=64)", + "tcp(dst_port=2222, option=str('\\x00' * 4), src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ] + } + ] + }, + { + "description": "ethernet/ipv6/tcp-->'actions=set_field:12345->tunnel_id,goto_table:1','table_id:1,tunnel_id=12345,actions=output:2'", + "prerequisite":[ + { + "OFPFlowMod":{ + "table_id":0, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"in_port", + "value":1 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionSetField":{ + "field":{ + "OXMTlv":{ + "field":"tunnel_id", + "value":12345 + } + } + } + } + ], + "type":4 + } + }, + { + "OFPInstructionGotoTable":{ + "table_id":1 + } + } + ] + } + }, + { + "OFPFlowMod":{ + "table_id":1, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"tunnel_id", + "value":12345 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=34525)", + "ipv6(dst='20::20', flow_label=100, src='10::10', nxt=6, hop_limit=64, traffic_class=32)", + "tcp(dst_port=2222, option=str('\\x00' * 4), src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ], + "egress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=34525)", + "ipv6(dst='20::20', flow_label=100, src='10::10', nxt=6, hop_limit=64, traffic_class=32)", + "tcp(dst_port=2222, option=str('\\x00' * 4), src_port=11111)", + "'\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'" + ] + } + ] + }, + { + "description": "ethernet/arp-->'actions=set_field:12345->tunnel_id,goto_table:1','table_id:1,tunnel_id=12345,actions=output:2'", + "prerequisite":[ + { + "OFPFlowMod":{ + "table_id":0, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"in_port", + "value":1 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionSetField":{ + "field":{ + "OXMTlv":{ + "field":"tunnel_id", + "value":12345 + } + } + } + } + ], + "type":4 + } + }, + { + "OFPInstructionGotoTable":{ + "table_id":1 + } + } + ] + } + }, + { + "OFPFlowMod":{ + "table_id":1, + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"tunnel_id", + "value":12345 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=2054)", + "arp(dst_ip='192.168.20.20',dst_mac='22:22:22:22:22:22', opcode=1, src_ip='192.168.10.10',src_mac='12:11:11:11:11:11')", + "str('\\x00' * (60 - 42))" + ], + "egress":[ + "ethernet(dst='22:22:22:22:22:22', src='12:11:11:11:11:11', ethertype=2054)", + "arp(dst_ip='192.168.20.20',dst_mac='22:22:22:22:22:22', opcode=1, src_ip='192.168.10.10',src_mac='12:11:11:11:11:11')", + "str('\\x00' * (60 - 42))" + ] + } + ] + } +] |