Hello Everyone,
I am experimenting with group "select" feature in OVS 2.1 prerelease 
branch-2.1. I have *only* modified the "group_best_live_bucket()" function in 
"ofproto-dpif-xlate.c" to stochastically choose a bucket based on bucket 
weights (as shown below). I did not change the "xlate_select_group()" function.
// for stochastic switchingstatic const struct ofputil_bucket 
*group_best_live_bucket(const struct xlate_ctx *ctx,                       
const struct group_dpif *group,                       uint32_t basis){    const 
struct ofputil_bucket *best_bucket = NULL;    uint32_t rand_num = 0, sum = 0;   
 const struct ofputil_bucket *bucket;    const struct list *buckets;
    // initialize random seed    srand(time(NULL));    // generate a number 
number in [1, 10]    rand_num = (rand() % 10) + 1;
    group_dpif_get_buckets(group, &buckets);    LIST_FOR_EACH (bucket, 
list_node, buckets) {        sum += bucket->weight;        if (rand_num <= sum) 
{            return bucket; // return this bucket        }    }
    return best_bucket; // return NULL}
My group entry is as follows:
ovs-ofctl -O OpenFlow13 add-group tcp:127.0.0.1:6641 
group_id=0,type=select,bucket=weight=8,mod_dl_src=0A:00:14:01:00:05,mod_dl_dst=0A:00:14:FE:00:02,output=5,bucket=weight=2,mod_dl_src=0A:00:13:01:00:04,mod_dl_dst=0A:00:13:FE:00:02,output=4
However, while monitoring with Wireshark at switch interfaces 
"0A:00:14:01:00:05" and "0A:00:13:01:00:04", I see only one of the buckets 
being selected ALL the time. Based on my understanding, I should have seen 
approximately 80% traffic through "0A:00:14:01:00:05" and 20% traffic going 
through "0A:00:13:01:00:04". I have tried this with varying weights, but to no 
avail. Moreover, when I dump group stats, I always see the packet/byte count to 
be zero (for all buckets). Please note, I am using iperf and see traffic being 
received at the host running iperf server (via the switch having the group 
entry and corresponding flow entry).
Furthermore, I have tried similar stochastic bucket selection on CPqD's 
of13softswitch and saw traffic being split probabilistically.
So, my questions are as follows:
1. Why is the group stats not showing the correct packet count?2. What am I 
missing to stochastically choose group buckets?
Any help/directions in this regard will be highly appreciated.
Thank you!
P.S. I am not seeing my previous request regarding the same issue in dev 
archive. Hence, I am posting my query again and apologize if you receive 
multiple copies.                                        
_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to