-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcluster-protocol.txt
42 lines (38 loc) · 1.9 KB
/
cluster-protocol.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
Message types:
Accept: 0x1
Reject: 0x2
Join: 0x3
Status: 0x4
Job: 0x5
Start: 0x6
Stop: 0x7
Finished: 0x8
Disconnect: 0x9
Status values: 0x1 (idle) 0x2 (ready to start) 0x3 (working)
Node ================================================================== Owner
Join[1]:length[4]:'version(major.minor.micro);modules' ==>
<== Accept[1]:length[4]:'name of node' | Reject[1]:length[4]:'reason' Node status: idle
........................................
<== Status[1]
Status[1]:status value[1] ==>
====================== IF IDLE =============================================
<== Job[1]:lengthOfParameters[4]:parameters:lengthOfCode[4]:'code'
Accept[1] | Reject[1]:length[4]:'reason' ==> Node status: ready to start
====================== IF ACCEPT ============================================
<== Start[1]
Start[1]:now[8] | Reject[1]:length[4]:'reason' ==> Node status: working
====================== IF NEED TO STOP ======================================
<== Stop[1]
Accept[1] | Reject[1]:length[4]:'reason' ==> Node status: idle
........................................
Finished[1]:length[4]:now;'result' ==>
<== Accept[1]
........................................
Disconnect[1]:length[4]:'reason' ==>
========================================================================================
Both node and owner can issue Disconnect message at any time:
Disconnect[1]:length[4]:'reason'
Node sends packet as on line 19 when its status changes.
Semicolons are there to denote boundaries, they are never transmitted over the wire.
While technically, message length can be up to 4GB, maximum valid message length is limited to 256MB for convenience of buffer allocation.
All transfering time must be presentated in unix64