Difference between revisions of "GeometryServiceNetworkProtocol"

From BRL-CAD
(Enter more of the libPKG header use description.)
(Remove references to pkg)
 
(9 intermediate revisions by 2 users not shown)
Line 12: Line 12:
 
----
 
----
  
==GSNet Msg (Visual) Breakdown==
 
[[Image:GSNetMsgBreakdown.png|520x373px]]
 
  
----
 
  
==GSNet Msg==
+
=GSNet Msg Description=
===Header===
+
==Header==
The header of the GSNet Msg contains the information necessary for quickly determining authenticity, type and length.  Geometry Service's network library, libNetwork, is built upon BRL-CAD's networking library: libPKG.  This causes the header byte layout to look like this:
+
The header of the GSNet Msg contains the information necessary for quickly determining authenticity, type and length.  Geometry Service's network library, libNetwork, has a header byte layout that looks like this:
 
<br /><br />
 
<br /><br />
 
   
 
   
Line 27: Line 24:
 
|style="border: 1px solid #666699; background-color: #666699; color: #FFFFFF; width: 180px;"|'''Value'''
 
|style="border: 1px solid #666699; background-color: #666699; color: #FFFFFF; width: 180px;"|'''Value'''
 
|-
 
|-
|style="border: 1px solid #666699;"|Magic1
+
|style="border: 1px solid #666699;"|MsgType
|style="border: 1px solid #666699;"|int16 (2 Bytes)
+
|style="border: 1px solid #666699;"|int16 (2 bytes)
|style="border: 1px solid #666699;"|Always 0x41FE
+
|style="border: 1px solid #666699;"|
|-
 
|style="border: 1px solid #666699;"|Magic2
 
|style="border: 1px solid #666699;"|int16 (2 Bytes)
 
|style="border: 1px solid #666699;"|Always 0x5309
 
 
|-
 
|-
 
|style="border: 1px solid #666699;"|MessageLength
 
|style="border: 1px solid #666699;"|MessageLength
 
|style="border: 1px solid #666699;"|int32 (4 bytes)
 
|style="border: 1px solid #666699;"|int32 (4 bytes)
|style="border: 1px solid #666699;"|
+
|style="border: 1px solid #666699;"|Does *NOT* include the type or length, so is packet size - 6
|-
 
|style="border: 1px solid #666699;"|MsgType
 
|style="border: 1px solid #666699;"|int16 (2 bytes)
 
|style="border: 1px solid #666699;"|
 
 
|-
 
|-
 
|style="border: 1px solid #666699;"|MessageUUID
 
|style="border: 1px solid #666699;"|MessageUUID
Line 57: Line 46:
  
  
====libPKG Part====
+
* '''MsgType:''' 2 byte integer value that tells what type of message this is.
Due to some C and C++ incompatibilities, the libPKG "Type" parameter is used as "Magic2" in the GSNet ProtocolTo address this change, NetMsg routing should be performed on the "GS Msg Type" parameter rather than the "libPKG Type" parameter.
+
* '''MessageUUID:''' Standard UUID for this messageCurrently stored as a string.
<br /><br />
+
* '''HasRegardingUUID:''' Boolean flag that indicates whether there is a Regarding UUID or not.
Table showing modifications described above:
+
* '''RegardingMessageUUID:''' Standard UUID that indicates this NetMsg is a response to another NetMsg.
<br /><br />
 
{|style="border-collapse: separate; border-spacing: 0; border-width: 1px; border-style: solid; border-color: #666699; padding: 0;"
 
|style="border: 1px solid #666699; background-color: #666699; color: #FFFFFF; width: 180px;"|'''libPKG element'''
 
|style="border: 1px solid #666699; background-color: #666699; color: #FFFFFF; width: 180px;"|'''GSNet element'''
 
|-
 
|style="border: 1px solid #666699;"|Magic
 
|style="border: 1px solid #666699;"|Magic01
 
|-
 
|style="border: 1px solid #666699;"|Type
 
|style="border: 1px solid #666699;"|Magic02
 
|-
 
|style="border: 1px solid #666699;"|Length
 
|style="border: 1px solid #666699;"|Length
 
|}
 
 
 
 
 
====GSNet Part====
 
 
 
  
 
----
 
----
  
===Data===
+
==Data==
 
----
 
----
 +
The Data load of a NetMsg is, obivously, the important and unique part.  Data Loads can be as small as zero (in the case of a TypeOnlyMsg) or many kilobytes long.
  
 
+
Here is a list of [[NetMsgTypes|NetMsg types]] and here is a list of [[Common NetMsg Exchanges]].
List of [[NetMsgTypes]].
 
 
List of [[Common NetMsg Exchanges]]
 

Latest revision as of 15:12, 4 May 2011


GSNet
The Geometry Service Network (GSNet) Protocol is a TCP/IP based protocol designed to facilitate socketed communications between Geometry Service Nodes on a network. A Geometry Service Node is defined as any softwares that supports communication via the GSNet Protocol.




GSNet Msg Description[edit]

Header[edit]

The header of the GSNet Msg contains the information necessary for quickly determining authenticity, type and length. Geometry Service's network library, libNetwork, has a header byte layout that looks like this:

Element Length Value
MsgType int16 (2 bytes)
MessageLength int32 (4 bytes) Does *NOT* include the type or length, so is packet size - 6
MessageUUID String (Variable bytes)
HasRegardingUUID Boolean (1 byte)
RegardingMessageUUID String (Variable bytes)


  • MsgType: 2 byte integer value that tells what type of message this is.
  • MessageUUID: Standard UUID for this message. Currently stored as a string.
  • HasRegardingUUID: Boolean flag that indicates whether there is a Regarding UUID or not.
  • RegardingMessageUUID: Standard UUID that indicates this NetMsg is a response to another NetMsg.

Data[edit]


The Data load of a NetMsg is, obivously, the important and unique part. Data Loads can be as small as zero (in the case of a TypeOnlyMsg) or many kilobytes long.

Here is a list of NetMsg types and here is a list of Common NetMsg Exchanges.