Difference between revisions of "Deployment Platform/Sneakernet/Packets format"

From Sugar Labs
Jump to navigation Jump to search
(Created page with "Packets' structure: * '''PUSH''' packet: :* {{Code|type}}: {{Code|push}} :* {{Code|src}}: sender's identity to push from :* {{Code|[dst]}}: receiver's identity to push to, op...")
 
Line 1: Line 1:
Packets' structure:
+
== Packets format ==
  
* '''PUSH''' packet:
+
Packets are tarball files with {{Code|.packet}} suffix.
:* {{Code|type}}: {{Code|push}}
+
 
 +
On logic level, every packet consists of:
 +
 
 +
* one header, a dictionary of key-value pairs;
 +
* records, a dictionary of key-value pairs and optional data depending on record type.
 +
 
 +
== Header ==
 +
 
 +
Header is being stored in JSON notation in {{Code|/header}} file in packet tarball.
 +
 
 +
* {{Code|src}}, sender's GUID
 +
* {{Code|dst}}, optional destination GUID
 +
* {{Code|filename}}, suggested file name for packet file, it is assumed to be unique
 +
 
 +
== Record types ==
 +
 
 +
* '''sn_push''':
 +
:* {{Code|cmd}}: {{Code|sn_push}}
 
:* {{Code|src}}: sender's identity to push from
 
:* {{Code|src}}: sender's identity to push from
 
:* {{Code|[dst]}}: receiver's identity to push to, optional for packets from master
 
:* {{Code|[dst]}}: receiver's identity to push to, optional for packets from master

Revision as of 03:01, 27 July 2012

Packets format

Packets are tarball files with .packet suffix.

On logic level, every packet consists of:

  • one header, a dictionary of key-value pairs;
  • records, a dictionary of key-value pairs and optional data depending on record type.

Header

Header is being stored in JSON notation in /header file in packet tarball.

  • src, sender's GUID
  • dst, optional destination GUID
  • filename, suggested file name for packet file, it is assumed to be unique

Record types

  • sn_push:
  • cmd: sn_push
  • src: sender's identity to push from
  • [dst]: receiver's identity to push to, optional for packets from master
  • sequence: Sequence associated with packet's payload
  • ACK packet:
  • type: ack
  • src: master's identity
  • dst: receiver's identity ack is intended for
  • push_sequence: original PUSH packet's sequence
  • pull_sequence: Sequence after merging original PUSH packet
  • PULL packet:
  • type: pull
  • src: sender's identity to pull to
  • dst: receiver's identity to pull from
  • sequence: Sequence to pull for