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 to 
stochastically choose a bucket based on bucket weights (as shown below).
// 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 "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 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 count to be zero (for all buckets). Please note, I am 
using iperf and see traffic being received at the server (via the switch having 
the group entry and corresponding flow entry).
Furthermore, I have tried similar stochastic bucket selecting on CPqD 
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 in this regard will be highly appreciated.
Thank you!

                                          
_______________________________________________
dev mailing list
[email protected]
http://openvswitch.org/mailman/listinfo/dev

Reply via email to