[
    "group: 01_SELECT_Weight_Ether",
    {
        "description":"2Mbps(ethernet(dst=random,src=random)/ipv4/tcp)-->'in_port=1,actions=group:select(weight=1,actions=output:2/weight=2,actions=output:3)'",
        "prerequisite":[
            {
                "OFPGroupMod":{
                    "group_id":0,
                    "type":1,
                    "buckets":[
                        {
                            "OFPBucket":{
                                "weight":1,
                                "actions":[
                                    {
                                        "OFPActionOutput":{
                                            "port":2
                                        }
                                    }
                                ]
                            }
                        },
                        {
                            "OFPBucket":{
                                "weight":2,
                                "actions":[
                                    {
                                        "OFPActionOutput":{
                                            "port":3
                                        }
                                    }
                                ]
                            }
                        }
                    ]
                }
            },
            {
                "OFPFlowMod":{
                    "match":{
                        "OFPMatch":{
                            "oxm_fields":[
                                {
                                    "OXMTlv":{
                                        "field":"in_port",
                                        "value":1
                                    }
                                }
                            ]
                        }
                    },
                    "instructions":[
                        {
                            "OFPInstructionActions":{
                                "actions":[
                                    {
                                        "OFPActionGroup":{
                                            "group_id":0
                                        }
                                    }
                                ],
                                "type":4
                            }
                        }
                    ]
                }
            }
        ],
        "tests":[
            {
                "ingress":{
                    "packets":{
                        "data":[
                            "ethernet(dst=netaddr.EUI(randint(0, 2 ** 48 - 1)), src=netaddr.EUI(randint(0, 2 ** 48 - 1) & 0xfeffffffffff), ethertype=2048)",
                            "ipv4(proto=6)",
                            "tcp()",
                            "bytes(b'\\x11' * (1500 - 54))"
                        ],
                        "pktps":175,
                        "duration_time":30
                    }
                },
                "egress":{
                    "throughput":[
                        {
                            "OFPMatch":{
                                "oxm_fields":[
                                    {
                                        "OXMTlv":{
                                            "field":"in_port",
                                            "value":2
                                        }
                                    }
                                ]
                            },
                            "kbps":667
                        },
                        {
                            "OFPMatch":{
                                "oxm_fields":[
                                    {
                                        "OXMTlv":{
                                            "field":"in_port",
                                            "value":3
                                        }
                                    }
                                ]
                            },
                            "kbps":1333
                        }
                    ]
                }
            }
        ]
    },
    {
        "description":"2Mbps(ethernet(dst=random,src=random)/ipv6/tcp)-->'in_port=1,actions=group:select(weight=1,actions=output:2/weight=2,actions=output:3)'",
        "prerequisite":[
            {
                "OFPGroupMod":{
                    "group_id":0,
                    "type":1,
                    "buckets":[
                        {
                            "OFPBucket":{
                                "weight":1,
                                "actions":[
                                    {
                                        "OFPActionOutput":{
                                            "port":2
                                        }
                                    }
                                ]
                            }
                        },
                        {
                            "OFPBucket":{
                                "weight":2,
                                "actions":[
                                    {
                                        "OFPActionOutput":{
                                            "port":3
                                        }
                                    }
                                ]
                            }
                        }
                    ]
                }
            },
            {
                "OFPFlowMod":{
                    "match":{
                        "OFPMatch":{
                            "oxm_fields":[
                                {
                                    "OXMTlv":{
                                        "field":"in_port",
                                        "value":1
                                    }
                                }
                            ]
                        }
                    },
                    "instructions":[
                        {
                            "OFPInstructionActions":{
                                "actions":[
                                    {
                                        "OFPActionGroup":{
                                            "group_id":0
                                        }
                                    }
                                ],
                                "type":4
                            }
                        }
                    ]
                }
            }
        ],
        "tests":[
            {
                "ingress":{
                    "packets":{
                        "data":[
                            "ethernet(dst=netaddr.EUI(randint(0, 2 ** 48 - 1)), src=netaddr.EUI(randint(0, 2 ** 48 - 1) & 0xfeffffffffff), ethertype=34525)",
                            "ipv6(nxt=6)",
                            "tcp()",
                            "bytes(b'\\x11' * (1500 - 74))"
                        ],
                        "pktps":175,
                        "duration_time":30
                    }
                },
                "egress":{
                    "throughput":[
                        {
                            "OFPMatch":{
                                "oxm_fields":[
                                    {
                                        "OXMTlv":{
                                            "field":"in_port",
                                            "value":2
                                        }
                                    }
                                ]
                            },
                            "kbps":667
                        },
                        {
                            "OFPMatch":{
                                "oxm_fields":[
                                    {
                                        "OXMTlv":{
                                            "field":"in_port",
                                            "value":3
                                        }
                                    }
                                ]
                            },
                            "kbps":1333
                        }
                    ]
                }
            }
        ]
    },
    {
        "description":"2Mbps(ethernet(dst=random,src=random)/arp)-->'in_port=1,actions=group:select(weight=1,actions=output:2/weight=2,actions=output:3)'",
        "prerequisite":[
            {
                "OFPGroupMod":{
                    "group_id":0,
                    "type":1,
                    "buckets":[
                        {
                            "OFPBucket":{
                                "weight":1,
                                "actions":[
                                    {
                                        "OFPActionOutput":{
                                            "port":2
                                        }
                                    }
                                ]
                            }
                        },
                        {
                            "OFPBucket":{
                                "weight":2,
                                "actions":[
                                    {
                                        "OFPActionOutput":{
                                            "port":3
                                        }
                                    }
                                ]
                            }
                        }
                    ]
                }
            },
            {
                "OFPFlowMod":{
                    "match":{
                        "OFPMatch":{
                            "oxm_fields":[
                                {
                                    "OXMTlv":{
                                        "field":"in_port",
                                        "value":1
                                    }
                                }
                            ]
                        }
                    },
                    "instructions":[
                        {
                            "OFPInstructionActions":{
                                "actions":[
                                    {
                                        "OFPActionGroup":{
                                            "group_id":0
                                        }
                                    }
                                ],
                                "type":4
                            }
                        }
                    ]
                }
            }
        ],
        "tests":[
            {
                "ingress":{
                    "packets":{
                        "data":[
                            "ethernet(dst=netaddr.EUI(randint(0, 2 ** 48 - 1)), src=netaddr.EUI(randint(0, 2 ** 48 - 1) & 0xfeffffffffff), ethertype=2054)",
                            "arp(dst_mac='22:22:22:22:22:22', src_mac='12:11:11:11:11:11')",
                            "bytes(b'\\x11' * (1500 - 42))"
                        ],
                        "pktps":175,
                        "duration_time":30
                    }
                },
                "egress":{
                    "throughput":[
                        {
                            "OFPMatch":{
                                "oxm_fields":[
                                    {
                                        "OXMTlv":{
                                            "field":"in_port",
                                            "value":2
                                        }
                                    }
                                ]
                            },
                            "kbps":667
                        },
                        {
                            "OFPMatch":{
                                "oxm_fields":[
                                    {
                                        "OXMTlv":{
                                            "field":"in_port",
                                            "value":3
                                        }
                                    }
                                ]
                            },
                            "kbps":1333
                        }
                    ]
                }
            }
        ]
    }
]
