guid.rst 576 B

123456789101112131415161718192021
  1. GUID
  2. ====
  3. Each QoS1/2 MQTT message is identified by a 128 bits, k-ordered GUID(global unique ID).
  4. Structure
  5. ---------
  6. ::
  7. --------------------------------------------------------
  8. | Timestamp | NodeID + PID | Sequence |
  9. |<------- 64bits ------->|<--- 48bits --->|<- 16bits ->|
  10. --------------------------------------------------------
  11. 1. Timestamp: erlang:system_time if Erlang >= R18, otherwise os:timestamp
  12. 2. NodeId: encode node() to 2 bytes integer
  13. 3. Pid: encode pid to 4 bytes integer
  14. 4. Sequence: 2 bytes sequence in one process