Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

- Make NewRouteFlow become RouteFlow by replacing everything in master.

  This is bad practice, and it was done instead of a proper merge for the
  following reasons:
  - NewRouteFlow was already created with this bad practice because we started
    the development in a separate internal repository
  - We wanted to get rid of lots of unnecessary data commited to NewRouteFlow
    during testing
  - Anything we consider worth looking for is already in the master branch
  The NewRouteFlow branch will eventually be deleted.
  • Loading branch information...
commit 45e267e0f407a0057727819406893fa9df2bf664 1 parent 66b13ca
@alnvdl alnvdl authored
Showing with 539 additions and 3,347 deletions.
  1. +2 −1  COPYING
  2. +0 −148 INSTALL
  3. +2 −1  LICENSE
  4. +25 −15 Make.rules
  5. +28 −21 Makefile
  6. +326 −97 README
  7. +0 −45 TODO
  8. +0 −25 common/ipc/IPCCommunicator.cc
  9. +0 −105 common/ipc/IPCCommunicator.hh
  10. +0 −42 common/ipc/IPCMessage.cc
  11. +0 −154 common/ipc/IPCMessage.hh
  12. +0 −3  common/ipc/Makefile
  13. +0 −40 common/ipc/MessageProcessor.cc
  14. +0 −113 common/ipc/MessageProcessor.hh
  15. +0 −90 common/ipc/RFCtlMessageProcessor.cc
  16. +0 −48 common/ipc/RFCtlMessageProcessor.hh
  17. +0 −83 common/ipc/RawMessage.cc
  18. +0 −97 common/ipc/RawMessage.hh
  19. +0 −273 common/ipc/TCPSocket.cc
  20. +0 −138 common/ipc/TCPSocket.hh
  21. +0 −153 common/ipc/cpqd.cc
  22. +0 −121 common/ipc/cpqd.hh
  23. +0 −106 common/ipc/cpqd_types.hh
  24. +0 −3  common/rf-protocol/Makefile
  25. +0 −349 common/rf-protocol/rfprotocol.cc
  26. +0 −194 common/rf-protocol/rfprotocol.hh
  27. +0 −3  common/sys/Makefile
  28. +0 −61 common/sys/Mutex.cc
  29. +0 −66 common/sys/Mutex.hh
  30. +0 −128 common/sys/Semaphore.cc
  31. +0 −123 common/sys/Semaphore.hh
  32. +0 −109 common/sys/Thread.cc
  33. +0 −49 common/sys/Thread.hh
  34. +0 −144 common/sys/Timer.cc
  35. +0 −52 common/sys/Timer.hh
  36. +0 −47 include/base_msg.h
  37. +0 −35 include/cmd_msg.h
  38. +0 −65 include/event_msg.h
  39. 0  {rf-controller → nox}/.gitignore
  40. 0  {rf-controller → nox}/.gitmodules
  41. 0  {rf-controller → nox}/COPYING
  42. 0  {rf-controller → nox}/INSTALL
  43. 0  {rf-controller → nox}/LICENSE
  44. 0  {rf-controller → nox}/Makefile.am
  45. 0  {rf-controller → nox}/README
  46. 0  {rf-controller → nox}/acinclude.m4
  47. 0  {rf-controller → nox}/boot.sh
  48. 0  {rf-controller → nox}/config/.gitignore
  49. 0  {rf-controller → nox}/config/ac_devel_python.m4
  50. 0  {rf-controller → nox}/config/ac_pkg_doxygen.m4
  51. 0  {rf-controller → nox}/config/ac_pkg_sphinx.m4
  52. 0  {rf-controller → nox}/config/ac_pkg_swig.m4
  53. 0  {rf-controller → nox}/config/aci.m4
  54. 0  {rf-controller → nox}/config/acx_pthread.m4
  55. 0  {rf-controller → nox}/config/ax_boost_base.m4
  56. 0  {rf-controller → nox}/config/ax_boost_filesystem.m4
  57. 0  {rf-controller → nox}/config/ax_boost_serialization.m4
  58. 0  {rf-controller → nox}/config/ax_boost_thread.m4
  59. 0  {rf-controller → nox}/config/ax_boost_unit_test_framework.m4
  60. 0  {rf-controller → nox}/config/ax_check_openflow.m4
  61. 0  {rf-controller → nox}/config/ax_coverage.m4
  62. 0  {rf-controller → nox}/config/ax_ldap.m4
  63. 0  {rf-controller → nox}/config/ax_ltdl.m4
  64. 0  {rf-controller → nox}/config/ax_ndebug.m4
  65. 0  {rf-controller → nox}/config/ax_netlink.m4
  66. 0  {rf-controller → nox}/config/ax_pcap.m4
  67. 0  {rf-controller → nox}/config/ax_profiling.m4
  68. 0  {rf-controller → nox}/config/ax_rtc.m4
  69. +29 −0 nox/config/ax_ssl.m4
  70. 0  {rf-controller → nox}/config/ax_thread_local.m4
  71. 0  {rf-controller → nox}/config/ax_with_vm.m4
  72. 0  {rf-controller → nox}/config/check_twisted.m4
  73. 0  {rf-controller → nox}/config/leak-checker.m4
  74. 0  {rf-controller → nox}/config/nx-build.m4
  75. +127 −0 nox/configure.ac.in
  76. 0  {rf-controller → nox}/doc/Makefile.am
  77. 0  {rf-controller → nox}/doc/doxygen/Makefile.am
  78. 0  {rf-controller → nox}/doc/doxygen/customdoxygen.css
  79. 0  {rf-controller → nox}/doc/doxygen/doxygen.conf.in
  80. 0  {rf-controller → nox}/doc/doxygen/footer.html
  81. 0  {rf-controller → nox}/doc/doxygen/header.html
  82. 0  {rf-controller → nox}/doc/manual/.gitignore
  83. 0  {rf-controller → nox}/doc/manual/Makefile.am
  84. 0  {rf-controller → nox}/doc/manual/source/.static/nox-icon-small.gif
  85. 0  {rf-controller → nox}/doc/manual/source/.static/placeholder
  86. 0  {rf-controller → nox}/doc/manual/source/.templates/layout.html
  87. 0  {rf-controller → nox}/doc/manual/source/app-index.rst
  88. 0  {rf-controller → nox}/doc/manual/source/app.rst
  89. 0  {rf-controller → nox}/doc/manual/source/conf.py
  90. 0  {rf-controller → nox}/doc/manual/source/core-api.rst
  91. 0  {rf-controller → nox}/doc/manual/source/index.rst
  92. 0  {rf-controller → nox}/doc/manual/source/installation.rst
  93. 0  {rf-controller → nox}/doc/manual/source/nox-of-ref1.jpg
  94. 0  {rf-controller → nox}/doc/manual/source/nox-overview.jpg
  95. 0  {rf-controller → nox}/doc/manual/source/nox_overview.rst
  96. 0  {rf-controller → nox}/doc/manual/source/noxbox.rst
  97. 0  {rf-controller → nox}/doc/manual/source/noxbox_small.jpg
  98. 0  {rf-controller → nox}/doc/manual/source/ports.jpg
  99. 0  {rf-controller → nox}/doc/manual/source/using.rst
  100. 0  {rf-controller → nox}/doc/manual/source/vm_diagram.jpg
  101. 0  {rf-controller → nox}/doc/manual/source/vm_environment.rst
  102. 0  {rf-controller → nox}/man/Makefile.am
  103. 0  {rf-controller → nox}/man/man1/Makefile.am
  104. 0  {rf-controller → nox}/man/man1/start-test-vm.1
  105. 0  {rf-controller → nox}/man/man1/stop-test-vm.1
  106. 0  {rf-controller → nox}/man/man5/Makefile.am
  107. 0  {rf-controller → nox}/man/man5/vms.conf.5
  108. 0  {rf-controller → nox}/package/Makefile
  109. 0  {rf-controller → nox}/package/nox-dependencies/DEBIAN/control
  110. 0  {rf-controller → nox}/src/.gitignore
  111. 0  {rf-controller → nox}/src/Make.vars
  112. 0  {rf-controller → nox}/src/Makefile.am
  113. 0  {rf-controller → nox}/src/builtin/Makefile.am
  114. 0  {rf-controller → nox}/src/builtin/component.cc
  115. 0  {rf-controller → nox}/src/builtin/components.xsd
  116. 0  {rf-controller → nox}/src/builtin/deployer.cc
  117. 0  {rf-controller → nox}/src/builtin/dso-deployer.cc
  118. 0  {rf-controller → nox}/src/builtin/event-dispatcher-component.cc
  119. 0  {rf-controller → nox}/src/builtin/event-dispatcher-component.hh
  120. 0  {rf-controller → nox}/src/builtin/kernel.cc
  121. 0  {rf-controller → nox}/src/builtin/nox.cc
  122. 0  {rf-controller → nox}/src/builtin/nox.xsd
  123. 0  {rf-controller → nox}/src/builtin/packet-classifier.cc
  124. 0  {rf-controller → nox}/src/builtin/static-deployer.cc
  125. 0  {rf-controller → nox}/src/etc/Makefile.am
  126. 0  {rf-controller → nox}/src/etc/gen-nox-cert.sh
  127. 0  {rf-controller → nox}/src/etc/nox.json
  128. 0  {rf-controller → nox}/src/etc/noxca.cnf
  129. 0  {rf-controller/src/lib → nox/src/include}/.gitignore
  130. 0  {rf-controller → nox}/src/include/JSON_parser.h
  131. 0  {rf-controller → nox}/src/include/Makefile.am
  132. 0  {rf-controller → nox}/src/include/aggregate-stats-in.hh
  133. 0  {rf-controller → nox}/src/include/assert.hh
  134. 0  {rf-controller → nox}/src/include/async_file.hh
  135. 0  {rf-controller → nox}/src/include/async_io.hh
  136. 0  {rf-controller → nox}/src/include/auto_array.hh
  137. 0  {rf-controller → nox}/src/include/auto_fd.hh
  138. 0  {rf-controller → nox}/src/include/auto_free.hh
  139. 0  {rf-controller → nox}/src/include/barrier-reply.hh
  140. 0  {rf-controller → nox}/src/include/bitmap.hh
  141. 0  {rf-controller → nox}/src/include/bootstrap-complete.hh
  142. 0  {rf-controller → nox}/src/include/buffer.hh
  143. 0  {rf-controller → nox}/src/include/cfg.hh
  144. 0  {rf-controller → nox}/src/include/classifier.hh
  145. 0  {rf-controller → nox}/src/include/cnode-result.hh
  146. 0  {rf-controller → nox}/src/include/cnode.hh
  147. 0  {rf-controller → nox}/src/include/command-line.hh
  148. 0  {rf-controller → nox}/src/include/core_events.hh
  149. 0  {rf-controller → nox}/src/include/datapath-join.hh
  150. 0  {rf-controller → nox}/src/include/datapath-leave.hh
  151. 0  {rf-controller → nox}/src/include/datapath.hh
  152. 0  {rf-controller → nox}/src/include/desc-stats-in.hh
  153. 0  {rf-controller → nox}/src/include/echo-request.hh
  154. 0  {rf-controller → nox}/src/include/errno_exception.hh
  155. 0  {rf-controller → nox}/src/include/error-event.hh
  156. 0  {rf-controller → nox}/src/include/event-dispatcher.hh
  157. 0  {rf-controller → nox}/src/include/event.hh
  158. 0  {rf-controller → nox}/src/include/expr.hh
  159. 0  {rf-controller → nox}/src/include/fault.hh
  160. 0  {rf-controller → nox}/src/include/flow-event.hh
  161. 0  {rf-controller → nox}/src/include/flow-mod-event.hh
  162. 0  {rf-controller → nox}/src/include/flow-removed.hh
  163. 0  {rf-controller → nox}/src/include/flow-stats-in.hh
  164. 0  {rf-controller → nox}/src/include/flow.hh
  165. 0  {rf-controller → nox}/src/include/fnv_hash.hh
  166. 0  {rf-controller → nox}/src/include/hash.hh
  167. 0  {rf-controller → nox}/src/include/hash_func.hh
  168. 0  {rf-controller → nox}/src/include/hash_map.hh
  169. 0  {rf-controller → nox}/src/include/hash_set.hh
  170. 0  {rf-controller → nox}/src/include/json-util.hh
  171. 0  {rf-controller → nox}/src/include/json_object.hh
  172. 0  {rf-controller → nox}/src/include/leak-checker.hh
  173. 0  {rf-controller → nox}/src/include/netinet++/.gitignore
  174. 0  {rf-controller → nox}/src/include/netinet++/arp.hh
  175. 0  {rf-controller → nox}/src/include/netinet++/bpdu.hh
  176. 0  {rf-controller → nox}/src/include/netinet++/cidr.hh
  177. 0  {rf-controller → nox}/src/include/netinet++/datapathid.hh
  178. 0  {rf-controller → nox}/src/include/netinet++/eapol.hh
  179. 0  {rf-controller → nox}/src/include/netinet++/ethernet.hh
  180. 0  {rf-controller → nox}/src/include/netinet++/ethernetaddr.hh
  181. 0  {rf-controller → nox}/src/include/netinet++/ip.hh
  182. 0  {rf-controller → nox}/src/include/netinet++/ipaddr.hh
  183. 0  {rf-controller → nox}/src/include/netinet++/ipaddr_port.hh
  184. 0  {rf-controller → nox}/src/include/netinet++/llc.hh
  185. 0  {rf-controller → nox}/src/include/netinet++/static_lib.hh
  186. 0  {rf-controller → nox}/src/include/netinet++/tcp.hh
  187. 0  {rf-controller → nox}/src/include/netinet++/vlan.hh
  188. 0  {rf-controller → nox}/src/include/netlink.hh
  189. 0  {rf-controller → nox}/src/include/network_graph.hh
  190. 0  {rf-controller → nox}/src/include/ofmp-config-update-ack.hh
  191. 0  {rf-controller → nox}/src/include/ofmp-config-update.hh
  192. 0  {rf-controller → nox}/src/include/ofmp-resources-update.hh
  193. 0  {rf-controller → nox}/src/include/ofp-msg-event.hh
  194. 0  {rf-controller → nox}/src/include/openflow-action.hh
  195. 0  {rf-controller → nox}/src/include/openflow-default.hh
  196. 0  {rf-controller → nox}/src/include/openflow-event.hh
  197. 0  {rf-controller → nox}/src/include/openflow-msg-in.hh
  198. 0  {rf-controller → nox}/src/include/openflow-pack-raw.hh
  199. 0  {rf-controller → nox}/src/include/openflow-pack.hh
  200. 0  {rf-controller → nox}/src/include/openflow-streamops.hh
  201. 0  {rf-controller → nox}/src/include/openflow.hh
  202. 0  {rf-controller → nox}/src/include/openflow/.gitignore
  203. 0  {rf-controller → nox}/src/include/openflow/openflow/nicira-ext.h
  204. 0  {rf-controller → nox}/src/include/openflow/openflow/openflow-mgmt.h
  205. 0  {rf-controller → nox}/src/include/openflow/openflow/openflow-netlink.h
  206. 0  {rf-controller → nox}/src/include/openflow/openflow/openflow.h
  207. 0  {rf-controller → nox}/src/include/packet-in.hh
  208. 0  {rf-controller → nox}/src/include/packetgen.hh
  209. 0  {rf-controller → nox}/src/include/packets.h
  210. 0  {rf-controller → nox}/src/include/pcapreader.hh
  211. 0  {rf-controller → nox}/src/include/poll-loop.hh
  212. 0  {rf-controller → nox}/src/include/port-stats-in.hh
  213. 0  {rf-controller → nox}/src/include/port-status.hh
  214. 0  {rf-controller → nox}/src/include/port.hh
  215. 0  {rf-controller → nox}/src/include/ppoll.hh
  216. 0  {rf-controller → nox}/src/include/queue-config-in.hh
  217. 0  {rf-controller → nox}/src/include/queue-stats-in.hh
  218. 0  {rf-controller → nox}/src/include/resolver.hh
  219. 0  {rf-controller → nox}/src/include/rule.hh
  220. 0  {rf-controller → nox}/src/include/sha1.hh
  221. 0  {rf-controller → nox}/src/include/shutdown-event.hh
  222. 0  {rf-controller → nox}/src/include/sigset.hh
  223. 0  {rf-controller → nox}/src/include/socket-util.hh
  224. 0  {rf-controller → nox}/src/include/ssl-config.hh
  225. 0  {rf-controller → nox}/src/include/ssl-session.hh
  226. 0  {rf-controller → nox}/src/include/ssl-socket.hh
  227. 0  {rf-controller → nox}/src/include/stable_list.hh
  228. 0  {rf-controller → nox}/src/include/stable_map.hh
  229. 0  {rf-controller → nox}/src/include/string.hh
  230. 0  {rf-controller → nox}/src/include/switch-mgr-join.hh
  231. 0  {rf-controller → nox}/src/include/switch-mgr-leave.hh
  232. 0  {rf-controller → nox}/src/include/switch-mgr.hh
  233. 0  {rf-controller → nox}/src/include/switch_auth.hh
  234. 0  {rf-controller → nox}/src/include/table-stats-in.hh
  235. 0  {rf-controller → nox}/src/include/tcp-socket.hh
  236. 0  {rf-controller → nox}/src/include/threads/cooperative.hh
  237. 0  {rf-controller → nox}/src/include/threads/impl.hh
  238. 0  {rf-controller → nox}/src/include/threads/native-pool.hh
  239. 0  {rf-controller → nox}/src/include/threads/native.hh
  240. 0  {rf-controller → nox}/src/include/threads/signals.hh
  241. 0  {rf-controller → nox}/src/include/threads/task.hh
  242. 0  {rf-controller → nox}/src/include/timer-dispatcher.hh
  243. 0  {rf-controller → nox}/src/include/timeval.hh
  244. 0  {rf-controller → nox}/src/include/type-props.h
  245. 0  {rf-controller → nox}/src/include/vlog-socket.hh
  246. 0  {rf-controller → nox}/src/include/vlog.hh
  247. 0  {rf-controller → nox}/src/include/xtoxll.h
  248. 0  {rf-controller/src/include → nox/src/lib}/.gitignore
  249. 0  {rf-controller → nox}/src/lib/JSON_parser.c
  250. 0  {rf-controller → nox}/src/lib/Makefile.am
  251. 0  {rf-controller → nox}/src/lib/async_file.cc
  252. 0  {rf-controller → nox}/src/lib/async_io.cc
  253. 0  {rf-controller → nox}/src/lib/auto_fd.cc
  254. 0  {rf-controller → nox}/src/lib/bitmap.cc
  255. 0  {rf-controller → nox}/src/lib/buffer.cc
  256. 0  {rf-controller → nox}/src/lib/cfg.cc
  257. 0  {rf-controller → nox}/src/lib/command-line.cc
  258. 0  {rf-controller → nox}/src/lib/datapath.cc
  259. 0  {rf-controller → nox}/src/lib/dh1024.pem
  260. 0  {rf-controller → nox}/src/lib/dh2048.pem
  261. 0  {rf-controller → nox}/src/lib/dh4096.pem
  262. 0  {rf-controller → nox}/src/lib/dhparams.c
  263. 0  {rf-controller → nox}/src/lib/dhparams.h
  264. 0  {rf-controller → nox}/src/lib/errno_exception.cc
  265. 0  {rf-controller → nox}/src/lib/event-dispatcher.cc
  266. 0  {rf-controller → nox}/src/lib/event.cc
  267. 0  {rf-controller → nox}/src/lib/expr.cc
  268. 0  {rf-controller → nox}/src/lib/fault.cc
  269. 0  {rf-controller → nox}/src/lib/flow-stats-in.cc
  270. 0  {rf-controller → nox}/src/lib/flow.cc
  271. 0  {rf-controller → nox}/src/lib/json-util.cc
  272. 0  {rf-controller → nox}/src/lib/json_object.cc
  273. 0  {rf-controller → nox}/src/lib/leak-checker.cc
  274. 0  {rf-controller → nox}/src/lib/netinet++/ethernetaddr.cc
  275. 0  {rf-controller → nox}/src/lib/netlink.cc
  276. 0  {rf-controller → nox}/src/lib/network_graph.cc
  277. 0  {rf-controller → nox}/src/lib/openflow-action.cc
  278. 0  {rf-controller → nox}/src/lib/openflow-event.cc
  279. 0  {rf-controller → nox}/src/lib/openflow-pack-raw.cc
  280. 0  {rf-controller → nox}/src/lib/openflow-pack.cc
  281. 0  {rf-controller → nox}/src/lib/openflow.cc
  282. 0  {rf-controller → nox}/src/lib/packetgen.cc
  283. 0  {rf-controller → nox}/src/lib/pcapreader.cc
  284. 0  {rf-controller → nox}/src/lib/poll-loop.cc
  285. 0  {rf-controller → nox}/src/lib/ppoll.cc
  286. 0  {rf-controller → nox}/src/lib/queue-config-in.cc
  287. 0  {rf-controller → nox}/src/lib/queue-stats-in.cc
  288. 0  {rf-controller → nox}/src/lib/resolver.cc
  289. 0  {rf-controller → nox}/src/lib/sha1.cc
  290. 0  {rf-controller → nox}/src/lib/sigset.cc
  291. 0  {rf-controller → nox}/src/lib/ssl-config.cc
  292. 0  {rf-controller → nox}/src/lib/ssl-socket.cc
  293. 0  {rf-controller → nox}/src/lib/string.cc
  294. 0  {rf-controller → nox}/src/lib/switch-mgr.cc
  295. 0  {rf-controller → nox}/src/lib/tcp-socket.cc
  296. 0  {rf-controller → nox}/src/lib/tests/Makefile
  297. 0  {rf-controller → nox}/src/lib/threads/cooperative.cc
  298. 0  {rf-controller → nox}/src/lib/threads/impl.cc
  299. 0  {rf-controller → nox}/src/lib/threads/native.cc
  300. 0  {rf-controller → nox}/src/lib/threads/signals.cc
Sorry, we could not display the entire diff because too many files (1,732) changed.
View
3  COPYING
@@ -186,7 +186,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.
- Copyright 2011 Funda��o CPqD
+ Copyright 2011 Fundação CPqD
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -199,3 +199,4 @@
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
+
View
148 INSTALL
@@ -1,148 +0,0 @@
-RouteFlow v0.1.0
------------------------------------
-Copyright (C) 2011 CPqD
-
-Welcome
-========
-
-Welcome to the RouteFlow remote virtual routing platform. This distribution includes all the software you need to build, install, and deploy RouteFlow in your OpenFlow network.
-
-This version of RouteFlow is an alpha developers' release intended to evaluate RouteFlow for providing virtualized IP routing services on one or more OpenFlow switches.
-
-*Note*
-
-RouteFlow relies on NOX and OpenFlow as the communication protocol for controlling switches.
-RouteFlow uses Open vSwitch to provide the connectivitiy within the virtual environment where Linux virtual machines run the Quagga routing engine.
-This build supports Openflow v1.0.0 and NOX v0.6.
-Please be aware of OpenFlow, NOX, Open vSwitch, Quagga and RouteFlow licenses.
-
-Contents
-========
-- Install
-- Starting RouteFlow
-- Running RouteFlow
-
-
-Install
-=======
-
-Requirements:
-- RouteFlow package (contains NOX-Zaku (v0.9.0), http://noxrepo.org/)
-- Virtual Machine image with the Quagga routing engine and an implementation of RFSlave on it. You can obtain a sample environment for QEMU: http://github.com/chesteve/RouteFlowVM
-- OpenVSwitch (Download and installation instructions: http://openvswitch.org/?page_id=10)
-- OpenFlow-enabled* devices (e.g., OVS, Mininet, NetFPGA, commercial)
-
-*Note: Corrrect IP forwarding requires MAC-re-writing capabilities (plus TTL decrement and header checksum update)
-
-Dependencies:
-RouteFlow requires the following packages to be installed:
-$ sudo apt-get install iproute-dev
-$ sudo apt-get install libboost-all-dev swig1.3
-
-In addition to the dependencies from the NOX controller. An unofficial list of dependencies can be found here:
-http://noxrepo.org/noxwiki/index.php/Dependencies
-
-For instance, for Ubuntu 10.04, a full compile of NOX zaku requires the following packages:
-$ sudo apt-get install autoconf automake g++ libtool swig make git-core libboost-dev libboost-test-dev libboost-filesystem-dev libssl-dev libpcap-dev python-twisted python-simplejson python-dev
-
-The main directory tree of RouteFlow is divided into:
- -rf-server
-- rf-slave (also provided in the sample VM with Quagga 0.99.10)
-- rf-controller (includes NOX-Zaku with the RouteFlowc application located in the netapps folder: \src\nox\netapps)
-- rf-protocol
-
-You can compile all modules simply running the command "make all" on the main directory.
-
-Since rf-slave, rf-controller, and rf-server are meant to run on different machines you can compile only the slave module with "make slave" (which will make needed libraries and rf-slave), only the controller with "make controller" (which will make needed libraries and rf-controller) and only the server with make server, both in the main directory.
-
-The OpenFlow switches in the data plane must support the same controller's version (in this case, version 1.0) and it is not necessary any special configuration. For instance, you can use Mininet and connect to the external NOX controller running the rf-controller.
-
-You need to setup a virtual enviroment that will be responsible for running the virtual topology. There are options in the virtualization solution space. We have succesfully tested RouteFlow with images for KVM/QEMU and LXC. Each VM should meet the minimal requirements to run the route engine (e.g, Quagga) and RouteFlow-Slave daemon. In order to get a good performance on virtualization the processor should support a virtualization technology, it means that you will find the flag VMX for Intel processor or SVM for AMD. This information can be found in the file /proc/cpuinfo.
-
-Starting RouteFlow
-=================
-
-The initialization sequence should be as follows:
-
-1- Insert the Open vSwitch (OVS) module into the kernel. At OVS main directory:
-$sudo insmod datapath/linux-2.6/openvswitch_mod.ko
-
-2- Start two OVS instances, each using a different port:
-$sudo ovs-openflowd br0 tcp:127.0.0.1:6363 --out-of-band (VM configuration interfaces)
-$sudo ovs-openflowd --hw-desc=rfovs switch1 tcp:127.0.0.1:6633 --out-of-band. (Virtual Control Plane Network i.e. inter-VM connectivity).
-
-3- Configure the br0 interface with an IP on the configuration network, for instance 192.169.100.1:
-$ifconfig br0 192.169.100.1.
-Make sure that the IP of the Virtual Machines running the RF-Slave are on the same network of br0. In the sample virtualization environment it should be on the form 192.169.100.X
-
-4- Start the NOX controller located at rf-controller/build/src with a simple learning switch module (such as pyswitch) listening to the same port of the (br0) OVS used for VM configuration connectivity:
-$cd rf-controller/build/src
-$sudo ./nox_core -v -i ptcp:6363 pyswitch
-
-5- Start rf-server:
-$ ./build/rf-server
-The default tcpport that it uses to connect to the VMs is 5678.
-
-NOTE: In further versions you’ll have the option to choice RouteFlow´s mode operation on start-up. For now, there is only one mode available in which all packets originated in the VMs (e.g. OSPF hello) are sent through the data plane. If you want to try the mode of operation where routing packets are kept in the virtual data plane where the virtual topology is defined with the aid of NOX discovery application, you will have to change the following piece of code in the file main.cc contained in the rf-server folder, line 45.
-
-RouteFlowServer rfSrv(TCP_PORT, VIRT_N_FORWARD_PLANE);
-
-becomes
-
-RouteFlowServer rfSrv(TCP_PORT, VIRTUAL_PLANE);
-
-
-6- Start a new rf-controller NOX application instance, with the RouteFlowc module, listening to the same port used on the OVS in charge of the inter-VM connectivity:
-$sudo ./nox_core -v -i ptcp:6633 routeflowc .
-
-The default tcpport that it uses to connect with server is 7890, but this can be changed passing the parameter tcpport. For example, if you want to set the port to 1234:
-$sudo ./nox_core -v -i ptcp:6633 routeflowc=tcpport=1234 .
-
-
-
-7- Start VMs
-
-Any virtualization environment can be used to load the VMs with Quagga and RF-Slave..
-You can find a sample VM in the routeflow-vm-0.2.tar.bz2
-
-Uncompress:
-$tar xvjpf routeflow-vm-0.2.tar.bz2
-
-To start a new VM use the start-vm.sh script that accepts two parameters: 1.- An ID to identify the VM, 2.- The number* of interfaces that should be loaded. The VMs are started with one management interface plus the number used on 2. Thus, if you want VM 1 to be started with 25 interfaces* (e.g., 1 for control and 24 to act as data path ports):
-# start-vm <ID> <interfaces>
-
-$ start-vm.sh 1 24
-$ user: root
-$ password: root
-
-*Note the number of interfaces in the Virtual Machine shall be equal + 1 to the number of ports in the OpenFlow, switch to be controlled, because the rf-slave uses the VM first port to communicate with server.
-
-* The script start-vm.sh adds the virtual machines interfaces to the datapaths of Open vSwitch instances. That’s another reason to init the Open vSwitchs before any virtual machine.
-If you’re not using our sample virtualization environment, you will need to add the interfaces with the Open vSwitch command below:
-
- sudo ovs-dpctl add-if <datapath_name> <interface>
-
-For more information about the command read the ovs-dpctl manual.
-
-Inside the VM x, run the RF-Slave located in the /opt/ folder. This module needs three parameters on start, and the correct syntax is as follows:
-$./rfslave <IP> <port number> <interface>
-
-The <port number> parameter must match the routeflowc tcpport parameter, <IP> must be the IP of NOX and <interface> will provide the interface from which rfslave will get the MAC address to use as it's Id.
-
-*In our sample virtualization environment the RF-Slave starts when you initizalize the virtual machine.
-
-8- Start the Datapaths (i.e. OpenFlow switches)
-
-Start the OpenFlow switches pointing them to the NOX controller running routeflowc (e.g. tcp:6633). When a Datapath connects to RouteFlowc, if there are no Idle VMs available, the Datapath is set to Idle mode and it's flow table is left empty.
-
-When a VM joins, it is assigned to the first Datapath on the list, the Datapath and the VM are both set to running mode and two default permanent flows are installed on the Datapath to forward RIP and OSPF packets to the controller. If there are no eligible Datapath's to assign to the registered VM, it's status is set to Idle, and it will wait for the next Datapath join event.
-
-When a VM assignment is successfully made, RouteFlowc stores this info so that a Datapath will always connect to it's specific VM.
-
-Note that when a VM connects to RouteFlow, the MAC address corresponding to the <interface> will be it's assigned Id. If a VM tries to connect using a MAC address equal to another VM already connected, the connection will be refused.
-
-Once the desired topology of the network is up, Quagga may be started on each VM, so that flows can be installed on each Datapath according to the Quagga+Linux generated forwarding rules (i.e., FIB = ARP + ROUTE tables) obtained by Quagga (more information about Quagga configuration can be obtained at http://www.quagga.net).
-
-*In the virtualization environment available with the RouteFlow package, Quagga is initialized when the VM starts.
-
-
View
3  LICENSE
@@ -186,7 +186,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.
- Copyright 2011 Funda��o CPqD
+ Copyright 2011 Fundação CPqD
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -199,3 +199,4 @@
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
+
View
40 Make.rules
@@ -8,14 +8,14 @@ SOURCE_SUFIX := cc
SOURCE_FILES := $(wildcard *.$(SOURCE_SUFIX))
-LIBS := $(addprefix $(BUILD_LIB_DIR)/$(LIBPREFIX),$(libdirs))
-LIBS := $(addsuffix .$(LIBSUFFIX),$(LIBS))
+RFLIBS := $(addprefix $(BUILD_LIB_DIR)/,$(RFLIB_NAME))
+RFLIBS := $(addsuffix .$(LIBSUFFIX),$(RFLIBS))
+LNX_LIBS := -lrt -lnetlink -lutil -lpthread -lmongoclient -lboost_thread -lboost_system -lboost_filesystem -lboost_program_options
-LNX_LIBS := -lrt -lnetlink -lutil -lpthread
-
+CPPFLAGS += -I$(LIB_DIR)
CPPFLAGS += $(addprefix -I$(LIB_DIR)/,$(libdirs))
-CPPFLAGS += -I$(INC_DIR)
+CPPFLAGS += -I$(MONGO_DIR)
ifneq (,$(DEBUG))
CFLAGS += -g -D_GLIBCXX_DEBUG=1
@@ -23,40 +23,50 @@ endif
ifneq (,$(MAKEAPPS))
apps_bin := $(BUILD_DIR)/$(MAKEAPPS)
+objs := $(patsubst %.$(SOURCE_SUFIX),%.o, \
+ $(addprefix $(BUILD_OBJ_DIR)/$(notdir $(CURDIR))/,$(SOURCE_FILES)))
endif
-ifneq (,$(MAKELIB))
-targetlib = $(BUILD_LIB_DIR)/$(LIBPREFIX)$(notdir $(CURDIR)).$(LIBSUFFIX)
+ifneq (,$(MAKELIBS))
+targetlib := $(BUILD_LIB_DIR)/$(RFLIB_NAME).$(LIBSUFFIX)
+objs := $(foreach dir, $(MAKELIBS), $(wildcard $(BUILD_OBJ_DIR)/$(dir)/*.o))
endif
-ifneq (,$(SOURCE_FILES))
-objs := $(patsubst %.$(SOURCE_SUFIX),%.o, \
+ifneq (,$(LIBDEP))
+lib_objs := $(patsubst %.$(SOURCE_SUFIX),%.o, \
$(addprefix $(BUILD_OBJ_DIR)/$(notdir $(CURDIR))/,$(SOURCE_FILES)))
endif
+
+ifneq (,$(SOURCE_FILES))
+endif
################################################################################
# TARGETS
-all: $(targetlib) $(apps_bin)
+all: $(lib_objs) $(targetlib) $(apps_bin)
################################################################################
# BUILD OBJS
$(BUILD_OBJ_DIR)/$(notdir $(CURDIR))/%.o: %.$(SOURCE_SUFIX)
- $(CPP) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
+ $(CPP) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
+
+################################################################################
+# BUILD LIB DEPS
+
+$(BUILD_LIB_DIR)/$(notdir $(CURDIR))/%.o: %.$(SOURCE_SUFIX)
+ $(CPP) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
################################################################################
# BUILD LIBS
-ifneq (,$(MAKELIB))
$(BUILD_LIB_DIR)/%.$(LIBSUFFIX): $(objs)
$(AR) r $@ $?
-endif
################################################################################
# BUILD APPS
-$(apps_bin): $(objs) $(LIBS)
- $(CPP) $(CPPFLAGS) -o $@ $(objs) $(LIBS) $(LNX_LIBS);
+$(apps_bin): $(objs) $(RFLIBS)
+ $(CPP) $(CPPFLAGS) -o $@ $(objs) $(RFLIBS) $(LNX_LIBS);
################################################################################
# CLEAN
View
49 Makefile
@@ -1,19 +1,20 @@
-
export ROOT_DIR=$(CURDIR)
export BUILD_DIR=$(ROOT_DIR)/build
-export LIB_DIR=$(ROOT_DIR)/common
-export RFC_DIR=$(ROOT_DIR)/rf-controller
-export INC_DIR=$(ROOT_DIR)/include
+export LIB_DIR=$(ROOT_DIR)/rflib
+export RFC_DIR=$(ROOT_DIR)/nox
+export MONGO_DIR=/usr/local/include/mongo
export BUILD_LIB_DIR=$(BUILD_DIR)/lib
export BUILD_OBJ_DIR=$(BUILD_DIR)/obj
+export RFLIB_NAME=rflib
+
#the lib subdirs should be done first
-export libdirs := rf-protocol sys ipc
-export srcdirs := rf-server rf-slave
+export libdirs := ipc rftable types openflow
+export srcdirs := rfserver rfclient
export CPP := g++
-export CFLAGS := -O2 -Wall -D_GNU_SOURCE -D_POSIX_SOURCE -W
+export CFLAGS := -Wall -W
export AR := ar
all: build lib app nox
@@ -26,11 +27,12 @@ lib: build
@mkdir -p $(BUILD_LIB_DIR);
@for dir in $(libdirs); do \
mkdir -p $(BUILD_OBJ_DIR)/$$dir; \
- echo "Compiling Library $$dir..."; \
+ echo "Compiling Library Dependency ($$dir)..."; \
make -C $(LIB_DIR)/$$dir all; \
- rmdir $(BUILD_OBJ_DIR)/$$dir; \
echo "done."; \
done
+ @echo "Generating Library";
+ make -C $(LIB_DIR) all;
app: lib
@mkdir -p $(BUILD_OBJ_DIR);
@@ -41,18 +43,18 @@ app: lib
echo "done."; \
done
-server: lib
+rfserver: lib
@mkdir -p $(BUILD_OBJ_DIR);
- @for dir in "rf-server"; do \
+ @for dir in "rfserver"; do \
mkdir -p $(BUILD_OBJ_DIR)/$$dir; \
echo "Compiling Application $$dir..."; \
make -C $(ROOT_DIR)/$$dir all; \
echo "done."; \
done
-slave: lib
+rfclient: lib
@mkdir -p $(BUILD_OBJ_DIR);
- @for dir in "rf-slave" ; do \
+ @for dir in "rfclient" ; do \
mkdir -p $(BUILD_OBJ_DIR)/$$dir; \
echo "Compiling Application $$dir..."; \
make -C $(ROOT_DIR)/$$dir all; \
@@ -60,15 +62,17 @@ slave: lib
done
nox: lib
- echo "Building NOX and RF-Controller..."
- if test -d $(RFC_DIR)/build; \
- then echo "Skipping configure..."; \
- else cd $(RFC_DIR); ./boot.sh; mkdir build; cd build; export CPP=; ../configure;\
- fi
- make -C $(RFC_DIR)/build
- echo "finished."
+ echo "Building NOX with rfproxy..."
+ cd $(RFC_DIR); \
+ ./boot.sh; \
+ mkdir build; \
+ cd build; \
+ export CPP=; \
+ ../configure --enable-ndebug; \
+ make -C $(RFC_DIR)/build; \
+ echo "done."
-clean: clean-libs clean-apps_obj clean-apps_bin
+clean: clean-libs clean-apps_obj clean-apps_bin clean-nox
clean-nox:
@rm -rf $(RFC_DIR)/build
@@ -81,6 +85,9 @@ clean-nox:
clean-libs:
@rm -rf $(BUILD_LIB_DIR)
+ @for dir in $(libdirs); do \
+ rm -rf $(BUILD_OBJ_DIR)/$$dir; \
+ done
clean-apps_obj:
@rm -rf $(BUILD_OBJ_DIR)
View
423 README
@@ -1,142 +1,371 @@
-RouteFlow v0.1.0
------------------------------------
-Copyright (C) 2011 CPqD
+RouteFlow
+Copyright (C) 2012 CPqD
-Welcome
-========
+=== Welcome ===
+Welcome to the RouteFlow remote virtual routing platform. This distribution
+includes all the software you need to build, install, and deploy RouteFlow in
+your OpenFlow network.
-Welcome to the RouteFlow remote virtual routing platform. This distribution includes all the software you need to build, install, and deploy RouteFlow in your OpenFlow network.
+This version of RouteFlow is a beta developers' release intended to evaluate
+RouteFlow for providing virtualized IP routing services on one or more OpenFlow
+switches.
-This version of RouteFlow is a beta developers' release intended to evaluate RouteFlow for providing virtualized IP routing services on one or more OpenFlow switches.
+RouteFlow relies on the following technologies:
+- NOX and OpenFlow v1.0 as the communication protocol for controlling switches.
+- Open vSwitch to provide the connectivity within the virtual environment where
+ Linux virtual machines may run the Quagga routing engine.
+- MongoDB as a central database and IPC.
-*Note*
+Please be aware of NOX, OpenFlow, Open vSwitch, Quagga, MongoDB and RouteFlow
+licenses.
-RouteFlow relies on NOX and OpenFlow as the communication protocol for controlling switches.
-RouteFlow uses Open vSwitch to provide the connectivity within the virtual environment where Linux virtual machines run the Quagga routing engine.
-This build supports Openflow v1.0.0 and NOX v0.6.
-Please be aware of OpenFlow, NOX, Open vSwitch, Quagga and RouteFlow licenses.
-Contents
-========
-- Overview
-- Install
-- Running
-- Changes from last version
-- Known bugs
-- TODO (+ Upcoming features)
-- License and Terms
+=== Overview ===
+RouteFlow is a distribution composed by three basic applications: rfclient,
+rfserver and rfproxy.
-Overview
-========
+- rfclient is the module running as a daemon in the Virtual Machine (VM)
+responsible for detecting changes in the linux ARP and routing tables.
+When a change is detected (via netlink events) messages are sent to the server.
-RouteFlow is made of four basic modules: rf-slave, rf-server, rf-controller, and the rf-protocol:
+- rfserver is a standalone application that manages the VMs running the
+RFClient daemons. The RFServer keeps the mapping between the RFClient VM
+instances and the corresponding switches and their datapaths. It connects to
+the rfproxy to instruct it about when to configure flows and also to
+configure the Open vSwitch to maintain the connectivity in the virtual
+environment formed by the set of registered VMs.
-- RF-Slave is the module running as a daemon in the Virtual Machine (VM) responsible for detecting changes in the linux ARP table and ROUTE tables. Upon a change is detected (via IP Netlink announcements), the corresponding rf-Protocol message is sent to the rf-Server.
+- rfproxy is a NOX (OpenFlow controller) application responsible for the
+interactions with the OpenFlow switches (identified by datapaths) via the
+OpenFlow protocol. It listens to instructions from the RFServer and also
+notifies whenever a switch joins or leavens the network.
-- RF-Server is a standalone application that manages the VM running the RF-Slave daemon and requests the creation of the OpenFlow flow mod messages according to route changes detected by rf-slaves. The RF-Server keeps the mapping between the rf-slave VM instances and the corresponding datapath switches. In addition, the RF-Server configures the Open vSwitch via the OpenFlow protocol to maintain the connectivity in the virtual environment formed by the set of registered VMs;
+There is also a library of common functions (rflib). It defines the IPC, a
+central table for RouteFlow state data and utilities like custom types for IP
+and MAC addresses, OpenFlow message creation and type conversion.
-- RF-Controller is a NOX (OpenFlow controller) application responsible for the interactions with the OpenFlow switches (identified by Datapath ID - DPID) via the OpenFlow protocol and implements the RF-Protocol to send and receives commands from/to the rf-server.
+Additionally, there are two extra modules: rfweb, an web interface for
+RouteFlow and jsonflowagent, an SNMP agent.
-- RF-Protocol defines most of the classes used by the other modules and specifies the protocol messages used for the interactions between the rf-server and the rf-slave and the rf-controller.;
+== RouteFlow architecture ===
++--------VM---------+
+| Quagga | rfclient |
++-------------------+
+ \
+M:1 \ RFProtocol
+ \
++-------------------+
+| rfserver |
++-------------------+
+ \
+1:1 \ RFProtocol
+ \
++-------------------+
+| rfproxy |
+|-------------------|
+| NOX |
++-------------------+
+ \
+1:N \ OpenFlow Protocol
+ \
++-------------------+
+| OpenFlow Switch |
++-------------------+
-+----- VM ----------+
-| Quagga | RF-Slave |
-+-------------------+
- \
-M:1 \ rf-Protocol
- \
-+----------------+
-| rf-Server |
-+----------------+
- \
-1:1 \ rf-Protocol
- \
-+|-----------------------------+
-| rf-Controller | Discovery |
-|------------------------------|
-| NOX |
-+------------------------------+
- \
-1:N \ OpenFlow Protocol
- \
-+-----------------+
-| OF Switch (DPID)|
-+-----------------+
+=== Building ===
+These instructions are tested on Ubuntu 11.04. The version of the NOX controller
+we are using does not compile under newer versions of Ubuntu (11.10, 12.04).
+
+
+** Open vSwitch **
+1) Install the dependencies:
+$ sudo apt-get install build-essential linux-headers-generic
+
+2) Download Open vSwitch 1.4.1, extract it to a folder and browse to it:
+$ wget http://openvswitch.org/releases/openvswitch-1.4.1.tar.gz
+$ tar xzf openvswitch-1.4.1.tar.gz
+$ cd openvswitch-1.4.1
+
+3) Configure it as a kernel module, then compile and install
+$ ./configure --with-linux=/lib/modules/`uname -r`/build
+$ make
+$ sudo make install
+
+4) Install the modules in your system:
+$ sudo mkdir /lib/modules/`uname -r`/kernel/net/ovs
+$ sudo cp datapath/linux/*.ko /lib/modules/`uname -r`/kernel/net/ovs/
+$ sudo depmod -a
+$ sudo modprobe openvswitch_mod
+
+Optionally, you may choose to skip the steps above and load the module manually
+every time:
+
+$ sudo insmod datapath/linux/openvswitch_mod.ko
+
+--- Note ---
+ If for some reason the bridge module is loaded in your system, the command
+ above will fail with an invalid module format error. If you don't need the
+ default bridge support in your system, use the modprobe -r bridge command to
+ unload it and try the modprobe command again. If you need bridge support,
+ you can get some help from the INSTALL.bridge file instructions in the
+ Open vSwitch distribution directory.
+
+ To avoid automatic loading of the bridge module (which would conflict with
+ openvswitch_mod), let's blacklist it. Access the /etc/modprobe.d/ directory
+ and create a new bridge.conf file:
+
+ $ cd /etc/modprobe.d
+ $ sudo vi bridge.conf
+
+ Insert the following lines in the editor, save and close:
+
+ # avoid conflicts with the openvswitch module
+ blacklist bridge
+
+5) Edit /etc/modules to configure the automatic loading of the openvswitch_mod
+ module:
+
+ $ sudo vi /etc/modules
+
+ Insert the following line at the end of the file, save and close:
+
+ openvswitch_mod
+
+ To be sure that everything is OK, reboot your computer. Log in and try the
+ following command. If the "openvswitch_mod" line is shown like in the
+ example below, you're ready to go.
+
+ $ sudo lsmod | grep openvswitch_mod
+ openvswitch_mod 68247 0
+
+6) Initialize the configuration database:
+$ sudo mkdir -p /usr/local/etc/openvswitch
+$ sudo ovsdb-tool create /usr/local/etc/openvswitch/conf.db vswitchd/vswitch.ovsschema
+
+
+** MongoDB **
+1) Install the dependencies:
+$ sudo apt-get install git-core build-essential scons libboost-dev \
+ libboost-program-options-dev libboost-thread-dev libboost-filesystem-dev \
+ python-pip
+
+3) Download and extract MongoDB v2.0.5
+$ wget http://downloads.mongodb.org/src/mongodb-src-r2.0.5.tar.gz
+$ tar zxf mongodb-src-r2.0.5.tar.gz
+$ cd mongodb-src-r2.0.5
+
+3) There's a conflict with a constant name in NOX and MongoDB. It has
+been fixed, but is not part of version 2.0.5 yet. So, we need to fix it
+applying the changes listed in this commit:
+https://github.com/mongodb/mongo/commit/a1e68969d48bbb47c893870f6428048a602faf90
+
+4) Then compile and install MongoDB:
+$ scons all
+$ sudo scons --full install --prefix=/usr --sharedclient
+$ sudo pip install pymongo
+
+
+** NOX install instructions **
+1) Install the dependencies:
+$ sudo apt-get install autoconf automake g++ libtool swig make git-core \
+ libboost-dev libboost-test-dev libboost-filesystem-dev libssl-dev \
+ libpcap-dev python-twisted python-simplejson python-dev
+
+2) TwistedPython, one of the dependencies of the NOX controller bundled with
+the RouteFlow distribution, got an update that made it stop working.
+To get around this issue, edit the following file in your machine:
+$ sudo vi /usr/lib/python2.6/dist-packages/twisted/internet/base.py
+
+Insert the method _handleSigchld at the end of the file, just before the last
+statement (the one that reads "__all__ = []"):
+
+[other lines above... (supressed) ]
+ except:
+ log.msg("Unexpected error in main loop.")
+ log.err()
+ else:
+ log.msg('Main loop terminated.')
+
+ def _handleSigchld(self, signum, frame, _threadSupport=platform.supportsThreads()):
+ from twisted.internet.process import reapAllProcesses
+ if _threadSupport:
+ self.callFromThread(reapAllProcesses)
+ else:
+ self.callLater(0, reapAllProcesses)
+
+__all__ = []
+
+Save the file and you're ready to go.
+
+NOX will be compiled with the RouteFlow distribution in the steps ahead.
+
+
+** RouteFlow **
+1) Install the dependencies:
+$ sudo apt-get install build-essential iproute-dev swig1.3
+
+2) Checkout the RouteFlow distribution:
+$ git clone git://github.com/CPqD/RouteFlow.git
+$ git checkout NewRouteFlow
+
+3) You can compile all RouteFlow applications by running the following command
+in the project root:
+$ make all
+
+You can also compile them individually:
+$ make rfclient
+$ make rfserver
+$ make nox
+
+4) That's it, everything is installed! After the build, you can run tests 1 and
+2. The setup to run them is described in the section "Running".
+
+
+=== Running ===
+The folder rftest contains all that is needed to create and run two test cases.
+
+First, create the LXC containers that will run as virtual machines:
+ $ sudo ./create
+
+Test 1
+ $ sudo ./rftest1
+
+ You can then log in to the LXC container b1 and try to ping b2:
+ $ sudo lxc-console -n b1
+ And inside b1:
+ # ping 172.31.2.2
+
+ To stop running:
+ $ sudo ./rftest1 clear
+
+ For more details on this test, see:
+ http://sites.google.com/site/routeflow/documents/first-routeflow
+
+Test 2
+ $ sudo ./rftest2
+
+ To stop running:
+ $ sudo ./rftest2 clear
+
+ This test should be run with a Mininet simulated network:
+ http://yuba.stanford.edu/foswiki/bin/view/OpenFlow/Mininet
+
+ Once you have a Mininet setup, copy the files in rftest to the VM:
+ $ scp topo-4sw-4host.py openflow@[Mininet address]:/home/openflow/mininet/custom
+ $ scp ipconf openflow@[Mininet address]:/home/openflow/
+
+ Then start the network:
+ $ sudo mn --custom ~/mininet/custom/topo-4sw-4host.py --topo=rftopo" \
+ --controller=remote --ip=[Controller address] --port=6633"
+
+ Inside Mininet, load the address configuration:
+ mininet> source ipconf
+
+ Wait for the network to converge (it should take a few seconds), and try to
+ ping:
+ mininet> pingall
+
+ You'll need to setup the network using virtual machines, and the
+ configuration will depend on the chosen technology. If you have questions
+ about setting up RouteFlow on a particular technology, we might be able to
+ help. See the section "Support".
+
+ For more details on this test, see:
+ http://sites.google.com/site/routeflow/documents/tutorial2-four-routers-with-ospf
+
+POX
+ Experimental support for POX is included. There are versions of the tests
+ above written to run using POX (rftest*_pox). Note however that rfweb and
+ SNMP support won't work.
+
+=== Web interface ===
+The module rfweb provides an web application to inspect the network, showing
+topology, status and statistics. The application is written in Python using the
+WSGI specification: http://wsgi.readthedocs.org/en/latest/
+It's possible to run the application in several servers, and a simple server is
+provided in rfweb_server.py. This server is very simple, and you probably don't
+want to use it for anything more serious than playing around and testing.
+We've also tested the application with gunicorn (http://gunicorn.org/). You can
+run rfweb on it using the following command:
-Install
-=======
-See the companion INSTALL file.
+$ gunicorn -w 4 -b 0.0.0.0:8080 rfweb:application
+(Runs four workers, listening on all interfaces on port 8080)
-Running
-========
+Then to access the main page of the web interface (adapt the address to your
+setup), go to:
+http://localhost:8080/index.html
-Quagga Routing Engine:
--------------------------------
-Once the VMs are up and assigned to the discovered Datapath switches, routing protocol messages originating at the VMs running Quagga are sent over the rf-Controller to the corresponding port in the Datapah. Conversely, routing protocol messages entering a Datapath port will match the default flow entry and will be forwarded to the rf-Controller, which in turn delivers it to the virtual interface of the corresponding VM.
+The web interface currently only works with rftest2 running under NOX. Other
+tests should work, but this module still requires improvements.
-Manual IP Routes:
--------------
-Instead of (or in addition to) IP routing engines like Quagga, you can also manually add routes. Suppose a new switch connects to another switch in your network. A new link will arise in the network but the system still has not the feature to change the respective switch virtual machine configuration on the fly, so you’ll need do add the new route in the virtual machine.
-For instance, to insert a new network with address 192.168.0.0, with gateway 192.168.2.1 and subnet mask 255.255.255.0 you can type:
-# route add -net 192.168.0.0 netmask 255.255.255.0 dev eth1
-or
-# ip route add 192.168.0.0/24 dev eth1
+=== Support ===
+RouteFlow has a discussion list. You can send your questions on:
+https://groups.google.com/group/routeflow-discuss/topics
-Route all traffic via 192.168.2.1 gateway connected via eth1 network interface:
-# route add default gw 192.168.2.1 dev eth1
-or
-# ip route add default via 192.168.2.1 dev eth1
+=== Known Bugs ===
+- rfproxy: random (and somewhat rare) segfaults without any clear reason.
-Useful commands:
-----------
-You can check installed flows with the following commands
+- rftest*: When closing the tests, rfproxy segfaults to no effect.
-In Open vSwitch:
- sudo ovs-ofctl dump-flows <datapath> <flows>
+- rfweb: topology monitoring for rftest1 doesn't work
-OpenFlow Switches(mininet, fpgas, etc)
- sudo ovs-dpctl dump-flows <datapath> <flows>
+- rfweb: topology monitoring shows switch8 as active when all switches are down
-For more information, please check the Open vSwitch and OpenFlow documentation.
+- rfweb: flow colors are not shown correctly
-Future releases will allow the option to choose the RouteFlow mode of operation where some routing protocol messages can be kept only in the virtual plane.
+- See: http://bugs.openflowhub.org/browse/ROUTEFLOW
-Changes from last version
-========
-- See changelog file
+=== TODO (+ features expected in upcoming versions) ===
+- Preload VM-datapath association (and also the ports used) in RFServer,
+ allowing for flexible configuration.
+
+- Tests and instructions for other virtualization environments
+- Hooks into Quagga Zebra to reflect link up/down events and extract additional route / label information
-Known Bugs
-========
--
+- Create headers for RFClient.cc and RFServer.cc.
+- Let the (RFServer order the) RFClient set the VM's non-administrative
+ interfaces to the same MAC Address.
-ToDo (+ features expected in upcoming versions)
-========
-- See TODO File
+- Create a verbose mode for RFServer.
+- Configuration arguments for RFServer.
+- Wireshark dissector plugin for the RouteFlow protocol
-License and Terms
-========
+- Experiment with NEC Trema controller: Port routeflowc to Trema
-Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
+- Add TTL-decrement action (if supported by the datapath devices)
-- See LICENSE file
+- Explore integration opportunities with FlowVisor
-Terms of contributing to RouteFlow program ("Program")
+- Libvirt: Virtualization-independence to accomodate alternative virtualization
+ environments via unified virtualization API provided by libvirt
+ - provide on-demand start-up of VMs via libvirt upon interactions (e.g. CLI)
+ with RFServer)
-Please read the following terms before you submit to the RouteFlow project ("Project") any original works of corrections, modifications, additions, patches and so forth to the Program ("Contribution"). By submitting the Contribution, you are agreeing to be bound by the following terms. If you do not or cannot agree to any of the terms, please do not submit the Contribution:
+- Routing Protocol Optimization:
+ - Separate topology discovery and maintenance from state distribution
+ - Dynamic virtual topology maintenance, with selective routing protocol
+ messages delivery to the Datapath (e.g., HELLOs).
+ - Improve the scenario where routing protocol messages are kept in the
+ virtual domain and topology is mantained through a Topology Discovery
+ controller application.
+ - Hooks into Quagga Zebra to reflect link up/down events
- 1. You hereby grant to any person or entity receiving or distributing the Program through the Project a worldwide, perpetual, non-exclusive, royalty free license to use, reproduce, modify, prepare derivative works of, display, perform, sublicense, and distribute the Contribution and such derivative works.
- 2. You warrant that you have all rights necessary to submit the Contribution and, to the best of your knowledge, the Contribution does not infringe copyright, patent, trademark, trade secret, or other intellectual property rights of any third parties.
- 3. In the event that the Contribution is combined with third parties' programs, you notify to Project maintainers including NEC Corporation ("Maintainers") the author, the license condition, and the name of such third parties' programs.
+- Resiliency & Scalability:
+ - Physically distribute the virtualization environment via mutliple OVS
+ providing the connectivity of the virtual control network
+ - Improve resiliency: Have a "stand-by" environment to take over in case of
+ failure of the master RFServer / Virtualized Control Plane
+- For smaller changes, see TODO markings in the files.
View
45 TODO
@@ -1,45 +0,0 @@
-Bugs
------
-- Check: http://bugs.openflowhub.org/browse/ROUTEFLOW
-
-ToDo
-==============================
-(approx. ordered by priority)
-
-- Code standardization (names of variables, indentation, etc.)
-- Optimize some data structures(change lists for maps, for example).
-- Make the code more modular(create a .hh for rf-controller, consider how better we can divide in classes, less code on main.cc)
-- Let the (RF-Server order the) RF-Slave set the VM's non-administrative interfaces to the same MAC Address.
-- Create a verbose mode to RF-Server(server info are only available on log files).
-- Get TCP port, ovs name and RouteFlow operation from user arguments on RF-Server.
-- Wireshark dissector plugin for the RouteFlow protocol
-- Experiment with NEC Trema controller: Port routeflowc to Trema
-- Port RF-C to Beacon controller
-
-
-Features
--------------
-(approx. ordered by priority)
-
-- Add TTL-decrement action (if supported by the datapath devices)
-
-- DataBase for consistent state management (Choose NoSQL candidate, e.g., Redis http://88.198.54.126/nosqldbs.pdf)
-
-- Extend RouteFlow protocol with a command to on-demand send VM IP + ARP Table from RF-Slave to Server
-
-- Flexible mapping of switches to VMs:
---- M:1, 1:N and M:N mapping between Datapath and VMs, allowing for virtual routing approaches and/or physical switch stacking.
---- Explore integration opportunities with FlowVisor
-
-- Libvirt: Virtualization-independence to accomodate alternative virtualization environments via unified virtualization API provided by libvirt
---- Provide on-demand start-up of VMs via libvirt upon interactions (e.g. CLI) with RF-Server
-
-- Routing Protocol Optimization:
---- Searate topology discovery and maintenance from state distribution
---- Dynamic virtual topology maintenance, with selective routing protocol messages delivery to the Datapath (e.g., HELLOs).
---- Improve the scenario where routing protocol messages are kept in the virtual domain and topology is mantained through a Topology Discovery controller application.
---- Hooks into Quagga Zebra to reflect link up/down events
-
-- Resiliency & Scalability:
---- Physically distribute the virtualization environment via mutliple OVS providing the connectivity of the virtual control network
---- Improve resiliency: Have a "stand-by" environment to take over in case of failure of the master RF-Server / Virtualized Control Plane
View
25 common/ipc/IPCCommunicator.cc
@@ -1,25 +0,0 @@
-/*
- * Copyright 2011 Fundação CPqD
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <IPCCommunicator.hh>
-
-IPCCommunicator::IPCCommunicator() {
-
-}
-
-IPCCommunicator::~IPCCommunicator() {
-
-}
View
105 common/ipc/IPCCommunicator.hh
@@ -1,105 +0,0 @@
-/*
- * Copyright 2011 Fundação CPqD
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-#ifndef IPCCOMMUNICATOR_H_
-#define IPCCOMMUNICATOR_H_
-
-#include "cpqd.hh"
-#include "IPCMessage.hh"
-
-/**
- * @defgroup Communicators Communicators
- * This module contains classes for interprocess communications.
- * The design of communicators classes and messages considered the following
- * points:
- * -# A message class could be used by any communicator class.
- * -# The communicator class must not know anything about message encoding.
- * -# The message must not rely on any particularity of a communicator class.
- *
- * But, the most important thing about these communicator messages is:
- * <h1>They are supposed to send and receive messages only! </h1> although it
- * can also handle its file descriptor, for instance.
- * This means:
- * - <b> No message processing should be done by any of these classes; </b>
- * - <b> No verifications on message data should be performed, except the presence
- * or not of a message header. This is necessary in order to check whether the
- * message should parse its header or not.</b>
- * @{
- *
- * @class IPCCommunicator
- * Abstract class for communications.
- */
-class IPCCommunicator {
-public:
- /** Default constructor. */
- IPCCommunicator();
- /** Destructor. */
- virtual ~IPCCommunicator() = 0;
-
- /**
- * Opens the communication channel.
- * This class doesn't define what exactly is a communication channel. For
- * Linux systems, for instance, it can be a file descriptor for a socket.
- * @return It's up to the child class to define what can be return by open()
- * method. It's advisable that this error code can be decoded by using
- * ErrorHandler::dumpError().
- */
- virtual t_result open() = 0;
-
- /**
- * Closes the communication channel.
- * This class doesn't define what exactly is a communication channel. For
- * Linux systems, for instance, it can be a file descriptor for a socket.
- * @return It's up to the child class to define what can be return by open()
- * method. It's advisable that this error code can be decoded by using
- * ErrorHandler::dumpError().
- */
- virtual t_result close() = 0;
-
- /**
- * Reopens the communication channel.
- * This class doesn't define what exactly is a communication channel. For
- * Linux systems, for instance, it can be a file descriptor for a socket.
- * This method can close and reopen the communication channel
- * @return It's up to the child class to define what can be return by open()
- * method. It's advisable that this error code can be decoded by using
- * ErrorHandler::dumpError().
- */
- virtual t_result reopen() = 0;
-
- /**
- * Receives a message.
- * @param msg The message which will hold the received data. This pointer
- * should be already allocated. This pointer doesn't belong to this class,
- * so it's up to the user to release its memory afterwards.
- */
- virtual t_result recvMessage(IPCMessage *msg) = 0;
-
- /**
- * Sends a message.
- * @param msg The message which will hold the received data. This pointer
- * should be already allocated. This pointer doesn't belong to this class,
- * so it's up to the user to release its memory afterwards.
- */
- virtual t_result sendMessage(IPCMessage *msg) = 0;
-};
-
-/**
- * @}
- */
-
-#endif /* IPCCOMMUNICATOR_H_ */
View
42 common/ipc/IPCMessage.cc
@@ -1,42 +0,0 @@
-/*
- * Copyright 2011 Fundação CPqD
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <string.h>
-#include <stdint.h>
-
-#include "IPCMessage.hh"
-
-
-IPCMessage::IPCMessage() {
- ::memset(vuiRawData, 0, MAX_VECTOR_SIZE);
- uiRawDataSize = 0;
-}
-
-IPCMessage::~IPCMessage() {
- ::memset(vuiRawData, 0, MAX_VECTOR_SIZE);
- uiRawDataSize = 0;
-}
-
-int8_t IPCMessage::copyToRawData(uint8_t data[], uint32_t size)
-{
- int8_t ret = 0;
-
- ::memset(vuiRawData, 0, MAX_VECTOR_SIZE);
- ::memcpy(vuiRawData, data, size);
- uiRawDataSize = size;
-
- return ret;
-}
View
154 common/ipc/IPCMessage.hh
@@ -1,154 +0,0 @@
-/*
- * Copyright 2011 Fundação CPqD
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef IPCMESSAGE_H_
-#define IPCMESSAGE_H_
-
-#include <stdint.h>
-#include "cpqd.hh"
-
-/**
- * @defgroup Messages Messages
- * @{
- *
- * @class IPCMessage
- *
- * Class for message abstraction.
- * This class abstracts a generic message used by any protocol. There are some
- * details that should be understood:
- * -# This is a generic message. While specifying it, many aspects of messages
- * were taken into account, such as: should this class represents only protocol
- * messages (including header, etc.) or it should consider also plain messages
- * (such as text messages, with no header)? The latter option was chosen, once
- * there are some parts of ONCS that use headerless messages (such as commands
- * sent to Marben's stack through StackOperator class - check out the
- * documentation of mpa_oncs project).
- * -# All messages should contain its own data, i.e., there should not be any
- * pointers to external data. Hence, this class can handle its own memory
- * operations and verifications. Also, no referece from internal data should be
- * passed to external elements, in order to avoid memory corruption.
- * -# The message class should know how to convert a byte vector to its format
- * and vice-versa.
- *
- * The usage flow for this message is:
- * - Building a new message from stratch:
- * - Call the constructor ( IPCMessage() ). This should be done while building
- * a new message from a child class;
- * - Fill the message header - if the message has a header :D (this is
- * meaningful for child classes);
- * - Add content to message payload;
- * - Transform the message into a byte vector.
- * - And finally, send the byte vector through a communication channel.
- */
-class IPCMessage {
-protected:
-
- /**
- * Message raw data.
- * All data - and I mean *every* bit - of this message should be copied to
- * this vector. No reference to it should be passed as a reference to other
- * elements, in order to prevent memory corruption.
- */
- uint8_t vuiRawData [MAX_VECTOR_SIZE];
-
- /**
- * Current used size of raw data.
- */
- uint32_t uiRawDataSize;
-
- /**
- * Copies a vector to message raw data.
- * This method copies a vector to the raw data byte vector, starting at the
- * beginning (there's no offset).
- * @param data The vector to be copied
- * @param size How many bytes from data[] should be copied to raw data
- * byte vector
- * @return Error code (this value can be decoded using ErrorHandler::dumpError())
- */
- int8_t copyToRawData(uint8_t data[], uint32_t size);
-public:
-
- /**
- * Default constructor.
- * This contructor zeroes vuiRawData vector.
- */
- IPCMessage();
-
- /**
- * Destructor.
- * This contructor zeroes vuiRawData vector. So, if there's a reference to
- * some data inside this vector, which should be avoided, it will be invalid
- * after destroying the message.
- */
- virtual ~IPCMessage() = 0;
-
- /**
- * Returns the header total size.
- * This method should return a value different than zero iff the message has
- * a header.
- * @return Header size, 0 if the message has no header.
- */
- virtual uint32_t getHeaderSize() = 0;
-
- /**
- * Interprets a vector of bytes representing a message header.
- */
- virtual t_result parseHeaderBytes(uint8_t data []) = 0;
-
- /**
- * Interprets a vector of bytes representing a payload
- * @param data Vector containing the data to be processed.
- */
- virtual t_result parsePayloadBytes(uint8_t data []) = 0;
-
- /**
- * Interprets a vector of bytes (whole message)
- * @param data Vector containing the data to be processed
- * @param size Data size to be considered
- */
- virtual t_result parseBytes(uint8_t data [], uint32_t size) = 0;
-
- /**
- * Check if the message has a header.
- * @return true if the message has a header (protocol messages) or not (text
- * messages)
- */
- virtual bool hasHeader() = 0;
-
- /**
- * Transforms a message represented by this object into a vector of bytes
- * @param data Vector in which the data will be copied to.
- * @param size Total size of the data
- */
- virtual void getBytes(uint8_t data[], uint32_t & size) = 0;
-
- /**
- * Return the size (in bytes) of payload
- */
- virtual uint32_t getPayloadSize() = 0;
-
- /**
- * Return the size (in bytes) of this message (header + payload)
- */
- virtual uint32_t getSize() = 0;
-
-};
-
-/**
- * @}
- */
-
-#endif /* IPCMESSAGE_H_ */
View
3  common/ipc/Makefile
@@ -1,3 +0,0 @@
-MAKELIB=1
-
-include ../../Make.rules
View
40 common/ipc/MessageProcessor.cc
@@ -1,40 +0,0 @@
-/*
- * Copyright 2011 Fundação CPqD
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <stdint.h>
-#include <cpqd_types.hh>
-#include <cpqd.hh>
-#include <MessageProcessor.hh>
-
-map<uint16_t, ptag_Callback> MessageProcessor::resultFunctions;
-
-void MessageProcessor::addResultCallback(ptag_Callback callback, uint16_t msgID)
-{
- resultFunctions[msgID] = callback;
-}
-
-void MessageProcessor::removeResultCallback(uint16_t msgID)
-{
- ptag_Callback ptagCurrCbk = NULL;
- map<uint16_t, ptag_Callback>::iterator it;
- if ((it = resultFunctions.find(msgID)) != resultFunctions.end())
- {
- ptagCurrCbk = (*it).second;
- resultFunctions.erase(it);
- }
-}
-
-
View
113 common/ipc/MessageProcessor.hh
@@ -1,113 +0,0 @@
-/*
- * Copyright 2011 Fundação CPqD
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef MESSAGEPROCESSOR_H_
-#define MESSAGEPROCESSOR_H_
-
-#include <stdint.h>
-#include "IPCMessage.hh"
-#include "cpqd_types.hh"
-#include "../sys/Semaphore.hh"
-#include <map>
-
-//#include "../../qf-server/qfserver.hh"
-using namespace std;
-
-/**
- * Function executed when some asynchronous event occurs
- */
-typedef void * (*processResult)(void *);
-
-/**
- * Structure for callback procedures
- */
-typedef struct tag_Callback
-{
- processResult callbackOK; ///< Function to be executed when an event occurs
- processResult callbackError; ///< Function to be executed when an event occurs
- uint16_t resultCallback; ///< Result of the execution of callback function
- uint16_t errorCode; ///< Error code for a request.
- Semaphore * semaphore; ///< Semaphore related to the event waiter (can be NULL)
-} ttag_Callback, * ptag_Callback;
-
-
-/**
- * Abstract class for message processors.
- * Child classes should implement these methods in order to process messages
- * (check which type a message is and take the proper action). Remember that
- * message reception, message checking, and actual actions taken are not
- * supposed to be done by this message.
- */
-class MessageProcessor {
-protected:
- /**
- * This static member holds information about scheduled asynchronous
- * callbacks. For example, think about when a command should be sent to an
- * equipment, but the answer comes in through other communication channel.
- * The message sender cannot just sit and wait for an answer to be received
- * by his socket, once all commmunication is received by other
- * IPCCommunicator object. Instead, it sets ptag_Callback.fnc (stands for
- * 'function') member structure to process the answer, adds a new entry
- * to this attribute and goes on. When the message is received, it should
- * be recognized as an 'answer' by MessageProcessor child class, and the
- * function previously defined is called in order to complete the message
- * processing.
- * If this operation is blocking (the answer is really important to the
- * remaining operations), the message sender could set the
- * ttag_Callback.lock attribute, and, obviously, acquire the lock ( using
- * lock->lock() method) before going on.
- */
- static map<uint16_t, ptag_Callback> resultFunctions;
-
-public:
- virtual ~MessageProcessor() {};
-
- /**
- * Process a message received by some communicator.
- * This is the main method for this class. It's supposed to know how to
- * process a message received by a communicator and start the appropriate
- * procedures in order to do that.
- * @param msg Reference to the received message
- * @return Should return an error code that can be decoded by ErrorHandler::dumpError()
- */
- virtual t_result processMessage(IPCMessage * msg, void * arg) = 0;
-
- /**
- * Initializes the message processor.
- * This method is needed if some procedure must be performed before starting
- * the message reception and processing. Otherwise, the implementation of
- * this method can be empty.
- * @return Should return an error code that can be decoded by ErrorHandler::dumpError()
- */
- virtual t_result init() = 0;
-
- /**
- * Adds a new callback handler
- */
- static void addResultCallback(ptag_Callback callback, uint16_t msgID);
-
-
-
- /**
- * Removes an existing callback handler.
- * Once the message processing is done, this method SHOULD be called.
- * Afterwards, the lock attribute should be deallocated!.
- */
- static void removeResultCallback(uint16_t msgID);
-
-};
-
-#endif /* MESSAGEPROCESSOR_H_ */
View
90 common/ipc/RFCtlMessageProcessor.cc
@@ -1,90 +0,0 @@
-/*
- * Copyright 2011 Fundação CPqD
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <syslog.h>
-#include <stdint.h>
-#include <string.h>
-#include <inttypes.h>
-
-#include "RFCtlMessageProcessor.hh"
-#include "IPCMessage.hh"
-#include "RawMessage.hh"
-#include "../../include/cmd_msg.h"
-#include "../../include/event_msg.h"
-#include "../../include/openflow.h"
-#include "../../rf-server/rfserver.hh"
-
-t_result RFCtlMessageProcessor::processMessage(IPCMessage * msg, void * arg) {
-
- syslog(LOG_INFO, "[RFMP] Processing Message");
-
- t_result ret = SUCCESS;
- base_msg BaseMessage;
-
- msg = (RawMessage *) msg;
-
- uint32_t size = sizeof(base_msg);
- bzero(&BaseMessage, size);
- msg->getBytes(&BaseMessage.group, size);
-
- RouteFlowServer * pQFSrv = (RouteFlowServer *) arg;
- if (BaseMessage.group == EVENT) {
-
- if (BaseMessage.type == PACKET_IN) {
- packet_in MsgEvent;
- ::memcpy(&MsgEvent, &BaseMessage.payload, sizeof(MsgEvent));
- pQFSrv->packet_in_event(MsgEvent.datapath_id, MsgEvent.port_in,
- MsgEvent.pkt_id, 0, MsgEvent.type);
- }
- else if (BaseMessage.type == DATAPATH_JOIN) {
- datapath_join MsgEvent;
- ::memcpy(&MsgEvent, &BaseMessage.payload, BaseMessage.pay_size);
- pQFSrv->datapath_join_event(MsgEvent.datapath_id, MsgEvent.hw_desc,
- MsgEvent.no_ports);
-
- }
- else if (BaseMessage.type == DATAPATH_LEAVE) {
- datapath_leave MsgEvent;
- ::memcpy(&MsgEvent, &BaseMessage.payload, sizeof(MsgEvent));
- pQFSrv->datapath_leave_event(MsgEvent.datapath_id);
- }
- else if (BaseMessage.type == LINK_EVENT) {
- link_event MsgEvent;
- ::memcpy(&MsgEvent, &BaseMessage.payload, BaseMessage.pay_size);
- pQFSrv->handle_link_event(MsgEvent.reason, MsgEvent.dp1,
- MsgEvent.port_1, MsgEvent.dp2, MsgEvent.port_2);
-
- }
- else if (BaseMessage.type == MAP_EVENT) {
- VmtoOvs MsgMapEvent;
- ::memcpy(&MsgMapEvent, &BaseMessage.payload, sizeof(MsgMapEvent));
- pQFSrv->VmToOvsMapping(MsgMapEvent.vmId, MsgMapEvent.VmPort,
- MsgMapEvent.OvsPort);
- }
- } else
- ret = ERROR_1;
-
- return ret;
-}
-
-t_result RFCtlMessageProcessor::init() {
-
- syslog(LOG_INFO, "[RFMP] Initializing Message Processor");
-
- t_result ret = SUCCESS;
-
- return ret;
-}
View
48 common/ipc/RFCtlMessageProcessor.hh
@@ -1,48 +0,0 @@
-/*
- * Copyright 2011 Fundação CPqD
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef RFMESSAGEPROCESSOR_HH_
-#define RFMESSAGEPROCESSOR_HH_
-
-#include "MessageProcessor.hh"
-#include "../../rf-server/rfserver.hh"
-
-
-class RFCtlMessageProcessor : public MessageProcessor {
-
-public:
- /**
- * Process a message received by some communicator.
- * This is the main method for this class. It's supposed to know how to
- * process a message received by a communicator and start the appropriate
- * procedures in order to do that.
- * @param msg Reference to the received message
- * @return Should return an error code that can be decoded by ErrorHandler::dumpError()
- */
- t_result processMessage(IPCMessage * msg, void * arg);
-
- /**
- * Initializes the message processor.
- * This method is needed if some procedure must be performed before starting
- * the message reception and processing. Otherwise, the implementation of
- * this method can be empty.
- * @return Should return an error code that can be decoded by ErrorHandler::dumpError()
- */
- t_result init();
-};
-
-
-#endif /* RFMESSAGEPROCESSOR_HH_ */
View
83 common/ipc/RawMessage.cc
@@ -1,83 +0,0 @@
-/*
- * Copyright 2011 Fundação CPqD
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <string.h>
-
-#include <stdint.h>
-#include <cpqd.hh>
-#include <cpqd_types.hh>
-#include <RawMessage.hh>
-
-RawMessage::RawMessage()
-{
-
-}
-RawMessage::~RawMessage()
-{
-
-}
-
-/**
- * Interprets a vector of bytes (whole message)
- * @param data Vector containing the data to be processed
- * @param size Data size to be considered
- */
-t_result RawMessage::parseBytes(uint8_t data[], uint32_t size)
-{
- int8_t ret = 0;
-
- ret = copyToRawData(data, size);
-
- return ret;
-}
-
-/**
- * Transforms a message represented by this object into a vector of bytes
- * @param data Vector in which the data will be copied to.
- * @param size Total size of the data
- */
-void RawMessage::getBytes(uint8_t data[], uint32_t & size)
-{
- ::memcpy(data, vuiRawData, uiRawDataSize);
- size = uiRawDataSize;
-}
-
-/**
- * Return the size (in bytes) of this message (header + payload)
- */
-uint32_t RawMessage::getSize()
-{
- return uiRawDataSize;
-}
-
-ostream & operator<<(ostream & out, RawMessage & msg)
-{
- uint8_t data[MAX_VECTOR_SIZE];
- uint32_t size = 0;
- memset(data, 0, MAX_VECTOR_SIZE);
-
- msg.getBytes(data, size);
-
- for (uint32_t i = 0; i < size; i++)
- {
- out << "[" << (data[i] < 16 ? "0" : "") << hex << (uint32_t) data[i] << "] ";
- if (((i % 16) == 0) && (i!=0))
- {
- out << endl;
- }
- }
- return out;
-}
View
97 common/ipc/RawMessage.hh
@@ -1,97 +0,0 @@
-/*
- * Copyright 2011 Fundação CPqD
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef RAWMESSAGE_H_
-#define RAWMESSAGE_H_
-
-#include "IPCMessage.hh"
-#include <iostream>
-using namespace std;
-
-/**
- * @addtogroup Messages
- * @{
- *
- * @class RawMessage
- * This class defines a special type of message: it has no header, its payload
- * is not composed by data structures, but only by bytes.
- */
-class RawMessage : public IPCMessage {
-protected:
-
-public:
-
- /**
- * Default constructor
- */
- RawMessage();
-
- /**
- * Destructor
- */
- virtual ~RawMessage();
-
- /**
- * Returns the header total size
- */
- uint32_t getHeaderSize() { return 0; };
-
- /**
- * Interprets a vector of bytes representing a message header.
- */
- t_result parseHeaderBytes(uint8_t data[]) { return 0; };
-
- /**
- * Interprets a vector of bytes representing a payload.
- * @param data Vector containing the data to be processed
- */
- t_result parsePayloadBytes(uint8_t data[]) { return 0; };
-
- /**
- * Interprets a vector of bytes (whole message).
- * @param data Vector containing the data to be processed
- * @param size Data size to be considered
- */
- t_result parseBytes(uint8_t data[], uint32_t size);
-
- bool hasHeader() { return false; };
-
- /**
- * Transforms a message represented by this object into a vector of bytes.
- * @param data Vector in which the data will be copied to.
- * @param size Total size of the data
- */
- void getBytes(uint8_t data[], uint32_t & size);
-
- /**
- * Return the size (in bytes) of payload.
- */
- uint32_t getPayloadSize() { return 0; };
-
- /**
- * Return the size (in bytes) of this message (header + payload).
- */
- uint32_t getSize();
-
-
- friend ostream & operator<<(ostream & out, RawMessage & msg);
-};
-
-/**
- * @}
- */
-
-#endif /* RAWMESSAGE_H_ */
View
273 common/ipc/TCPSocket.cc
@@ -1,273 +0,0 @@
-/*
- * Copyright 2011 Fundação CPqD
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <cstring>
-#include <arpa/inet.h>
-#include <errno.h>
-#include <sstream>
-#include <syslog.h>
-
-#include <TCPSocket.hh>
-
-TCPSocket::TCPSocket() {
- uiSockFD = -1;
-
-}
-
-TCPSocket::~TCPSocket() {
- int32_t ret = 0;
-
- if (uiSockFD != 0) {
- ret = checkSocket(uiSockFD);
-
- if (ret != SUCCESS) {
- syslog(LOG_ERR, "TCPSocket::<~>: Error while closing socket %d",
- ret);
- }
-
- if (uiSockFD != 0) {
- ret = ::close(uiSockFD);
- }
-
- if (ret != 0) {
- syslog(LOG_ERR, "TCPSocket::<~>: Error while closing socket %d",
- ret);
- }
- }
-
-}
-
-t_result TCPSocket::open() {
- int32_t ret = 0;
-
- ret = ::socket(AF_INET, SOCK_STREAM, 0);
- if (ret >= 0) {
- uiSockFD = ret;
- syslog(LOG_INFO, "[TCPSOCK] new uiSockFD: %d ", uiSockFD);
- ret = SUCCESS; // EXIT: Success
- } else {
- ret = -1; // EXIT: Cannot create socket
- }
- return ret;
-}
-
-t_result TCPSocket::close() {
- int8_t ret = 0;
-
- ret = ::close(uiSockFD);
-
- if (ret != 0) {
- syslog(LOG_ERR, "TCPSocket::close: Cannot close socket");
- }
-
- return ret;
-}
-
-t_result TCPSocket::reopen() {
- int8_t ret = 0;
-
- ret = close();
-
- if (ret != SUCCESS) {
- syslog(LOG_ERR, "TCPSocket::reopen: Cannot close socket");
- }
-
- ret = open();
-
- if (ret != SUCCESS) {
- syslog(LOG_ERR, "TCPSocket::reopen: Cannot open socket");
- }
-
- return ret;
-}
-
-t_result TCPSocket::setFD(uint32_t fd) {
- int32_t ret = 0;
-
- ret = checkSocket(fd);
- if (ret == SUCCESS) {
- uiSockFD = fd;
- } else {
- syslog(LOG_ERR, "TCPSocket::setFD: Cannot set FD for TCP socket");
- }
- return ret;
-}
-
-t_result TCPSocket::connect(ttag_Address address, uint32_t port) {
- int8_t ret = 0;
-
-
- string strAddr;
-
- ::bzero(&sock, sizeof(sockaddr_in));
-
- sock.sin_family = AF_INET;
- sock.sin_port = htons(port);
-
- connectedIP.ulTotal = address.ulTotal;
- addressToStr(address, strAddr);
-
- syslog(LOG_INFO, "[TCPSOCK] Connecting to controller at %s ,port %d",
- strAddr.c_str(), port);
-
- ::inet_pton(AF_INET, strAddr.c_str(), &sock.sin_addr);
-
- ret = ::connect(uiSockFD, ((sockaddr*) &sock), sizeof(sockaddr_in));
-
- if (ret != 0) {
- syslog(LOG_ERR, "TCPSocket::connect: Cannot connect");
- } else {
- syslog(LOG_INFO, "[TCPSOCK] Connected successfully");
- }
- return ret;
-}
-
-t_result TCPSocket::sendMessage(IPCMessage *msg) {
- t_result ret = 0;
-
- uint8_t data[MAX_VECTOR_SIZE];
- uint32_t size = 0;
-
- ::bzero(data, MAX_VECTOR_SIZE);
-
- /** >> DEBUG */
- uint8_t temp[MAX_VECTOR_SIZE];
-
- if (msg == NULL) {
- return -1;
- }
-
- stringstream ss;
- string tempText;
- msg->getBytes(temp, size);
-
- if (uiSockFD < 0) {
- ret = ERROR_2;
- return ret;
- }
-
- msg->getBytes(data, size);
-
- ret = ::send(uiSockFD, data, size, 0);
-
- if (ret > 0) {
- ret = SUCCESS; // EXIT: Success
- } else {
-
- ret = ERROR_2;
-
- }
-
- return ret;
-}
-
-t_result TCPSocket::recvMessage(IPCMessage *msg) {
- int32_t ret = 0;
-
- uint8_t data[MAX_VECTOR_SIZE];
-
- ::bzero(data, MAX_VECTOR_SIZE);
-
- if (msg == NULL) {
- ret = ERROR_2;
- return ret;
- }
-
- if (uiSockFD < 0) {
- ret = ERROR_2;
- return ret;
- }
-
- ret = ::recv(uiSockFD, data, MAX_VECTOR_SIZE, 0);
-
- if (ret > 0) {
-
- ret = msg->parseBytes(data, ret);
- if (ret != SUCCESS) {
- }
-
- } else if (ret == 0) {
- syslog(LOG_INFO, "Message total bytes == 0");
- uint32_t i = 0;
- ret = reopen();
- do {
- ret = reconnect();
- i++;
- syslog(LOG_INFO, "We are trying to reconnect, attempt number: %d ",
- i);
- if (ret != SUCCESS) {
- sleep(5);
- }
- } while (ret != SUCCESS);
- } else if (ret < 0) {
- ret = errno;
- syslog(LOG_INFO, "Ret < 0");
-
- }
-
- return ret;
-}
-
-t_result TCPSocket::checkSocket(uint32_t fd) {
- sockaddr_in test;
- socklen_t testlen = sizeof(sockaddr_in);
- int32_t ret = 0;
-
- ::bzero(&test, sizeof(sockaddr_in));
-
- if (fd <= 0) {
- ret = ERROR_2;
- return ret;
- }
-
- ret = ::getsockname(fd, (sockaddr *) &test, &testlen);
- if (ret == SUCCESS) {
- ret = ::getpeername(fd, (sockaddr *) &test, &testlen);
- if (ret == SUCCESS) {
-
- ret = SUCCESS;
- } else {
- ret = ERROR_2;
- }
- } else {
- ret = ERROR_2;
- }
-
- return ret;
-}
-
-t_result TCPSocket::reconnect() {
-
- string strAddr;
- t_result ret = SUCCESS;
-
- addressToStr(connectedIP, strAddr);
-
- syslog(LOG_INFO, "[TCPSOCK] Re-Connecting to controller at %s",
- strAddr.c_str());
-
- ::inet_pton(AF_INET, strAddr.c_str(), &sock.sin_addr);
-
- ret = ::connect(uiSockFD, ((sockaddr*) &sock), sizeof(sockaddr_in));
- if (ret != 0) {
- syslog(LOG_ERR, "TCPSocket::connect: Cannot connect");
- } else {
- syslog(LOG_INFO, "[TCPSOCK] Connected successfully");
- }
- return ret;
-}
View
138 common/ipc/TCPSocket.hh
@@ -1,138 +0,0 @@
-/*
- * Copyright 2011 Fundação CPqD
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef TCPSOCKET_H_
-#define TCPSOCKET_H_
-
-#include "IPCCommunicator.hh"
-
-/**
- * @addtogroup Communicators
- * @{
- *
- * @class TCPSocket
- * Class used for interprocess communication using TCP.
- * The usage flow is:
- * - call the constructor (TCPSocket())
- * - set the file descriptor by using setFD(uint32_t) or open() methods.
- * - if the socket was opened through open(), it must be connected to some
- * endpoint. This can be done by connect(char[], uint32_t) method;
- * -
- *
- */
-class TCPSocket : public IPCCommunicator {
-protected:
-
- /**
- * File descriptor of the opened socket
- */
- int32_t uiSockFD;
-
- /**
- * Check whether the socket is still valid
- */
- static t_result checkSocket(uint32_t fd);
-
- ttag_Address connectedIP;
-
- /*
- * Socket used to connect
- */
-
- sockaddr_in sock;
-
-public:
-
- /**
- * Default constructor.
- * In this constructor, no attempt is made to build a socket. This must be
- * done later, using 'openSocket', 'connect', and 'recvMessage' and
- * 'sendMessage' methods.
- */
- TCPSocket();
-
- /**
- * Destructor.
- * When deleting an object of this class, the socket, if exists, is closed.
- */
- virtual ~TCPSocket();
-
- /**
- * Creates a socket.
- * This brand new socket isn't bound to any port or address. This task
- * is done by the 'connect' method.
- * @return The error returned by the 'socket' function. (Check your operating
- * system's manual).
- */
- t_result open();
-
- /**
- * Closes the socket
- */
- t_result close();
-
- /**
- * Reopens the socket, but it doesn't connect to any host (as previously
- * configured)
- */
- t_result reopen();
-
- /**
- * Configures the file descriptor related to the socket.
- * Before assigning the new file descriptor, a test is made in order to check
- * the validity of the file descriptor. If it is valid, then this object will
- * use the given file descriptor for further communication.
- * @param fd The new file descriptor
- * @return The state of the file descriptor
- */
- t_result setFD(uint32_t fd);
-
- /**
- * Connects the socket to a specific remote address and port.
- * @param address Remote address
- * @param port Remote port
- * @return The error returnd by the 'connect' function. (Check your operating
- * system's manual)
- */
- t_result connect(ttag_Address address, uint32_t port);
-
-
- /**
- * Receives a message from the opened socket.
- * @param msg The message which will hold the received data. This pointer
- * should be already allocated. This pointer doesn't belong to this class,
- * so it's up to the user to release its memory afterwards.
- */
- t_result recvMessage(IPCMessage *msg);
-
- /**
- * Sends a message through the socket.
- * @param msg The message which will hold the received data. This pointer
- * should be already allocated. This pointer doesn't belong to this class,
- * so it's up to the user to release its memory afterwards.
- */
- t_result sendMessage(IPCMessage *msg);
-
- ttag_Address getConnectedIP() { return connectedIP; };
-
- t_result reconnect();
-};
-
-/**
- * @}
- */
-
-#endif /* TCPSOCKET_H_ */
View
153 common/ipc/cpqd.cc
@@ -1,153 +0,0 @@
-/*
- * Copyright 2011 Fundação CPqD
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and