Node Level State Transition Table

Incoming Events

Name Meaning
tg_Msg_Rcvd A GIMPS message has been received in D or C-Mode.
tg_SendMessage A SendMessage event from the API.
tg_InvalidateRoutingState An InvalidateRoutingState event from the API.
tg_SetStateLifetime A SetStateLifetime event from the API.

Outgoing Events

Name Meaning
tg_Data_Rcvd A GIMPS message containing data only has been received in D or C-Mode.
tg_Query_Rcvd A GIMPS Query has been received in D or C-Mode.
tg_Response_Rcvd A GIMPS Response has been received in D or C-Mode.
tg_Confirm_Rcvd A GIMPS Confirm has been received in D or C-Mode.
er_Malformed_Msg_Rcvd Indicate that a malformed GIMPS message has been received.
tg_Msg_To_Send Queue a D-Mode message for transmission.
tg_NSLP_Data_To_Send Pass the NSLP data to the Q or R-Node state machine for transmission.
tg_Set_QRNode_Lifetime Set the lifetime of a Q or R-Node state machine.
er_Bad_API_Call_Parameters Bad parameter(s) passed with API call.
er_No_QRNode No matching Q or R-Node state machine exists for this flow / NSLP.

Actions

Name Meaning
createRNode Create an RNode state machine for this flow / NSLP.
handleNSLPData Pass any NSLP contained in the message to the relevant NSLP. If no such NSLP is registered then create a tg_SendMsg event for the Q-Node state machine on this node.
forwardMsg Forward the message to the next node along the flow path without passing information to any NSLP. Before the message is forwarded any alterations to the TTL etc are made.
createQNode Create a Q-Node state machine for this flow / NSLP. Can only be done by the Querying node at the Command processing level.
destroyQRNode Destroy a Q or R-Node state machine.

Predicates

Name Meaning Possible Values
msgType The received message type. DATA_ONLY, QUERY, RESPONSE, CONFIRM
stateless State may not be stored for this flow / NSLP. TRUE, FALSE
qrNodeExists A Q or R-Node state machine exists for this flow / NSLP. TRUE, FALSE
waitForConfirm A new Q or R-Node state machine may not be created for this flow/NSLP until a Confirm is received.
requestConfirm A confirm message is required for this flow/NSLP
nslpExists An NSLP capable of handling the message exists on this node.
toRNode The message is to be sent to the R-Node. TRUE, FALSE

Extended Event-State Table

State Transitions


Current State
Incoming Event Idle
tg_Msg_Rcvd 0
tg_SendMessage 1
tg_InvalidateRoutingState 2
tg_SetStateLifetime 3

Processing Rules

Rule Actions / Outgoing Events Next State
0 if nslpExists:
  if stateless:
    if msgType = QUERY
      handleNSLPData
      tg_Msg_To_Send (Response)
    elif msgType = RESPONSE
      handleNSLPData
    else:
      er_Malformed_Msg_Rcvd
  else:
    if msgType = DATA_ONLY && qrNodeExists:
      tg_Data_Rcvd
   elif msgType = QUERY:
     if qrNodeExists:
       tg_Query_Rcvd
     else:
       if !waitForConfirm:
         createRNode
       tg_Msg_To_Send (Response)
   elif msgType = RESPONSE && qrNodeExists:
     tg_Response_Rcvd
   elif msgType = CONFIRM
     if qrNodeExists:
       tg_Confirm_Rcvd
     elif waitForConfirm:
       createRNode
   else:
     er_Malformed_Msg_Rcvd
else:
  forwardMsg





























Idle
1 if toRNode:
  if stateless:
    tg_Msg_To_Send (Query)
  else:
    if !qrNodeExists:
      createQNode
    tg_NSLP_Data_To_Send
else:
  if stateless:
    er_Bad_API_Call_Parameters
  else:
    if !qrNodeExists:
      er_No_QRNode
    else:
      tg_NSLP_Data_To_Send














Idle
2 if qrNodeExists:
  destroyQRNode
else:
  er_No_QRNode



Idle
3 if qrNodeExists:
  tg_Set_QRNode_Lifetime
else:
  er_No_QRNode



Idle