How can I add flow with only vlan priority using rest api

asked 2015-09-03 00:20:39 -0700

anonymous user


I want to add flow with vlan priority using rest api. However I don't want to using vlanid, only want to using vlanpcp tag. So, I set the vlan id to 0 and ethertype to 0x8100. Below is part of my java code.

    // Sample post data.
    JSONObject postData1 = new JSONObject();
    postData1.put("name", "TestFlow1");
    postData1.put("dlDst", "52:54:00:12:34:59");
    postData1.put("installInHw", "true");
    postData1.put("priority", "501");
    if (VlanId != null && VlanPCP != null) {
        postData1.put("vlanId", VlanId);
        postData1.put("vlanPriority", VlanPCP);
    postData1.put("etherType", "0x8100");

    postData1.put("actions", new JSONArray().put("OUTPUT=2"));

    // Node on which this flow should be installed
    JSONObject node1 = new JSONObject();
    node1.put("id", "00:00:00:13:3b:8b:28:1b");
    node1.put("type", "OF");
    postData1.put("node", node1);

    // Actual flow install
    FlowManager.installFlow("00:00:00:13:3b:8b:28:1b", "TestFlow1",

I added flow with vlan priority from controller using rest api, but it doesn't work properly. This is my ovs result using command 'ovs-ofctl dump-flows br0'

NXSTFLOW reply (xid=0x4): cookie=0x0, duration=726.334s, table=0, npackets=0, nbytes=0, idleage=726, priority=501,vlantci=0x0000,dldst=52:54:00:12:34:53,dltype=0x8100 actions=output:1 cookie=0x0, duration=726.347s, table=0, npackets=0, nbytes=0, idleage=726, priority=501,vlantci=0x0000,dldst=52:54:00:12:34:59,dl_type=0x8100 actions=output:3

in this result, vlantci is 0x0000. So, it is mean that ignore vlan tag. I want to know how can i use only vlanpcp tag for add flow with priority using rest api and java programming. Of course, if any other way to add flow with only vlan_pcp tag, please inform to me.

edit retag flag offensive close merge delete