OpenDaylight OpenFlow Plugin:Statistics
This page contains high level detail about the statistics collection mechanism in new OpenFlow plugin.
Statistics collection in new OpenFlow plugin
New OpenFlow plugin collects following statistics from OpenFlow enabled node(switch):
- Individual Flow Statistics
- Aggregate Flow Statistics
- Flow Table Statistics
- Port Statistics
- Group Description
- Group Statistics
- Meter Configuration
- Meter Statistics
- Queue Statistics
- Node Description
- Flow Table Features
- Port Description
- Group Features
- Meter Features
At a high level statistics collection mechanism is divided into following three parts
1) Statistics related YANG models, service APIs and notification interfaces are defined in the MD-SAL.
2) Service APIs (RPCs) defined in yang models are implemented by OpenFlow plugin. Notification interfaces are wired up by OpenFlow plugin to MD-SAL.
3) Statistics Manager Module : This module use service APIs implemented by OpenFlow plugin to send statistics requests to all the connected OpenFlow enabled nodes. Module also implements notification interfaces to receive statistics response from nodes. Once it receives statistics response, it augment all the statistics data to the relevant element of the node (like node-connector, flow, table,group, meter) and store it in MD-SAL operational data store.
Details of statistics collection
- Current implementation collects above mentioned statistics (except 10-14) at a periodic interval of 15 seconds.
- Statistics mentioned in 10 to 14 are only fetched when any node connects to the controller because these statistics are just static details about the respective elements.
- Whenever any new element is added to node (like flow, group, meter, queue) it sends statistics request immediately to fetch the latest statistics and store it in the operational data store.
- Whenever any element is deleted from the node, it immediately remove the relevant statistics from operational data store.
- Statistics data are augmented to their respective element stored in the configuration data store. E.g Controller installed flows are stored in configuration data store. Whenever Statistics Manager receive statistics data related to these flow, it search the corresponding flow in the configuration data store and augment statistics in the corresponding location in operational data store. Similar approach is used for other elements of the node.
- Statistics Manager stores flow statistics as an unaccounted flow statistics in operational data store if there is no corresponding flow exist in configuration data store. ID format of unaccounted flow statistics is as follows - [#UF$TABLE*<table-id>*Unaccounted-flow-count - e.g #UF$TABLE*2*1].
- All the unaccounted flows will be cleaned up periodically after every two cycle of flow statistics collection, given that there is no update for these flows in the last two cycles.
- Statistics Manager only entertains statistics response for the request sent by itself. User can write its own statistics collector using the statistics service APIs and notification defined in yang models, it won't effect the functioning of Statistics Manager.
- OpenFlow 1.0 don't have concept of Meter and Group, so Statistics Manager don't send any group & meter related statistics request to OpenFlow 1.0 enabled switch.
RESTCONF Uris to access statistics of various node elements
- Aggregate Flow Statistics & Flow Table Statistics
- Individual Flow Statistics from specific table
- Group Features & Meter Features Statistics
- Group Description & Group Statistics
- Meter Configuration & Meter Statistics
- Node Connector Statistics
- Queue Statistics
Disable statistics polling via restconf + rpc (Li-design)
In order to manage statistics activite following rpc can be used:
- Send using POST method to this url: http://localhost:8181/restconf/operations/statistics-manager-control:get-statistics-work-mode
- with empty data in order to get current work mode of statistics manager.
- Send using POST method to this url: http://localhost:8181/restconf/operations/statistics-manager-control:change-statistics-work-mode
- with following data in order to change current work mode of statistics manager:
- (mode element can contain: COLLECT_ALL or FULLY_DISABLED)
<input xmlns="urn:opendaylight:params:xml:ns:yang:openflowplugin:sm:control"> <mode>COLLECT_ALL</mode> </input>
For more details and queuries, please send mail to firstname.lastname@example.org or email@example.com If you want to report any bug in statistics collection, please use bugzilla.