121 | | === 4d. Download the pox apps === |
122 | | To help you get started with your controller writing, we will provide: |
123 | | * skeleton files for the controllers where you only need to complete some missing functionality |
124 | | * the solution: fully implemented controllers |
125 | | * a utility library that makes some of the pox messages easier to write |
126 | | |
127 | | '''In the controller terminal execute''': |
128 | | {{{ |
129 | | cd /tmp/pox/ext |
130 | | wget http://www.gpolab.bbn.com/experiment-support/NFVApps/pox-intro-ctrlapps.tar.gz |
131 | | tar xvfz pox-intro-ctrlapps.tar.gz |
132 | | }}} |
133 | | ==== Useful Tips for writing your controller ==== |
134 | | |
135 | | In order to make this first experience of writing a controller easier, we wrote some helpful functions that will abstract some of the particularities of POX away. |
136 | | These functions are located in `/tmp/pox/ext/utils.py`, so while you write your controller consult this file for details. |
137 | | |
138 | | Functions that are implemented include: |
139 | | * packetIsIP : Test if the packet is IP |
140 | | * packetIsARP : Test if the packet is ARP |
141 | | * packetIsRequestARP : Test if this is an ARP Request packet |
142 | | * packetIsReplyARP : Test if this is an ARP Reply packet |
143 | | * packetArpDstIp : Test what is the destination IP in an ARP packet |
144 | | * packetArpSrcIp : Test what is the sources IP in an ARP packet |
145 | | * packetIsTCP : Test if a packet is TCP |
146 | | * packetDstIp : Test the destination IP of a packet |
147 | | * packetSrcIp : Test the source IP of a packet |
148 | | * packetDstTCPPort : Test the destination TCP port of a packet |
149 | | * packetSrcTCPPort : Test the source TCP port of a packet |
150 | | * createOFAction : Create one OpenFlow action |
151 | | * getFullMatch : get the full match out of a packet |
152 | | * createFlowMod : create a flow mod |
153 | | * createArpRequest : Create an Arp Request for a different destination IP |
154 | | * createArpReply : Create an Arp Reply for a different source IP |