Changes between Version 8 and Version 9 of HowTo/WriteOFv3Rspecs/Examples


Ignore:
Timestamp:
09/30/11 10:14:07 (8 years ago)
Author:
nriga@bbn.com
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • HowTo/WriteOFv3Rspecs/Examples

    v8 v9  
    5555
    5656= Rspec with multiple groups =
    57 If you need to apply different packet filters in different datapath sets, then you can create multiple groups and use them as needed in your matches.
     57If you need to apply different packet filters in different datapath sets, then you can create multiple groups and use them as needed in your matches.
     58In this example we want all ARP packets of a specific vlan. 
    5859{{{
    5960#!xml
     
    103104           <openflow:use-group name="mygrp2" />
    104105           <openflow:packet>
    105              <openflow:nw_src value="10.1.1.0/24" />
    106              <openflow:tp_src value="80" />
     106             <openflow:dl_vlan value="10" />
     107             <openflow:dl_type value="0x806" />
    107108           <openflow:packet />
    108109       <openflow:match>
     
    111112           <openflow:use-group name="mygrp2" />
    112113           <openflow:packet>
    113              <openflow:nw_src value="10.1.1.0/24" />
    114              <openflow:tp_src value="80, 8080-8090" />
     114             <openflow:nw_src dl_vlan="10-12" />
     115              <openflow:dl_type value="0x806" />
    115116           <openflow:packet />
    116117         <openflow:match>
     
    123124= Rspec with groups and datapaths =
    124125If for only one of your matches you need a different set of datapaths, you don't need to create a group
    125 you can just add the datapaths directly in your match.
     126you can just add the datapaths directly in your match. In this example we match all ssh (TCP port 22) traffic.
    126127{{{
    127128#!xml
     
    166167
    167168           <openflow:packet>
    168              <openflow:nw_src value="10.1.1.0/24" />
    169              <openflow:tp_src value="80" />
    170            <openflow:packet />
    171        <openflow:match>
    172    
    173        <openflow:match>
    174            <openflow:use-group name="mygrp" />
    175            <openflow:packet>
    176              <openflow:nw_src value="10.1.1.0/24" />
    177              <openflow:tp_src value="80, 8080-8090" />
     169             <openflow:dl_type value="0x800" />
     170             <openflow:nw_proto value="6" />
     171             <openflow:tp_dst value="22" />
     172           <openflow:packet />
     173       <openflow:match>
     174   
     175       <openflow:match>
     176           <openflow:use-group name="mygrp" />
     177           <openflow:packet>
     178             <openflow:dl_type value="0x800" />
     179             <openflow:nw_proto value="6" />
     180             <openflow:tp_src value="22" />
    178181           <openflow:packet />
    179182         <openflow:match>
     
    183186</rspec>
    184187}}}
     188
     189= Rspec for ICMP traffic from all the datapaths =
     190{{{
     191#!xml
     192<?xml version="1.1" encoding="UTF-8"?>
     193<rspec  xmlns="http://www.protogeni.net/resources/rspec/2"
     194        xmlns:xs="http://www.w3.org/2001/XMLSchema-instance"
     195        xmlns:openflow="http://www.geni.net/resources/rspec/ext/openflow/3"
     196        xs:schemaLocation="http://www.protogeni.net/resources/rspec/2
     197              http://www.protogeni.net/resources/rspec/2/request.xsd
     198              http://www.geni.net/resources/rspec/ext/openflow/3
     199              http://www.geni.net/resources/rspec/ext/openflow/3/of-resv.xsd"
     200    type="request">
     201   
     202    <openflow:sliver email="user@example.net" description="My GENI experiment"
     203ref="http://wiki.example.net/myproj" />
     204
     205       <openflow:controller url="tcp:myctrl.example.net:9933" type="primary" />
     206
     207       <openflow:group name="all" />
     208
     209       <openflow:match>
     210           <openflow:use-group name="all" />
     211
     212           <openflow:packet>
     213             <openflow:dl_type value="0x800" />
     214             <openflow:nw_proto value="1" />
     215           <openflow:packet />
     216       <openflow:match>
     217
     218    </openflow:sliver>
     219
     220</rspec>
     221}}}
     222
     223
     224= Rspec to get all traffic for an IP subnet including ARP =
     225{{{
     226#!xml
     227<?xml version="1.1" encoding="UTF-8"?>
     228<rspec  xmlns="http://www.protogeni.net/resources/rspec/2"
     229        xmlns:xs="http://www.w3.org/2001/XMLSchema-instance"
     230        xmlns:openflow="http://www.geni.net/resources/rspec/ext/openflow/3"
     231        xs:schemaLocation="http://www.protogeni.net/resources/rspec/2
     232              http://www.protogeni.net/resources/rspec/2/request.xsd
     233              http://www.geni.net/resources/rspec/ext/openflow/3
     234              http://www.geni.net/resources/rspec/ext/openflow/3/of-resv.xsd"
     235    type="request">
     236   
     237    <openflow:sliver email="user@example.net" description="My GENI experiment"
     238ref="http://wiki.example.net/myproj" />
     239
     240       <openflow:controller url="tcp:myctrl.example.net:9933" type="primary" />
     241
     242       <openflow:group name="all" />
     243
     244       <openflow:match>
     245           <openflow:use-group name="all" />
     246
     247           <openflow:packet>
     248             <openflow:dl_type value="0x800, 0x806" />
     249             <openflow:nw_src value="10.10.10.0/24" />
     250             <openflow:nw_dst value="10.10.10.0/24" />
     251           <openflow:packet />
     252       <openflow:match>
     253
     254    </openflow:sliver>
     255
     256</rspec>
     257}}}