Receive REFUSE

This message is sent by the connection responder in response to a CONNECT message. If the message fails to conform to any of the following conditions, then the message MUST be discarded unprocessed and the connection MUST be terminated.

  • The Message Size MUST be at least 0x0C.

  • Address Count * 20 + Address Offset MUST be at most Message Size.

  • Error Code MUST be a value between 0x01 and 0x04, inclusive.

If this message is received, but the Link is not in LINK_STATE_CONNECT_WAIT state the message MUST be ignored and the connection MUST be terminated.

Otherwise, the addresses in the message's address array, if any, MUST be added to the Referral List. If during the insertion of the new addresses, the Referral List reaches its maximum size, the least recently added entries MUST be removed in order to keep the list within its maximum size.

Upon receiving this message, the local node MUST terminate the connection unless Error Code is REFUSE_CODE_ALREADY_CONNECTED.

The Node MUST try to connect to another node selected from the Referral List as described below:

  • A Node MUST be selected at random within the Referral List

  • If a connection attempt has already been made to the selected node, the next node in the list MUST be selected. Step 2 MUST be repeated until a node is identified or all nodes in the list have been scanned.

  • If a node is selected after executing the previous two steps, the local node MUST try to connect to the selected node. The selected node's Referral Entries MUST be flagged to indicate that a connection attempt has been made.