You are previewing OpenFlow Cookbook.
O'Reilly logo
OpenFlow Cookbook

Book Description

Over 110 recipes to design and develop your own OpenFlow switch and OpenFlow controller

In Detail

Moving on from the traditional, configuration-driven network, OpenFlow paves the way to an open, centrally programmable structure providing standard interfaces between the controller and the actual packet forwarding entity.

This book has been divided into two parts to provide you with everything you need to know to develop either an OpenFlow switch or an OpenFlow controller. Starting from the basics of establishing communication channels between the controller and switch, this book explains in detail about the various tables, table operations, and switch and controller procedures.

What You Will Learn

  • Create, maintain, and close an OpenFlow communication channel between the switch and controller

  • Manage multiple switches from a single controller and vice versa: manage a single switch from multiple controllers with different controller roles

  • Configure an OpenFlow switch using standard OpenFlow controller and switch procedures

  • Explore tables present in OpenFlow switches such as flow tables, group tables, and meter tables

  • Using controller and switch procedures, program tables within the switch, such as flow tables, group tables, and meter tables

  • Downloading the example code for this book. You can download the example code files for all Packt books you have purchased from your account at http://www.PacktPub.com. If you purchased this book elsewhere, you can visit http://www.PacktPub.com/support and register to have the files e-mailed directly to you.

    Table of Contents

    1. OpenFlow Cookbook
      1. Table of Contents
      2. OpenFlow Cookbook
      3. Credits
      4. About the Author
      5. About the Reviewers
      6. www.PacktPub.com
        1. Support files, eBooks, discount offers, and more
          1. Why Subscribe?
          2. Free Access for Packt account holders
      7. Preface
        1. What this book covers
        2. What you need for this book
        3. Who this book is for
        4. Sections
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
          5. See also
        5. Conventions
        6. Reader feedback
        7. Customer support
          1. Downloading the example code
          2. Errata
          3. Piracy
          4. Questions
      8. 1. OpenFlow Channel Connection Establishment (Part 1)
        1. Introduction
        2. Connection setup on TCP and TLS
          1. Getting started
          2. How to do it...
            1. TCP Procedure
            2. TLS Procedure
          3. There's more…
          4. See also
        3. Connection setup with multiple controllers
          1. How to do it...
          2. How it works...
          3. There's more…
          4. See also
        4. Setting the role of the communication channel towards a controller
          1. How to do it...
          2. There's more…
          3. See also
        5. Establishing an auxiliary connection to the controller
          1. Getting started
          2. How to do it...
          3. There's more…
          4. See also
        6. Handling a handshake message from the controller
          1. Getting started
          2. How to do it...
          3. See also
        7. Handling a switch configuration message from the controller
          1. How to do it...
          2. See also
        8. Connection interruption procedures
          1. How to do it...
          2. How it works...
          3. There's more…
      9. 1. OpenFlow Channel Connection Establishment (Part 2)
        1. Introduction
        2. Connection setup on TCP and TLS
          1. Getting started
          2. How to do it...
            1. TCP Procedure
            2. TLS Procedure
          3. There's more…
          4. See also
        3. Multiple controllers managing a switch with different roles
          1. How to do it...
          2. How it works...
          3. See also
        4. Setting the role of a controller's communication channel
          1. How to do it...
          2. See also
        5. Auxiliary connection establishment
          1. Getting started
          2. How to do it...
          3. There's more…
          4. See also
        6. Sending a handshake message to the switch
          1. Getting started
          2. How to do it...
          3. See also
        7. Sending a switch configuration message to the switch
          1. Getting started
          2. How to do it...
          3. See also
      10. 2. Symmetric Messages and Asynchronous Messages (Part 1)
        1. Sending and processing a hello message
          1. Getting started
          2. How to do it...
            1. Sending the OFPT_HELLO message
            2. Receiving the OFPT_HELLO message
          3. There's more…
          4. See also
        2. Sending and processing an echo request and a reply message
          1. Getting started
          2. How to do it...
            1. Sending the OFPT_ECHO_REQUEST message
            2. Receiving OFPT_ECHO_REQUEST
            3. Processing OFPT_ECHO_REPLY message
          3. There's more…
        3. Sending and processing an error message
          1. How to do it...
          2. See also
        4. Sending and processing an experimenter message
          1. How to do it...
        5. Handling a "Set Asynchronous Configuration message"
          1. How to do it...
          2. How it works...
          3. See also
        6. Handling a "Get Asynchronous Configuration message" from the controller
          1. How to do it...
          2. See also
        7. Sending a packet-in message to the controller
          1. How to do it...
          2. How it works...
          3. There's more…
          4. See also
        8. Sending a flow-removed message to the controller
          1. How to do it...
          2. See also
        9. Sending a port-status message to the controller
          1. How to do it...
          2. See also
        10. Sending a controller role-status message to the controller
          1. How to do it...
          2. See also
        11. Sending a table-status message to the controller
          1. How to do it...
          2. See also
        12. Sending a request-forward message to the controller
          1. How to do it...
          2. See also
        13. Handling a packet-out message from the controller
          1. How to do it...
          2. See also
        14. Handling a barrier message from the controller
          1. How to do it...
          2. See also
      11. 2. Symmetric Messages and Asynchronous Messages (Part 2)
        1. Sending and processing a hello message
          1. Getting started
          2. How to do it...
            1. Sending the OFPT_HELLO message
            2. Receiving the OFPT_HELLO message
          3. There's more…
          4. See also
        2. Sending and processing an echo request and a reply message
          1. Getting started
          2. How to do it...
            1. Sending the OFPT_ECHO_REQUEST message
            2. Receiving OFPT_ECHO_REQUEST message
            3. Processing OFPT_ECHO_REPLY message
          3. There's more…
        3. Sending and processing error message
          1. How to do it...
          2. See also
        4. Sending and processing experimenter message
          1. How to do it...
        5. Configuring the switch to send a list of asynchronous events the controller channel is interested in
          1. How to do it...
          2. How it works...
          3. See also
        6. Fetching the list of possible asynchronous events that can come from the switch to the controller channel
          1. How to do it...
          2. See also
        7. Processing a packet-in asynchronous message from the switch
          1. Getting started
          2. How to do it...
          3. See also
        8. Processing a flow removed asynchronous message from the switch
          1. Getting started
          2. How to do it...
          3. See also
        9. Processing a port-status asynchronous message from the switch
          1. Getting started
          2. How to do it...
          3. See also
        10. Processing the controller role-status message from the switch
          1. Getting started
          2. How to do it...
          3. See also
        11. Processing a table status asynchronous message from the switch
          1. Getting started
          2. How to do it...
          3. See also
        12. Processing a request forward message from the switch
          1. Getting started
          2. How to do it...
        13. Sending a packet-out message to the switch
          1. How to do it...
            1. Construct the packet and sending it for further pipeline processing in the switch
            2. Using packet buffer in the switch
          2. See also
        14. Sending a barrier message to the switch
          1. How to do it...
          2. See also
      12. 3. Flow Table and Flow Entry Modification Messages (Part 1)
        1. Introduction
          1. Flow table entry
            1. Match Fields
            2. Oxm_class
            3. Oxm_field
            4. Oxm_haskmask
            5. Priority
            6. Counter
            7. Instructions
          2. Action set
          3. Action list
          4. Action
            1. Timeout
            2. Cookie
        2. Modifying a flow table with eviction enabled
          1. How to do it...
          2. See also
        3. Modifying a flow table with vacancy enabled
          1. How to do it...
          2. There's more…
          3. See also
        4. Adding a new flow entry to a flow table
          1. How to do it...
          2. See also
        5. Deleting a flow entry in a flow table
          1. How to do it...
          2. See also
        6. Modifying a flow entry in a flow table
          1. How to do it...
          2. See also
        7. Flow table synchronizations
          1. How to do it...
      13. 3. Flow Table and Flow Entry Modification Messages (Part 2)
        1. Introduction
        2. Modifying a flow table with eviction enabled
          1. How to do it...
          2. See also
        3. Modifying a flow table with vacancy enabled
          1. How to do it...
          2. See also
        4. Adding a new flow entry to the flow table
          1. How to do it...
          2. See also
        5. Deleting an entry from a flow table
          1. How to do it...
          2. See also
        6. Modifying an entry in the flow table
          1. How to do it...
          2. See also
      14. 4. Group Table and Meter Table Modification Messages (Part 1)
        1. Introduction
          1. Group table
          2. Meter table
        2. Adding a new group entry in a group table
          1. How to do it...
          2. See also
        3. Deleting a group entry in a group table
          1. How to do it...
          2. See also
        4. Modifying a group entry in a group table
          1. How to do it...
          2. See also
        5. Adding a new meter in a meter table
          1. How to do it...
          2. See also
        6. Deleting a meter entry
          1. How to do it...
          2. See also
        7. Modifying a meter entry in a meter table
          1. How to do it...
          2. See also
      15. 4. Group Table and Meter Table Modification Messages (Part 2)
        1. Introduction
        2. Adding a new group entry in a group table
          1. How to do it...
          2. How it works...
          3. See also
        3. Deleting a group entry in a group table
          1. How to do it...
          2. How it works...
          3. See also
        4. Modifying a group entry in a group table
          1. How to do it...
          2. How it works...
          3. See also
        5. Adding a new meter in a meter table
          1. How to do it...
          2. How it works...
          3. See also
        6. Deleting a meter entry
          1. How to do it...
          2. How it works...
          3. See also
        7. Modifying a meter entry in a meter table
          1. How to do it...
          2. How it works...
          3. See also
      16. 5. Handling Multipart Statistics Messages (Part 1)
        1. Introduction
        2. Handling a multipart request message to get statistics of an individual flow table entry
          1. How to do it...
          2. See also
        3. Handling a multipart request message to get statistics of a group/aggregate of flow table entry
          1. How to do it...
          2. See also
        4. Handling a multipart request message to get statistics of flow table
          1. How to do it...
          2. See also
        5. Handling a multipart request message to get port statistics
          1. How to do it...
          2. See also
        6. Handling a multipart request message to get port queue statistics
          1. How to do it...
          2. See also
        7. Handling a multipart request message to get meter statistics
          1. How to do it...
          2. See also
        8. Handling a multipart request message to get group statistics
          1. How to do it...
          2. See also
      17. 5. Handling Multipart Statistics Messages (Part 2)
        1. Getting statistics of an individual flow table entry using multipart messages
          1. How to do it...
          2. How it works...
        2. Getting statistics of group/aggregate of flow table entries using multipart messages
          1. How to do it...
          2. How it works...
        3. Getting statistics of flow table using multipart messages
          1. How to do it...
          2. How it works...
        4. Getting port statistics using multipart messages
          1. How to do it...
          2. How it works...
        5. Getting port queue statistics using multipart messages
          1. How to do it...
          2. How it works...
        6. Getting meter statistics using multipart messages
          1. How to do it...
          2. How it works...
        7. Getting group statistics using multipart messages
          1. How to do it...
          2. How it works...
      18. 6. Handling Multipart State Information Messages (Part 1)
        1. Introduction
        2. Getting information about the switch using multipart messages
          1. How to do it...
          2. See also
        3. Getting group description using multipart messages
          1. How to do it...
          2. See also
        4. Getting group feature using multipart messages
          1. How to do it...
          2. See also
        5. Getting meter configuration using multipart messages
          1. How to do it...
          2. See also
        6. Getting the meter feature using multipart messages
          1. How to do it...
          2. See also
        7. Getting the table feature using multipart messages
          1. How to do it...
          2. See also
        8. Getting port description using multipart messages
          1. How to do it...
          2. See also
        9. Getting table description using multipart messages
          1. How to do it...
          2. See also
        10. Getting queue description using multipart messages
          1. How to do it...
          2. See also
        11. Configuring Flow monitor using multipart messages
          1. How to do it...
          2. See also
        12. Experimenter multipart messages
          1. How to do it...
      19. 6. Handling Multipart State Information Messages (Part 2)
        1. Introduction
        2. Getting information about the switch using multipart messages
          1. How to do it...
          2. See also
        3. Getting the group description using multipart messages
          1. How to do it...
          2. See also
        4. Getting the group feature using multipart messages
          1. How to do it...
          2. See also
        5. Getting the meter configuration using multipart messages
          1. How to do it...
          2. See also
        6. Getting the meter feature using multipart messages
          1. How to do it...
          2. See also
        7. Getting the table feature using multipart messages
          1. How to do it...
          2. See also
        8. Getting the port description using multipart messages
          1. How to do it...
          2. See also
        9. Getting the table description using multipart messages
          1. How to do it...
          2. See also
        10. Getting the queue description using multipart messages
          1. How to do it...
          2. See also
        11. Configuring the flow monitor using multipart messages
          1. How to do it...
          2. See also
        12. Experimenter multipart message
          1. How to do it...
      20. 7. Handling Bundle Messages (Part 1)
        1. Introduction
        2. Creation of a bundle
          1. How to do it...
        3. Adding messages to a bundle
          1. Getting started
          2. How to do it...
        4. Closing a bundle
          1. Getting started
          2. How to do it...
        5. Committing or executing all the operations inside a bundle
          1. Getting started
          2. How to do it...
        6. Discarding a bundle
          1. Getting started
          2. How to do it...
      21. 7. Handling Bundle Messages (Part 2)
        1. Introduction
        2. Creation of a bundle
          1. How to do it...
        3. Adding messages to a bundle
          1. Getting started
          2. How to do it...
        4. Closing a bundle
          1. Getting started
          2. How to do it...
        5. Committing or executing all the operations inside a bundle
          1. Getting started
          2. How to do it...
        6. Discarding a bundle
          1. Getting started
          2. How to do it...
      22. A. Common OpenFlow Headers, Structures, and Error Code
        1. Common OpenFlow headers
          1. OpenFlow Header
        2. Common OpenFlow structures
          1. Port structures
          2. Table structures
        3. Common OpenFlow error codes
        4. Common OpenFlow multipart message types
      23. Index