3.1.1 Abstract Data Model
This section describes a conceptual model of possible data organization that an instance of an implementation maintains to participate in this protocol. The described organization is provided to facilitate the explanation of how the protocol behaves. This document does not mandate that implementations adhere to this model as long as their external behavior is consistent with that described in this document.
Note that multiple instances of the implementation can reside on a single host, corresponding to multiple graphs. Each instance, however, is associated with a single graph.
Presence Lifetime: (unsigned integer value) : The lifetime, in seconds, for which presence records MUST be published. This value is specified by the application when creating the graph and published in the graph info record. Each Node in the graph will read this value from the graph info record.
Max Presence Records: An integer value specifying the maximum number of presence records to be published in the graph. This value is specified by the application when creating the graph and received by other nodes in the graph info record.
Force Publish Presence: A flag indicating whether the application has requested the local node to publish its presence record. For more details, see section 3.1.4.6.
Max Record Size: An integer value specifying the maximum size of a record. This value is specified by the application when creating the graph, and received by other nodes in the graph info record.
Peer ID: A string identifying the local node's user. This string is used inside the protocol to identify a user in the graph.
Node ID: (64 bit unsigned integer): An instance of a node.
Graph ID: A string identifying a graph.
Friendly Name: A null-terminated Unicode string containing a friendly name for the graph.
Comment: A null-terminated Unicode string containing a comment used to describe the graph.
Database: A set of all the records that have been published in the graph that have not yet expired.
GraphSecurityProvider: A pointer to a configured graph security provider to be used to provide security for this Graph.
Max Frame Size: The largest message size supported by the graph security provider, in bytes. This value cannot exceed 32,768 bytes.
Defer Expiration: A Boolean flag indicating whether the graph SHOULD expire records when not connected.
Scope: An integer value indicating the IPv6 scope of the graph as defined in [RFC2460]. MUST be one of the following values:
-
Value
Meaning
PEER_GRAPH_SCOPE_GLOBAL
(0x01)
The IP addresses for the peer graph's network scope can be from any unblocked address range.
PEER_GRAPH_SCOPE_SITELOCAL
(0x02)
The IP addresses for the peer graph's network scope MUST be within the IP range defined for the site.
PEER_GRAPH_SCOPE_LINKLOCAL
(0x03)
The IP addresses for the peer graph's network scope MUST be within the IP range defined for the local area network.
Deferred Record List: A list of records that have been received, but that the graph security provider could not validate immediately. At some point in the future, the graph security provider will ask for these records to be re-validated.
Signature: The signature of the graph, as viewed by the local node.
Contact List: A list of the current graph contacts, including, for each, its IP address, port, view of the graph signature, Peer ID, and Contact Record Id.
ContactMin: The minimum number of contacts permitted to be present in the graph at any given time. This value is calculated as described in section 3.1.7.12.
ContactMax: The maximum number of contacts permitted to be present in the graph at any given time. This value is calculated as described in section 3.1.7.12.
Presence List: A list of all the nodes in the graph that are publishing presence records, including, for each, its node ID, IP addresses, ports, Peer ID, and Presence Record Id.
Peer Time Delta: The delta that, when applied to the UTC time as seen by the local node, will result in Peer Time. For more details, see section 3.1.5.2.2.
Peer Time: The time value calculated by applying the Peer Time Delta to the UTC time of the local node: PT = localUTCtime - PeerTimeDelta
TConnect: A FILETIME, A 64-bit value that represents a time, as specified in [MS-RPCE] section 6, value storing the sender's Peer Time when a CONNECT message is sent.
Referral Entry: A data structure containing a node ID, an IP address, a port, an integer sequence number indicating order of receipt, and a flag indicating whether a Connection attempt has been made to the node.
Referral List: A list of Referral Entries for referrals that have been received in WELCOME and REFUSE messages. The maximum size for this list MUST be 100 entries. This is used to store referrals received from neighbor nodes.
Neighbor List: A list of the local node's neighbors, including, for each, the remote node's Peer ID, Node ID, IP addresses, port, and current connection utility, and an integer sequence number indicating order of inclusion in the list.
Minimum Neighbors: The minimum number of neighbors that a node is configured to require. The default value is 2.
Ideal Neighbors: The ideal number of neighbors that a node is configured to converge on. The default value is 3.
Maximum Neighbors: The maximum number of neighbors that a node will allow. The default value is 7.
IsListening: A Boolean value indicating whether the node is currently listening for incoming connections.
Listening addresses: The list of addresses the node is listening on. This list is kept updated by the local node.
fNeverConnected: A Boolean flag that indicates whether the node's database has been previously synchronized.
Record Notify List: A list of record types for which the application has requested a notification.
fAcceptDirectConnection: A Boolean flag that indicates whether the node MUST accept incoming direct connections. For more details, see section 3.1.5.2.1.
SYNC_TYPE: A variable indicating the current synchronization operation (if any) for each connection. Values are in the following set: {NONE_SYNC_ALL, SYNC_HASH, SYNC_TIME}.
Sync Record Types: An array containing a list of record types to be synchronized during a synchronize operation on a particular connection. Each element of the array contains a GUID storing the value of the Record Type and a Boolean flag indicating whether the Record Type has been synchronized.
Current Sync Record Type: For each connection, a pointer to the element of Sync Record Types corresponding to the record type (if any) currently being synchronized on that connection.
All Record Types Synched: For each connection, a flag indicating whether all record types have been synchronized during a synchronization operation.
Prioritized Record Types: An application-provided array containing a list of record types that will have high priority during synchronization operations.
Records To Send: A list of records to be flooded to the responder node during a SYNC_HASH operation.
Direct Connection: A flag associated with a Connection to indicate the connection type (direct connection or neighbor connection).
Connection: An object associated with a socket connection, either outgoing or incoming.
The following states are defined to keep track of the state of each connection; a connection MUST always be in exactly one of the following states:
Incoming Connections (see section 3.1.7.26)
IN_CONN_STATE_ALLOC: A connection object to handle the incoming connection has been allocated.
IN_CONN_STATE_ACCEPTED: The socket connection has succeeded.
IN_CONN_STATE_GOT_AUTHINFO: An AUTH_INFO message has been received on the connection.
IN_CONN_STATE_AUTHENTICATED: The connection has been successfully authenticated.
IN_CONN_STATE_DISCONNECTED: The socket associated with this connection has been disconnected.
Outgoing Connections (see section 3.1.7.24)
OUT_CONN_STATE_ALLOC: A connection object to handle the outgoing connection has been allocated.
OUT_CONN_STATE_SOCKET: The outgoing socket has been successfully set up.
OUT_CONN_STATE_SOCK_CONNECTED: The outgoing socket is connected.
OUT_CONN_STATE_SENT_AUTHINFO: An AUTH_INFO message has been sent on the connection.
OUT_CONN_STATE_AUTHENTICATED: The connection is authenticated.
OUT_CONN_STATE_DISCONNECTED: The socket associated with this connection has been disconnected.
Link: An object representing a connection to a neighbor.
The following set of states is used to keep track of the state of a link: a link MUST always be in exactly one of the followed states (see sections 3.1.7.24 and 3.1.7.26).
LINK_STATE_START: The link has been created, but no network connection has been made.
LINK_STATE_AUTHENTICATED: The network connection has been established.
LINK_STATE_CONNECT_WAIT: A CONNECT message has been sent, and the link is waiting for a response.
LINK_STATE_CONNECTED: The neighbor relationship has been established.
LINK_STATE_DISCONNECTING: The link is disconnecting.
LINK_STATE_DISCONNECTED: The link is no longer connected.
LINK_STATE_CONNECT_FAILED: The connection supporting this link failed.
Note that the above conceptual data can be implemented using a variety of techniques. An implementation is at liberty to implement such data in any way it pleases.