Book Image

OpenFlow Cookbook

Book Image

OpenFlow Cookbook

Overview of this book

Table of Contents (17 chapters)
16
Index

Handling a multipart request message to get statistics of flow table

When the controller wants to get statistics of a flow table, it sends an OFPMP_TABLE multipart message (ofp_multipart_request) to the switch.

How to do it...

The message format that will be used by the controller to get the statistics of a flow table using multipart messages is defined in the Getting statistics of a flow table using multipart messages recipe of Chapter 5, Handling Multipart State Information Messages (Part 2). When the switch receives this OFPMP_TABLE message, it should fetch the flow-table-related statistical information. Once it fetches this information, it should construct a reply message. The format of the reply message is defined in the Introduction section of this chapter.

The type field represents the type of multipart message and should be set with the value as OFPMP_TABLE. The body field should take the following format:

/* Body of reply to OFPMP_TABLE request. */
struct ofp_table_stats {
uint8_t...