PROTOCOL 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. Unfortunetaly, on L2 all messages are sending to all members of the cluster.
  2. unicast: dst_node_id == node_id
  3. broadcast: dst_node_id == NOID
  4. session example of two nodes (A and B):
  5. "A" appears (getting node_id):
  6. A -> hello (serial: 0; src: NOID ; dst: NOID; name: A) | cluster_init()
  7. A -> register (serial: 1; src: 0 ; dst: NOID; name: A) |
  8. Trying to sync with somebody:
  9. A -> updtree (serial: 2; src: 0 ; dst: NOID; [A modtree])
  10. "B" appears (getting node_id):
  11. B -> hello (serial: 0; src: NOID ; dst: NOID; name: B) | cluster_init()
  12. A -> welcome (serial: 3; src: 0 ; dst: NOID; my_name: A; to_name: B)
  13. B -> register (serial: 1; src: 1 : dst: NOID; name: B) |
  14. A -> ack (serial: 4; src: 0 ; dst: 1; ack_serial: 1)
  15. Initial syncing A <-> B:
  16. B -> updtree (serial: 2; src: 1 ; dst: NOID; [B modtree])
  17. A -> updtree (serial: 5; src: 0 ; dst: NOID; [A modtree])
  18. A -> lock (serial: 6: src: 0 ; dst: NOID; [paths list])
  19. B -> ack (serial: 2; src: 1 ; dst: 0; ack_serial: 6)
  20. B -> lock (serial: 3: src: 1 ; dst: NOID; [paths list])
  21. A -> ack (serial: 7; src: 0 ; dst: 1; ack_serial: 3)
  22. A -> unlockall (serial: 8: src: 0 ; dst: NOID)
  23. B -> ack (serial: 4; src: 1 ; dst: 0; ack_serial: 8)
  24. B -> unlockall (serial: 5: src: 1 ; dst: NOID)
  25. A -> ack (serial: 9; src: 0 ; dst: 1; ack_serial: 5)
  26. Just syncing A -> B:
  27. A -> lock (serial: 10: src: 0 ; dst: NOID; [paths list])
  28. B -> ack (serial: 6; src: 1 ; dst: 0; ack_serial: 10)
  29. A -> unlockall (serial: 11: src: 0 ; dst: NOID)
  30. B -> ack (serial: 7; src: 1 ; dst: 0; ack_serial: 11)
  31. "A" disappers (shutdown)
  32. "A" appears (registering with old node_id)
  33. A -> hello (serial: 0; src: NOID ; dst: NOID; name: A)
  34. B -> welcome (serial: 4; src: 1 ; dst: 0; my_name: B; to_name: A)
  35. A -> register (serial: 1; src: 0 ; dst: NOID; name: A)
  36. B -> ack (serial: 5; src: 1 ; dst: 0; ack_serial: 1)
  37. [...]