使用RPC调用的OpenDaylight Flow统计信息

时间:2016-09-19 19:42:28

标签: rpc openflow opendaylight

我尝试使用以下RPC调用来获取统计信息,而不是通过默认的statistics-manager。

POST / restconf / operations / opendaylight - flow - statistics: get - all - flows - statistics - from - all - flow - tables {
    "input": {
        "node": "/opendaylight-inventory:nodes/opendaylight-inventory:node[opendaylight-inventory:id=\"openflow:1000\"]"
    }
}

但是,此请求的响应仅为transaction-id。虽然我可以看到OpenFlow Flow Stat RequestFlow Stat Reply消息在控制器和交换机之间交换,但操作数据存储似乎不会因调用上述RPC而更新。我使用以下方法检查运营数据存储区:

GET /restconf/operational/opendaylight-inventory:nodes/node/openflow:1000/table/0

我的问题是:

  • 如何通过上述RPC(get-all-flows-statistics-from-all-flow-tables)获取交换机发送给控制器的流量统计信息?为什么运营数据存储未更新?

谢谢!迈克尔。

1 个答案:

答案 0 :(得分:1)

使用Boron,您尝试使用的内容已被弃用,因此您应该使用以下内容:

  1. 安装odl-openflowplugin-flow-services
  2. 连接您的开关
  3. 发送以下请求:
  4.     POST /restconf/operations/opendaylight-direct-statistics:get-node-connector-statistics
        Host: localhost:8181
        Content-Type: application/json
        Authorization: Basic YWRtaW46YWRtaW4=
    
        {
            "input": 
            { 
                "node" : "/opendaylight-inventory:nodes/opendaylight-inventory:node[opendaylight-inventory:id=\"openflow:187811733353539\"]" ,
                "store-stats" : false
            } 
        }
    
    1. 如果要将商店统计信息保留在数据存储区中,请将其设置为true
    2. 您还可以仅获取指定端口的统计信息,但在尝试时,它似乎无法正常工作 将其添加到上述有效负载中:

          "node-connector-id" : "/opendaylight-inventory:nodes/opendaylight-inventory:node[opendaylight-inventory:id=\"openflow:187811733353539\"]/opendaylight-inventory:node-connector[opendaylight-inventory:id='openflow:187811733353539:LOCAL']",
      

      而不是LOCAL,请指定所需的端口。

      希望这有帮助, 亚历