#ratman #netmod

ratman-netmod

Interface and framing abstraction for Ratman network drivers

6 releases (breaking)

0.5.1 Apr 4, 2021
0.5.0 Mar 2, 2021
0.4.0 Jan 29, 2021
0.3.0 Feb 26, 2020
0.1.0 Jan 30, 2020

#3 in #ratman

Download history 38/week @ 2023-10-31 31/week @ 2023-11-07 31/week @ 2023-11-14 32/week @ 2023-11-21 51/week @ 2023-11-28 24/week @ 2023-12-05 22/week @ 2023-12-12 23/week @ 2023-12-19 36/week @ 2023-12-26 17/week @ 2024-01-02 23/week @ 2024-01-09 34/week @ 2024-01-16 12/week @ 2024-01-23 24/week @ 2024-01-30 23/week @ 2024-02-06 55/week @ 2024-02-13

123 downloads per month
Used in 7 crates (4 directly)

AGPL-3.0

19KB
288 lines

A network module abstraction for Ratman

Netmod provides an async interface to interact with endpoints basic data frame definitions, and frame sequencing.

The interface itself makes no assumption about underlying address spacing or resend behaviour. Using netmod as a library allows you to write Ratman compatible network adapters.

Frames, Sequences and Signatures

A Frame is a single packet that is sent over a network connection. It corresponds (for example) to a UDP packet in other protocols. It contains sender, recipient information, and a sequence indicator (seqid), which is constructed over data slices, and can be reassembled on the other side of a circuit.

When constructing a Frame sequence, the payload is split into appropriately sized chunks, then hashed, and those signature hashes are entered into the sequence ID next sequentially. The following diagram explains the concept further.

|--------------|        |--------------|        |--------------|
|  Frame #1    |        |  Frame #2    |        |  Frame #2    |
| next: f4aa   | ------ | next: bb61   | ------ | next: NONE   |
| sig: a1a1    |        | sig: f4aa    |        | sig: bb61    |
|--------------|        |--------------|        |--------------|

The payload signature is used to validate transport layer integrity (resends are up to a user of this interface to implement, as well as associating sequential frames into a data set.

Dependencies

~3MB
~61K SLoC