diff options
40 files changed, 7953 insertions, 0 deletions
diff --git a/ryu/tests/switch/of10/action/00_OUTPUT.json b/ryu/tests/switch/of10/action/00_OUTPUT.json new file mode 100644 index 00000000..59ea6e97 --- /dev/null +++ b/ryu/tests/switch/of10/action/00_OUTPUT.json @@ -0,0 +1,112 @@ +[ + "action: 00_OUTPUT", + { + "description": "ethernet/ipv4/tcp-->'actions=output:2'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionOutput": { + "port": 2 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": {} + } + } + } + ], + "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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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=output:2'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionOutput": { + "port": 2 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": {} + } + } + } + ], + "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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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=output:2'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionOutput": { + "port": 2 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": {} + } + } + } + ], + "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')", + "bytes(b'\\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')", + "bytes(b'\\x00' * (60 - 42))" + ] + } + ] + } +] diff --git a/ryu/tests/switch/of10/action/01_SET_VLAN_VID.json b/ryu/tests/switch/of10/action/01_SET_VLAN_VID.json new file mode 100644 index 00000000..3c9e6757 --- /dev/null +++ b/ryu/tests/switch/of10/action/01_SET_VLAN_VID.json @@ -0,0 +1,139 @@ +[ + "action: 01_SET_VLAN_VID", + { + "description": "ethernet/vlan(vid=100)/ipv4/tcp-->'vlan_vid=100,actions=mod_vlan_vid:203,output:2'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionVlanVid": { + "vlan_vid": 203 + } + }, + { + "OFPActionOutput": { + "port": 2 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_vlan": 100 + } + } + } + } + ], + "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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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=mod_vlan_vid:203,output:2'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionVlanVid": { + "vlan_vid": 203 + } + }, + { + "OFPActionOutput": { + "port": 2 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_vlan": 100 + } + } + } + } + ], + "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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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=mod_vlan_vid:203,output:2'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionVlanVid": { + "vlan_vid": 203 + } + }, + { + "OFPActionOutput": { + "port": 2 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_vlan": 100 + } + } + } + } + ], + "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')", + "bytes(b'\\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')", + "bytes(b'\\x00' * 30)" + ] + } + ] + } +] diff --git a/ryu/tests/switch/of10/action/02_SET_VLAN_PCP.json b/ryu/tests/switch/of10/action/02_SET_VLAN_PCP.json new file mode 100644 index 00000000..6a3c75b0 --- /dev/null +++ b/ryu/tests/switch/of10/action/02_SET_VLAN_PCP.json @@ -0,0 +1,139 @@ +[ + "action: 02_SET_VLAN_PCP", + { + "description": "ethernet/vlan(pcp=3)/ipv4/tcp-->'vlan_pcp=3,actions=mod_vlan_pcp:5,output:2'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionVlanPcp": { + "vlan_pcp": 5 + } + }, + { + "OFPActionOutput": { + "port": 2 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_vlan_pcp": 3 + } + } + } + } + ], + "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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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=mod_vlan_pcp:5,output:2'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionVlanPcp": { + "vlan_pcp": 5 + } + }, + { + "OFPActionOutput": { + "port": 2 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_vlan_pcp": 3 + } + } + } + } + ], + "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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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=mod_vlan_pcp:5,output:2'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionVlanPcp": { + "vlan_pcp": 5 + } + }, + { + "OFPActionOutput": { + "port": 2 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_vlan_pcp": 3 + } + } + } + } + ], + "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')", + "bytes(b'\\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')", + "bytes(b'\\x00' * 30)" + ] + } + ] + } +] diff --git a/ryu/tests/switch/of10/action/03_STRIP_VLAN.json b/ryu/tests/switch/of10/action/03_STRIP_VLAN.json new file mode 100644 index 00000000..c742a21e --- /dev/null +++ b/ryu/tests/switch/of10/action/03_STRIP_VLAN.json @@ -0,0 +1,130 @@ +[ + "action: 03_STRIP_VLAN", + { + "description": "ethernet/vlan(vid=100)/ipv4/tcp-->'vlan_vid=100,actions=strip_vlan,output:2'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionStripVlan": {} + }, + { + "OFPActionOutput": { + "port": 2 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_vlan": 100 + } + } + } + } + ], + "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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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=strip_vlan,output:2'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionStripVlan": {} + }, + { + "OFPActionOutput": { + "port": 2 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_vlan": 100 + } + } + } + } + ], + "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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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=strip_vlan,output:2'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionStripVlan": {} + }, + { + "OFPActionOutput": { + "port": 2 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_vlan": 100 + } + } + } + } + ], + "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')", + "bytes(b'\\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')", + "bytes(b'\\x00' * (60 - 42))" + ] + } + ] + } +] diff --git a/ryu/tests/switch/of10/action/04_SET_DL_SRC.json b/ryu/tests/switch/of10/action/04_SET_DL_SRC.json new file mode 100644 index 00000000..63a25783 --- /dev/null +++ b/ryu/tests/switch/of10/action/04_SET_DL_SRC.json @@ -0,0 +1,133 @@ +[ + "action: 04_SET_DL_SRC", + { + "description": "ethernet(src='12:11:11:11:11:11')/ipv4/tcp-->'eth_src=12:11:11:11:11:11,actions=mod_dl_src:aa:aa:aa:aa:aa:aa,output:2'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionSetDlSrc": { + "dl_addr": "aa:aa:aa:aa:aa:aa" + } + }, + { + "OFPActionOutput": { + "port": 2 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_src": "12:11:11:11:11:11" + } + } + } + } + ], + "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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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=mod_dl_src:aa:aa:aa:aa:aa:aa,output:2'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionSetDlSrc": { + "dl_addr": "aa:aa:aa:aa:aa:aa" + } + }, + { + "OFPActionOutput": { + "port": 2 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_src": "12:11:11:11:11:11" + } + } + } + } + ], + "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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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=mod_dl_src:aa:aa:aa:aa:aa:aa,output:2'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionSetDlSrc": { + "dl_addr": "aa:aa:aa:aa:aa:aa" + } + }, + { + "OFPActionOutput": { + "port": 2 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_src": "12:11:11:11:11:11" + } + } + } + } + ], + "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')", + "bytes(b'\\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')", + "bytes(b'\\x00' * (60 - 42))" + ] + } + ] + } +] diff --git a/ryu/tests/switch/of10/action/05_SET_DL_DST.json b/ryu/tests/switch/of10/action/05_SET_DL_DST.json new file mode 100644 index 00000000..2317075b --- /dev/null +++ b/ryu/tests/switch/of10/action/05_SET_DL_DST.json @@ -0,0 +1,133 @@ +[ + "action: 05_SET_DL_DST", + { + "description": "ethernet(dst='22:22:22:22:22:22')/ipv4/tcp-->'eth_dst=22:22:22:22:22:22,actions=mod_dl_dst:ba:bb:bb:bb:bb:bb,output:2'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionSetDlDst": { + "dl_addr": "ba:bb:bb:bb:bb:bb" + } + }, + { + "OFPActionOutput": { + "port": 2 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_dst": "22:22:22:22:22:22" + } + } + } + } + ], + "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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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=mod_dl_dst:ba:bb:bb:bb:bb:bb,output:2'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionSetDlDst": { + "dl_addr": "ba:bb:bb:bb:bb:bb" + } + }, + { + "OFPActionOutput": { + "port": 2 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_dst": "22:22:22:22:22:22" + } + } + } + } + ], + "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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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=mod_dl_dst:ba:bb:bb:bb:bb:bb,output:2'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionSetDlDst": { + "dl_addr": "ba:bb:bb:bb:bb:bb" + } + }, + { + "OFPActionOutput": { + "port": 2 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_dst": "22:22:22:22:22:22" + } + } + } + } + ], + "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')", + "bytes(b'\\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')", + "bytes(b'\\x00' * (60 - 42))" + ] + } + ] + } +] diff --git a/ryu/tests/switch/of10/action/06_SET_NW_SRC.json b/ryu/tests/switch/of10/action/06_SET_NW_SRC.json new file mode 100644 index 00000000..061ce2d7 --- /dev/null +++ b/ryu/tests/switch/of10/action/06_SET_NW_SRC.json @@ -0,0 +1,95 @@ +[ + "action: 06_SET_NW_SRC", + { + "description": "ethernet/ipv4(src='192.168.10.10')/tcp-->'nw_src=192.168.10.10,actions=mod_nw_src:10.10.10.10,output:2'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionSetNwSrc": { + "nw_addr": "10.10.10.10" + } + }, + { + "OFPActionOutput": { + "port": 2 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_type": 2048, + "nw_src": "192.168.10.10" + } + } + } + } + ], + "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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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-->'nw_src=192.168.10.10,actions=mod_nw_src:10.10.10.10,output:2'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionSetNwSrc": { + "nw_addr": "10.10.10.10" + } + }, + { + "OFPActionOutput": { + "port": 2 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_type": 2048, + "nw_src": "192.168.10.10" + } + } + } + } + ], + "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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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/of10/action/07_SET_NW_DST.json b/ryu/tests/switch/of10/action/07_SET_NW_DST.json new file mode 100644 index 00000000..029b5022 --- /dev/null +++ b/ryu/tests/switch/of10/action/07_SET_NW_DST.json @@ -0,0 +1,95 @@ +[ + "action: 07_SET_NW_DST", + { + "description": "ethernet/ipv4(dst='192.168.20.20')/tcp-->'nw_dst=192.168.20.20,actions=mod_nw_dst:10.10.20.20,output:2'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionSetNwDst": { + "nw_addr": "10.10.20.20" + } + }, + { + "OFPActionOutput": { + "port": 2 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_type": 2048, + "nw_dst": "192.168.20.20" + } + } + } + } + ], + "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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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-->'nw_dst=192.168.20.20,actions=mod_nw_dst:10.10.20.20,output:2'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionSetNwDst": { + "nw_addr": "10.10.20.20" + } + }, + { + "OFPActionOutput": { + "port": 2 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_type": 2048, + "nw_dst": "192.168.20.20" + } + } + } + } + ], + "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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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/of10/action/08_SET_NW_TOS_IPv4.json b/ryu/tests/switch/of10/action/08_SET_NW_TOS_IPv4.json new file mode 100644 index 00000000..3cfff1dd --- /dev/null +++ b/ryu/tests/switch/of10/action/08_SET_NW_TOS_IPv4.json @@ -0,0 +1,95 @@ +[ + "action: 08_SET_NW_TOS (IPv4)", + { + "description": "ethernet/ipv4(tos=32)/tcp-->'nw_tos=32,actions=mod_nw_tos:64,output:2'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionSetNwTos": { + "tos": 64 + } + }, + { + "OFPActionOutput": { + "port": 2 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_type": 2048, + "nw_tos": 32 + } + } + } + } + ], + "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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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-->'nw_tos=32,actions=mod_nw_tos:64,output:2'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionSetNwTos": { + "tos": 64 + } + }, + { + "OFPActionOutput": { + "port": 2 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_type": 2048, + "nw_tos": 32 + } + } + } + } + ], + "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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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/of10/action/08_SET_NW_TOS_IPv6.json b/ryu/tests/switch/of10/action/08_SET_NW_TOS_IPv6.json new file mode 100644 index 00000000..e34ac73e --- /dev/null +++ b/ryu/tests/switch/of10/action/08_SET_NW_TOS_IPv6.json @@ -0,0 +1,95 @@ +[ + "action: 08_SET_NW_TOS (IPv6)", + { + "description": "ethernet/ipv6(traffic_class=32)/tcp-->'nw_tos=32,actions=mod_nw_tos:64,output:2'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionSetNwTos": { + "tos": 64 + } + }, + { + "OFPActionOutput": { + "port": 2 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_type": 34525, + "nw_tos": 32 + } + } + } + } + ], + "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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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-->'nw_tos=32,actions=mod_nw_tos:64,output:2'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionSetNwTos": { + "tos": 64 + } + }, + { + "OFPActionOutput": { + "port": 2 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_type": 34525, + "nw_tos": 32 + } + } + } + } + ], + "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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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/of10/action/09_SET_TP_SRC_IPv4_TCP.json b/ryu/tests/switch/of10/action/09_SET_TP_SRC_IPv4_TCP.json new file mode 100644 index 00000000..6738f8db --- /dev/null +++ b/ryu/tests/switch/of10/action/09_SET_TP_SRC_IPv4_TCP.json @@ -0,0 +1,97 @@ +[ + "action: 09_SET_TP_SRC (IPv4/TCP)", + { + "description": "ethernet/ipv4/tcp(src_port=11111)-->'tp_dst=11111,actions=mod_tp_src:12345,output:2'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionSetTpSrc": { + "tp": 12345 + } + }, + { + "OFPActionOutput": { + "port": 2 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_type": 2048, + "nw_proto": 6, + "tp_src": 11111 + } + } + } + } + ], + "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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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=bytes(b'\\x00' * 4), src_port=12345)", + "b'\\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)-->'tp_dst=11111,actions=mod_tp_src:12345,output:2'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionSetTpSrc": { + "tp": 12345 + } + }, + { + "OFPActionOutput": { + "port": 2 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_type": 2048, + "nw_proto": 6, + "tp_src": 11111 + } + } + } + } + ], + "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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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=bytes(b'\\x00' * 4), src_port=12345)", + "b'\\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/of10/action/09_SET_TP_SRC_IPv4_UDP.json b/ryu/tests/switch/of10/action/09_SET_TP_SRC_IPv4_UDP.json new file mode 100644 index 00000000..c284239a --- /dev/null +++ b/ryu/tests/switch/of10/action/09_SET_TP_SRC_IPv4_UDP.json @@ -0,0 +1,97 @@ +[ + "action: 09_SET_TP_SRC (IPv4/UDP)", + { + "description": "ethernet/ipv4/udp(src_port=11111)-->'tp_dst=11111,actions=mod_tp_src:12345,output:2'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionSetTpSrc": { + "tp": 12345 + } + }, + { + "OFPActionOutput": { + "port": 2 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_type": 2048, + "nw_proto": 17, + "tp_src": 11111 + } + } + } + } + ], + "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)", + "b'\\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)", + "b'\\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)-->'tp_dst=11111,actions=mod_tp_src:12345,output:2'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionSetTpSrc": { + "tp": 12345 + } + }, + { + "OFPActionOutput": { + "port": 2 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_type": 2048, + "nw_proto": 17, + "tp_src": 11111 + } + } + } + } + ], + "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)", + "b'\\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)", + "b'\\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/of10/action/09_SET_TP_SRC_IPv6_TCP.json b/ryu/tests/switch/of10/action/09_SET_TP_SRC_IPv6_TCP.json new file mode 100644 index 00000000..efa88efd --- /dev/null +++ b/ryu/tests/switch/of10/action/09_SET_TP_SRC_IPv6_TCP.json @@ -0,0 +1,97 @@ +[ + "action: 09_SET_TP_SRC (IPv6/TCP)", + { + "description": "ethernet/ipv6/tcp(src_port=11111)-->'tp_dst=11111,actions=mod_tp_src:12345,output:2'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionSetTpSrc": { + "tp": 12345 + } + }, + { + "OFPActionOutput": { + "port": 2 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_type": 34525, + "nw_proto": 6, + "tp_src": 11111 + } + } + } + } + ], + "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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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=bytes(b'\\x00' * 4), src_port=12345)", + "b'\\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)-->'tp_dst=11111,actions=mod_tp_src:12345,output:2'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionSetTpSrc": { + "tp": 12345 + } + }, + { + "OFPActionOutput": { + "port": 2 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_type": 34525, + "nw_proto": 6, + "tp_src": 11111 + } + } + } + } + ], + "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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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=bytes(b'\\x00' * 4), src_port=12345)", + "b'\\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/of10/action/09_SET_TP_SRC_IPv6_UDP.json b/ryu/tests/switch/of10/action/09_SET_TP_SRC_IPv6_UDP.json new file mode 100644 index 00000000..805cabd6 --- /dev/null +++ b/ryu/tests/switch/of10/action/09_SET_TP_SRC_IPv6_UDP.json @@ -0,0 +1,97 @@ +[ + "action: 09_SET_TP_SRC (IPv6/UDP)", + { + "description": "ethernet/ipv6/udp(src_port=11111)-->'tp_dst=11111,actions=mod_tp_src:12345,output:2'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionSetTpSrc": { + "tp": 12345 + } + }, + { + "OFPActionOutput": { + "port": 2 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_type": 34525, + "nw_proto": 17, + "tp_src": 11111 + } + } + } + } + ], + "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)", + "b'\\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)", + "b'\\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)-->'tp_dst=11111,actions=mod_tp_src:12345,output:2'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionSetTpSrc": { + "tp": 12345 + } + }, + { + "OFPActionOutput": { + "port": 2 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_type": 34525, + "nw_proto": 17, + "tp_src": 11111 + } + } + } + } + ], + "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)", + "b'\\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)", + "b'\\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/of10/action/10_SET_TP_DST_IPv4_TCP.json b/ryu/tests/switch/of10/action/10_SET_TP_DST_IPv4_TCP.json new file mode 100644 index 00000000..93804144 --- /dev/null +++ b/ryu/tests/switch/of10/action/10_SET_TP_DST_IPv4_TCP.json @@ -0,0 +1,97 @@ +[ + "action: 10_SET_TP_DST (IPv4/TCP)", + { + "description": "ethernet/ipv4/tcp(dst_port=2222)-->'tp_dst=2222,actions=mod_tp_dst:6789,output:2'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionSetTpDst": { + "tp": 6789 + } + }, + { + "OFPActionOutput": { + "port": 2 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_type": 2048, + "nw_proto": 6, + "tp_dst": 2222 + } + } + } + } + ], + "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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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)-->'tp_dst=2222,actions=mod_tp_dst:6789,output:2'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionSetTpDst": { + "tp": 6789 + } + }, + { + "OFPActionOutput": { + "port": 2 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_type": 2048, + "nw_proto": 6, + "tp_dst": 2222 + } + } + } + } + ], + "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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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/of10/action/10_SET_TP_DST_IPv4_UDP.json b/ryu/tests/switch/of10/action/10_SET_TP_DST_IPv4_UDP.json new file mode 100644 index 00000000..a586cce7 --- /dev/null +++ b/ryu/tests/switch/of10/action/10_SET_TP_DST_IPv4_UDP.json @@ -0,0 +1,97 @@ +[ + "action: 10_SET_TP_DST (IPv4/UDP)", + { + "description": "ethernet/ipv4/udp(dst_port=2222)-->'tp_dst=2222,actions=mod_tp_dst:6789,output:2'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionSetTpDst": { + "tp": 6789 + } + }, + { + "OFPActionOutput": { + "port": 2 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_type": 2048, + "nw_proto": 17, + "tp_dst": 2222 + } + } + } + } + ], + "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)", + "b'\\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)", + "b'\\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)-->'tp_dst=2222,actions=mod_tp_dst:6789,output:2'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionSetTpDst": { + "tp": 6789 + } + }, + { + "OFPActionOutput": { + "port": 2 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_type": 2048, + "nw_proto": 17, + "tp_dst": 2222 + } + } + } + } + ], + "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)", + "b'\\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)", + "b'\\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/of10/action/10_SET_TP_DST_IPv6_TCP.json b/ryu/tests/switch/of10/action/10_SET_TP_DST_IPv6_TCP.json new file mode 100644 index 00000000..3cc0a713 --- /dev/null +++ b/ryu/tests/switch/of10/action/10_SET_TP_DST_IPv6_TCP.json @@ -0,0 +1,97 @@ +[ + "action: 10_SET_TP_DST (IPv4/TCP)", + { + "description": "ethernet/ipv6/tcp(dst_port=2222)-->'tp_dst=2222,actions=mod_tp_dst:6789,output:2'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionSetTpDst": { + "tp": 6789 + } + }, + { + "OFPActionOutput": { + "port": 2 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_type": 34525, + "nw_proto": 6, + "tp_dst": 2222 + } + } + } + } + ], + "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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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)-->'tp_dst=2222,actions=mod_tp_dst:6789,output:2'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionSetTpDst": { + "tp": 6789 + } + }, + { + "OFPActionOutput": { + "port": 2 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_type": 34525, + "nw_proto": 6, + "tp_dst": 2222 + } + } + } + } + ], + "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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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/of10/action/10_SET_TP_DST_IPv6_UDP.json b/ryu/tests/switch/of10/action/10_SET_TP_DST_IPv6_UDP.json new file mode 100644 index 00000000..236e7632 --- /dev/null +++ b/ryu/tests/switch/of10/action/10_SET_TP_DST_IPv6_UDP.json @@ -0,0 +1,97 @@ +[ + "action: 10_SET_TP_DST (IPv6/UDP)", + { + "description": "ethernet/ipv6/udp(dst_port=2222)-->'tp_dst=2222,actions=mod_tp_dst:6789,output:2'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionSetTpDst": { + "tp": 6789 + } + }, + { + "OFPActionOutput": { + "port": 2 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_type": 34525, + "nw_proto": 17, + "tp_dst": 2222 + } + } + } + } + ], + "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)", + "b'\\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)", + "b'\\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)-->'tp_dst=2222,actions=mod_tp_dst:6789,output:2'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionSetTpDst": { + "tp": 6789 + } + }, + { + "OFPActionOutput": { + "port": 2 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_type": 34525, + "nw_proto": 17, + "tp_dst": 2222 + } + } + } + } + ], + "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)", + "b'\\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)", + "b'\\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/of10/match/00_IN_PORT.json b/ryu/tests/switch/of10/match/00_IN_PORT.json new file mode 100644 index 00000000..e7e13b92 --- /dev/null +++ b/ryu/tests/switch/of10/match/00_IN_PORT.json @@ -0,0 +1,340 @@ +[ + "match: 00_IN_PORT", + { + "description": "ethernet/ipv4/tcp-->'in_port=1,actions=output:2'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionOutput": { + "port": 2 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "in_port": 1 + } + } + } + } + ], + "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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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/ipv4/tcp-->'in_port=1,actions=output:CONTROLLER'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionOutput": { + "port": 65533 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "in_port": 1 + } + } + } + } + ], + "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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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'" + ], + "PACKET_IN": [ + "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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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/ipv4/tcp-->'in_port=2,actions=output:2'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionOutput": { + "port": 2 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "in_port": 2 + } + } + } + } + ], + "tests": [ + { + "ingress": [ + "ethernet(dst='ba:bb:bb:bb:bb:bb', src='aa:aa:aa:aa:aa:aa', ethertype=2048)", + "ipv4(tos=65, proto=6, src='10.10.10.10', dst='10.10.20.20', ttl=127)", + "tcp(dst_port=6789, option=bytes(b'\\x01' * 4), src_port=12345)", + "b'\\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'" + ], + "table-miss": [ + 0 + ] + } + ] + }, + { + "description": "ethernet/ipv6/tcp-->'in_port=1,actions=output:2'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionOutput": { + "port": 2 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "in_port": 1 + } + } + } + } + ], + "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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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-->'in_port=1,actions=output:CONTROLLER'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionOutput": { + "port": 65533 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "in_port": 1 + } + } + } + } + ], + "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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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'" + ], + "PACKET_IN": [ + "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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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-->'in_port=2,actions=output:2'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionOutput": { + "port": 2 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "in_port": 2 + } + } + } + } + ], + "tests": [ + { + "ingress": [ + "ethernet(dst='ba:bb:bb:bb:bb:bb', src='aa:aa:aa:aa:aa:aa', ethertype=34525)", + "ipv6(dst='b0::b0', flow_label=203, src='a0::a0', nxt=6, hop_limit=127, traffic_class=65)", + "tcp(dst_port=6789, option=bytes(b'\\x01' * 4), src_port=12345)", + "b'\\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'" + ], + "table-miss": [ + 0 + ] + } + ] + }, + { + "description": "ethernet/arp-->'in_port=1,actions=output:2'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionOutput": { + "port": 2 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "in_port": 1 + } + } + } + } + ], + "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')", + "bytes(b'\\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')", + "bytes(b'\\x00' * (60 - 42))" + ] + } + ] + }, + { + "description": "ethernet/arp-->'in_port=1,actions=output:CONTROLLER'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionOutput": { + "port": 65533 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "in_port": 1 + } + } + } + } + ], + "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')", + "bytes(b'\\x00' * (60 - 42))" + ], + "PACKET_IN": [ + "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')", + "bytes(b'\\x00' * (60 - 42))" + ] + } + ] + }, + { + "description": "ethernet/arp-->'in_port=2,actions=output:2'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionOutput": { + "port": 2 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "in_port": 2 + } + } + } + } + ], + "tests": [ + { + "ingress": [ + "ethernet(dst='ba:bb:bb:bb:bb:bb', src='aa:aa:aa:aa:aa:aa', ethertype=2054)", + "arp(dst_ip='10.10.20.20',dst_mac='ba:bb:bb:bb:bb:bb', opcode=2, src_ip='10.10.10.10',src_mac='aa:aa:aa:aa:aa:aa')", + "bytes(b'\\x00' * (60 - 42))" + ], + "table-miss": [ + 0 + ] + } + ] + } +] diff --git a/ryu/tests/switch/of10/match/01_DL_SRC.json b/ryu/tests/switch/of10/match/01_DL_SRC.json new file mode 100644 index 00000000..dbf5f9f0 --- /dev/null +++ b/ryu/tests/switch/of10/match/01_DL_SRC.json @@ -0,0 +1,340 @@ +[ + "match: 01_DL_SRC", + { + "description": "ethernet(src='12:11:11:11:11:11')/ipv4/tcp-->'dl_src=12:11:11:11:11:11,actions=output:2'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionOutput": { + "port": 2 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_src": "12:11:11:11:11:11" + } + } + } + } + ], + "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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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')/ipv4/tcp-->'dl_src=12:11:11:11:11:11,actions=output:CONTROLLER'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionOutput": { + "port": 65533 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_src": "12:11:11:11:11:11" + } + } + } + } + ], + "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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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'" + ], + "PACKET_IN": [ + "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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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='aa:aa:aa:aa:aa:aa')/ipv4/tcp-->'dl_src=12:11:11:11:11:11,actions=output:2'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionOutput": { + "port": 2 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_src": "12:11:11:11:11:11" + } + } + } + } + ], + "tests": [ + { + "ingress": [ + "ethernet(dst='ba:bb:bb:bb:bb:bb', src='aa:aa:aa:aa:aa:aa', ethertype=2048)", + "ipv4(tos=65, proto=6, src='10.10.10.10', dst='10.10.20.20', ttl=127)", + "tcp(dst_port=6789, option=bytes(b'\\x01' * 4), src_port=12345)", + "b'\\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'" + ], + "table-miss": [ + 0 + ] + } + ] + }, + { + "description": "ethernet(src='12:11:11:11:11:11')/ipv6/tcp-->'dl_src=12:11:11:11:11:11,actions=output:2'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionOutput": { + "port": 2 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_src": "12:11:11:11:11:11" + } + } + } + } + ], + "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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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-->'dl_src=12:11:11:11:11:11,actions=output:CONTROLLER'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionOutput": { + "port": 65533 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_src": "12:11:11:11:11:11" + } + } + } + } + ], + "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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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'" + ], + "PACKET_IN": [ + "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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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='aa:aa:aa:aa:aa:aa')/ipv6/tcp-->'dl_src=12:11:11:11:11:11,actions=output:2'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionOutput": { + "port": 2 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_src": "12:11:11:11:11:11" + } + } + } + } + ], + "tests": [ + { + "ingress": [ + "ethernet(dst='ba:bb:bb:bb:bb:bb', src='aa:aa:aa:aa:aa:aa', ethertype=34525)", + "ipv6(dst='b0::b0', flow_label=203, src='a0::a0', nxt=6, hop_limit=127, traffic_class=65)", + "tcp(dst_port=6789, option=bytes(b'\\x01' * 4), src_port=12345)", + "b'\\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'" + ], + "table-miss": [ + 0 + ] + } + ] + }, + { + "description": "ethernet(src='12:11:11:11:11:11')/arp-->'dl_src=12:11:11:11:11:11,actions=output:2'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionOutput": { + "port": 2 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_src": "12:11:11:11:11:11" + } + } + } + } + ], + "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')", + "bytes(b'\\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')", + "bytes(b'\\x00' * (60 - 42))" + ] + } + ] + }, + { + "description": "ethernet(src='12:11:11:11:11:11')/arp-->'dl_src=12:11:11:11:11:11,actions=output:CONTROLLER'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionOutput": { + "port": 65533 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_src": "12:11:11:11:11:11" + } + } + } + } + ], + "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')", + "bytes(b'\\x00' * (60 - 42))" + ], + "PACKET_IN": [ + "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')", + "bytes(b'\\x00' * (60 - 42))" + ] + } + ] + }, + { + "description": "ethernet(src='aa:aa:aa:aa:aa:aa')/arp-->'dl_src=12:11:11:11:11:11,actions=output:2'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionOutput": { + "port": 2 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_src": "12:11:11:11:11:11" + } + } + } + } + ], + "tests": [ + { + "ingress": [ + "ethernet(dst='ba:bb:bb:bb:bb:bb', src='aa:aa:aa:aa:aa:aa', ethertype=2054)", + "arp(dst_ip='10.10.20.20',dst_mac='ba:bb:bb:bb:bb:bb', opcode=2, src_ip='10.10.10.10',src_mac='aa:aa:aa:aa:aa:aa')", + "bytes(b'\\x00' * (60 - 42))" + ], + "table-miss": [ + 0 + ] + } + ] + } +] diff --git a/ryu/tests/switch/of10/match/02_DL_DST.json b/ryu/tests/switch/of10/match/02_DL_DST.json new file mode 100644 index 00000000..313764b8 --- /dev/null +++ b/ryu/tests/switch/of10/match/02_DL_DST.json @@ -0,0 +1,340 @@ +[ + "match: 02_DL_DST", + { + "description": "ethernet(dst='22:22:22:22:22:22')/ipv4/tcp-->'dl_dst=22:22:22:22:22:22,actions=output:2'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionOutput": { + "port": 2 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_dst": "22:22:22:22:22:22" + } + } + } + } + ], + "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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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')/ipv4/tcp-->'dl_dst=22:22:22:22:22:22,actions=output:CONTROLLER'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionOutput": { + "port": 65533 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_dst": "22:22:22:22:22:22" + } + } + } + } + ], + "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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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'" + ], + "PACKET_IN": [ + "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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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='ba:bb:bb:bb:bb:bb')/ipv4/tcp-->'dl_dst=22:22:22:22:22:22,actions=output:2'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionOutput": { + "port": 2 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_dst": "22:22:22:22:22:22" + } + } + } + } + ], + "tests": [ + { + "ingress": [ + "ethernet(dst='ba:bb:bb:bb:bb:bb', src='aa:aa:aa:aa:aa:aa', ethertype=2048)", + "ipv4(tos=65, proto=6, src='10.10.10.10', dst='10.10.20.20', ttl=127)", + "tcp(dst_port=6789, option=bytes(b'\\x01' * 4), src_port=12345)", + "b'\\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'" + ], + "table-miss": [ + 0 + ] + } + ] + }, + { + "description": "ethernet(dst='22:22:22:22:22:22')/ipv6/tcp-->'dl_dst=22:22:22:22:22:22,actions=output:2'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionOutput": { + "port": 2 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_dst": "22:22:22:22:22:22" + } + } + } + } + ], + "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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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-->'dl_dst=22:22:22:22:22:22,actions=output:CONTROLLER'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionOutput": { + "port": 65533 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_dst": "22:22:22:22:22:22" + } + } + } + } + ], + "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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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'" + ], + "PACKET_IN": [ + "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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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='ba:bb:bb:bb:bb:bb')/ipv6/tcp-->'dl_dst=22:22:22:22:22:22,actions=output:2'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionOutput": { + "port": 2 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_dst": "22:22:22:22:22:22" + } + } + } + } + ], + "tests": [ + { + "ingress": [ + "ethernet(dst='ba:bb:bb:bb:bb:bb', src='aa:aa:aa:aa:aa:aa', ethertype=34525)", + "ipv6(dst='b0::b0', flow_label=203, src='a0::a0', nxt=6, hop_limit=127, traffic_class=65)", + "tcp(dst_port=6789, option=bytes(b'\\x01' * 4), src_port=12345)", + "b'\\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'" + ], + "table-miss": [ + 0 + ] + } + ] + }, + { + "description": "ethernet(dst='22:22:22:22:22:22')/arp-->'dl_dst=22:22:22:22:22:22,actions=output:2'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionOutput": { + "port": 2 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_dst": "22:22:22:22:22:22" + } + } + } + } + ], + "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')", + "bytes(b'\\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')", + "bytes(b'\\x00' * (60 - 42))" + ] + } + ] + }, + { + "description": "ethernet(dst='22:22:22:22:22:22')/arp-->'dl_dst=22:22:22:22:22:22,actions=output:CONTROLLER'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionOutput": { + "port": 65533 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_dst": "22:22:22:22:22:22" + } + } + } + } + ], + "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')", + "bytes(b'\\x00' * (60 - 42))" + ], + "PACKET_IN": [ + "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')", + "bytes(b'\\x00' * (60 - 42))" + ] + } + ] + }, + { + "description": "ethernet(dst='ba:bb:bb:bb:bb:bb')/arp-->'dl_dst=22:22:22:22:22:22,actions=output:2'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionOutput": { + "port": 2 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_dst": "22:22:22:22:22:22" + } + } + } + } + ], + "tests": [ + { + "ingress": [ + "ethernet(dst='ba:bb:bb:bb:bb:bb', src='aa:aa:aa:aa:aa:aa', ethertype=2054)", + "arp(dst_ip='10.10.20.20',dst_mac='ba:bb:bb:bb:bb:bb', opcode=2, src_ip='10.10.10.10',src_mac='aa:aa:aa:aa:aa:aa')", + "bytes(b'\\x00' * (60 - 42))" + ], + "table-miss": [ + 0 + ] + } + ] + } +] diff --git a/ryu/tests/switch/of10/match/03_DL_VLAN.json b/ryu/tests/switch/of10/match/03_DL_VLAN.json new file mode 100644 index 00000000..34907fe1 --- /dev/null +++ b/ryu/tests/switch/of10/match/03_DL_VLAN.json @@ -0,0 +1,355 @@ +[ + "match: 03_DL_VLAN", + { + "description": "ethernet/vlan(vid=100)/ipv4/tcp-->'dl_vlan=100,actions=output:2'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionOutput": { + "port": 2 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_vlan": 100 + } + } + } + } + ], + "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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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)/ipv4/tcp-->'dl_vlan=100,actions=output:CONTROLLER'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionOutput": { + "port": 65533 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_vlan": 100 + } + } + } + } + ], + "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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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'" + ], + "PACKET_IN": [ + "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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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=203)/ipv4/tcp-->'dl_vlan=100,actions=output:2'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionOutput": { + "port": 2 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_vlan": 100 + } + } + } + } + ], + "tests": [ + { + "ingress": [ + "ethernet(dst='ba:bb:bb:bb:bb:bb', src='aa:aa:aa:aa:aa:aa', ethertype=33024)", + "vlan(pcp=5, cfi=0, vid=203, ethertype=2048)", + "ipv4(tos=65, proto=6, src='10.10.10.10', dst='10.10.20.20', ttl=127)", + "tcp(dst_port=6789, option=bytes(b'\\x01' * 4), src_port=12345)", + "b'\\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'" + ], + "table-miss": [ + 0 + ] + } + ] + }, + { + "description": "ethernet/vlan(vid=100)/ipv6/tcp-->'dl_vlan=100,actions=output:2'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionOutput": { + "port": 2 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_vlan": 100 + } + } + } + } + ], + "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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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-->'dl_vlan=100,actions=output:CONTROLLER'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionOutput": { + "port": 65533 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_vlan": 100 + } + } + } + } + ], + "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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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'" + ], + "PACKET_IN": [ + "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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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=203)/ipv6/tcp-->'dl_vlan=100,actions=output:2'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionOutput": { + "port": 2 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_vlan": 100 + } + } + } + } + ], + "tests": [ + { + "ingress": [ + "ethernet(dst='ba:bb:bb:bb:bb:bb', src='aa:aa:aa:aa:aa:aa', ethertype=33024)", + "vlan(pcp=5, cfi=0, vid=203, ethertype=34525)", + "ipv6(dst='b0::b0', flow_label=203, src='a0::a0', nxt=6, hop_limit=127, traffic_class=65)", + "tcp(dst_port=6789, option=bytes(b'\\x01' * 4), src_port=12345)", + "b'\\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'" + ], + "table-miss": [ + 0 + ] + } + ] + }, + { + "description": "ethernet/vlan(vid=100)/arp-->'dl_vlan=100,actions=output:2'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionOutput": { + "port": 2 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_vlan": 100 + } + } + } + } + ], + "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')", + "bytes(b'\\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='12:11:11:11:11:11')", + "bytes(b'\\x00' * 30)" + ] + } + ] + }, + { + "description": "ethernet/vlan(vid=100)/arp-->'dl_vlan=100,actions=output:CONTROLLER'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionOutput": { + "port": 65533 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_vlan": 100 + } + } + } + } + ], + "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')", + "bytes(b'\\x00' * 30)" + ], + "PACKET_IN": [ + "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')", + "bytes(b'\\x00' * 30)" + ] + } + ] + }, + { + "description": "ethernet/vlan(vid=203)/arp-->'dl_vlan=100,actions=output:2'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionOutput": { + "port": 2 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_vlan": 100 + } + } + } + } + ], + "tests": [ + { + "ingress": [ + "ethernet(dst='ba:bb:bb:bb:bb:bb', src='aa:aa:aa:aa:aa:aa', ethertype=33024)", + "vlan(pcp=5, cfi=0, vid=203, ethertype=2054)", + "arp(dst_ip='10.10.20.20',dst_mac='ba:bb:bb:bb:bb:bb', opcode=2, src_ip='10.10.10.10',src_mac='aa:aa:aa:aa:aa:aa')", + "bytes(b'\\x00' * 30)" + ], + "table-miss": [ + 0 + ] + } + ] + } +] diff --git a/ryu/tests/switch/of10/match/04_DL_VLAN_PCP.json b/ryu/tests/switch/of10/match/04_DL_VLAN_PCP.json new file mode 100644 index 00000000..deb4189e --- /dev/null +++ b/ryu/tests/switch/of10/match/04_DL_VLAN_PCP.json @@ -0,0 +1,364 @@ +[ + "match: 04_DL_VLAN_PCP", + { + "description": "ethernet/vlan(pcp=3)/ipv4/tcp-->'dl_vlan_pcp=3,actions=output:2'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionOutput": { + "port": 2 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_vlan": 100, + "dl_vlan_pcp": 3 + } + } + } + } + ], + "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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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)/ipv4/tcp-->'dl_vlan_pcp=3,actions=output:CONTROLLER'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionOutput": { + "port": 65533 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_vlan": 100, + "dl_vlan_pcp": 3 + } + } + } + } + ], + "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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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'" + ], + "PACKET_IN": [ + "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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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=5)/ipv4/tcp-->'dl_vlan_pcp=3,actions=output:2'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionOutput": { + "port": 2 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_vlan": 100, + "dl_vlan_pcp": 3 + } + } + } + } + ], + "tests": [ + { + "ingress": [ + "ethernet(dst='ba:bb:bb:bb:bb:bb', src='aa:aa:aa:aa:aa:aa', ethertype=33024)", + "vlan(pcp=5, cfi=0, vid=203, ethertype=2048)", + "ipv4(tos=65, proto=6, src='10.10.10.10', dst='10.10.20.20', ttl=127)", + "tcp(dst_port=6789, option=bytes(b'\\x01' * 4), src_port=12345)", + "b'\\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'" + ], + "table-miss": [ + 0 + ] + } + ] + }, + { + "description": "ethernet/vlan(pcp=3)/ipv6/tcp-->'dl_vlan_pcp=3,actions=output:2'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionOutput": { + "port": 2 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_vlan": 100, + "dl_vlan_pcp": 3 + } + } + } + } + ], + "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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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-->'dl_vlan_pcp=3,actions=output:CONTROLLER'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionOutput": { + "port": 65533 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_vlan": 100, + "dl_vlan_pcp": 3 + } + } + } + } + ], + "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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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'" + ], + "PACKET_IN": [ + "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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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=5)/ipv6/tcp-->'dl_vlan_pcp=3,actions=output:2'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionOutput": { + "port": 2 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_vlan": 100, + "dl_vlan_pcp": 3 + } + } + } + } + ], + "tests": [ + { + "ingress": [ + "ethernet(dst='ba:bb:bb:bb:bb:bb', src='aa:aa:aa:aa:aa:aa', ethertype=33024)", + "vlan(pcp=5, cfi=0, vid=203, ethertype=34525)", + "ipv6(dst='b0::b0', flow_label=203, src='a0::a0', nxt=6, hop_limit=127, traffic_class=65)", + "tcp(dst_port=6789, option=bytes(b'\\x01' * 4), src_port=12345)", + "b'\\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'" + ], + "table-miss": [ + 0 + ] + } + ] + }, + { + "description": "ethernet/vlan(pcp=3)/arp-->'dl_vlan_pcp=3,actions=output:2'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionOutput": { + "port": 2 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_vlan": 100, + "dl_vlan_pcp": 3 + } + } + } + } + ], + "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')", + "bytes(b'\\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='12:11:11:11:11:11')", + "bytes(b'\\x00' * 30)" + ] + } + ] + }, + { + "description": "ethernet/vlan(pcp=3)/arp-->'dl_vlan_pcp=3,actions=output:CONTROLLER'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionOutput": { + "port": 65533 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_vlan": 100, + "dl_vlan_pcp": 3 + } + } + } + } + ], + "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')", + "bytes(b'\\x00' * 30)" + ], + "PACKET_IN": [ + "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')", + "bytes(b'\\x00' * 30)" + ] + } + ] + }, + { + "description": "ethernet/vlan(pcp=5)/arp-->'dl_vlan_pcp=3,actions=output:2'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionOutput": { + "port": 2 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_vlan": 100, + "dl_vlan_pcp": 3 + } + } + } + } + ], + "tests": [ + { + "ingress": [ + "ethernet(dst='ba:bb:bb:bb:bb:bb', src='aa:aa:aa:aa:aa:aa', ethertype=33024)", + "vlan(pcp=5, cfi=0, vid=203, ethertype=2054)", + "arp(dst_ip='10.10.20.20',dst_mac='ba:bb:bb:bb:bb:bb', opcode=2, src_ip='10.10.10.10',src_mac='aa:aa:aa:aa:aa:aa')", + "bytes(b'\\x00' * 30)" + ], + "table-miss": [ + 0 + ] + } + ] + } +] diff --git a/ryu/tests/switch/of10/match/05_DL_TYPE.json b/ryu/tests/switch/of10/match/05_DL_TYPE.json new file mode 100644 index 00000000..ee61ba06 --- /dev/null +++ b/ryu/tests/switch/of10/match/05_DL_TYPE.json @@ -0,0 +1,340 @@ +[ + "match: 05_DL_TYPE", + { + "description": "ethernet(ethertype=0x0800)/ipv4/tcp-->'dl_type=0x0800,actions=output:2'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionOutput": { + "port": 2 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_type": 2048 + } + } + } + } + ], + "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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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=0x0800)/ipv4/tcp-->'dl_type=0x0800,actions=output:CONTROLLER'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionOutput": { + "port": 65533 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_type": 2048 + } + } + } + } + ], + "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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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'" + ], + "PACKET_IN": [ + "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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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=0x0800)/ipv4/tcp-->'dl_type=0x0806,actions=output:2'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionOutput": { + "port": 2 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_type": 2054 + } + } + } + } + ], + "tests": [ + { + "ingress": [ + "ethernet(dst='ba:bb:bb:bb:bb:bb', src='aa:aa:aa:aa:aa:aa', ethertype=2048)", + "ipv4(tos=65, proto=6, src='10.10.10.10', dst='10.10.20.20', ttl=127)", + "tcp(dst_port=6789, option=bytes(b'\\x01' * 4), src_port=12345)", + "b'\\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'" + ], + "table-miss": [ + 0 + ] + } + ] + }, + { + "description": "ethernet(ethertype=0x86dd)/ipv6/tcp-->'dl_type=0x86dd,actions=output:2'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionOutput": { + "port": 2 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_type": 34525 + } + } + } + } + ], + "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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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-->'dl_type=0x86dd,actions=output:CONTROLLER'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionOutput": { + "port": 65533 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_type": 34525 + } + } + } + } + ], + "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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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'" + ], + "PACKET_IN": [ + "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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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-->'dl_type=0x0806,actions=output:2'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionOutput": { + "port": 2 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_type": 2054 + } + } + } + } + ], + "tests": [ + { + "ingress": [ + "ethernet(dst='ba:bb:bb:bb:bb:bb', src='aa:aa:aa:aa:aa:aa', ethertype=34525)", + "ipv6(dst='b0::b0', flow_label=203, src='a0::a0', nxt=6, hop_limit=127, traffic_class=65)", + "tcp(dst_port=6789, option=bytes(b'\\x01' * 4), src_port=12345)", + "b'\\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'" + ], + "table-miss": [ + 0 + ] + } + ] + }, + { + "description": "ethernet(ethertype=0x0806)/arp-->'dl_type=0x0806,actions=output:2'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionOutput": { + "port": 2 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_type": 2054 + } + } + } + } + ], + "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')", + "bytes(b'\\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')", + "bytes(b'\\x00' * (60 - 42))" + ] + } + ] + }, + { + "description": "ethernet(ethertype=0x0806)/arp-->'dl_type=0x0806,actions=output:CONTROLLER'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionOutput": { + "port": 65533 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_type": 2054 + } + } + } + } + ], + "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')", + "bytes(b'\\x00' * (60 - 42))" + ], + "PACKET_IN": [ + "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')", + "bytes(b'\\x00' * (60 - 42))" + ] + } + ] + }, + { + "description": "ethernet(ethertype=0x0806)/arp-->'dl_type=0x0800,actions=output:2'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionOutput": { + "port": 2 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_type": 2048 + } + } + } + } + ], + "tests": [ + { + "ingress": [ + "ethernet(dst='ba:bb:bb:bb:bb:bb', src='aa:aa:aa:aa:aa:aa', ethertype=2054)", + "arp(dst_ip='10.10.20.20',dst_mac='ba:bb:bb:bb:bb:bb', opcode=2, src_ip='10.10.10.10',src_mac='aa:aa:aa:aa:aa:aa')", + "bytes(b'\\x00' * (60 - 42))" + ], + "table-miss": [ + 0 + ] + } + ] + } +] diff --git a/ryu/tests/switch/of10/match/06_NW_TOS_IPv4.json b/ryu/tests/switch/of10/match/06_NW_TOS_IPv4.json new file mode 100644 index 00000000..78ff2874 --- /dev/null +++ b/ryu/tests/switch/of10/match/06_NW_TOS_IPv4.json @@ -0,0 +1,242 @@ +[ + "match: 06_NW_TOS (IPv4)", + { + "description": "ethernet/ipv4(tos=32)/tcp-->'nw_tos=32,actions=output:2'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionOutput": { + "port": 2 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_type": 2048, + "nw_tos": 32 + } + } + } + } + ], + "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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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/ipv4(tos=32)/tcp-->'nw_tos=32,actions=output:CONTROLLER'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionOutput": { + "port": 65533 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_type": 2048, + "nw_tos": 32 + } + } + } + } + ], + "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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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'" + ], + "PACKET_IN": [ + "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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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/ipv4(tos=65)/tcp-->'nw_tos=32,actions=output:2'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionOutput": { + "port": 2 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_type": 2048, + "nw_tos": 32 + } + } + } + } + ], + "tests": [ + { + "ingress": [ + "ethernet(dst='ba:bb:bb:bb:bb:bb', src='aa:aa:aa:aa:aa:aa', ethertype=2048)", + "ipv4(tos=65, proto=6, src='10.10.10.10', dst='10.10.20.20', ttl=127)", + "tcp(dst_port=6789, option=bytes(b'\\x01' * 4), src_port=12345)", + "b'\\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'" + ], + "table-miss": [ + 0 + ] + } + ] + }, + { + "description": "ethernet/vlan/ipv4(tos=32)/tcp-->'nw_tos=32,actions=output:2'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionOutput": { + "port": 2 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_type": 2048, + "nw_tos": 32 + } + } + } + } + ], + "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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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-->'nw_tos=32,actions=output:CONTROLLER'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionOutput": { + "port": 65533 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_type": 2048, + "nw_tos": 32 + } + } + } + } + ], + "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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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'" + ], + "PACKET_IN": [ + "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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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=65)/tcp-->'nw_tos=32,actions=output:2'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionOutput": { + "port": 2 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_type": 2048, + "nw_tos": 32 + } + } + } + } + ], + "tests": [ + { + "ingress": [ + "ethernet(dst='ba:bb:bb:bb:bb:bb', src='aa:aa:aa:aa:aa:aa', ethertype=33024)", + "vlan(pcp=5, cfi=0, vid=203, ethertype=2048)", + "ipv4(tos=65, proto=6, src='10.10.10.10', dst='10.10.20.20', ttl=127)", + "tcp(dst_port=6789, option=bytes(b'\\x01' * 4), src_port=12345)", + "b'\\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'" + ], + "table-miss": [ + 0 + ] + } + ] + } +] diff --git a/ryu/tests/switch/of10/match/06_NW_TOS_IPv6.json b/ryu/tests/switch/of10/match/06_NW_TOS_IPv6.json new file mode 100644 index 00000000..32b98f6c --- /dev/null +++ b/ryu/tests/switch/of10/match/06_NW_TOS_IPv6.json @@ -0,0 +1,242 @@ +[ + "match: 06_NW_TOS (IPv6)", + { + "description": "ethernet/ipv6(traffic_class=32)/tcp-->'nw_tos=32,actions=output:2'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionOutput": { + "port": 2 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_type": 34525, + "nw_tos": 32 + } + } + } + } + ], + "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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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(traffic_class=32)/tcp-->'nw_tos=32,actions=output:CONTROLLER'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionOutput": { + "port": 65533 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_type": 34525, + "nw_tos": 32 + } + } + } + } + ], + "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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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'" + ], + "PACKET_IN": [ + "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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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(traffic_class=65)/tcp-->'nw_tos=32,actions=output:2'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionOutput": { + "port": 2 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_type": 34525, + "nw_tos": 32 + } + } + } + } + ], + "tests": [ + { + "ingress": [ + "ethernet(dst='ba:bb:bb:bb:bb:bb', src='aa:aa:aa:aa:aa:aa', ethertype=34525)", + "ipv6(dst='b0::b0', flow_label=203, src='a0::a0', nxt=6, hop_limit=127, traffic_class=65)", + "tcp(dst_port=6789, option=bytes(b'\\x01' * 4), src_port=12345)", + "b'\\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'" + ], + "table-miss": [ + 0 + ] + } + ] + }, + { + "description": "ethernet/vlan/ipv6(traffic_class=32)/tcp-->'nw_tos=32,actions=output:2'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionOutput": { + "port": 2 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_type": 34525, + "nw_tos": 32 + } + } + } + } + ], + "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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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-->'nw_tos=32,actions=output:CONTROLLER'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionOutput": { + "port": 65533 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_type": 34525, + "nw_tos": 32 + } + } + } + } + ], + "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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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'" + ], + "PACKET_IN": [ + "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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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=65)/tcp-->'nw_tos=32,actions=output:2'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionOutput": { + "port": 2 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_type": 34525, + "nw_tos": 32 + } + } + } + } + ], + "tests": [ + { + "ingress": [ + "ethernet(dst='ba:bb:bb:bb:bb:bb', src='aa:aa:aa:aa:aa:aa', ethertype=33024)", + "vlan(pcp=5, cfi=0, vid=203, ethertype=34525)", + "ipv6(dst='b0::b0', flow_label=203, src='a0::a0', nxt=6, hop_limit=127, traffic_class=65)", + "tcp(dst_port=6789, option=bytes(b'\\x01' * 4), src_port=12345)", + "b'\\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'" + ], + "table-miss": [ + 0 + ] + } + ] + } +] diff --git a/ryu/tests/switch/of10/match/07_NW_PROTO_IPv4.json b/ryu/tests/switch/of10/match/07_NW_PROTO_IPv4.json new file mode 100644 index 00000000..9cec9671 --- /dev/null +++ b/ryu/tests/switch/of10/match/07_NW_PROTO_IPv4.json @@ -0,0 +1,242 @@ +[ + "match: 07_NW_PROTO (IPv4)", + { + "description": "ethernet/ipv4(proto=6)/tcp-->'nw_proto=6,actions=output:2'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionOutput": { + "port": 2 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_type": 2048, + "nw_proto": 6 + } + } + } + } + ], + "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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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/ipv4(proto=6)/tcp-->'nw_proto=6,actions=output:CONTROLLER'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionOutput": { + "port": 65533 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_type": 2048, + "nw_proto": 6 + } + } + } + } + ], + "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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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'" + ], + "PACKET_IN": [ + "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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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/ipv4(proto=6)/tcp-->'nw_proto=17,actions=output:2'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionOutput": { + "port": 2 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_type": 2048, + "nw_proto": 17 + } + } + } + } + ], + "tests": [ + { + "ingress": [ + "ethernet(dst='ba:bb:bb:bb:bb:bb', src='aa:aa:aa:aa:aa:aa', ethertype=2048)", + "ipv4(tos=65, proto=6, src='10.10.10.10', dst='10.10.20.20', ttl=127)", + "tcp(dst_port=6789, option=bytes(b'\\x01' * 4), src_port=12345)", + "b'\\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'" + ], + "table-miss": [ + 0 + ] + } + ] + }, + { + "description": "ethernet/vlan/ipv4(proto=6)/tcp-->'nw_proto=6,actions=output:2'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionOutput": { + "port": 2 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_type": 2048, + "nw_proto": 6 + } + } + } + } + ], + "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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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-->'nw_proto=6,actions=output:CONTROLLER'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionOutput": { + "port": 65533 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_type": 2048, + "nw_proto": 6 + } + } + } + } + ], + "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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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'" + ], + "PACKET_IN": [ + "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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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-->'nw_proto=17,actions=output:2'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionOutput": { + "port": 2 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_type": 2048, + "nw_proto": 17 + } + } + } + } + ], + "tests": [ + { + "ingress": [ + "ethernet(dst='ba:bb:bb:bb:bb:bb', src='aa:aa:aa:aa:aa:aa', ethertype=33024)", + "vlan(pcp=5, cfi=0, vid=203, ethertype=2048)", + "ipv4(tos=65, proto=6, src='10.10.10.10', dst='10.10.20.20', ttl=127)", + "tcp(dst_port=6789, option=bytes(b'\\x01' * 4), src_port=12345)", + "b'\\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'" + ], + "table-miss": [ + 0 + ] + } + ] + } +] diff --git a/ryu/tests/switch/of10/match/07_NW_PROTO_IPv6.json b/ryu/tests/switch/of10/match/07_NW_PROTO_IPv6.json new file mode 100644 index 00000000..7cd4c93a --- /dev/null +++ b/ryu/tests/switch/of10/match/07_NW_PROTO_IPv6.json @@ -0,0 +1,242 @@ +[ + "match: 07_NW_PROTO (IPv6)", + { + "description": "ethernet/ipv6(nxt=6)/tcp-->'nw_proto=6,actions=output:2'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionOutput": { + "port": 2 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_type": 34525, + "nw_proto": 6 + } + } + } + } + ], + "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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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(nxt=6)/tcp-->'nw_proto=6,actions=output:CONTROLLER'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionOutput": { + "port": 65533 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_type": 34525, + "nw_proto": 6 + } + } + } + } + ], + "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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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'" + ], + "PACKET_IN": [ + "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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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(nxt=6)/tcp-->'nw_proto=17,actions=output:2'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionOutput": { + "port": 2 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_type": 34525, + "nw_proto": 17 + } + } + } + } + ], + "tests": [ + { + "ingress": [ + "ethernet(dst='ba:bb:bb:bb:bb:bb', src='aa:aa:aa:aa:aa:aa', ethertype=34525)", + "ipv6(dst='b0::b0', flow_label=203, src='a0::a0', nxt=6, hop_limit=127, traffic_class=65)", + "tcp(dst_port=6789, option=bytes(b'\\x01' * 4), src_port=12345)", + "b'\\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'" + ], + "table-miss": [ + 0 + ] + } + ] + }, + { + "description": "ethernet/vlan/ipv6(nxt=6)/tcp-->'nw_proto=6,actions=output:2'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionOutput": { + "port": 2 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_type": 34525, + "nw_proto": 6 + } + } + } + } + ], + "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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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-->'nw_proto=6,actions=output:CONTROLLER'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionOutput": { + "port": 65533 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_type": 34525, + "nw_proto": 6 + } + } + } + } + ], + "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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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'" + ], + "PACKET_IN": [ + "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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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-->'nw_proto=17,actions=output:2'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionOutput": { + "port": 2 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_type": 34525, + "nw_proto": 17 + } + } + } + } + ], + "tests": [ + { + "ingress": [ + "ethernet(dst='ba:bb:bb:bb:bb:bb', src='aa:aa:aa:aa:aa:aa', ethertype=33024)", + "vlan(pcp=5, cfi=0, vid=203, ethertype=34525)", + "ipv6(dst='b0::b0', flow_label=203, src='a0::a0', nxt=6, hop_limit=127, traffic_class=65)", + "tcp(dst_port=6789, option=bytes(b'\\x01' * 4), src_port=12345)", + "b'\\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'" + ], + "table-miss": [ + 0 + ] + } + ] + } +] diff --git a/ryu/tests/switch/of10/match/08_NW_SRC.json b/ryu/tests/switch/of10/match/08_NW_SRC.json new file mode 100644 index 00000000..e62375f2 --- /dev/null +++ b/ryu/tests/switch/of10/match/08_NW_SRC.json @@ -0,0 +1,242 @@ +[ + "match: 08_NW_SRC", + { + "description": "ethernet/ipv4(src='192.168.10.10')/tcp-->'nw_src=192.168.10.10,actions=output:2'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionOutput": { + "port": 2 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_type": 2048, + "nw_src": "192.168.10.10" + } + } + } + } + ], + "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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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/ipv4(src='192.168.10.10')/tcp-->'nw_src=192.168.10.10,actions=output:CONTROLLER'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionOutput": { + "port": 65533 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_type": 2048, + "nw_src": "192.168.10.10" + } + } + } + } + ], + "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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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'" + ], + "PACKET_IN": [ + "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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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/ipv4(src='10.10.10.10')/tcp-->'nw_src=192.168.10.10,actions=output:2'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionOutput": { + "port": 2 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_type": 2048, + "nw_src": "192.168.10.10" + } + } + } + } + ], + "tests": [ + { + "ingress": [ + "ethernet(dst='ba:bb:bb:bb:bb:bb', src='aa:aa:aa:aa:aa:aa', ethertype=2048)", + "ipv4(tos=65, proto=6, src='10.10.10.10', dst='10.10.20.20', ttl=127)", + "tcp(dst_port=6789, option=bytes(b'\\x01' * 4), src_port=12345)", + "b'\\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'" + ], + "table-miss": [ + 0 + ] + } + ] + }, + { + "description": "ethernet/vlan/ipv4(src='192.168.10.10')/tcp-->'nw_src=192.168.10.10,actions=output:2'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionOutput": { + "port": 2 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_type": 2048, + "nw_src": "192.168.10.10" + } + } + } + } + ], + "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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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-->'nw_src=192.168.10.10,actions=output:CONTROLLER'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionOutput": { + "port": 65533 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_type": 2048, + "nw_src": "192.168.10.10" + } + } + } + } + ], + "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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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'" + ], + "PACKET_IN": [ + "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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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='10.10.10.10')/tcp-->'nw_src=192.168.10.10,actions=output:2'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionOutput": { + "port": 2 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_type": 2048, + "nw_src": "192.168.10.10" + } + } + } + } + ], + "tests": [ + { + "ingress": [ + "ethernet(dst='ba:bb:bb:bb:bb:bb', src='aa:aa:aa:aa:aa:aa', ethertype=33024)", + "vlan(pcp=5, cfi=0, vid=203, ethertype=2048)", + "ipv4(tos=65, proto=6, src='10.10.10.10', dst='10.10.20.20', ttl=127)", + "tcp(dst_port=6789, option=bytes(b'\\x01' * 4), src_port=12345)", + "b'\\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'" + ], + "table-miss": [ + 0 + ] + } + ] + } +] diff --git a/ryu/tests/switch/of10/match/08_NW_SRC_Mask.json b/ryu/tests/switch/of10/match/08_NW_SRC_Mask.json new file mode 100644 index 00000000..0a944bbd --- /dev/null +++ b/ryu/tests/switch/of10/match/08_NW_SRC_Mask.json @@ -0,0 +1,248 @@ +[ + "match: 08_NW_SRC (Mask)", + { + "description": "ethernet/ipv4(src='192.168.10.10')/tcp-->'nw_src=192.168.10.0/24,actions=output:2'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionOutput": { + "port": 2 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_type": 2048, + "nw_src": "192.168.10.0", + "nw_src_mask": 24 + } + } + } + } + ], + "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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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/ipv4(src='192.168.10.10')/tcp-->'nw_src=192.168.10.0/24,actions=output:CONTROLLER'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionOutput": { + "port": 65533 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_type": 2048, + "nw_src": "192.168.10.0", + "nw_src_mask": 24 + } + } + } + } + ], + "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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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'" + ], + "PACKET_IN": [ + "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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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/ipv4(src='10.10.10.10')/tcp-->'nw_src=192.168.10.0/24,actions=output:2'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionOutput": { + "port": 2 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_type": 2048, + "nw_src": "192.168.10.0", + "nw_src_mask": 24 + } + } + } + } + ], + "tests": [ + { + "ingress": [ + "ethernet(dst='ba:bb:bb:bb:bb:bb', src='aa:aa:aa:aa:aa:aa', ethertype=2048)", + "ipv4(tos=65, proto=6, src='10.10.10.10', dst='10.10.20.20', ttl=127)", + "tcp(dst_port=6789, option=bytes(b'\\x01' * 4), src_port=12345)", + "b'\\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'" + ], + "table-miss": [ + 0 + ] + } + ] + }, + { + "description": "ethernet/vlan/ipv4(src='192.168.10.10')/tcp-->'nw_src=192.168.10.0/24,actions=output:2'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionOutput": { + "port": 2 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_type": 2048, + "nw_src": "192.168.10.0", + "nw_src_mask": 24 + } + } + } + } + ], + "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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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-->'nw_src=192.168.10.0/24,actions=output:CONTROLLER'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionOutput": { + "port": 65533 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_type": 2048, + "nw_src": "192.168.10.0", + "nw_src_mask": 24 + } + } + } + } + ], + "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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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'" + ], + "PACKET_IN": [ + "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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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='10.10.10.10')/tcp-->'nw_src=192.168.10.0/24,actions=output:2'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionOutput": { + "port": 2 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_type": 2048, + "nw_src": "192.168.10.0", + "nw_src_mask": 24 + } + } + } + } + ], + "tests": [ + { + "ingress": [ + "ethernet(dst='ba:bb:bb:bb:bb:bb', src='aa:aa:aa:aa:aa:aa', ethertype=33024)", + "vlan(pcp=5, cfi=0, vid=203, ethertype=2048)", + "ipv4(tos=65, proto=6, src='10.10.10.10', dst='10.10.20.20', ttl=127)", + "tcp(dst_port=6789, option=bytes(b'\\x01' * 4), src_port=12345)", + "b'\\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'" + ], + "table-miss": [ + 0 + ] + } + ] + } +] diff --git a/ryu/tests/switch/of10/match/09_NW_DST.json b/ryu/tests/switch/of10/match/09_NW_DST.json new file mode 100644 index 00000000..ee8ebe9d --- /dev/null +++ b/ryu/tests/switch/of10/match/09_NW_DST.json @@ -0,0 +1,242 @@ +[ + "match: 09_NW_DST", + { + "description": "ethernet/ipv4(dst='192.168.20.20')/tcp-->'nw_dst=192.168.20.20,actions=output:2'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionOutput": { + "port": 2 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_type": 2048, + "nw_dst": "192.168.20.20" + } + } + } + } + ], + "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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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/ipv4(dst='192.168.20.20')/tcp-->'nw_dst=192.168.20.20,actions=output:CONTROLLER'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionOutput": { + "port": 65533 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_type": 2048, + "nw_dst": "192.168.20.20" + } + } + } + } + ], + "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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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'" + ], + "PACKET_IN": [ + "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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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/ipv4(dst='10.10.20.20')/tcp-->'nw_dst=192.168.20.20,actions=output:2'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionOutput": { + "port": 2 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_type": 2048, + "nw_dst": "192.168.20.20" + } + } + } + } + ], + "tests": [ + { + "ingress": [ + "ethernet(dst='ba:bb:bb:bb:bb:bb', src='aa:aa:aa:aa:aa:aa', ethertype=2048)", + "ipv4(tos=65, proto=6, src='10.10.10.10', dst='10.10.20.20', ttl=127)", + "tcp(dst_port=6789, option=bytes(b'\\x01' * 4), src_port=12345)", + "b'\\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'" + ], + "table-miss": [ + 0 + ] + } + ] + }, + { + "description": "ethernet/vlan/ipv4(dst='192.168.20.20')/tcp-->'nw_dst=192.168.20.20,actions=output:2'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionOutput": { + "port": 2 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_type": 2048, + "nw_dst": "192.168.20.20" + } + } + } + } + ], + "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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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-->'nw_dst=192.168.20.20,actions=output:CONTROLLER'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionOutput": { + "port": 65533 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_type": 2048, + "nw_dst": "192.168.20.20" + } + } + } + } + ], + "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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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'" + ], + "PACKET_IN": [ + "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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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='10.10.20.20')/tcp-->'nw_dst=192.168.20.20,actions=output:2'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionOutput": { + "port": 2 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_type": 2048, + "nw_dst": "192.168.20.20" + } + } + } + } + ], + "tests": [ + { + "ingress": [ + "ethernet(dst='ba:bb:bb:bb:bb:bb', src='aa:aa:aa:aa:aa:aa', ethertype=33024)", + "vlan(pcp=5, cfi=0, vid=203, ethertype=2048)", + "ipv4(tos=65, proto=6, src='10.10.10.10', dst='10.10.20.20', ttl=127)", + "tcp(dst_port=6789, option=bytes(b'\\x01' * 4), src_port=12345)", + "b'\\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'" + ], + "table-miss": [ + 0 + ] + } + ] + } +] diff --git a/ryu/tests/switch/of10/match/09_NW_DST_Mask.json b/ryu/tests/switch/of10/match/09_NW_DST_Mask.json new file mode 100644 index 00000000..43eeb247 --- /dev/null +++ b/ryu/tests/switch/of10/match/09_NW_DST_Mask.json @@ -0,0 +1,248 @@ +[ + "match: 09_NW_DST (Mask)", + { + "description": "ethernet/ipv4(dst='192.168.20.20')/tcp-->'nw_dst=192.168.20.0/24,actions=output:2'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionOutput": { + "port": 2 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_type": 2048, + "nw_dst": "192.168.20.0", + "nw_dst_mask": 24 + } + } + } + } + ], + "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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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/ipv4(dst='192.168.20.20')/tcp-->'nw_dst=192.168.20.0/24,actions=output:CONTROLLER'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionOutput": { + "port": 65533 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_type": 2048, + "nw_dst": "192.168.20.0", + "nw_dst_mask": 24 + } + } + } + } + ], + "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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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'" + ], + "PACKET_IN": [ + "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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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/ipv4(dst='10.10.20.20')/tcp-->'nw_dst=192.168.20.0/24,actions=output:2'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionOutput": { + "port": 2 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_type": 2048, + "nw_dst": "192.168.20.0", + "nw_dst_mask": 24 + } + } + } + } + ], + "tests": [ + { + "ingress": [ + "ethernet(dst='ba:bb:bb:bb:bb:bb', src='aa:aa:aa:aa:aa:aa', ethertype=2048)", + "ipv4(tos=65, proto=6, src='10.10.10.10', dst='10.10.20.20', ttl=127)", + "tcp(dst_port=6789, option=bytes(b'\\x01' * 4), src_port=12345)", + "b'\\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'" + ], + "table-miss": [ + 0 + ] + } + ] + }, + { + "description": "ethernet/vlan/ipv4(dst='192.168.20.20')/tcp-->'nw_dst=192.168.20.0/24,actions=output:2'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionOutput": { + "port": 2 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_type": 2048, + "nw_dst": "192.168.20.0", + "nw_dst_mask": 24 + } + } + } + } + ], + "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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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-->'nw_dst=192.168.20.0/24,actions=output:CONTROLLER'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionOutput": { + "port": 65533 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_type": 2048, + "nw_dst": "192.168.20.0", + "nw_dst_mask": 24 + } + } + } + } + ], + "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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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'" + ], + "PACKET_IN": [ + "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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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='10.10.20.20')/tcp-->'nw_dst=192.168.20.0/24,actions=output:2'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionOutput": { + "port": 2 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_type": 2048, + "nw_dst": "192.168.20.0", + "nw_dst_mask": 24 + } + } + } + } + ], + "tests": [ + { + "ingress": [ + "ethernet(dst='ba:bb:bb:bb:bb:bb', src='aa:aa:aa:aa:aa:aa', ethertype=33024)", + "vlan(pcp=5, cfi=0, vid=203, ethertype=2048)", + "ipv4(tos=65, proto=6, src='10.10.10.10', dst='10.10.20.20', ttl=127)", + "tcp(dst_port=6789, option=bytes(b'\\x01' * 4), src_port=12345)", + "b'\\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'" + ], + "table-miss": [ + 0 + ] + } + ] + } +] diff --git a/ryu/tests/switch/of10/match/10_TP_SRC_IPv4_TCP.json b/ryu/tests/switch/of10/match/10_TP_SRC_IPv4_TCP.json new file mode 100644 index 00000000..bd7a28ee --- /dev/null +++ b/ryu/tests/switch/of10/match/10_TP_SRC_IPv4_TCP.json @@ -0,0 +1,248 @@ +[ + "match: 10_TP_SRC (IPv4/TCP)", + { + "description": "ethernet/ipv4/tcp(src_port=11111)-->'tp_src=11111,actions=output:2'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionOutput": { + "port": 2 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_type": 2048, + "nw_proto": 6, + "tp_src": 11111 + } + } + } + } + ], + "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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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/ipv4/tcp(src_port=11111)-->'tp_src=11111,actions=output:CONTROLLER'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionOutput": { + "port": 65533 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_type": 2048, + "nw_proto": 6, + "tp_src": 11111 + } + } + } + } + ], + "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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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'" + ], + "PACKET_IN": [ + "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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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/ipv4/tcp(src_port=12345)-->'tp_src=11111,actions=output:2'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionOutput": { + "port": 2 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_type": 2048, + "nw_proto": 6, + "tp_src": 11111 + } + } + } + } + ], + "tests": [ + { + "ingress": [ + "ethernet(dst='ba:bb:bb:bb:bb:bb', src='aa:aa:aa:aa:aa:aa', ethertype=2048)", + "ipv4(tos=65, proto=6, src='10.10.10.10', dst='10.10.20.20', ttl=127)", + "tcp(dst_port=6789, option=bytes(b'\\x01' * 4), src_port=12345)", + "b'\\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'" + ], + "table-miss": [ + 0 + ] + } + ] + }, + { + "description": "ethernet/vlan/ipv4/tcp(src_port=11111)-->'tp_src=11111,actions=output:2'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionOutput": { + "port": 2 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_type": 2048, + "nw_proto": 6, + "tp_src": 11111 + } + } + } + } + ], + "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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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)-->'tp_src=11111,actions=output:CONTROLLER'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionOutput": { + "port": 65533 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_type": 2048, + "nw_proto": 6, + "tp_src": 11111 + } + } + } + } + ], + "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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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'" + ], + "PACKET_IN": [ + "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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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=12345)-->'tp_src=11111,actions=output:2'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionOutput": { + "port": 2 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_type": 2048, + "nw_proto": 6, + "tp_src": 11111 + } + } + } + } + ], + "tests": [ + { + "ingress": [ + "ethernet(dst='ba:bb:bb:bb:bb:bb', src='aa:aa:aa:aa:aa:aa', ethertype=33024)", + "vlan(pcp=5, cfi=0, vid=203, ethertype=2048)", + "ipv4(tos=65, proto=6, src='10.10.10.10', dst='10.10.20.20', ttl=127)", + "tcp(dst_port=6789, option=bytes(b'\\x01' * 4), src_port=12345)", + "b'\\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'" + ], + "table-miss": [ + 0 + ] + } + ] + } +] diff --git a/ryu/tests/switch/of10/match/10_TP_SRC_IPv4_UDP.json b/ryu/tests/switch/of10/match/10_TP_SRC_IPv4_UDP.json new file mode 100644 index 00000000..613c1d10 --- /dev/null +++ b/ryu/tests/switch/of10/match/10_TP_SRC_IPv4_UDP.json @@ -0,0 +1,248 @@ +[ + "match: 10_TP_SRC (IPv4/UDP)", + { + "description": "ethernet/ipv4/udp(src_port=11111)-->'tp_src=11111,actions=output:2'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionOutput": { + "port": 2 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_type": 2048, + "nw_proto": 17, + "tp_src": 11111 + } + } + } + } + ], + "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)", + "b'\\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=11111)", + "b'\\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/ipv4/udp(src_port=11111)-->'tp_src=11111,actions=output:CONTROLLER'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionOutput": { + "port": 65533 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_type": 2048, + "nw_proto": 17, + "tp_src": 11111 + } + } + } + } + ], + "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)", + "b'\\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'" + ], + "PACKET_IN": [ + "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)", + "b'\\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/ipv4/udp(src_port=12345)-->'tp_src=11111,actions=output:2'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionOutput": { + "port": 2 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_type": 2048, + "nw_proto": 17, + "tp_src": 11111 + } + } + } + } + ], + "tests": [ + { + "ingress": [ + "ethernet(dst='ba:bb:bb:bb:bb:bb', src='aa:aa:aa:aa:aa:aa', ethertype=2048)", + "ipv4(tos=65, proto=17, src='10.10.10.10', dst='10.10.20.20', ttl=127)", + "udp(dst_port=6789, src_port=12345)", + "b'\\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'" + ], + "table-miss": [ + 0 + ] + } + ] + }, + { + "description": "ethernet/vlan/ipv4/udp(src_port=11111)-->'tp_src=11111,actions=output:2'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionOutput": { + "port": 2 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_type": 2048, + "nw_proto": 17, + "tp_src": 11111 + } + } + } + } + ], + "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)", + "b'\\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=11111)", + "b'\\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)-->'tp_src=11111,actions=output:CONTROLLER'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionOutput": { + "port": 65533 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_type": 2048, + "nw_proto": 17, + "tp_src": 11111 + } + } + } + } + ], + "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)", + "b'\\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'" + ], + "PACKET_IN": [ + "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)", + "b'\\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=12345)-->'tp_src=11111,actions=output:2'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionOutput": { + "port": 2 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_type": 2048, + "nw_proto": 17, + "tp_src": 11111 + } + } + } + } + ], + "tests": [ + { + "ingress": [ + "ethernet(dst='ba:bb:bb:bb:bb:bb', src='aa:aa:aa:aa:aa:aa', ethertype=33024)", + "vlan(pcp=5, cfi=0, vid=203, ethertype=2048)", + "ipv4(tos=65, proto=17, src='10.10.10.10', dst='10.10.20.20', ttl=127)", + "udp(dst_port=6789, src_port=12345)", + "b'\\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'" + ], + "table-miss": [ + 0 + ] + } + ] + } +] diff --git a/ryu/tests/switch/of10/match/10_TP_SRC_IPv6_TCP.json b/ryu/tests/switch/of10/match/10_TP_SRC_IPv6_TCP.json new file mode 100644 index 00000000..2cbc21d7 --- /dev/null +++ b/ryu/tests/switch/of10/match/10_TP_SRC_IPv6_TCP.json @@ -0,0 +1,248 @@ +[ + "match: 10_TP_SRC (IPv4/TCP)", + { + "description": "ethernet/ipv6/tcp(src_port=11111)-->'tp_src=11111,actions=output:2'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionOutput": { + "port": 2 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_type": 34525, + "nw_proto": 6, + "tp_src": 11111 + } + } + } + } + ], + "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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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(src_port=11111)-->'tp_src=11111,actions=output:CONTROLLER'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionOutput": { + "port": 65533 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_type": 34525, + "nw_proto": 6, + "tp_src": 11111 + } + } + } + } + ], + "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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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'" + ], + "PACKET_IN": [ + "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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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(src_port=12345)-->'tp_src=11111,actions=output:2'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionOutput": { + "port": 2 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_type": 34525, + "nw_proto": 6, + "tp_src": 11111 + } + } + } + } + ], + "tests": [ + { + "ingress": [ + "ethernet(dst='ba:bb:bb:bb:bb:bb', src='aa:aa:aa:aa:aa:aa', ethertype=34525)", + "ipv6(dst='b0::b0', flow_label=203, src='a0::a0', nxt=6, hop_limit=127, traffic_class=65)", + "tcp(dst_port=6789, option=bytes(b'\\x01' * 4), src_port=12345)", + "b'\\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'" + ], + "table-miss": [ + 0 + ] + } + ] + }, + { + "description": "ethernet/vlan/ipv6/tcp(src_port=11111)-->'tp_src=11111,actions=output:2'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionOutput": { + "port": 2 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_type": 34525, + "nw_proto": 6, + "tp_src": 11111 + } + } + } + } + ], + "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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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)-->'tp_src=11111,actions=output:CONTROLLER'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionOutput": { + "port": 65533 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_type": 34525, + "nw_proto": 6, + "tp_src": 11111 + } + } + } + } + ], + "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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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'" + ], + "PACKET_IN": [ + "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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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=12345)-->'tp_src=11111,actions=output:2'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionOutput": { + "port": 2 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_type": 34525, + "nw_proto": 6, + "tp_src": 11111 + } + } + } + } + ], + "tests": [ + { + "ingress": [ + "ethernet(dst='ba:bb:bb:bb:bb:bb', src='aa:aa:aa:aa:aa:aa', ethertype=33024)", + "vlan(pcp=5, cfi=0, vid=203, ethertype=34525)", + "ipv6(dst='b0::b0', flow_label=203, src='a0::a0', nxt=6, hop_limit=127, traffic_class=65)", + "tcp(dst_port=6789, option=bytes(b'\\x01' * 4), src_port=12345)", + "b'\\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'" + ], + "table-miss": [ + 0 + ] + } + ] + } +] diff --git a/ryu/tests/switch/of10/match/10_TP_SRC_IPv6_UDP.json b/ryu/tests/switch/of10/match/10_TP_SRC_IPv6_UDP.json new file mode 100644 index 00000000..30d23888 --- /dev/null +++ b/ryu/tests/switch/of10/match/10_TP_SRC_IPv6_UDP.json @@ -0,0 +1,248 @@ +[ + "match: 10_TP_SRC (IPv6/UDP)", + { + "description": "ethernet/ipv6/udp(src_port=11111)-->'tp_src=11111,actions=output:2'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionOutput": { + "port": 2 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_type": 34525, + "nw_proto": 17, + "tp_src": 11111 + } + } + } + } + ], + "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)", + "b'\\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=11111)", + "b'\\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/udp(src_port=11111)-->'tp_src=11111,actions=output:CONTROLLER'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionOutput": { + "port": 65533 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_type": 34525, + "nw_proto": 17, + "tp_src": 11111 + } + } + } + } + ], + "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)", + "b'\\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'" + ], + "PACKET_IN": [ + "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)", + "b'\\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/udp(src_port=12345)-->'tp_src=11111,actions=output:2'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionOutput": { + "port": 2 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_type": 34525, + "nw_proto": 17, + "tp_src": 11111 + } + } + } + } + ], + "tests": [ + { + "ingress": [ + "ethernet(dst='ba:bb:bb:bb:bb:bb', src='aa:aa:aa:aa:aa:aa', ethertype=34525)", + "ipv6(dst='b0::b0', flow_label=203, src='a0::a0', nxt=17, hop_limit=127, traffic_class=65)", + "udp(dst_port=6789, src_port=12345)", + "b'\\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'" + ], + "table-miss": [ + 0 + ] + } + ] + }, + { + "description": "ethernet/vlan/ipv6/udp(src_port=11111)-->'tp_src=11111,actions=output:2'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionOutput": { + "port": 2 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_type": 34525, + "nw_proto": 17, + "tp_src": 11111 + } + } + } + } + ], + "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)", + "b'\\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=11111)", + "b'\\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)-->'tp_src=11111,actions=output:CONTROLLER'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionOutput": { + "port": 65533 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_type": 34525, + "nw_proto": 17, + "tp_src": 11111 + } + } + } + } + ], + "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)", + "b'\\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'" + ], + "PACKET_IN": [ + "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)", + "b'\\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=12345)-->'tp_src=11111,actions=output:2'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionOutput": { + "port": 2 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_type": 34525, + "nw_proto": 17, + "tp_src": 11111 + } + } + } + } + ], + "tests": [ + { + "ingress": [ + "ethernet(dst='ba:bb:bb:bb:bb:bb', src='aa:aa:aa:aa:aa:aa', ethertype=33024)", + "vlan(pcp=5, cfi=0, vid=203, ethertype=34525)", + "ipv6(dst='b0::b0', flow_label=203, src='a0::a0', nxt=17, hop_limit=127, traffic_class=65)", + "udp(dst_port=6789, src_port=12345)", + "b'\\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'" + ], + "table-miss": [ + 0 + ] + } + ] + } +] diff --git a/ryu/tests/switch/of10/match/11_TP_DST_IPv4_TCP.json b/ryu/tests/switch/of10/match/11_TP_DST_IPv4_TCP.json new file mode 100644 index 00000000..a463ca35 --- /dev/null +++ b/ryu/tests/switch/of10/match/11_TP_DST_IPv4_TCP.json @@ -0,0 +1,248 @@ +[ + "match: 11_TP_DST (IPv4/TCP)", + { + "description": "ethernet/ipv4/tcp(dst_port=2222)-->'tp_dst=2222,actions=output:2'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionOutput": { + "port": 2 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_type": 2048, + "nw_proto": 6, + "tp_dst": 2222 + } + } + } + } + ], + "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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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/ipv4/tcp(dst_port=2222)-->'tp_dst=2222,actions=output:CONTROLLER'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionOutput": { + "port": 65533 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_type": 2048, + "nw_proto": 6, + "tp_dst": 2222 + } + } + } + } + ], + "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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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'" + ], + "PACKET_IN": [ + "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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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/ipv4/tcp(dst_port=6789)-->'tp_dst=2222,actions=output:2'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionOutput": { + "port": 2 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_type": 2048, + "nw_proto": 6, + "tp_dst": 2222 + } + } + } + } + ], + "tests": [ + { + "ingress": [ + "ethernet(dst='ba:bb:bb:bb:bb:bb', src='aa:aa:aa:aa:aa:aa', ethertype=2048)", + "ipv4(tos=65, proto=6, src='10.10.10.10', dst='10.10.20.20', ttl=127)", + "tcp(dst_port=6789, option=bytes(b'\\x01' * 4), src_port=12345)", + "b'\\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'" + ], + "table-miss": [ + 0 + ] + } + ] + }, + { + "description": "ethernet/vlan/ipv4/tcp(dst_port=2222)-->'tp_dst=2222,actions=output:2'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionOutput": { + "port": 2 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_type": 2048, + "nw_proto": 6, + "tp_dst": 2222 + } + } + } + } + ], + "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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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)-->'tp_dst=2222,actions=output:CONTROLLER'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionOutput": { + "port": 65533 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_type": 2048, + "nw_proto": 6, + "tp_dst": 2222 + } + } + } + } + ], + "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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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'" + ], + "PACKET_IN": [ + "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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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=6789)-->'tp_dst=2222,actions=output:2'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionOutput": { + "port": 2 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_type": 2048, + "nw_proto": 6, + "tp_dst": 2222 + } + } + } + } + ], + "tests": [ + { + "ingress": [ + "ethernet(dst='ba:bb:bb:bb:bb:bb', src='aa:aa:aa:aa:aa:aa', ethertype=33024)", + "vlan(pcp=5, cfi=0, vid=203, ethertype=2048)", + "ipv4(tos=65, proto=6, src='10.10.10.10', dst='10.10.20.20', ttl=127)", + "tcp(dst_port=6789, option=bytes(b'\\x01' * 4), src_port=12345)", + "b'\\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'" + ], + "table-miss": [ + 0 + ] + } + ] + } +] diff --git a/ryu/tests/switch/of10/match/11_TP_DST_IPv4_UDP.json b/ryu/tests/switch/of10/match/11_TP_DST_IPv4_UDP.json new file mode 100644 index 00000000..b1129c20 --- /dev/null +++ b/ryu/tests/switch/of10/match/11_TP_DST_IPv4_UDP.json @@ -0,0 +1,248 @@ +[ + "match: 11_TP_DST (IPv4/UDP)", + { + "description": "ethernet/ipv4/udp(dst_port=2222)-->'tp_dst=2222,actions=output:2'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionOutput": { + "port": 2 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_type": 2048, + "nw_proto": 17, + "tp_dst": 2222 + } + } + } + } + ], + "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)", + "b'\\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=11111)", + "b'\\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/ipv4/udp(dst_port=2222)-->'tp_dst=2222,actions=output:CONTROLLER'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionOutput": { + "port": 65533 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_type": 2048, + "nw_proto": 17, + "tp_dst": 2222 + } + } + } + } + ], + "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)", + "b'\\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'" + ], + "PACKET_IN": [ + "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)", + "b'\\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/ipv4/udp(dst_port=6789)-->'tp_dst=2222,actions=output:2'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionOutput": { + "port": 2 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_type": 2048, + "nw_proto": 17, + "tp_dst": 2222 + } + } + } + } + ], + "tests": [ + { + "ingress": [ + "ethernet(dst='ba:bb:bb:bb:bb:bb', src='aa:aa:aa:aa:aa:aa', ethertype=2048)", + "ipv4(tos=65, proto=17, src='10.10.10.10', dst='10.10.20.20', ttl=127)", + "udp(dst_port=6789, src_port=12345)", + "b'\\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'" + ], + "table-miss": [ + 0 + ] + } + ] + }, + { + "description": "ethernet/vlan/ipv4/udp(dst_port=2222)-->'tp_dst=2222,actions=output:2'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionOutput": { + "port": 2 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_type": 2048, + "nw_proto": 17, + "tp_dst": 2222 + } + } + } + } + ], + "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)", + "b'\\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=11111)", + "b'\\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)-->'tp_dst=2222,actions=output:CONTROLLER'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionOutput": { + "port": 65533 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_type": 2048, + "nw_proto": 17, + "tp_dst": 2222 + } + } + } + } + ], + "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)", + "b'\\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'" + ], + "PACKET_IN": [ + "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)", + "b'\\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=6789)-->'tp_dst=2222,actions=output:2'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionOutput": { + "port": 2 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_type": 2048, + "nw_proto": 17, + "tp_dst": 2222 + } + } + } + } + ], + "tests": [ + { + "ingress": [ + "ethernet(dst='ba:bb:bb:bb:bb:bb', src='aa:aa:aa:aa:aa:aa', ethertype=33024)", + "vlan(pcp=5, cfi=0, vid=203, ethertype=2048)", + "ipv4(tos=65, proto=17, src='10.10.10.10', dst='10.10.20.20', ttl=127)", + "udp(dst_port=6789, src_port=12345)", + "b'\\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'" + ], + "table-miss": [ + 0 + ] + } + ] + } +] diff --git a/ryu/tests/switch/of10/match/11_TP_DST_IPv6_TCP.json b/ryu/tests/switch/of10/match/11_TP_DST_IPv6_TCP.json new file mode 100644 index 00000000..dfd44e48 --- /dev/null +++ b/ryu/tests/switch/of10/match/11_TP_DST_IPv6_TCP.json @@ -0,0 +1,248 @@ +[ + "match: 11_TP_DST (IPv6/TCP)", + { + "description": "ethernet/ipv6/tcp(dst_port=2222)-->'tp_dst=2222,actions=output:2'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionOutput": { + "port": 2 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_type": 34525, + "nw_proto": 6, + "tp_dst": 2222 + } + } + } + } + ], + "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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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(dst_port=2222)-->'tp_dst=2222,actions=output:CONTROLLER'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionOutput": { + "port": 65533 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_type": 34525, + "nw_proto": 6, + "tp_dst": 2222 + } + } + } + } + ], + "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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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'" + ], + "PACKET_IN": [ + "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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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(dst_port=6789)-->'tp_dst=2222,actions=output:2'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionOutput": { + "port": 2 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_type": 34525, + "nw_proto": 6, + "tp_dst": 2222 + } + } + } + } + ], + "tests": [ + { + "ingress": [ + "ethernet(dst='ba:bb:bb:bb:bb:bb', src='aa:aa:aa:aa:aa:aa', ethertype=34525)", + "ipv6(dst='b0::b0', flow_label=203, src='a0::a0', nxt=6, hop_limit=127, traffic_class=65)", + "tcp(dst_port=6789, option=bytes(b'\\x01' * 4), src_port=12345)", + "b'\\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'" + ], + "table-miss": [ + 0 + ] + } + ] + }, + { + "description": "ethernet/vlan/ipv6/tcp(dst_port=2222)-->'tp_dst=2222,actions=output:2'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionOutput": { + "port": 2 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_type": 34525, + "nw_proto": 6, + "tp_dst": 2222 + } + } + } + } + ], + "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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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)-->'tp_dst=2222,actions=output:CONTROLLER'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionOutput": { + "port": 65533 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_type": 34525, + "nw_proto": 6, + "tp_dst": 2222 + } + } + } + } + ], + "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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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'" + ], + "PACKET_IN": [ + "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=bytes(b'\\x00' * 4), src_port=11111)", + "b'\\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=6789)-->'tp_dst=2222,actions=output:2'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionOutput": { + "port": 2 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_type": 34525, + "nw_proto": 6, + "tp_dst": 2222 + } + } + } + } + ], + "tests": [ + { + "ingress": [ + "ethernet(dst='ba:bb:bb:bb:bb:bb', src='aa:aa:aa:aa:aa:aa', ethertype=33024)", + "vlan(pcp=5, cfi=0, vid=203, ethertype=34525)", + "ipv6(dst='b0::b0', flow_label=203, src='a0::a0', nxt=6, hop_limit=127, traffic_class=65)", + "tcp(dst_port=6789, option=bytes(b'\\x01' * 4), src_port=12345)", + "b'\\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'" + ], + "table-miss": [ + 0 + ] + } + ] + } +] diff --git a/ryu/tests/switch/of10/match/11_TP_DST_IPv6_UDP.json b/ryu/tests/switch/of10/match/11_TP_DST_IPv6_UDP.json new file mode 100644 index 00000000..f76daf33 --- /dev/null +++ b/ryu/tests/switch/of10/match/11_TP_DST_IPv6_UDP.json @@ -0,0 +1,248 @@ +[ + "match: 11_TP_DST (IPv6/UDP)", + { + "description": "ethernet/ipv6/udp(dst_port=2222)-->'tp_dst=2222,actions=output:2'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionOutput": { + "port": 2 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_type": 34525, + "nw_proto": 17, + "tp_dst": 2222 + } + } + } + } + ], + "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)", + "b'\\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=11111)", + "b'\\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/udp(dst_port=2222)-->'tp_dst=2222,actions=output:CONTROLLER'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionOutput": { + "port": 65533 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_type": 34525, + "nw_proto": 17, + "tp_dst": 2222 + } + } + } + } + ], + "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)", + "b'\\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'" + ], + "PACKET_IN": [ + "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)", + "b'\\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/udp(dst_port=6789)-->'tp_dst=2222,actions=output:2'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionOutput": { + "port": 2 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_type": 34525, + "nw_proto": 17, + "tp_dst": 2222 + } + } + } + } + ], + "tests": [ + { + "ingress": [ + "ethernet(dst='ba:bb:bb:bb:bb:bb', src='aa:aa:aa:aa:aa:aa', ethertype=34525)", + "ipv6(dst='b0::b0', flow_label=203, src='a0::a0', nxt=17, hop_limit=127, traffic_class=65)", + "udp(dst_port=6789, src_port=12345)", + "b'\\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'" + ], + "table-miss": [ + 0 + ] + } + ] + }, + { + "description": "ethernet/vlan/ipv6/udp(dst_port=2222)-->'tp_dst=2222,actions=output:2'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionOutput": { + "port": 2 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_type": 34525, + "nw_proto": 17, + "tp_dst": 2222 + } + } + } + } + ], + "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)", + "b'\\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=11111)", + "b'\\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)-->'tp_dst=2222,actions=output:CONTROLLER'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionOutput": { + "port": 65533 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_type": 34525, + "nw_proto": 17, + "tp_dst": 2222 + } + } + } + } + ], + "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)", + "b'\\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'" + ], + "PACKET_IN": [ + "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)", + "b'\\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=6789)-->'tp_dst=2222,actions=output:2'", + "prerequisite": [ + { + "OFPFlowMod": { + "actions": [ + { + "OFPActionOutput": { + "port": 2 + } + } + ], + "command": 0, + "cookie": 0, + "match": { + "OFPMatch": { + "dl_type": 34525, + "nw_proto": 17, + "tp_dst": 2222 + } + } + } + } + ], + "tests": [ + { + "ingress": [ + "ethernet(dst='ba:bb:bb:bb:bb:bb', src='aa:aa:aa:aa:aa:aa', ethertype=33024)", + "vlan(pcp=5, cfi=0, vid=203, ethertype=34525)", + "ipv6(dst='b0::b0', flow_label=203, src='a0::a0', nxt=17, hop_limit=127, traffic_class=65)", + "udp(dst_port=6789, src_port=12345)", + "b'\\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'" + ], + "table-miss": [ + 0 + ] + } + ] + } +] |