Next: Encrypted packet, Up: Packet format [Index]
Plain packet contains either the whole file, or file request (freq), or transition packet or exec message. It is called "plain", because it contains plaintext, but plain packets would never be stored on your hard drive.
HEADER +--------------------------------------+--...---+ | MAGIC | TYPE | NICE | PATHLEN | PATH | PAYLOAD| +--------------------------------------+--...---+
XDR type | Value | |
---|---|---|
Magic number | 8-byte, fixed length opaque data | N N C P P 0x00 0x00 0x03 |
Payload type | unsigned integer |
|
Niceness | unsigned integer | 1-255, preferred packet niceness level |
Path length | unsigned integer | actual length of path field’s payload |
Path | 255 byte, fixed length opaque data | Depending on packet’s type, path holds:
|
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 XDR has no ability to pass more than 4 GiB of opaque data. Moreover most XDR libraries store fields in the memory in practice.
Depending on the packet’s type, payload could store:
Also depending on packet’s type, niceness level means:
$NNCP_NICE
variable’s value passed during CfgExec invocation.
So plain packets can hold following paths and payloads:
file
+--------------- PATH ---------------+ +---- PAYLOAD ---+ / \ / \ +----------------------------------------+---------------...--+ | FILENAME | 0x00 ... variable ... 0x00 | FILE CONTENTS | +----------------------------------------+---------------...--+ \ / PATHLEN
freq
+--------------- PATH ---------------+ +---- PAYLOAD ---+ / \ / \ +----------------------------------------+---------------...--+ | FILENAME | 0x00 ... variable ... 0x00 | FILENAME | +----------------------------------------+---------------...--+ \ / PATHLEN
exec
+------------------------- PATH ----------------------------+ +---- PAYLOAD ---+ / \ / \ +---------------------------------------------------------------+---------------...--+ | HANDLE 0x00 | ARG0 0x00 ARG1 ...| 0x00 ... variable ... 0x00 | ZSTD DATA | +---------------------------------------------------------------+---------------...--+ \ / +-------- PATHLEN -------------+
exec-fat
+------------------------- PATH ----------------------------+ +---- PAYLOAD ---+ / \ / \ +---------------------------------------------------------------+---------------...--+ | HANDLE 0x00 | ARG0 0x00 ARG1 ...| 0x00 ... variable ... 0x00 | DATA | +---------------------------------------------------------------+---------------...--+ \ / +-------- PATHLEN -------------+
trns
+------- PATH ---------+ +---- PAYLOAD ---+ / \ / \ +--------------------------+---------------...--+ | NODE ID | 0x00 ... 0x00 | ENCRYPTED PACKET | +--------------------------+---------------...--+ \ / PATHLEN
area
+------- PATH ---------+ +---- PAYLOAD ---+ / \ / \ +--------------------------+---------------...--+ | AREA ID | 0x00 ... 0x00 | ENCRYPTED PACKET | +--------------------------+---------------...--+ \ / PATHLEN
See also encrypted area packet.
ack
+------- PATH --------+ / \ +-------------------------+ | PKT ID | 0x00 ... 0x00 | +-------------------------+ \ / PATHLEN
Next: Encrypted packet, Up: Packet format [Index]