hopr_network_types

Module session

Source
Expand description

Contains implementation of a Session message protocol.

§What is Session protocol?

Session protocol is a simple protocol for unreliable networks that implements basic TCP-like features, such as segmentation, retransmission and acknowledgement.

The goal of this protocol is to establish a read-write session between two parties, where one is a message sender and the other one is the receiver. The messages are called frames which are split and are delivered as segments from the sender to the recipient. The session has some reliability guarantees given by the retransmission and acknowledgement capabilities of individual segments.

§Overview of the module

  • Protocol messages are defined in the protocol submodule.
  • Protocol state machine is defined in the state submodule.
  • Frames, segmentation and reassembly are defined in the frame submodule.

Contains errors thrown from this module.

Modules§

errors
protocol
Session protocol messages
state
Session protocol state machine

Structs§

Frame
Data frame of arbitrary length. The frame can be segmented into segments and reassembled back via FrameReassembler.
FrameInfo
Contains information about a frame that being built. The instances are totally ordered as most recently used first.
FrameReassembler
Represents a frame reassembler.
Segment
Represents a frame segment. Besides the data, a segment carries information about the total number of segments in the original frame, its index within the frame and ID of that frame.
SegmentId
Convenience type that identifies a segment within a frame.

Type Aliases§

FrameId
ID of a Frame.