Module internet2::transport

source ·
Expand description

LNP transport level works with framed messages of defined size. This messages can be put into different underlying transport protocols, including streaming protocols (like TCP), or overlaid over application-level protocols like HTTP, Websockets, SMTP (for high-latency communication networks). Current mod implements such overlays and provides TCP with the required framing functionality (this variant is called FTCP). It also integrates with ZMQ such that the upper level can abstract for a particular transport protocol used.

Re-exports

pub use zeromq::ZmqConnectionType;
pub use zeromq::ZmqSocketType;

Modules

Types generic over specific implementations
Noise_XK protocols: reads & writes frames (corresponding to LNP messages) from TCP stream according to Brontide BOLT-8 requirements or LNP/BP Brontozaur protocol.
Framed TCP protocol: reads & writes frames (corresponding to LNP messages) from TCP stream

Structs

Enums

Transport protocol-level errors

Constants

Size of the frame prefix which is not included into payload size, consisting of the 2-bytes message size data and 16-byte MAC of the payload length
Size of the frame suffix represented by a 16-byte MAC of the frame payload
Maximum size of the frame payload which may be expressed by two bytes
Maximum size of the transport frame; chosen in compliance with LN specs

Traits

Marker trait for types that can provide a concrete implementation for both frame parser implementing RecvFrame and frame composer implementing SendFrame. These types must also implement amplify::Bipolar, i.e. they must be splittable into the receiving and sending half-types.
Frame receiving type which is able to parse raw data (streamed or framed by an underlying overlaid protocol such as ZMQ, HTTP, Websocket).
Frame sending type which is able to compose frame with a given raw data and send it via an underlying overlaid protocol such as ZMQ, HTTP, Websocket.