diff --git a/ryu/tests/switch/of13/meter/01_DROP_00_KBPS_00_1M.json b/ryu/tests/switch/of13/meter/01_DROP_00_KBPS_00_1M.json new file mode 100644 index 00000000..0fdbeaef --- /dev/null +++ b/ryu/tests/switch/of13/meter/01_DROP_00_KBPS_00_1M.json @@ -0,0 +1,257 @@ +[ + "meter: 01_DROP_00_KBPS_00_1M", + { + "description":"2Mbps(ethernet/ipv4/tcp)-->'in_port=1,actions=meter:1Mbps(drop),output:2'", + "prerequisite":[ + { + "OFPMeterMod":{ + "meter_id":1, + "bands":[ + { + "OFPMeterBandDrop":{ + "rate":1000 + } + } + ] + } + }, + { + "OFPFlowMod":{ + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"in_port", + "value":1 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionMeter":{ + "meter_id":1 + } + }, + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":{ + "packets":{ + "data":[ + "ethernet(ethertype=2048)", + "ipv4(proto=6)", + "tcp()", + "str(\"\\x11\" * (1500 - 54))" + ], + "pktps":175, + "duration_time":30 + } + }, + "egress":{ + "throughput":[ + { + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"in_port", + "value":2 + } + } + ] + }, + "kbps":1000 + } + ] + } + } + ] + }, + { + "description":"2Mbps(ethernet/ipv6/tcp)-->'in_port=1,actions=meter:1Mbps(drop),output:2'", + "prerequisite":[ + { + "OFPMeterMod":{ + "meter_id":1, + "bands":[ + { + "OFPMeterBandDrop":{ + "rate":1000 + } + } + ] + } + }, + { + "OFPFlowMod":{ + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"in_port", + "value":1 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionMeter":{ + "meter_id":1 + } + }, + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":{ + "packets":{ + "data":[ + "ethernet(ethertype=34525)", + "ipv6(nxt=6)", + "tcp()", + "str(\"\\x11\" * (1500 - 74))" + ], + "pktps":175, + "duration_time":30 + } + }, + "egress":{ + "throughput":[ + { + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"in_port", + "value":2 + } + } + ] + }, + "kbps":1000 + } + ] + } + } + ] + }, + { + "description":"2Mbps(ethernet/arp)-->'in_port=1,actions=meter:1Mbps(drop),output:2'", + "prerequisite":[ + { + "OFPMeterMod":{ + "meter_id":1, + "bands":[ + { + "OFPMeterBandDrop":{ + "rate":1000 + } + } + ] + } + }, + { + "OFPFlowMod":{ + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"in_port", + "value":1 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionMeter":{ + "meter_id":1 + } + }, + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":{ + "packets":{ + "data":[ + "ethernet(ethertype=2054)", + "arp()", + "str(\"\\x11\" * (1500 - 42))" + ], + "pktps":175, + "duration_time":30 + } + }, + "egress":{ + "throughput":[ + { + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"in_port", + "value":2 + } + } + ] + }, + "kbps":1000 + } + ] + } + } + ] + } +] diff --git a/ryu/tests/switch/of13/meter/01_DROP_00_KBPS_01_10M.json b/ryu/tests/switch/of13/meter/01_DROP_00_KBPS_01_10M.json new file mode 100644 index 00000000..a3e55f9b --- /dev/null +++ b/ryu/tests/switch/of13/meter/01_DROP_00_KBPS_01_10M.json @@ -0,0 +1,257 @@ +[ + "meter: 01_DROP_00_KBPS_01_10M", + { + "description":"20Mbps(ethernet/ipv4/tcp)-->'in_port=1,actions=meter:10Mbps(drop),output:2'", + "prerequisite":[ + { + "OFPMeterMod":{ + "meter_id":1, + "bands":[ + { + "OFPMeterBandDrop":{ + "rate":10000 + } + } + ] + } + }, + { + "OFPFlowMod":{ + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"in_port", + "value":1 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionMeter":{ + "meter_id":1 + } + }, + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":{ + "packets":{ + "data":[ + "ethernet(ethertype=2048)", + "ipv4(proto=6)", + "tcp()", + "str(\"\\x11\" * (1500 - 54))" + ], + "pktps":1750, + "duration_time":30 + } + }, + "egress":{ + "throughput":[ + { + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"in_port", + "value":2 + } + } + ] + }, + "kbps":10000 + } + ] + } + } + ] + }, + { + "description":"20Mbps(ethernet/ipv6/tcp)-->'in_port=1,actions=meter:10Mbps(drop),output:2'", + "prerequisite":[ + { + "OFPMeterMod":{ + "meter_id":1, + "bands":[ + { + "OFPMeterBandDrop":{ + "rate":10000 + } + } + ] + } + }, + { + "OFPFlowMod":{ + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"in_port", + "value":1 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionMeter":{ + "meter_id":1 + } + }, + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":{ + "packets":{ + "data":[ + "ethernet(ethertype=34525)", + "ipv6(nxt=6)", + "tcp()", + "str(\"\\x11\" * (1500 - 74))" + ], + "pktps":1750, + "duration_time":30 + } + }, + "egress":{ + "throughput":[ + { + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"in_port", + "value":2 + } + } + ] + }, + "kbps":10000 + } + ] + } + } + ] + }, + { + "description":"20Mbps(ethernet/arp)-->'in_port=1,actions=meter:10Mbps(drop),output:2'", + "prerequisite":[ + { + "OFPMeterMod":{ + "meter_id":1, + "bands":[ + { + "OFPMeterBandDrop":{ + "rate":10000 + } + } + ] + } + }, + { + "OFPFlowMod":{ + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"in_port", + "value":1 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionMeter":{ + "meter_id":1 + } + }, + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":{ + "packets":{ + "data":[ + "ethernet(ethertype=2054)", + "arp()", + "str(\"\\x11\" * (1500 - 42))" + ], + "pktps":1750, + "duration_time":30 + } + }, + "egress":{ + "throughput":[ + { + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"in_port", + "value":2 + } + } + ] + }, + "kbps":10000 + } + ] + } + } + ] + } +] diff --git a/ryu/tests/switch/of13/meter/01_DROP_00_KBPS_02_100M.json b/ryu/tests/switch/of13/meter/01_DROP_00_KBPS_02_100M.json new file mode 100644 index 00000000..9c1e7e1d --- /dev/null +++ b/ryu/tests/switch/of13/meter/01_DROP_00_KBPS_02_100M.json @@ -0,0 +1,257 @@ +[ + "meter: 01_DROP_00_KBPS_02_100M", + { + "description":"200Mbps(ethernet/ipv4/tcp)-->'in_port=1,actions=meter:100Mbps(drop),output:2'", + "prerequisite":[ + { + "OFPMeterMod":{ + "meter_id":1, + "bands":[ + { + "OFPMeterBandDrop":{ + "rate":100000 + } + } + ] + } + }, + { + "OFPFlowMod":{ + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"in_port", + "value":1 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionMeter":{ + "meter_id":1 + } + }, + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":{ + "packets":{ + "data":[ + "ethernet(ethertype=2048)", + "ipv4(proto=6)", + "tcp()", + "str(\"\\x11\" * (1500 - 54))" + ], + "pktps":17500, + "duration_time":30 + } + }, + "egress":{ + "throughput":[ + { + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"in_port", + "value":2 + } + } + ] + }, + "kbps":100000 + } + ] + } + } + ] + }, + { + "description":"200Mbps(ethernet/ipv6/tcp)-->'in_port=1,actions=meter:100Mbps(drop),output:2'", + "prerequisite":[ + { + "OFPMeterMod":{ + "meter_id":1, + "bands":[ + { + "OFPMeterBandDrop":{ + "rate":100000 + } + } + ] + } + }, + { + "OFPFlowMod":{ + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"in_port", + "value":1 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionMeter":{ + "meter_id":1 + } + }, + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":{ + "packets":{ + "data":[ + "ethernet(ethertype=34525)", + "ipv6(nxt=6)", + "tcp()", + "str(\"\\x11\" * (1500 - 74))" + ], + "pktps":17500, + "duration_time":30 + } + }, + "egress":{ + "throughput":[ + { + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"in_port", + "value":2 + } + } + ] + }, + "kbps":100000 + } + ] + } + } + ] + }, + { + "description":"200Mbps(ethernet/arp)-->'in_port=1,actions=meter:100Mbps(drop),output:2'", + "prerequisite":[ + { + "OFPMeterMod":{ + "meter_id":1, + "bands":[ + { + "OFPMeterBandDrop":{ + "rate":100000 + } + } + ] + } + }, + { + "OFPFlowMod":{ + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"in_port", + "value":1 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionMeter":{ + "meter_id":1 + } + }, + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":{ + "packets":{ + "data":[ + "ethernet(ethertype=2054)", + "arp()", + "str(\"\\x11\" * (1500 - 42))" + ], + "pktps":17500, + "duration_time":30 + } + }, + "egress":{ + "throughput":[ + { + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"in_port", + "value":2 + } + } + ] + }, + "kbps":100000 + } + ] + } + } + ] + } +] diff --git a/ryu/tests/switch/of13/meter/01_DROP_01_PKTPS_00_100.json b/ryu/tests/switch/of13/meter/01_DROP_01_PKTPS_00_100.json new file mode 100644 index 00000000..7cec0e62 --- /dev/null +++ b/ryu/tests/switch/of13/meter/01_DROP_01_PKTPS_00_100.json @@ -0,0 +1,260 @@ +[ + "meter: 01_DROP_01_PKTPS_00_100", + { + "description":"200pktps(ethernet/ipv4/tcp)-->'in_port=1,actions=meter:100pktps(drop),output:2'", + "prerequisite":[ + { + "OFPMeterMod":{ + "flags":2, + "meter_id":1, + "bands":[ + { + "OFPMeterBandDrop":{ + "rate":100 + } + } + ] + } + }, + { + "OFPFlowMod":{ + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"in_port", + "value":1 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionMeter":{ + "meter_id":1 + } + }, + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":{ + "packets":{ + "data":[ + "ethernet(ethertype=2048)", + "ipv4(proto=6)", + "tcp()", + "str(\"\\x11\" * (1500 - 54))" + ], + "pktps":200, + "duration_time":30 + } + }, + "egress":{ + "throughput":[ + { + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"in_port", + "value":2 + } + } + ] + }, + "pktps":100 + } + ] + } + } + ] + }, + { + "description":"200pktps(ethernet/ipv6/tcp)-->'in_port=1,actions=meter:100pktps(drop),output:2'", + "prerequisite":[ + { + "OFPMeterMod":{ + "flags":2, + "meter_id":1, + "bands":[ + { + "OFPMeterBandDrop":{ + "rate":100 + } + } + ] + } + }, + { + "OFPFlowMod":{ + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"in_port", + "value":1 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionMeter":{ + "meter_id":1 + } + }, + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":{ + "packets":{ + "data":[ + "ethernet(ethertype=34525)", + "ipv6(nxt=6)", + "tcp()", + "str(\"\\x11\" * (1500 - 74))" + ], + "pktps":200, + "duration_time":30 + } + }, + "egress":{ + "throughput":[ + { + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"in_port", + "value":2 + } + } + ] + }, + "pktps":100 + } + ] + } + } + ] + }, + { + "description":"200pktps(ethernet/arp)-->'in_port=1,actions=meter:100pktps(drop),output:2'", + "prerequisite":[ + { + "OFPMeterMod":{ + "flags":2, + "meter_id":1, + "bands":[ + { + "OFPMeterBandDrop":{ + "rate":100 + } + } + ] + } + }, + { + "OFPFlowMod":{ + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"in_port", + "value":1 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionMeter":{ + "meter_id":1 + } + }, + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":{ + "packets":{ + "data":[ + "ethernet(ethertype=2054)", + "arp()", + "str(\"\\x11\" * (1500 - 42))" + ], + "pktps":200, + "duration_time":30 + } + }, + "egress":{ + "throughput":[ + { + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"in_port", + "value":2 + } + } + ] + }, + "pktps":100 + } + ] + } + } + ] + } +] diff --git a/ryu/tests/switch/of13/meter/01_DROP_01_PKTPS_01_1000.json b/ryu/tests/switch/of13/meter/01_DROP_01_PKTPS_01_1000.json new file mode 100644 index 00000000..f4651ee7 --- /dev/null +++ b/ryu/tests/switch/of13/meter/01_DROP_01_PKTPS_01_1000.json @@ -0,0 +1,260 @@ +[ + "meter: 01_DROP_01_PKTPS_01_1000", + { + "description":"2000pktps(ethernet/ipv4/tcp)-->'in_port=1,actions=meter:1000pktps(drop),output:2'", + "prerequisite":[ + { + "OFPMeterMod":{ + "flags":2, + "meter_id":1, + "bands":[ + { + "OFPMeterBandDrop":{ + "rate":1000 + } + } + ] + } + }, + { + "OFPFlowMod":{ + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"in_port", + "value":1 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionMeter":{ + "meter_id":1 + } + }, + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":{ + "packets":{ + "data":[ + "ethernet(ethertype=2048)", + "ipv4(proto=6)", + "tcp()", + "str(\"\\x11\" * (1500 - 54))" + ], + "pktps":2000, + "duration_time":30 + } + }, + "egress":{ + "throughput":[ + { + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"in_port", + "value":2 + } + } + ] + }, + "pktps":1000 + } + ] + } + } + ] + }, + { + "description":"2000pktps(ethernet/ipv6/tcp)-->'in_port=1,actions=meter:1000pktps(drop),output:2'", + "prerequisite":[ + { + "OFPMeterMod":{ + "flags":2, + "meter_id":1, + "bands":[ + { + "OFPMeterBandDrop":{ + "rate":1000 + } + } + ] + } + }, + { + "OFPFlowMod":{ + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"in_port", + "value":1 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionMeter":{ + "meter_id":1 + } + }, + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":{ + "packets":{ + "data":[ + "ethernet(ethertype=34525)", + "ipv6(nxt=6)", + "tcp()", + "str(\"\\x11\" * (1500 - 74))" + ], + "pktps":2000, + "duration_time":30 + } + }, + "egress":{ + "throughput":[ + { + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"in_port", + "value":2 + } + } + ] + }, + "pktps":1000 + } + ] + } + } + ] + }, + { + "description":"2000pktps(ethernet/arp)-->'in_port=1,actions=meter:1000pktps(drop),output:2'", + "prerequisite":[ + { + "OFPMeterMod":{ + "flags":2, + "meter_id":1, + "bands":[ + { + "OFPMeterBandDrop":{ + "rate":1000 + } + } + ] + } + }, + { + "OFPFlowMod":{ + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"in_port", + "value":1 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionMeter":{ + "meter_id":1 + } + }, + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":{ + "packets":{ + "data":[ + "ethernet(ethertype=2054)", + "arp()", + "str(\"\\x11\" * (1500 - 42))" + ], + "pktps":2000, + "duration_time":30 + } + }, + "egress":{ + "throughput":[ + { + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"in_port", + "value":2 + } + } + ] + }, + "pktps":1000 + } + ] + } + } + ] + } +] diff --git a/ryu/tests/switch/of13/meter/01_DROP_01_PKTPS_02_10000.json b/ryu/tests/switch/of13/meter/01_DROP_01_PKTPS_02_10000.json new file mode 100644 index 00000000..36dabb70 --- /dev/null +++ b/ryu/tests/switch/of13/meter/01_DROP_01_PKTPS_02_10000.json @@ -0,0 +1,260 @@ +[ + "meter: 01_DROP_01_PKTPS_02_10000", + { + "description":"20000pktps(ethernet/ipv4/tcp)-->'in_port=1,actions=meter:10000pktps(drop),output:2'", + "prerequisite":[ + { + "OFPMeterMod":{ + "flags":2, + "meter_id":1, + "bands":[ + { + "OFPMeterBandDrop":{ + "rate":10000 + } + } + ] + } + }, + { + "OFPFlowMod":{ + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"in_port", + "value":1 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionMeter":{ + "meter_id":1 + } + }, + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":{ + "packets":{ + "data":[ + "ethernet(ethertype=2048)", + "ipv4(proto=6)", + "tcp()", + "str(\"\\x11\" * (1500 - 54))" + ], + "pktps":20000, + "duration_time":30 + } + }, + "egress":{ + "throughput":[ + { + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"in_port", + "value":2 + } + } + ] + }, + "pktps":10000 + } + ] + } + } + ] + }, + { + "description":"20000pktps(ethernet/ipv6/tcp)-->'in_port=1,actions=meter:10000pktps(drop),output:2'", + "prerequisite":[ + { + "OFPMeterMod":{ + "flags":2, + "meter_id":1, + "bands":[ + { + "OFPMeterBandDrop":{ + "rate":10000 + } + } + ] + } + }, + { + "OFPFlowMod":{ + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"in_port", + "value":1 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionMeter":{ + "meter_id":1 + } + }, + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":{ + "packets":{ + "data":[ + "ethernet(ethertype=34525)", + "ipv6(nxt=6)", + "tcp()", + "str(\"\\x11\" * (1500 - 74))" + ], + "pktps":20000, + "duration_time":30 + } + }, + "egress":{ + "throughput":[ + { + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"in_port", + "value":2 + } + } + ] + }, + "pktps":10000 + } + ] + } + } + ] + }, + { + "description":"20000pktps(ethernet/arp)-->'in_port=1,actions=meter:10000pktps(drop),output:2'", + "prerequisite":[ + { + "OFPMeterMod":{ + "flags":2, + "meter_id":1, + "bands":[ + { + "OFPMeterBandDrop":{ + "rate":10000 + } + } + ] + } + }, + { + "OFPFlowMod":{ + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"in_port", + "value":1 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionMeter":{ + "meter_id":1 + } + }, + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":{ + "packets":{ + "data":[ + "ethernet(ethertype=2054)", + "arp()", + "str(\"\\x11\" * (1500 - 42))" + ], + "pktps":20000, + "duration_time":30 + } + }, + "egress":{ + "throughput":[ + { + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"in_port", + "value":2 + } + } + ] + }, + "pktps":10000 + } + ] + } + } + ] + } +] diff --git a/ryu/tests/switch/of13/meter/02_DSCP_REMARK_00_KBPS_00_1M.json b/ryu/tests/switch/of13/meter/02_DSCP_REMARK_00_KBPS_00_1M.json new file mode 100644 index 00000000..afd10b69 --- /dev/null +++ b/ryu/tests/switch/of13/meter/02_DSCP_REMARK_00_KBPS_00_1M.json @@ -0,0 +1,334 @@ +[ + "meter: 02_DSCP_REMARK_00_KBPS_00_1M", + { + "description":"2Mbps(ethernet/ipv4(dscp=24)/tcp)-->'in_port=1,actions=meter:1Mbps(dscp_remark:ip_dscp=16),output:2'", + "prerequisite":[ + { + "OFPMeterMod":{ + "meter_id":1, + "bands":[ + { + "OFPMeterBandDscpRemark":{ + "rate":1000, + "prec_level":1 + } + } + ] + } + }, + { + "OFPFlowMod":{ + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"in_port", + "value":1 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionMeter":{ + "meter_id":1 + } + }, + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":{ + "packets":{ + "data":[ + "ethernet(ethertype=2048)", + "ipv4(proto=6, tos=96)", + "tcp()", + "str(\"\\x11\" * (1500 - 54))" + ], + "pktps":175, + "duration_time":30 + } + }, + "egress":{ + "throughput":[ + { + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"in_port", + "value":2 + } + }, + { + "OXMTlv":{ + "field":"eth_type", + "value":2048 + } + }, + { + "OXMTlv":{ + "field":"ip_dscp", + "value":24 + } + } + ] + }, + "kbps":1000 + }, + { + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"in_port", + "value":2 + } + }, + { + "OXMTlv":{ + "field":"eth_type", + "value":2048 + } + }, + { + "OXMTlv":{ + "field":"ip_dscp", + "value":16 + } + } + ] + }, + "kbps":1000 + } + ] + } + } + ] + }, + { + "description":"2Mbps(ethernet/ipv6(dscp=24)/tcp)-->'in_port=1,actions=meter:1Mbps(dscp_remark:ip_dscp=16),output:2'", + "prerequisite":[ + { + "OFPMeterMod":{ + "meter_id":1, + "bands":[ + { + "OFPMeterBandDscpRemark":{ + "rate":1000, + "prec_level":1 + } + } + ] + } + }, + { + "OFPFlowMod":{ + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"in_port", + "value":1 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionMeter":{ + "meter_id":1 + } + }, + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":{ + "packets":{ + "data":[ + "ethernet(ethertype=34525)", + "ipv6(nxt=6, traffic_class=96)", + "tcp()", + "str(\"\\x11\" * (1500 - 74))" + ], + "pktps":175, + "duration_time":30 + } + }, + "egress":{ + "throughput":[ + { + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"in_port", + "value":2 + } + }, + { + "OXMTlv":{ + "field":"eth_type", + "value":34525 + } + }, + { + "OXMTlv":{ + "field":"ip_dscp", + "value":24 + } + } + ] + }, + "kbps":1000 + }, + { + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"in_port", + "value":2 + } + }, + { + "OXMTlv":{ + "field":"eth_type", + "value":34525 + } + }, + { + "OXMTlv":{ + "field":"ip_dscp", + "value":16 + } + } + ] + }, + "kbps":1000 + } + ] + } + } + ] + }, + { + "description":"2Mbps(ethernet/arp)-->'in_port=1,actions=meter:2Mbps(dscp_remark:prec_level=1),output:2'", + "prerequisite":[ + { + "OFPMeterMod":{ + "meter_id":1, + "bands":[ + { + "OFPMeterBandDscpRemark":{ + "rate":1000, + "prec_level":1 + } + } + ] + } + }, + { + "OFPFlowMod":{ + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"in_port", + "value":1 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionMeter":{ + "meter_id":1 + } + }, + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":{ + "packets":{ + "data":[ + "ethernet(ethertype=2054)", + "arp()", + "str(\"\\x11\" * (1500 - 42))" + ], + "pktps":175, + "duration_time":30 + } + }, + "egress":{ + "throughput":[ + { + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"in_port", + "value":2 + } + } + ] + }, + "kbps":2000 + } + ] + } + } + ] + } +] diff --git a/ryu/tests/switch/of13/meter/02_DSCP_REMARK_00_KBPS_01_10M.json b/ryu/tests/switch/of13/meter/02_DSCP_REMARK_00_KBPS_01_10M.json new file mode 100644 index 00000000..c2c2f673 --- /dev/null +++ b/ryu/tests/switch/of13/meter/02_DSCP_REMARK_00_KBPS_01_10M.json @@ -0,0 +1,334 @@ +[ + "meter: 02_DSCP_REMARK_00_KBPS_01_10M", + { + "description":"20Mbps(ethernet/ipv4(dscp=24)/tcp)-->'in_port=1,actions=meter:10Mbps(dscp_remark:ip_dscp=16),output:2'", + "prerequisite":[ + { + "OFPMeterMod":{ + "meter_id":1, + "bands":[ + { + "OFPMeterBandDscpRemark":{ + "rate":10000, + "prec_level":1 + } + } + ] + } + }, + { + "OFPFlowMod":{ + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"in_port", + "value":1 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionMeter":{ + "meter_id":1 + } + }, + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":{ + "packets":{ + "data":[ + "ethernet(ethertype=2048)", + "ipv4(proto=6, tos=96)", + "tcp()", + "str(\"\\x11\" * (1500 - 54))" + ], + "pktps":1750, + "duration_time":30 + } + }, + "egress":{ + "throughput":[ + { + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"in_port", + "value":2 + } + }, + { + "OXMTlv":{ + "field":"eth_type", + "value":2048 + } + }, + { + "OXMTlv":{ + "field":"ip_dscp", + "value":24 + } + } + ] + }, + "kbps":10000 + }, + { + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"in_port", + "value":2 + } + }, + { + "OXMTlv":{ + "field":"eth_type", + "value":2048 + } + }, + { + "OXMTlv":{ + "field":"ip_dscp", + "value":16 + } + } + ] + }, + "kbps":10000 + } + ] + } + } + ] + }, + { + "description":"20Mbps(ethernet/ipv6(dscp=24)/tcp)-->'in_port=1,actions=meter:10Mbps(dscp_remark:ip_dscp=16),output:2'", + "prerequisite":[ + { + "OFPMeterMod":{ + "meter_id":1, + "bands":[ + { + "OFPMeterBandDscpRemark":{ + "rate":10000, + "prec_level":1 + } + } + ] + } + }, + { + "OFPFlowMod":{ + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"in_port", + "value":1 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionMeter":{ + "meter_id":1 + } + }, + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":{ + "packets":{ + "data":[ + "ethernet(ethertype=34525)", + "ipv6(nxt=6, traffic_class=96)", + "tcp()", + "str(\"\\x11\" * (1500 - 74))" + ], + "pktps":1750, + "duration_time":30 + } + }, + "egress":{ + "throughput":[ + { + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"in_port", + "value":2 + } + }, + { + "OXMTlv":{ + "field":"eth_type", + "value":34525 + } + }, + { + "OXMTlv":{ + "field":"ip_dscp", + "value":24 + } + } + ] + }, + "kbps":10000 + }, + { + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"in_port", + "value":2 + } + }, + { + "OXMTlv":{ + "field":"eth_type", + "value":34525 + } + }, + { + "OXMTlv":{ + "field":"ip_dscp", + "value":16 + } + } + ] + }, + "kbps":10000 + } + ] + } + } + ] + }, + { + "description":"20Mbps(ethernet/arp)-->'in_port=1,actions=meter:20Mbps(dscp_remark:prec_level=1),output:2'", + "prerequisite":[ + { + "OFPMeterMod":{ + "meter_id":1, + "bands":[ + { + "OFPMeterBandDscpRemark":{ + "rate":10000, + "prec_level":1 + } + } + ] + } + }, + { + "OFPFlowMod":{ + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"in_port", + "value":1 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionMeter":{ + "meter_id":1 + } + }, + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":{ + "packets":{ + "data":[ + "ethernet(ethertype=2054)", + "arp()", + "str(\"\\x11\" * (1500 - 42))" + ], + "pktps":1750, + "duration_time":30 + } + }, + "egress":{ + "throughput":[ + { + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"in_port", + "value":2 + } + } + ] + }, + "kbps":20000 + } + ] + } + } + ] + } +] diff --git a/ryu/tests/switch/of13/meter/02_DSCP_REMARK_00_KBPS_02_100M.json b/ryu/tests/switch/of13/meter/02_DSCP_REMARK_00_KBPS_02_100M.json new file mode 100644 index 00000000..e1747326 --- /dev/null +++ b/ryu/tests/switch/of13/meter/02_DSCP_REMARK_00_KBPS_02_100M.json @@ -0,0 +1,334 @@ +[ + "meter: 02_DSCP_REMARK_00_KBPS_02_100M", + { + "description":"200Mbps(ethernet/ipv4(dscp=24)/tcp)-->'in_port=1,actions=meter:100Mbps(dscp_remark:ip_dscp=16),output:2'", + "prerequisite":[ + { + "OFPMeterMod":{ + "meter_id":1, + "bands":[ + { + "OFPMeterBandDscpRemark":{ + "rate":100000, + "prec_level":1 + } + } + ] + } + }, + { + "OFPFlowMod":{ + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"in_port", + "value":1 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionMeter":{ + "meter_id":1 + } + }, + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":{ + "packets":{ + "data":[ + "ethernet(ethertype=2048)", + "ipv4(proto=6, tos=96)", + "tcp()", + "str(\"\\x11\" * (1500 - 54))" + ], + "pktps":17500, + "duration_time":30 + } + }, + "egress":{ + "throughput":[ + { + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"in_port", + "value":2 + } + }, + { + "OXMTlv":{ + "field":"eth_type", + "value":2048 + } + }, + { + "OXMTlv":{ + "field":"ip_dscp", + "value":24 + } + } + ] + }, + "kbps":100000 + }, + { + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"in_port", + "value":2 + } + }, + { + "OXMTlv":{ + "field":"eth_type", + "value":2048 + } + }, + { + "OXMTlv":{ + "field":"ip_dscp", + "value":16 + } + } + ] + }, + "kbps":100000 + } + ] + } + } + ] + }, + { + "description":"200Mbps(ethernet/ipv6(dscp=24)/tcp)-->'in_port=1,actions=meter:100Mbps(dscp_remark:ip_dscp=16),output:2'", + "prerequisite":[ + { + "OFPMeterMod":{ + "meter_id":1, + "bands":[ + { + "OFPMeterBandDscpRemark":{ + "rate":100000, + "prec_level":1 + } + } + ] + } + }, + { + "OFPFlowMod":{ + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"in_port", + "value":1 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionMeter":{ + "meter_id":1 + } + }, + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":{ + "packets":{ + "data":[ + "ethernet(ethertype=34525)", + "ipv6(nxt=6, traffic_class=96)", + "tcp()", + "str(\"\\x11\" * (1500 - 74))" + ], + "pktps":17500, + "duration_time":30 + } + }, + "egress":{ + "throughput":[ + { + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"in_port", + "value":2 + } + }, + { + "OXMTlv":{ + "field":"eth_type", + "value":34525 + } + }, + { + "OXMTlv":{ + "field":"ip_dscp", + "value":24 + } + } + ] + }, + "kbps":100000 + }, + { + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"in_port", + "value":2 + } + }, + { + "OXMTlv":{ + "field":"eth_type", + "value":34525 + } + }, + { + "OXMTlv":{ + "field":"ip_dscp", + "value":16 + } + } + ] + }, + "kbps":100000 + } + ] + } + } + ] + }, + { + "description":"200Mbps(ethernet/arp)-->'in_port=1,actions=meter:200Mbps(dscp_remark:prec_level=1),output:2'", + "prerequisite":[ + { + "OFPMeterMod":{ + "meter_id":1, + "bands":[ + { + "OFPMeterBandDscpRemark":{ + "rate":100000, + "prec_level":1 + } + } + ] + } + }, + { + "OFPFlowMod":{ + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"in_port", + "value":1 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionMeter":{ + "meter_id":1 + } + }, + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":{ + "packets":{ + "data":[ + "ethernet(ethertype=2054)", + "arp()", + "str(\"\\x11\" * (1500 - 42))" + ], + "pktps":17500, + "duration_time":30 + } + }, + "egress":{ + "throughput":[ + { + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"in_port", + "value":2 + } + } + ] + }, + "kbps":200000 + } + ] + } + } + ] + } +] diff --git a/ryu/tests/switch/of13/meter/02_DSCP_REMARK_01_PKTPS_00_100.json b/ryu/tests/switch/of13/meter/02_DSCP_REMARK_01_PKTPS_00_100.json new file mode 100644 index 00000000..12a2daaa --- /dev/null +++ b/ryu/tests/switch/of13/meter/02_DSCP_REMARK_01_PKTPS_00_100.json @@ -0,0 +1,337 @@ +[ + "meter: 02_DSCP_REMARK_01_PKTPS_00_100", + { + "description":"200pktps(ethernet/ipv4(dscp=24)/tcp)-->'in_port=1,actions=meter:100pktps(dscp_remark:ip_dscp=16),output:2'", + "prerequisite":[ + { + "OFPMeterMod":{ + "flags":2, + "meter_id":1, + "bands":[ + { + "OFPMeterBandDscpRemark":{ + "rate":100, + "prec_level":1 + } + } + ] + } + }, + { + "OFPFlowMod":{ + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"in_port", + "value":1 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionMeter":{ + "meter_id":1 + } + }, + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":{ + "packets":{ + "data":[ + "ethernet(ethertype=2048)", + "ipv4(proto=6, tos=96)", + "tcp()", + "str(\"\\x11\" * (1500 - 54))" + ], + "pktps":200, + "duration_time":30 + } + }, + "egress":{ + "throughput":[ + { + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"in_port", + "value":2 + } + }, + { + "OXMTlv":{ + "field":"eth_type", + "value":2048 + } + }, + { + "OXMTlv":{ + "field":"ip_dscp", + "value":24 + } + } + ] + }, + "pktps":100 + }, + { + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"in_port", + "value":2 + } + }, + { + "OXMTlv":{ + "field":"eth_type", + "value":2048 + } + }, + { + "OXMTlv":{ + "field":"ip_dscp", + "value":16 + } + } + ] + }, + "pktps":100 + } + ] + } + } + ] + }, + { + "description":"200pktps(ethernet/ipv6(dscp=24)/tcp)-->'in_port=1,actions=meter:100pktps(dscp_remark:ip_dscp=16),output:2'", + "prerequisite":[ + { + "OFPMeterMod":{ + "flags":2, + "meter_id":1, + "bands":[ + { + "OFPMeterBandDscpRemark":{ + "rate":100, + "prec_level":1 + } + } + ] + } + }, + { + "OFPFlowMod":{ + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"in_port", + "value":1 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionMeter":{ + "meter_id":1 + } + }, + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":{ + "packets":{ + "data":[ + "ethernet(ethertype=34525)", + "ipv6(nxt=6, traffic_class=96)", + "tcp()", + "str(\"\\x11\" * (1500 - 74))" + ], + "pktps":200, + "duration_time":30 + } + }, + "egress":{ + "throughput":[ + { + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"in_port", + "value":2 + } + }, + { + "OXMTlv":{ + "field":"eth_type", + "value":34525 + } + }, + { + "OXMTlv":{ + "field":"ip_dscp", + "value":24 + } + } + ] + }, + "pktps":100 + }, + { + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"in_port", + "value":2 + } + }, + { + "OXMTlv":{ + "field":"eth_type", + "value":34525 + } + }, + { + "OXMTlv":{ + "field":"ip_dscp", + "value":16 + } + } + ] + }, + "pktps":100 + } + ] + } + } + ] + }, + { + "description":"200pktps(ethernet/arp)-->'in_port=1,actions=meter:200pktps(dscp_remark:prec_level=1),output:2'", + "prerequisite":[ + { + "OFPMeterMod":{ + "flags":2, + "meter_id":1, + "bands":[ + { + "OFPMeterBandDscpRemark":{ + "rate":100, + "prec_level":1 + } + } + ] + } + }, + { + "OFPFlowMod":{ + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"in_port", + "value":1 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionMeter":{ + "meter_id":1 + } + }, + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":{ + "packets":{ + "data":[ + "ethernet(ethertype=2054)", + "arp()", + "str(\"\\x11\" * (1500 - 42))" + ], + "pktps":200, + "duration_time":30 + } + }, + "egress":{ + "throughput":[ + { + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"in_port", + "value":2 + } + } + ] + }, + "pktps":200 + } + ] + } + } + ] + } +] diff --git a/ryu/tests/switch/of13/meter/02_DSCP_REMARK_01_PKTPS_01_1000.json b/ryu/tests/switch/of13/meter/02_DSCP_REMARK_01_PKTPS_01_1000.json new file mode 100644 index 00000000..6a9b1b12 --- /dev/null +++ b/ryu/tests/switch/of13/meter/02_DSCP_REMARK_01_PKTPS_01_1000.json @@ -0,0 +1,337 @@ +[ + "meter: 02_DSCP_REMARK_01_PKTPS_01_1000", + { + "description":"2000pktps(ethernet/ipv4(dscp=24)/tcp)-->'in_port=1,actions=meter:1000pktps(dscp_remark:ip_dscp=16),output:2'", + "prerequisite":[ + { + "OFPMeterMod":{ + "flags":2, + "meter_id":1, + "bands":[ + { + "OFPMeterBandDscpRemark":{ + "rate":1000, + "prec_level":1 + } + } + ] + } + }, + { + "OFPFlowMod":{ + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"in_port", + "value":1 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionMeter":{ + "meter_id":1 + } + }, + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":{ + "packets":{ + "data":[ + "ethernet(ethertype=2048)", + "ipv4(proto=6, tos=96)", + "tcp()", + "str(\"\\x11\" * (1500 - 54))" + ], + "pktps":2000, + "duration_time":30 + } + }, + "egress":{ + "throughput":[ + { + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"in_port", + "value":2 + } + }, + { + "OXMTlv":{ + "field":"eth_type", + "value":2048 + } + }, + { + "OXMTlv":{ + "field":"ip_dscp", + "value":24 + } + } + ] + }, + "pktps":1000 + }, + { + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"in_port", + "value":2 + } + }, + { + "OXMTlv":{ + "field":"eth_type", + "value":2048 + } + }, + { + "OXMTlv":{ + "field":"ip_dscp", + "value":16 + } + } + ] + }, + "pktps":1000 + } + ] + } + } + ] + }, + { + "description":"2000pktps(ethernet/ipv6(dscp=24)/tcp)-->'in_port=1,actions=meter:1000pktps(dscp_remark:ip_dscp=16),output:2'", + "prerequisite":[ + { + "OFPMeterMod":{ + "flags":2, + "meter_id":1, + "bands":[ + { + "OFPMeterBandDscpRemark":{ + "rate":1000, + "prec_level":1 + } + } + ] + } + }, + { + "OFPFlowMod":{ + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"in_port", + "value":1 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionMeter":{ + "meter_id":1 + } + }, + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":{ + "packets":{ + "data":[ + "ethernet(ethertype=34525)", + "ipv6(nxt=6, traffic_class=96)", + "tcp()", + "str(\"\\x11\" * (1500 - 74))" + ], + "pktps":2000, + "duration_time":30 + } + }, + "egress":{ + "throughput":[ + { + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"in_port", + "value":2 + } + }, + { + "OXMTlv":{ + "field":"eth_type", + "value":34525 + } + }, + { + "OXMTlv":{ + "field":"ip_dscp", + "value":24 + } + } + ] + }, + "pktps":1000 + }, + { + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"in_port", + "value":2 + } + }, + { + "OXMTlv":{ + "field":"eth_type", + "value":34525 + } + }, + { + "OXMTlv":{ + "field":"ip_dscp", + "value":16 + } + } + ] + }, + "pktps":1000 + } + ] + } + } + ] + }, + { + "description":"2000pktps(ethernet/arp)-->'in_port=1,actions=meter:2000pktps(dscp_remark:prec_level=1),output:2'", + "prerequisite":[ + { + "OFPMeterMod":{ + "flags":2, + "meter_id":1, + "bands":[ + { + "OFPMeterBandDscpRemark":{ + "rate":1000, + "prec_level":1 + } + } + ] + } + }, + { + "OFPFlowMod":{ + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"in_port", + "value":1 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionMeter":{ + "meter_id":1 + } + }, + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":{ + "packets":{ + "data":[ + "ethernet(ethertype=2054)", + "arp()", + "str(\"\\x11\" * (1500 - 42))" + ], + "pktps":2000, + "duration_time":30 + } + }, + "egress":{ + "throughput":[ + { + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"in_port", + "value":2 + } + } + ] + }, + "pktps":2000 + } + ] + } + } + ] + } +] diff --git a/ryu/tests/switch/of13/meter/02_DSCP_REMARK_01_PKTPS_02_10000.json b/ryu/tests/switch/of13/meter/02_DSCP_REMARK_01_PKTPS_02_10000.json new file mode 100644 index 00000000..9435d4f3 --- /dev/null +++ b/ryu/tests/switch/of13/meter/02_DSCP_REMARK_01_PKTPS_02_10000.json @@ -0,0 +1,337 @@ +[ + "meter: 02_DSCP_REMARK_01_PKTPS_02_10000", + { + "description":"20000pktps(ethernet/ipv4(dscp=24)/tcp)-->'in_port=1,actions=meter:10000pktps(dscp_remark:ip_dscp=16),output:2'", + "prerequisite":[ + { + "OFPMeterMod":{ + "flags":2, + "meter_id":1, + "bands":[ + { + "OFPMeterBandDscpRemark":{ + "rate":10000, + "prec_level":1 + } + } + ] + } + }, + { + "OFPFlowMod":{ + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"in_port", + "value":1 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionMeter":{ + "meter_id":1 + } + }, + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":{ + "packets":{ + "data":[ + "ethernet(ethertype=2048)", + "ipv4(proto=6, tos=96)", + "tcp()", + "str(\"\\x11\" * (1500 - 54))" + ], + "pktps":20000, + "duration_time":30 + } + }, + "egress":{ + "throughput":[ + { + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"in_port", + "value":2 + } + }, + { + "OXMTlv":{ + "field":"eth_type", + "value":2048 + } + }, + { + "OXMTlv":{ + "field":"ip_dscp", + "value":24 + } + } + ] + }, + "pktps":10000 + }, + { + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"in_port", + "value":2 + } + }, + { + "OXMTlv":{ + "field":"eth_type", + "value":2048 + } + }, + { + "OXMTlv":{ + "field":"ip_dscp", + "value":16 + } + } + ] + }, + "pktps":10000 + } + ] + } + } + ] + }, + { + "description":"20000pktps(ethernet/ipv6(dscp=24)/tcp)-->'in_port=1,actions=meter:10000pktps(dscp_remark:ip_dscp=16),output:2'", + "prerequisite":[ + { + "OFPMeterMod":{ + "flags":2, + "meter_id":1, + "bands":[ + { + "OFPMeterBandDscpRemark":{ + "rate":10000, + "prec_level":1 + } + } + ] + } + }, + { + "OFPFlowMod":{ + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"in_port", + "value":1 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionMeter":{ + "meter_id":1 + } + }, + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":{ + "packets":{ + "data":[ + "ethernet(ethertype=34525)", + "ipv6(nxt=6, traffic_class=96)", + "tcp()", + "str(\"\\x11\" * (1500 - 74))" + ], + "pktps":20000, + "duration_time":30 + } + }, + "egress":{ + "throughput":[ + { + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"in_port", + "value":2 + } + }, + { + "OXMTlv":{ + "field":"eth_type", + "value":34525 + } + }, + { + "OXMTlv":{ + "field":"ip_dscp", + "value":24 + } + } + ] + }, + "pktps":10000 + }, + { + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"in_port", + "value":2 + } + }, + { + "OXMTlv":{ + "field":"eth_type", + "value":34525 + } + }, + { + "OXMTlv":{ + "field":"ip_dscp", + "value":16 + } + } + ] + }, + "pktps":10000 + } + ] + } + } + ] + }, + { + "description":"20000pktps(ethernet/arp)-->'in_port=1,actions=meter:20000pktps(dscp_remark:prec_level=1),output:2'", + "prerequisite":[ + { + "OFPMeterMod":{ + "flags":2, + "meter_id":1, + "bands":[ + { + "OFPMeterBandDscpRemark":{ + "rate":10000, + "prec_level":1 + } + } + ] + } + }, + { + "OFPFlowMod":{ + "match":{ + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"in_port", + "value":1 + } + } + ] + } + }, + "instructions":[ + { + "OFPInstructionMeter":{ + "meter_id":1 + } + }, + { + "OFPInstructionActions":{ + "actions":[ + { + "OFPActionOutput":{ + "port":2 + } + } + ], + "type":4 + } + } + ] + } + } + ], + "tests":[ + { + "ingress":{ + "packets":{ + "data":[ + "ethernet(ethertype=2054)", + "arp()", + "str(\"\\x11\" * (1500 - 42))" + ], + "pktps":20000, + "duration_time":30 + } + }, + "egress":{ + "throughput":[ + { + "OFPMatch":{ + "oxm_fields":[ + { + "OXMTlv":{ + "field":"in_port", + "value":2 + } + } + ] + }, + "pktps":20000 + } + ] + } + } + ] + } +]