Revision 1 as of 2014-05-07 13:17:03

Clear message

WRT binary marshal, we need a high performance, efficient, RPC (remote procedure call) mechanism. Options are: 1. Current RMD 2. Google protobufs: https://code.google.com/p/protobuf/ 3. A new RPC mechanism defined by Yang files. The user would define separate Yang files for RPC calls -- that is different than the configuration file. However, the RPC Yang file might include the configuration one if a RPC call requires a parameter that is also a config object.

Pros/Cons:

1. Current RMD Pros: exists

Cons: XML definition language is not convenient for editing. XML definition language is OpenClovis-specific Code is complex for a simple thing, hard to debug. Could be higher performance C-only

2. Protobufs: Pros: exists in common use -- defacto standard

Cons: in common use -- OpenClovis adds no value possibly least efficient of the 3 (uses pedantic >> and << for serialization) Not integrated with TIPC or IOC

3. Yang Pros: Uses standard file format Integrates well with SAFplus7 because we already use Yang for configuration We have experience with Yang file format We could make an extremely efficient data format.

Cons: we must create it

Given these options, I think we should do some basic investigation into #2 and #3.

For #2, we need to see how efficient it is, and how hard to add IOC/TIPC underneath.

For #3, that means creating a binary marshal format and a special y2cpp that generates RPC optimized code and data. For example, the classes would not be "Managed" -- that is:

container Bar { leaf foo

}

->

class Bar { public: int foo; };

Also I would like the code generator to be capable of generating an in-place implementation. That is:

typedef GroupType // Some complex data

rpc getData

Classically could generate:

class GroupType { int something; int somethingElse; }

operator >> (Buffer& msg, GroupType& g) { ... } // Generate binary marshal

void getDataServer(Buffer* msg, Buffer* ret) {

}

In-place:

void getDataServer(Buffer* msg, Buffer* ret, int swapNeeded) {

}

For complex structures, the in-place mechanism is extremely efficient because it: 1. does no malloc/free 2. does not call a large number of nested subfunctions that demarshal each individual thing -- function calls are actually expensive when you think about doing 50 of them just for a single RPC. 3. does not copy, which both increases cache utilization and reduces expensive memory access.