sFlow.org Peter Phaal http://www.sFlow.org/ InMon Corp. info@sflow.org Ben Pfaff Nicira, Inc. January 2010 sFlow OpenFlow Structures Copyright Notice Copyright (C) sFlow.org (2010). All Rights Reserved. Abstract This memo describes sFlow version 5 structures for exporting OpenFlow related data. Table of Contents 1. Overview ...................................................... 1 2. Discussion .................................................... 1 3. sFlow Datagram Extensions ..................................... 2 4. References .................................................... 3 5. Author's Addresses ............................................ 3 1. Overview This document describes additional structures that allow an sFlow agent to export additional information when packet forwarding decisions are based on the OpenFlow [1] protocol. sFlow version 5 is an extensible protocol that allows the addition of new data structures without impacting existing collectors. This document does not change the sFlow version 5 protocol [2], it simply defines additional, optional, data structures that an sFlow agent can use to report forwarding decisions. 2. Discussion The OpenFlow protocol allows a central traffic controller to manage forwarding decisions in network switches. This architecture complements the sFlow architecture in which a central sFlow analyzer monitors forwarding decisions and traffic from the switches in the network. Extending sFlow to report on OpenFlow specific forwarding DRAFT sFlow.org [Page 1] Version 0.1 sFlow OpenFlow Structures January 2010 decisions will aid in the troubleshooting and performance monitoring of OpenFlow networks. An additional goal of this extension is to facilitate close coordination between the sFlow analyzer and the OpenFlow controller. The combination of sFlow's real-time traffic monitoring and OpenFlow's real-time traffic control capabilities offer the possiblity of integrated, closed-loop control systems that automate network provisioning and capacity management. Version 1.0 of the OpenFlow protocol adds the concept of a "flow cookie". The OpenFlow controller can send the cookie to the switch when it configures a forwarding path. Exporting the cookie as part of the sFlow record associated with a forwarded packet "closes the loop", allowing traffic measurements to be associated with OpenFlow controller forwarding policies. 3. sFlow Datagram Extensions The following structures are defined to report on OpenFlow forwarding: /* OpenFlow 1.0 Data */ /* Data structure for exporting OpenFlow 1.0 forwarding state See http://www.openflowswitch.org/ for field definitions Note: Bit definitions must be consistent with the OpenFlow version 1.0 specification. If later versions of OpenFlow define additional bits, then these additional bits may be included. However, if future versions of the OpenFlow protocol alter the meaning or order of existing bits then the information must be translated into a semantically equivalent 1.0 structure before exporting (possibly resulting in some loss of information). If major structural changes to the OpenFlow protocol invalidate the 1.0 structures, then the agent must not export the openflow_v1 structure. */ /* A bit array describing the fields in the packet header that are used to form the flow key. See ofp_match for the definition of wildcards. */ typedef unsigned int wildcards; /* A bit array describing fields that may have been altered by the flow action. The ofp_action_type enum is used to determine the bit positions, with OFPAT_OUTPUT assigned to the least significant bit. The bit is set if an action DRAFT sFlow.org [Page 2] Version 0.1 sFlow OpenFlow Structures January 2010 of the corresponding type has been specified. Note: OFPAT_VENDOR is encoded using the most significant bit */ typedef unsigned int actions; /* Extended OpenFlow 1.0 Data */ /* opaque = flow_data; enterprise = 0; format = 1017 */ struct extended_openflow_v1 { unsigned hyper flow_cookie; wildcards flow_match; actions flow_actions; } 4. References [1] "OpenFlow Switch Specification, Version 1.0.0 (Wire Protocol 0x01)", http://www.openflowswitch.org/documents/openflow-spec- v1.0.0.pdf, December 31, 2009 [2] Phaal, P. and Lavine, M., "sFlow Version 5", http://www.sflow.org/sflow_version_5.txt, July 2006 5. Author's Address Peter Phaal InMon Corp. 580 California Street, 5th Floor San Francisco, CA 94104 Phone: (415) 283-3263 EMail: peter.phaal@inmon.com Ben Pfaff Nicira, Inc. 3600 W. Bayshore Road, Suite 205 Palo Alto, CA 94303 Phone: (650) 473-9777 EMail: blp@nicira.com DRAFT sFlow.org [Page 3]