Responding-Node Routing State Machine

Incoming Events

Name Meaning
tg_Query_Rcvd Node receives a Query message.
tg_Data_Rcvd Node receives a message containing no cookies.
tg_Confirm_Rcvd Node receives a Confirm message.
tg_NSLP_Data_To_Send A SendMessage event is received from the API requesting transmission of a message.
tg_Set_QRNode_Lifetime A SetStateLifetime event is received from the API.
to_Expire_RNode A timeout is received indicating that the RS should be expired. Note: state may not be refreshed from the R-Node
to_No_Confirm A timeout is received indicating that we have not received a confirm for this RS where one was expected.
er_MA_Destroyed The MA was destroyed when we weren't expecting it. This is most likely caused by an network problem.

Outgoing Events

Name Meaning
tg_Msg_To_Send Queue a downstream message for transmission in D or C-Mode. The message type to transmit is indicated in brackets.
er_Bad_MA_Event Indicate that the MA received an event it wasn't expecting.
er_Msg_Tx_Error Indicate to the relevant NSLP that a message has failed to be transmitted.
er_msg_Rx_Error Indicate that an error was encountered processing an incoming message.

Actions

Name Meaning
setExpireRNodeTimer (Re)set the Expire RS timer for this RS.
createMA Create a new MA for this flow.
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.
cleanupRNode Destroy the RS cleanly. This includes destroying the associated MA if it is no longer referenced by an RSs.
setConfirmTimer Set the Confirm not received timer.
clearConfirmTimer Clear the Confirm not received timer.
storeMsg If an MA is not yet available, messages must be stored by Flow/NSLP until a suitable MA is established.
storedMsgsToSend Pass any stored messages for this Flow/NSLP to the appropriate MA for transmission.

Predicates

Name Meaning
isCookie Packet contains a Query Cookie
maExists A suitable MA already exists for this flow.
confirmRequired A confirm message is required for this flow / NSLP / Direction.

Extended Event-State Table

State Transitions


Current State
Incoming Event [Start] Awaiting Confirm Established
tg_Query_Rcvd 1 0 0
tg_Confirm_Rcvd 2 3 0
tg_Data_Rcvd 0 0 8
tg_NSLP_Data_To_Send 0 5 4
tg_Set_QRNode_Lifetime 0 6 6
to_Expire_RNode 0 7 7
to_No_Confirm 0 7 0
er_MA_Destroyed 0 7 7

Processing Rules

Rule Actions / Outgoing Events Next State
0 er_Bad_RS_Event
Present State
1 if !maExists:
  createMA
tg_Msg_To_Send (Response)
if confirmRequired:
  setConfirmTimer
else:
  # do nothing




Awaiting Confirm

Established
2 if !maExists:
  createMA

Established
3 clearConfirmTimer, storedMsgsToSend
Established
4 tg_Msg_To_Send (Data)
Present State
5 storeMsg
Present State
6 setExpireRNodeTimer
Present State
7 cleanupRNode

8 handleNSLPData
Present State