Query-Node Routing State Machine

Incoming Events

Name Meaning
tg_Initialise_QNode This RS has just been created.
tg_Response_Rcvd Node receives a Response message.
tg_Data_Rcvd Node receives a message containing no cookies.
tg_NSLP_Data_To_Send An event is received from Command Processing requesting transmission of a message in the downstream direction.
tg_Set_QRNode_Lifetime An event is received from Command Processing setting the lifetime of this RS.
to_Refresh_QNode A timeout is received indicating that the RS should be refreshed.
to_Resend_Query_Msg A timeout is received indicating that a Query message should be retransmitted.
to_Expire_QNode A timeout is received indicating that the RS should be expired.
to_No_Response A timeout is received indicating that no Response has been received in answer to our first Query.
er_MA_Destroyed The MA was destroyed when we weren't expecting it. This is most likely caused by an network problem.
to_Inactive_Qnode This Q-Node is inactive.

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_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.
er_Bad_RS_Event Indicate that the MA received an event it wasn't expecting.
er_SecInfo_Error Indicate that an error was encountered processing SecInfo.

Actions

Name Meaning
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.
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.
setQNodeLifeTimers (Re)set the RefreshRS timer, ExpireRS timer and Inactive timer for this flow.
cleanupQNode Destroy the RS cleanly. This includes destroying th associated MA if it is no longer referenced by an RSs.
startNoResponseTimer Start the NoResponse timer.
stopNoResponseTimer Stop the NoResponse timer.
storeSecHandle If the API call to sendMessage included a SecHandle store it for passing to the MA when it is created.
setQNodeInactiveTimer (Re)set the inactive timer for this state machine.

Predicates

Name Meaning
isCookie Packet contains a Responder Cookie
maExists A suitable MA already exists for this flow.
msgsStored There are messages queued for this flow for transmission in C-Mode.
inactiveCount A count of the number of refresh periods which have passed without activity for this RS. If this count reaches maxInactiveCount the RS is expired.
isSecInfo SecInfo is included in the API call to sendMessage.
secInfoMatches The SecInfo provided matches that of the MA used by this RS.

Extended Event-State Table

State Transitions


Current State
Incoming Event [Start] Awaiting Response Established Awaiting Refreash
tg_Initialise_QNode 1 0 0 0
tg_Response_Rcvd 0 2 0 2
tg_Data_Rcvd 0 0 7 7
tg_NSLP_Data_To_Send 0 3 8 8
tg_Set_QRNode_Lifetime 0 4 4 4
to_Refresh_QNode 0 0 5 0
to_Resend_Query_Msg 0 5 0 5
to_Expire_QNode 0 0 6 6
to_No_Response 0 6 0 0
er_MA_Destroyed 0 0 6 6
to_Inactive_Qnode 0 6 6 6

Processing Rules

Rule Actions / Outgoing Events Next State
0 er_Bad_RS_Event
Present State
1 setQNodeLifeTimers, tg_Msg_To_Send(Query), setQueryResendTimer, startNoResponseTimer, storeSecHandle
Awaiting Response
2 if !maExists:
  createMA
if isCookie:
  tg_Msg_To_Send (Confirm)
setQNodeLifeTimers, handleNSLPData, storedMsgsToSend, clearQueryResendTimer, stopNoResponseTimer




Established
3 if isSecInfo:
  er_SecInfo_Error
else:
  storeMsg
  setQNodeInactiveTimer

Present State


Present State
4 setQNodeLifeTimers
Present State
5 tg_Msg_To_Send (Query), setQueryResendTimer
Present State
6 cleanupQNode

7 handleNSLPData, setQNodeLifeTimers, setQNodeInactiveTimer
Present State
8 maExists:
  if isSecInfo && !secInfoMatches:
    er_SecInfo_Error
  else:
    tg_Msg_To_Send (Data), setQNodeInactiveTimer
else:
  er_Msg_Tx_Error


Present State

Present State

Present State