wiki:HowTo/WriteOFv3Rspecs

Version 6 (modified by nriga@bbn.com, 8 years ago) (diff)

--

This page describes how to write GENI compliant Openflow rspecs. These new rspecs are supported by FOAM, the new Openflow AM. This page also provides instructions and how to convert Expedient rspecs to the new form of rspecs. For a detailed explanation of the tags and attributes look at this specification page.

Openflow Slivers

In an Openflow Aggregate, an experimenter can control how the packets are forwarded within the network, using a custom controller running in an external compute resource. In the general case an Openflow Aggregate consists of Openflow-enabled devices(e.g. switches) which forward packets based on instructions received by the controllers.

The traffic of an Openflow network can be sliced, using matching rules on the traversing packets. A set of rules that describes part of the passing traffic is called a flowspace. A flowspace can be defined based on the datapath ids (aka dpids) and ports that the packets are going through, and/or based on their headers. Datapath is a virtual network device that is controlled using the Openflow protocol and can forward packets. So for example a switch running an Openflow compatible firmware might be a datapath.

More details about how Openflow works and about which fields of the packet headers can be used in flowspaces can be found in the Openflow Spec 1.0.0 and in the Openflow website.

For example a sliver on an Openflow network might request for :

"All packets coming in port 5 on datapath 15, and have a source IP address in subnet 10.10.10.0/24."

Writing FOAM request rspecs

The best way to understand and write FOAM rspecs is by looking at example rspecs. Keep in mind that the rspec is merely a structured representation of flowspaces that describe the traffic that an experiment wants to control.

This example rspec, is a complete example. In this wiki page you can also find other simpler examples.

In essence your rspec should:

  1. start with the <rspec> and the <openflow:sliver> tags :
    <?xml version="1.0" encoding="UTF-8"?>
    
    <rspec xmlns="http://www.protogeni.net/resources/rspec/2"
           xmlns:xs="http://www.w3.org/2001/XMLSchema-instance"
           xmlns:openflow="http://www.geni.net/resources/rspec/ext/openflow/2"
           xs:schemaLocation="http://www.protogeni.net/resources/rspec/2
                              http://www.protogeni.net/resources/rspec/2/request.xsd
                              http://www.geni.net/resources/rspec/ext/openflow/2
                              http://wwww.geni.net/resources/rspec/ext/openflow/2/of-resv.xsd"
           type="request">
        
        <openflow:sliver email="user@geni.net" description="My GENI experiment" ref="http://www.geni.net" />
    
            <!-- rest of rspec -->
    
        </openflow:sliver>
    </rspec>
    
  1. Specify where your controller is running. E.g.:
    <openflow:controller url="tcp:example.geni.net:9933" type="primary" />
    
  1. Organize the datapaths that are relevant to this sliver within groups. The best way to construct the <openflow:datapath> elements is by copying them from the advertisement rspecs. E.g if this is the advertisement rspec, and you want :
  • ports 7 and 20 of datapath with dpid 06:a4:00:12:e2:b8:a5:d0
  • ports 50 and 71 of datapath with dpid 06:af:00:24:a8:c4:b9:00

Then you can construct a group that looks like :

<openflow:group name="mygrp">
  <openflow:datapath component_id="urn:publicid:IDN+openflow:foam:uxmal.gpolab.bbn.com+datapath:06:a4:00:12:e2:b8:a5:d0" dpid="06:a4:00:12:e2:b8:a5:d0">
    <openflow:port name="GBE0/7" num="7"/>
    <openflow:port name="GBE0/20" num="20"/>
  </openflow:datapath>


  <openflow:datapath component_id="urn:publicid:IDN+openflow:foam:uxmal.gpolab.bbn.com+datapath:06:af:00:24:a8:c4:b9:00" dpid="06:af:00:24:a8:c4:b9:00">
    <openflow:port name="26" num="50"/>
    <openflow:port name="47" num="71"/>
    <openflow:port name="local" num="65534"/>
  </openflow:datapath>

</openflow:group>
  1. Specify your flowspace. E.g. if you want for the above group to get all traffic that is sourced or destined to the IP subnet 10.1.1.0/24 and uses tcp port 80, then you will need two <openflow:match> tags, one to match the packets that are sourced from that subnet and one to match the packets that are destined to that subnet. Keep in mind that your flowspace is the union of the traffic that is described by each
     <openflow:match>
       <openflow:use-group name="mygrp" />
       <openflow:packet>
         <openflow:nw_src value="10.1.1.0/24" />
         <openflow:tp_src value="80" />
       <openflow:packet />
     <openflow:match>
    
     <openflow:match>
       <openflow:use-group name="mygrp" />
       <openflow:packet>
         <openflow:nw_dst value="10.1.1.0/24" />
         <openflow:tp_dst value="80" />
       <openflow:packet />
     <openflow:match>
    

Done! The complete rspec looks like :

<rspec xmlns="http://www.protogeni.net/resources/rspec/2"
       xmlns:xs="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:openflow="http://www.geni.net/resources/rspec/ext/openflow/2"
       xs:schemaLocation="http://www.protogeni.net/resources/rspec/2
                          http://www.protogeni.net/resources/rspec/2/request.xsd
                          http://www.geni.net/resources/rspec/ext/openflow/2
                          http://wwww.geni.net/resources/rspec/ext/openflow/2/of-resv.xsd"
       type="request">
    
    <openflow:sliver email="user@geni.net" description="My GENI experiment" ref="http://www.geni.net" />

       <openflow:controller url="tcp:myctrl.example.net:9933" type="primary" />

       <openflow:group name="mygrp">
           <openflow:datapath component_id="urn:publicid:IDN+openflow:foam:uxmal.gpolab.bbn.com+datapath:06:a4:00:12:e2:b8:a5:d0" dpid="06:a4:00:12:e2:b8:a5:d0">
             <openflow:port name="GBE0/7" num="7"/>
             <openflow:port name="GBE0/20" num="20"/>
           </openflow:datapath>


           <openflow:datapath component_id="urn:publicid:IDN+openflow:foam:uxmal.gpolab.bbn.com+datapath:06:af:00:24:a8:c4:b9:00" dpid="06:af:00:24:a8:c4:b9:00">
             <openflow:port name="26" num="50"/>
             <openflow:port name="47" num="71"/>
             <openflow:port name="local" num="65534"/>
           </openflow:datapath>

       </openflow:group>

       <openflow:match>
           <openflow:use-group name="mygrp" />
           <openflow:packet>
             <openflow:nw_src value="10.1.1.0/24" />
             <openflow:tp_src value="80" />
           <openflow:packet />
         <openflow:match>

         <openflow:match>
           <openflow:use-group name="mygrp" />
           <openflow:packet>
             <openflow:nw_dst value="10.1.1.0/24" />
             <openflow:tp_dst value="80" />
           <openflow:packet />
         <openflow:match>

    </openflow:sliver>

</rspec>

FOAM and Expedient rspecs

Although the FOAM and the Expedient

Attachments (1)

Download all attachments as: .zip