-
Notifications
You must be signed in to change notification settings - Fork 7
StatisticsModule
ModuleTypeID (hex) | 0x0008 |
---|---|
ModuleTypeID (decimal) | 8 |
Distribution support | single instance |
Dependencies | - |
The StatisticsModule polls table- and port-statistics from each switch in the network. After receiving those statistics, it extracts the important information and publishes that information to everyone that is interested in it.
This module doesn't provide direct services.
After receiving a complete set of statistics from a switch, an event of this type will be published.
From-MessageType | [[FROM.STATISTICS_MODULE.STATISTICS_EVENT.ADDED |
From-Payload | [[From-Container |
For a detailed list of all supported topics, see the StatisticsModule.topics file.
Enabling:
On enabling this Module subscribes itself to SwitchAdapter multipart replies. From all possible multipart replies, only two the following messagetypes are interesting for this module:
- Table Stats Reply
- Port Stats Reply
The information contained in these packet_in messages is used for collecting data about the sending switch.
After subscribing successfully, a polling thread will be started. This thread is sending requests for table- and portstatistics to all Switchadapters in the network. The time between each request is set to 5 seconds by default.
Thread Behaviour:
Packet_in handling:
Upon receiving a packet_in the module checks the ZmfMessage for the messagetype. If the received message is a Table_stats_reply message, the StatisticsModule gathers the following informations:
Table Statistics | Description |
---|---|
active_count | Number of active entries. |
lookup_count | Number of packets looked up in table. |
matched_count | Number of packets that hit table. |
table_id | Identifier of table. Lower numbered tables are consulted first. |
max_entries | Max number of entries supported. (only available in open flow version 1.0) |
If the received message is a Port_stats_reply message, the StatisticsModule gathers the following information:
Port Statistics | Description |
---|---|
port_no | Number of the port |
rx_packets | Number of received packets. |
tx_packets | Number of transmitted packets. |
rx_bytes | Number of received bytes. |
tx_bytes | Number of transmitted bytes. |
rx_dropped | Number of packets dropped by RX. |
tx_dropped | Number of packets dropped by TX. |
rx_errors | Number of receive errors. This is a super-set of more specific receive errors and should be greater than or equal to the sum of all rx_*_err values. |
tx_errors | Number of transmit errors. This is a super-set of more specific transmit errors and should be greater than or equal to the sum of all tx_*_err values (none currently defined.) |
collisions | Number of collisions. |
Data Management:
Table- and portstatistics received are stored in a map. After a switch sent both, table- and portstatistics, the statistics will be published and removed from the map. The unique ID of a switch provides an easy way to add statistics to a map.
Switch Detection:
This Module uses the peerRegistry of Zmf to receive all active Switches. Before sending new statistic requests, the module checks if there were switches added to the network. New Switches will get requests after a few seconds though.
MessageType: FROM.SWITCH_ADAPTER.OPENFLOW.OF_1_0_BARRIER_REPLY_OF_1_3_MULTIPART_REPLY
Comment: Receiving multipart messages containing statistics from Switches using Openflow Version 1.3.
MessageType: FROM.SWITCH_ADAPTER.OPENFLOW.OF_1_0_STATS_REPLY_OF_1_3_TABLE_MOD
Comment: Receiving Stats_reply messages receiving statistics from Switches using Openflow Version 1.0.
Packet_In for Openflow Version 1.3 Request:
Packet_In for Openflow Version 1.0 Request: