Next: , Up: Packet  


Plain packet

Plain packet contains either the whole file, or file request (freq), or transition packet or email message. It is called "plain", because it contains plaintext, but plain packets would never be stored on your hard drive.

            HEADER
+-------------------------------+--...---+
| MAGIC | TYPE | PATHLEN | PATH | PAYLOAD|
+-------------------------------+--...---+
XDR typeValue
Magic number8-byte, fixed length opaque dataN N C P P 0x00 0x00 0x01
Payload typeunsigned integer0 (file), 1 (freq), 2 (mail), 3 (transition)
Path lengthunsigned integeractual length of path field’s payload
Path255 byte, fixed length opaque data
  • UTF-8 encoded destination path for file transfer
  • UTF-8 encoded source path for file request
  • UTF-8 encoded, space separated, email recipients list
  • Node’s id the transition packet must be relayed on

Path has fixed size because of hiding its actual length – it is valuable metadata. Payload is appended to the header – it is not stored as XDR field, because most XDR libraries will store all that data in the memory.

Depending on the packet’s type, payload could store: