[ovs-discuss] How do I push data from Open vSwitch to connected controllers?

Dzuy Pham pham.dzuy at gmail.com
Mon Jan 2 00:58:19 UTC 2017


Hi,

I am a researcher trying to gather custom statistics using Open vSwitch and
transmitting this information to any connected controllers, in my case the
RYU Controller.

I've currently coded it using the REQUEST/REPLY format, using the Nicira
extension "NXST" and adding additional ofptypes/ofpraw. I am able request
for these statistics from the controller and can successfully receive and
decode the reply. I am looking to change it so that the switch is able to
push these statistics (the reply) from the switch to any connected
controllers without a REQUEST and am unsure how to implement this.

Right now, I am using this structure.

static enum ofperr
handle_nxst_netlink_request(struct ofconn *ofconn,
                                const struct ofp_header *request)
{
struct ovs_list replies;
enum ofperr error;

ofpmp_init(&replies, request);
error = get_netlink_stats(&replies);
if (!error) {
        ofconn_send_replies(ofconn, &replies);
    }
    else {
        ofpbuf_list_delete(&replies);
    }
}

And appending instances of netlink_stats_reply using the ofpmp_append
function to the replies,

void reply_allocate(struct ovs_list *replies, struct nl_per_flow_stats
*cur_stats) {
    struct netlink_stats_reply *reply = ofpmp_append(replies,
sizeof(*reply));
    encode_netlink_stats(reply, cur_stats);
}

/* Custom Statistics */
struct netlink_stats_reply {
    struct nl_per_ip ipv4;
    __be32 packet_count;
    __be16 packet_size_list[100];
};

Is there a way I can modify/add to this code to push this data from Open
vSwitch to all connected controllers without a REQUEST requirement?

Thanks,

Dzuy.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openvswitch.org/pipermail/ovs-discuss/attachments/20170102/8f9b526e/attachment.html>


More information about the discuss mailing list