2020-04-27 02:07:24 +02:00
|
|
|
FediChordProtocol DEFINITIONS AUTOMATIC TAGS ::= BEGIN
|
|
|
|
|
|
|
|
NodeID ::= INTEGER (0..115792089237316195423570985008687907853269984665640564039457584007913129639935)
|
|
|
|
|
2020-04-28 15:58:53 +02:00
|
|
|
Domain ::= VisibleString
|
|
|
|
|
2020-05-30 13:07:28 +02:00
|
|
|
Partnum ::= INTEGER (0..150)
|
|
|
|
|
2020-04-29 22:55:43 +02:00
|
|
|
Action ::= ENUMERATED {queryID, join, leave, stabilise, ping}
|
|
|
|
|
2020-04-27 02:07:24 +02:00
|
|
|
Request ::= SEQUENCE {
|
2020-04-30 23:32:16 +02:00
|
|
|
action Action,
|
2020-05-20 18:37:56 +02:00
|
|
|
requestID INTEGER (0..4294967295), -- arbitrarily restricting to an unsigned 32bit integer
|
2020-05-04 20:37:16 +02:00
|
|
|
sender NodeState,
|
2020-05-30 13:07:28 +02:00
|
|
|
part Partnum, -- part number of this message, starts at 1
|
|
|
|
finalPart BOOLEAN, -- flag indicating this `part` to be the last of this reuest
|
2020-04-28 15:58:53 +02:00
|
|
|
actionPayload CHOICE {
|
2020-05-04 20:37:16 +02:00
|
|
|
queryIDRequestPayload QueryIDRequestPayload,
|
|
|
|
joinRequestPayload JoinRequestPayload,
|
|
|
|
leaveRequestPayload LeaveRequestPayload,
|
|
|
|
stabiliseRequestPayload StabiliseRequestPayload,
|
|
|
|
pingRequestPayload PingRequestPayload
|
2020-05-15 22:40:20 +02:00
|
|
|
} OPTIONAL -- just for symmetry reasons with response, requests without a payload have no meaning
|
2020-04-28 15:58:53 +02:00
|
|
|
}
|
|
|
|
|
2020-04-30 23:32:16 +02:00
|
|
|
-- idea: different message layouts as a way of distinguishing between
|
|
|
|
-- request and response instead of explicit flag
|
|
|
|
|
2020-04-28 15:58:53 +02:00
|
|
|
Response ::= SEQUENCE {
|
2020-06-08 20:31:18 +02:00
|
|
|
-- requestID of the request responding to
|
|
|
|
requestID INTEGER (0..4294967295), -- arbitrarily restricting to an unsigned 32bit integer
|
2020-04-28 15:58:53 +02:00
|
|
|
senderID NodeID,
|
2020-05-30 13:07:28 +02:00
|
|
|
part Partnum,
|
|
|
|
finalPart BOOLEAN, -- flag indicating this `part` to be the last of this response
|
2020-04-29 22:55:43 +02:00
|
|
|
action Action,
|
2020-04-28 15:58:53 +02:00
|
|
|
actionPayload CHOICE {
|
2020-05-04 20:37:16 +02:00
|
|
|
queryIDResponsePayload QueryIDResponsePayload,
|
|
|
|
joinResponsePayload JoinResponsePayload,
|
|
|
|
leaveResponsePayload LeaveResponsePayload,
|
|
|
|
stabiliseResponsePayload StabiliseResponsePayload,
|
|
|
|
pingResponsePayload PingResponsePayload
|
2020-05-15 22:40:20 +02:00
|
|
|
} OPTIONAL -- no payload when just ACKing a previous request
|
2020-04-28 15:58:53 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
NodeState ::= SEQUENCE {
|
|
|
|
nid NodeID,
|
|
|
|
domain Domain,
|
|
|
|
ipAddr OCTET STRING (SIZE(16)),
|
|
|
|
dhtPort INTEGER,
|
2020-05-21 21:13:58 +02:00
|
|
|
servicePort INTEGER,
|
2020-05-12 11:30:28 +02:00
|
|
|
vServerID INTEGER (0..255)
|
2020-04-28 15:58:53 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
CacheEntry ::= SEQUENCE {
|
|
|
|
node NodeState,
|
2020-04-29 22:55:43 +02:00
|
|
|
-- use POSIX time stamp, as DATE-TIME isn't supported by the Haskell lib
|
2020-04-28 15:58:53 +02:00
|
|
|
timestamp INTEGER
|
|
|
|
}
|
|
|
|
|
|
|
|
NodeCache ::= SEQUENCE OF CacheEntry
|
|
|
|
|
2020-05-04 20:37:16 +02:00
|
|
|
JoinRequestPayload ::= NULL
|
2020-04-28 15:58:53 +02:00
|
|
|
|
2020-05-04 20:37:16 +02:00
|
|
|
JoinResponsePayload ::= SEQUENCE {
|
2020-06-09 15:21:22 +02:00
|
|
|
successors SEQUENCE OF NodeState,
|
|
|
|
predecessors SEQUENCE OF NodeState,
|
2020-04-28 15:58:53 +02:00
|
|
|
cache NodeCache
|
2020-04-27 02:07:24 +02:00
|
|
|
}
|
|
|
|
|
2020-05-04 20:37:16 +02:00
|
|
|
QueryResult ::= ENUMERATED { found, forward }
|
|
|
|
|
|
|
|
QueryIDRequestPayload ::= SEQUENCE {
|
2020-04-28 15:58:53 +02:00
|
|
|
targetID NodeID,
|
|
|
|
lBestNodes INTEGER
|
|
|
|
}
|
|
|
|
|
2020-05-04 20:37:16 +02:00
|
|
|
QueryIDResponsePayload ::= SEQUENCE {
|
2020-04-28 15:58:53 +02:00
|
|
|
result QueryResult,
|
2020-05-04 20:37:16 +02:00
|
|
|
nodeData CHOICE {NodeState, NodeCache}
|
2020-04-28 15:58:53 +02:00
|
|
|
}
|
|
|
|
|
2020-05-04 20:37:16 +02:00
|
|
|
StabiliseRequestPayload ::= NULL
|
2020-04-28 15:58:53 +02:00
|
|
|
|
2020-05-04 20:37:16 +02:00
|
|
|
StabiliseResponsePayload ::= SEQUENCE {
|
2020-06-09 15:21:22 +02:00
|
|
|
successors SEQUENCE OF NodeState,
|
|
|
|
predecessors SEQUENCE OF NodeState
|
2020-04-28 15:58:53 +02:00
|
|
|
-- ToDo: transfer of handled key data, if newly responsible for it
|
|
|
|
}
|
|
|
|
|
2020-05-04 20:37:16 +02:00
|
|
|
LeaveRequestPayload ::= SEQUENCE {
|
2020-06-09 15:21:22 +02:00
|
|
|
successors SEQUENCE OF NodeState,
|
2020-08-17 12:34:47 +02:00
|
|
|
predecessors SEQUENCE OF NodeState,
|
|
|
|
doMigration BOOLEAN
|
2020-04-28 15:58:53 +02:00
|
|
|
}
|
|
|
|
|
2020-05-04 20:37:16 +02:00
|
|
|
LeaveResponsePayload ::= NULL -- just a confirmation
|
2020-04-28 15:58:53 +02:00
|
|
|
|
2020-05-04 20:37:16 +02:00
|
|
|
PingRequestPayload ::= NULL -- do not include a node/ vserver ID, so that
|
2020-04-30 13:37:46 +02:00
|
|
|
-- the node has to respond with all active ones
|
|
|
|
|
|
|
|
-- learning all active vserver IDs handled by the server at once
|
2020-05-04 20:37:16 +02:00
|
|
|
PingResponsePayload ::= SEQUENCE OF NodeState
|
2020-04-30 13:37:46 +02:00
|
|
|
|
2020-04-28 15:58:53 +02:00
|
|
|
|
2020-04-27 02:07:24 +02:00
|
|
|
END
|