User Tools

Site Tools


strutture:lnf:da:chaos:rpc_protocol

RPC Protocol

Whit in Chaos all the part, Control Unit, Metadata Server, UI Toolkit talk each other with an rpc system. Due to the abstract design of chaos the RPC system is plugable, so the syntax and semantic os RPC message can be embedded int RCP serialization. Has been chosen BSON to serialize and deserialize action information. With this choice we have only one roc endpoint, this permit to simply migrate the roc protocol to another.

For submit a CHAOS System Action we need to construct a BSON package to send to the RPC end point. Some information are needed to precisely locate the action to execute:

  • Domain
  • Action Name
  • Parameter(key/value)

This is a sample JSON version of the BSON package to call an action:

{	
 "cs|cmdm|act_domain": "CU_UUID",
 "cs|cmdm|act_name": "updateConfiguration"
 "cs|dm|ld|server_address" : [ "192.168.1.2:11211" ] ,
 "cs|cm|thread|schedule_delay" : 5000000, 
 "cs|cm|cu|managed_device_id" : [ "SIMULATED_DEVICE_ID" ],
}

Description of the key:

Domain(cs|cmdm|act_domain) - The domain represent a group of action. The Chaos Library for COntrol Unit has a default domain called "system". In this domain are grouped all action useful for Control Unit administrations and for debug function.

Action Name(cs|cmdm|act_name) - The name of an action, is an alias used by CHAOS library to recognize the action pointer to call.

Action Parameter(key/value) - Every other key/value in the BSON pack are used as parameter. The called fungi will search in the received packet if a parameter is present, in this case is taken from BSON serialization.

"Submission" instead of "Execution" - Wy submission? IN CHOAS system the duration of an action is not constrained, so we could call an action that take much time to be executed. For tho reason, wen a BSON pack is received by RPC end point, it s' is processed and submitted to intern execution scheduler, that will take care to execute the action. The current RPC implementation(MSGPACK-RPC) permit to receive a result of an rcp call. In this, is return a BSON pack with the result of the action submission described as follows:

"cs|cmdm|act_sub_result" as int32;  -> 0 Submission OK  or  ->1 something is gone wrong;
"cs|cmdm|act_sub_emsg" as string; -> error message;
"cs|cmdm|act_sub_edom" as string; -> domain of the error, typically is the part of the code where error is occurred;
"cs|cmdm|act_sub_ecode"as int32; -> this is the numerical code of the error;

The Answer System

Chaos Library for Control Unit support the deferred answer to an action submission. Whe the caller what to receive the result of an action execution, it can add to the BSON submission request pack two additional key.

"cs|cmdm|rh_resp_id" as string;  
This represent the Identification Number of the request. It will be forwarded in the result BSON pack. 
With this code the client can correlate the answer to the request.

"cs|cmdm|rh_ip" as string;
This represent the ip:port of the rpc end point to be used.

Current RPC used protocol - Actually CHAOS system library use the MSGPACK-RCP(http://msgpack.org/) rpc system. There is only one method exported by msgpack rpc implementation it is "chaos_rpc" and it accept one parameter of type "msgpack::type::raw_ref" and return "msgpack::type::raw_ref". The "raw_ref" contain the BSON serialization.

strutture/lnf/da/chaos/rpc_protocol.txt · Last modified: 2011/08/10 12:43 by bisegni@infn.it

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki