3.1.7.14 Connection Maintenance

Connection Maintenance is the process that attempts to maintain an ideal number of connections to other Graph Nodes, and chooses which connections to keep based on the usefulness of the connections. When Connection Maintenance is performed, the following actions MUST be taken:

  • If the number of neighbor connections is greater than the value of Ideal Neighbors, and this Connection Maintenance is being performed as a result of Graph Maintenance Timer expiration (see section 3.1.6.6):

  • If the number of neighbor connections is zero, a new connection MUST be attempted.

  • If the number of neighbor connections is less than the value of Minimum Neighbors and the fNeverConnected flag is unset, a new connection MUST be attempted.

  • If the number of neighbor connections is less than the Ideal Neighbor Count and the Connection Maintenance is being performed as a result of Graph Maintenance Timer expiration, a new connection MUST be attempted.

  • In order to attempt a new connection, a node MUST first be randomly selected from among the Presence List, Contact List, and Referral List satisfying the following conditions:

    • The node ID of the selected node MUST NOT be equal to the node ID of the local node.

    • The Local node MUST NOT have a connection with the selected node.

  • After a node is selected, a connection to it MUST be attempted, as specified in section3.1.7.24.