122 | | === Network Setup === |
123 | | |
124 | | In the previous diagram, it was implied that both host and guests were |
125 | | already connected to a common broker. This is clearly not the case upon startup. Both the |
126 | | host and the guests need to share some knowledge about the broker's location, if it's going |
127 | | to be running on an independent machine. Otherwise, it can be assumed that it listens on the |
128 | | host's IP. Moreover, this can always be assumed if an appropriate port forwarding mechanism |
129 | | is put in place in the host in order to route the connections to the broker. |
130 | | |
131 | | The recent release of the 2.2 series of !VirtualBox is a very convenient one: the newly introduced |
132 | | host-only networking feature fits our needs like a glove. From |
133 | | [http://download.virtualbox.org/virtualbox/2.2.2/UserManual.pdf the manual] (section 6.7): |
| 122 | === Network Setup === |
| 123 | |
| 124 | In the previous diagram, it was implied that both host and guests were |
| 125 | already connected to a common broker. This is clearly not the case upon startup. Both the |
| 126 | host and the guests need to share some knowledge about the broker's location, if it's going |
| 127 | to be running on an independent machine. Otherwise, it can be assumed that it listens on the |
| 128 | host's IP. Moreover, this can always be assumed if an appropriate port forwarding mechanism |
| 129 | is put in place in the host in order to route the connections to the broker. |
| 130 | |
| 131 | The recent release of the 2.2 series of !VirtualBox is a very convenient one: the newly introduced |
| 132 | host-only networking feature fits our needs like a glove. From |
| 133 | [http://download.virtualbox.org/virtualbox/2.2.2/UserManual.pdf the manual] (section 6.7): |
150 | | That is to say, we have our own virtual "ethernet network". On top of that, !VirtualBox |
151 | | provides an easily configurable DHCP server that makes it possible to set a fixed IP for the |
152 | | host while retaining a flexible pool of IPs for the VMs. |
153 | | Thanks to this feature, there is no exposure at all: not only do the used IPs belong to a private |
154 | | intranet IP range, but the interface itself is purely virtual. |
155 | | |
156 | | |
157 | | === Command Execution === |
158 | | Requesting the execution of a program contained in the guest fit nicely into an async. |
159 | | message passing infrastructure: a tailored message addressed to the guest we want to |
160 | | run the command on is published, processed by this guest and eventually answered back |
161 | | with some sort of status (maybe even periodically in order to feedback about progress). |
162 | | |
163 | | Given the subscription-based nature of the system, several guests can be addressed at |
164 | | once by a single host, triggering the execution of commands (or any other action |
165 | | covered by this mechanism) in a single go. Note that neither the hosts nor the |
166 | | (arbitrary number of) guests need to know how many of the latter conform the system: |
167 | | new guest instances need only subscribe to these "broadcasted" messages on their own |
168 | | to become part of the overall system. This contributes to the ''scalability'' of the system. |
169 | | |
170 | | |
171 | | === File Transfers === |
172 | | This is a trickier feature: transfers must be bidirectional, yet we want to avoid any kind |
173 | | of exposure or (complex) configuration. |
174 | | |
175 | | The proposed solution takes advantage of the [http://www.cse.nd.edu/~ccl/software/chirp/ Chirp protocol and set of tools]. |
176 | | This way, we don't even require privileges to launch the server instances. Because |
177 | | the file sharing must remain private, the chirp server is run on the guests. The host agent |
178 | | would act as a client that'd send or retrieve files. We spare ourselves from all the |
179 | | gory details involved in the actual management of the transferences, delegating the job |
180 | | to chirp (which deals with it brilliantly, by the way). |
181 | | |
182 | | The only bit missing in this argumentation is that the host needs to be aware of the guests' |
183 | | IP addresses in order to communicate with these chirp servers. This is a no-issue, as the |
184 | | custom STOMP-based protocol implemented makes it possible for the guests to "shout out" their |
185 | | details so that the host can keep track of every single one of them. |
186 | | |
187 | | |
188 | | === Open Questions === |
189 | | * Where should the broker live? Conveniently on the same machine as the hypervisor or on |
190 | | a third host? Maybe even a centralized and widely known (ie, standard) one? This last option |
191 | | might face congestion problems, though. |
192 | | * Broker choice. Full-fledged ([http://activemq.apache.org/ ActiveMQ]) or more limited but lighter? |
193 | | (ie, [http://www.germane-software.com/software/Java/Gozirra/ Gozirra]). On this |
194 | | question, unless a centralized broker is universally used, the lighter version largely suffices. |
195 | | Otherwise, given the high load expected, a more careful choice should be made. |
| 150 | That is to say, we have our own virtual "ethernet network". On top of that, !VirtualBox |
| 151 | provides an easily configurable DHCP server that makes it possible to set a fixed IP for the |
| 152 | host while retaining a flexible pool of IPs for the VMs. |
| 153 | Thanks to this feature, there is no exposure at all: not only do the used IPs belong to a private |
| 154 | intranet IP range, but the interface itself is purely virtual. |
| 155 | |
| 156 | |
| 157 | === Command Execution === |
| 158 | Requesting the execution of a program contained in the guest fit nicely into an async. |
| 159 | message passing infrastructure: a tailored message addressed to the guest we want to |
| 160 | run the command on is published, processed by this guest and eventually answered back |
| 161 | with some sort of status (maybe even periodically in order to feedback about progress). |
| 162 | |
| 163 | Given the subscription-based nature of the system, several guests can be addressed at |
| 164 | once by a single host, triggering the execution of commands (or any other action |
| 165 | covered by this mechanism) in a single go. Note that neither the hosts nor the |
| 166 | (arbitrary number of) guests need to know how many of the latter conform the system: |
| 167 | new guest instances need only subscribe to these "broadcasted" messages on their own |
| 168 | to become part of the overall system. This contributes to the ''scalability'' of the system. |
| 169 | |
| 170 | |
| 171 | === File Transfers === |
| 172 | This is a trickier feature: transfers must be bidirectional, yet we want to avoid any kind |
| 173 | of exposure or (complex) configuration. |
| 174 | |
| 175 | The proposed solution takes advantage of the [http://www.cse.nd.edu/~ccl/software/chirp/ Chirp protocol and set of tools]. |
| 176 | This way, we don't even require privileges to launch the server instances. Because |
| 177 | the file sharing must remain private, the chirp server is run on the guests. The host agent |
| 178 | would act as a client that'd send or retrieve files. We spare ourselves from all the |
| 179 | gory details involved in the actual management of the transfers, delegating the job |
| 180 | to chirp (which deals with it brilliantly, by the way). |
| 181 | |
| 182 | The only bit missing in this argumentation is that the host needs to be aware of the guests' |
| 183 | IP addresses in order to communicate with these chirp servers. This is a no-issue, as the |
| 184 | custom STOMP-based protocol implemented makes it possible for the guests to "shout out" their |
| 185 | details so that the host can keep track of every single one of them. |
| 186 | |
| 187 | |
| 188 | === Open Questions === |
| 189 | * Where should the broker live? Conveniently on the same machine as the hypervisor or on |
| 190 | a third host? Maybe even a centralized and widely known (ie, standard) one? This last option |
| 191 | might face congestion problems, though. |
| 192 | * Broker choice. Full-fledged ([http://activemq.apache.org/ ActiveMQ]) or more limited but lighter? |
| 193 | (ie, [http://www.germane-software.com/software/Java/Gozirra/ Gozirra]). On this |
| 194 | question, unless a centralized broker is universally used, the lighter version largely suffices. |
| 195 | Otherwise, given the high load expected, a more careful choice should be made. |
219 | | === Overview === |
220 | | Upon initialization, guests connect to the broker, that's expected to listen on the |
221 | | default STOMP port 61613 at the guest's gateway IP. |
222 | | Once connected, it "shouts out" he's joined the party, providing a its unique id (see |
223 | | following section for details). Upon reception, the BOINC host notes down this unique id for |
224 | | further unicast communication (in principle, other guests don't need this information). The |
225 | | host acknowledges the new guest (using the STOMP-provided ack mechanisms). |
226 | | |
227 | | |
228 | | === Unique Identification of Guests === |
229 | | The preferred way to identify guests is based simply on their IP. |
230 | | |
231 | | |
232 | | === Tailor-made STOMP Messages === |
233 | | The whole custom made protocol syntax is encapsulated in the |
234 | | classes of the "words" package. Each of these words correspond |
235 | | to this protocol's commands, which are always encoded as |
236 | | the first single word of the exchanged STOMP messages. |
237 | | |
238 | | It is the !MsgInterpreter class responsability to "interpret" |
239 | | the incoming STOMP messages and hence route them towards |
240 | | the appropriate "word" in order to perform the corresponding |
241 | | action. |
| 219 | === Overview === |
| 220 | Upon initialization, guests connect to the broker, that's expected to listen on the |
| 221 | default STOMP port 61613 at the guest's gateway IP. |
| 222 | Once connected, it "shouts out" he's joined the party, providing a its unique id (see |
| 223 | following section for details). Upon reception, the BOINC host notes down this unique id for |
| 224 | further unicast communication (in principle, other guests don't need this information). The |
| 225 | host acknowledges the new guest (using the STOMP-provided ack mechanisms). |
| 226 | |
| 227 | |
| 228 | === Unique Identification of Guests === |
| 229 | The preferred way to identify guests is based simply on their IP. |
| 230 | |
| 231 | |
| 232 | === Tailor-made STOMP Messages === |
| 233 | The whole custom made protocol syntax is encapsulated in the |
| 234 | classes of the "words" package. Each of these words correspond |
| 235 | to this protocol's commands, which are always encoded as |
| 236 | the first single word of the exchanged STOMP messages. |
| 237 | |
| 238 | It is the !MsgInterpreter class responsibility to "interpret" |
| 239 | the incoming STOMP messages and hence route them towards |
| 240 | the appropriate "word" in order to perform the corresponding |
| 241 | action. |
336 | | * Multiplatform: it runs wherever a python runtime is available. All |
337 | | the described dependencies are likewise portable. |
338 | | * Fully asynchronous. Thanks to the usage of the Twisted framework, the |
339 | | whole system developed is seamlessly multithreaded, even though no |
340 | | threads are used (in the developed code at least). Instead, all the |
341 | | operations rely on the asynchronous nature of the Twisted mechanism, |
342 | | about which details are given |
343 | | [http://twistedmatrix.com/projects/core/documentation/howto/async.html here]. |
| 336 | * Multiplatform: it runs wherever a python runtime is available. All |
| 337 | the described dependencies are likewise portable. |
| 338 | * Fully asynchronous. Thanks to the usage of the Twisted framework, the |
| 339 | whole system developed is seamlessly multithreaded, even though no |
| 340 | threads are used (in the developed code at least). Instead, all the |
| 341 | operations rely on the asynchronous nature of the Twisted mechanism, |
| 342 | about which details are given |
| 343 | [http://twistedmatrix.com/projects/core/documentation/howto/async.html here]. |