| 102 | - Trema web site: http://trema.github.io/trema/ |
| 103 | - Treme ruby API document: http://rubydoc.info/github/trema/trema/master/frames |
| 104 | - '''Functions used in our tutorial:''' |
| 105 | - start: is the function that will be called when the OpenFlow Controller is started. Here in our case, we read the file /tmp/portmap and figures out which OpenFlow port points to which path |
| 106 | - switch_ready: is the function that will be called each time a switch connects to the OpenFlow Controller. Here in our case, we allow all non-TCP flows to pass (including ARP and ICMP packets) and ask new inbound TCP flow to go to the controller. |
| 107 | - packet_in: is the function that will be called each time a packet arrives at the controller. Here in our case, we send out a flow_stats_request to get the current statistics about each flow. Then based on the last received statistics (so we are not using the current statistics to make path decisions--there is a delay of two flows), we make our path choices. |
| 108 | - stats_reply: is the function that will be called when the OpenFlow Controller receives a flow_stats_reply message from the OpenFlow Switch. Here in our case, we update the flow statistics here in this function. |
| 109 | - send_flow_mod_add(): is the function that you should use to add a flow entry into an OpenFlow Switch. |