Reference Guide
Table Of Contents
- 1 Introduction
- 2 Establishing Your Test and Development Environments
- 3 Developing Applications
- Introduction
- Authentication
- REST API
- Audit Logging
- Alert Logging
- Configuration
- High Availability
- OpenFlow
- Metrics Framework
- GUI
- SKI Framework - Overview
- SKI Framework - Navigation Tree
- SKI Framework - Hash Navigation
- SKI Framework - View Life-Cycle
- SKI Framework - Live Reference Application
- UI Extension
- Introduction
- Controller Teaming
- Distributed Coordination Service
- Persistence
- Backup and Restore
- Device Driver Framework
- 4 Application Security
- 5 Including Debian Packages with Applications
- 6 Sample Application
- Application Description
- Creating Application Development Workspace
- Application Generator (Automatic Workspace Creation)
- Creating Eclipse Projects
- Updating Project Dependencies
- Building the Application
- Installing the Application
- Application Code
- 7 Testing Applications
- 8 Built-In Applications
- Appendix A
- Appendix B
- Bibliography
}
}
private void handleEchoReply(OfmEchoReply msg, DataPathId dpid) {
...
}
private void handlePortStatus(OfmPortStatus msg, DataPathId dpid) {
...
}
}
Statistics
The ControllerService API has a number of methods for retrieving various “statistics” about the
controller, or about datapaths in the network.
•
getStats()—returns statistics on byte and packet counts, from the controller’s perspective.
•
getPortStats(...)—queries the specified datapath for statistics on its ports.
•
getFlowStats(...)—queries the specified datapath for statistics on installed flows.
•
getGroupDescription(...)—queries the specified datapath for its group descriptions.
•
getGroupStats(...)—queries the specified datapath for statistics on its groups.
•
getGroupFeatures(...)—queries the specified datapath for the group features it supports.
•
getMeterConfig(...)—queries the specified datapath for its meter configurations.
•
getMeterStats(...)—queries the specified datapath for statistics on its meters.
•
getMeterFeatures(...)—queries the specified datapath for the meter features it supports.
•
getExperimenter(...)—queries the specified datapath for meter configuration or statistics for
OpenFlow 1.0 datapaths.
As an example, a method to print all the flows on a given datapath could be written as follows:
Flows Example:
private void printFlowStats(DataPathId dpid) {
List<MBodyFlowStats> stats = cs.getFlowStats(dpid, TableId.ALL);
// Note: the above is a blocking call, which will wait for the
// controller to send the request to the datapath and retrieve the
// response, before returning.
print("All flows installed on datapath {} ...", dpid);
for (MBodyFlowStats fs: stats)
printFlow(fs);
}
private void printFlow(MBodyFlowStats fs) {
print("Table ID : {}", fs.getTableId());
print("Duration : {} secs", fs.getDurationSec());
print("Idle Timeout : {} secs", fs.getIdleTimeout());
print("Hard Timeout : {} secs", fs.getHardTimeout());
37