ltp#
Pure OCaml implementation of Licklider Transmission Protocol (RFC 5326) for reliable data delivery over high-delay and disruption-prone links.
Overview#
LTP is designed for deep-space communications where round-trip times can be minutes to hours. It provides selective acknowledgment and retransmission with support for both reliable and unreliable data segments.
Features#
- SDNV (Self-Delimiting Numeric Value) encoding/decoding
- Session management with engine/session IDs
- Data segment types:
- Red segments - reliable with acknowledgment
- Green segments - best-effort delivery
- Control segments:
- Report segments (acknowledge received ranges)
- Report-ack segments
- Cancel segments
- Checkpoint and report-based flow control
Installation#
opam install ltp
Usage#
open Ltp
(* Create a session ID *)
let session = { originator = 1L; number = 42L }
(* Encode an SDNV value *)
let encoded = encode_sdnv 127L
(* Decode an SDNV value *)
match decode_sdnv encoded 0 with
| Ok (value, _offset) -> Printf.printf "Value: %Ld\n" value
| Error msg -> Printf.printf "Error: %s\n" msg
Related Work#
References#
Licence#
ISC License. See LICENSE.md for details.