140 | | The connection information explains how the connectivity is established between the sub-experiments. Now there are two ways to establish connections - ssh tunnels and direct transit connections. The ssh connection implies a portal in this experiment (it will be in the topology description) that will connect to the peer. Generally the port on which to communicate will be a parameter as it is here. Parameters are set using the SetValue interface, which is demonstrated in most existing plug-ins. |
| 140 | The connection information explains how the connectivity is established between the sub-experiments. Now there are two ways to establish connections - ssh tunnels and direct transit connections. The ssh connection implies a portal in this experiment (it will be in the topology description) that will connect to the peer. Generally the port on which to communicate will be a parameter as it is here. Parameters are set using the !SetValue interface, which is demonstrated in most existing plug-ins. |
| 141 | |
| 142 | There are a few conventional parameters: |
| 143 | |
| 144 | '''peer''':: |
| 145 | The DNS name or IP address of the other side of the connection |
| 146 | '''ssh_port''':: |
| 147 | The port to contact ssh on the peer |
| 148 | '''vlan_id''':: |
| 149 | For federants that are connected to transit federants, e.g., dragon, this is the VLAN ID to use in the connection |
| 150 | |
| 151 | For most federants the {{{import_store_info}}} member of {{{federation/access.py}}} will import the necessary parameters correctly. For those outputting values, the {{{export_store_info}}} member of {{{federation/emulab_access.py}}} is a good starting point. |
| 227 | == Using !SetValue and !GetValue == |
| 228 | |
| 229 | The experiment controller acts as an exchange point where access controllers can exchange information they need to interconnect. Specifically the parameters in the connection structures of a !StartSegment request are exchanged through the experiment controller. |
| 230 | |
| 231 | A !SetValue request has the form: |
| 232 | |
| 233 | {{{ |
| 234 | request = { |
| 235 | 'name': key_from_connection_parameter, |
| 236 | 'value': value_to_set, |
| 237 | } |
| 238 | }}} |
| 239 | |
| 240 | Values are strings and the name is a unique key (generated by the experiment controller) that identifies the variable. Access is contolled for each variable. |
| 241 | |
| 242 | The response is |
| 243 | {{{ |
| 244 | request = { |
| 245 | 'name': key_from_connection_parameter, |
| 246 | 'value': value_set, |
| 247 | 'proof': An_ABAC_proof_of_access |
| 248 | } |
| 249 | }}} |
| 250 | |
| 251 | !GetValue requests are similarly formatted: |
| 252 | |
| 253 | {{{ |
| 254 | request = { |
| 255 | 'name': key_from_connection_parameter, |
| 256 | # If wait is true, the call will block until some access controller has set the value |
| 257 | 'wait': boolean, |
| 258 | } |
| 259 | }}} |
| 260 | |
| 261 | and the response is |
| 262 | |
| 263 | {{{ |
| 264 | response = { |
| 265 | 'name': key_from_connection_parameter, |
| 266 | # This is optional. If wait was not set in the request and the value is unset, this field will not be in the response |
| 267 | 'value': value, |
| 268 | 'proof': An_ABAC_proof_of_access |
| 269 | } |
| 270 | }}} |
| 271 | |
| 272 | Requesting !GetValue with the {{{wait}}} parameter set blocks the caller until the value is set. Commonly, access controllers will set their output parameters using multiple SetValue calls and then wait for values from others using blocking !GetValue calls. |
| 273 | |