Book Image

OpenFlow Cookbook

Book Image

OpenFlow Cookbook

Overview of this book

Table of Contents (17 chapters)
16
Index

Adding a new meter in a meter table

The OpenFlow meter tables are used to implement simple QoS operations such as rate limiting to complex QoS frameworks such as DiffServ. For more information regarding the meter table, refer to the Introduction section in Chapter 4, Group Table and Meter Table modification Messages (Part 1).

When the controller wants to program a meter, the controller should send a meter modification message (OFPT_METER_MOD) to the switch. This meter modification message contains the information required to program the meter table which includes the meter identifier, bands etc.

Tip

The OFPT_METER_MOD message is used for all the meter operations such as adding a new meter, deleting an existing meter, and modifying a meter.

How to do it...

The message format that should be used by the controller to send OFPT_METER_MOD is as follows:

/* Meter configuration. OFPT_METER_MOD. */
struct ofp_meter_mod {
struct ofp_header header;
uint16_t command;  /* One of OFPMC_*. */
uint16_t flags...