Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: edits for clarity.

...

Protocol Terms

  Any binary protocol requires the following things:

  1. Version: This indicates the API version.

  2. Correlation Id: This helps to relate the request-should be different per request sent. It allows correlation of request and response.

  3. Object Type: What is the The type of a serialized object.

  4. Response Type: It indicates whether a response is partial or complete.

  5. ErrorCodes: It indicates the problem with API invocation.

  6. Chunk Response: Send large response in multiple chunks.

  7. Continuous Response: Client can register(Observer pattern) for events and then server notify the client if those events occur.

  8. Request: It indicates client's message

  9. Response: It indicates server's message.

  10. Request Format: Format of request api and its parameters, which client wants to invoke.

  11. Response Format: Format for api return value, which client invoked.

  12. Message: Set of bytes which contain the Message Header and Request/Response.

  13. Serialized Byte Order: Big Endian

...

TypeNumber Of BytesValueSerializedBytes
booleanFixed = 1true0x01 
booleanFixed = 1false0x00
int8Fixed = 110x01
int16Fixed = 210x00 0x01 
int32Fixed = 410x00 0x00 0x00 0x01 
int64Fixed = 810x00 0x00 0x00 0x00 0x00 0x00 0x00 0x01 
String(modified UTF 8 )

Variable

  • 2 byte(int16) for length of encoded String
  • Utf Encoding
"Geode"

0x00 0x05 (length)

0x47 0x65 0x6f 0x64 0x65 (utf encoding)

byte[]

Variable

  • 2 bytebytes(int16) for number of bytes
  • sseries series of bytes.
{1,2}

0x00 0x02 (length)

0x01 0x02 

bytes

Variable: series of bytes which contains all themeta info to create the java objectcontaining a serialized value.

  


Message(Framing) 

A message is a series of bytes which contains the request or response. If the message is large, then we will have provision to divide the message into small messages. In that case, client/server needs to collect all messages to parse the request/response. The message will be sent in following way.  A client can send the multiple messages on the connection and the server will respond to those messages in same order. 

...

PutResponse => Success
Success => fixedSize = 1 byte, type = boolean

GetRequest

GetRequest --=> RegionName Key CallbackArg
RegionName => (variable size, type = String)
Key => bytes
CallbackArg => bytes

...

GetAllResponse

GetAllResponse --=> NumberOfKeyValuePair Key value {Key value}
NumberOfKeyValuePair => fixedSize = 4 bytes, type = int32
Key => bytes
value => bytes

...

ClientConfigRequestNumberOfProperties PropertyId PropertyValue{ PropertyId PropertyValue}
NumberOfPropertiesfixedSize = 2 bytes, type = int16
PropertyidfixedSize = 2 bytes, type = int16
PropertyValuevariable, Value as defined in table below
ClientConfigResponse –-==> Success
Success => fixedSize = 1 byte, type = boolean

...

AuthRequest

isDiffieHellmanEnabled ( NumberOfProperties PropertyId PropertyValue{ PropertyId PropertyValue}

| NumberOfEncryptedBytes EncryptedCredentials )

isDiffieHellmanEnabledfixedSize = 1 byte, type = boolean
NumberOfPropertiesfixedSize = 2 bytes, type = int16
Propertyidbytes
PropertyValuebytes
EncrptedCredentialsbytes
AuthResponse –-=> Success
Success => fixedSize = 1 byte, type = boolean

...