Skip to main content

Crate udp_prague

Crate udp_prague 

Source
Expand description

UDP Prague (L4S) example project ported to Rust.

This crate aims to be a near-literal port of the reference C++ code, keeping file/module structure and function naming close enough that it is easy to compare the two implementations line-by-line.

The hot path is the congestion controller (PragueCC) and related packet parsing. Those modules avoid heap allocations and preserve the original wrap-around arithmetic semantics.

The reusable protocol/runtime surface is always available. The higher-level session wrappers are behind the session feature. The demo application’s CLI/reporting adapter (app_stuff) is behind the demo-app feature.

Module layout:

  • udp_prague::core: runner loops, config, reporting, and errors.
  • udp_prague::congestion: Prague CC algorithm/types.
  • udp_prague::protocol: packet formats and wire helpers.
  • udp_prague::net: UDP socket backend.
  • udp_prague::core session wrappers: available with the session feature.
  • udp_prague::demo: reference-style CLI/reporting layer (demo-app only).

Re-exports§

pub use crate::congestion::prague_cc;
pub use crate::core::error;
pub use crate::core::runner;
pub use crate::core::runtime;
pub use crate::demo::app as app_stuff;
pub use crate::demo::json_writer;
pub use crate::net::udpsocket;
pub use crate::protocol::pkt_format;
pub use crate::congestion::cca_tp;
pub use crate::congestion::count_tp;
pub use crate::congestion::cs_tp;
pub use crate::congestion::ecn_tp;
pub use crate::congestion::fps_tp;
pub use crate::congestion::prob_tp;
pub use crate::congestion::rate_tp;
pub use crate::congestion::size_tp;
pub use crate::congestion::time_tp;
pub use crate::congestion::window_tp;
pub use crate::congestion::PragueBitrateAction;
pub use crate::congestion::PragueCC;
pub use crate::congestion::PragueCongestionSignal;
pub use crate::congestion::PragueRateAdvice;
pub use crate::congestion::PragueState;
pub use crate::congestion::PragueVideoRateAdvice;
pub use crate::congestion::PRAGUE_INITMTU;
pub use crate::congestion::PRAGUE_MAXRATE;
pub use crate::congestion::PRAGUE_MINRATE;
pub use crate::core::AppError;
pub use crate::core::SessionError;
pub use crate::core::PragueAckCounters;
pub use crate::core::PragueAckFeedback;
pub use crate::core::PragueAckReport;
pub use crate::core::PragueBulkTransferReport;
pub use crate::core::PragueFrameWindowMetrics;
pub use crate::core::PraguePacketWindowMetrics;
pub use crate::core::PragueQueuedVideoFrame;
pub use crate::core::PragueReceivedBulkPacket;
pub use crate::core::PragueReceivedBulkPacketView;
pub use crate::core::PragueReceivedFramePacket;
pub use crate::core::PragueReceivedFramePacketView;
pub use crate::core::PragueReceivedPacket;
pub use crate::core::PragueReceivedPacketAndAck;
pub use crate::core::PragueReceivedPacketAndAckView;
pub use crate::core::PragueReceivedPacketView;
pub use crate::core::PragueReceivedSegment;
pub use crate::core::PragueReceivedVideoFrame;
pub use crate::core::PragueReceiverReassemblyLimits;
pub use crate::core::PragueReceiverSession;
pub use crate::core::PragueRecvAckEvent;
pub use crate::core::PragueRecvDataEvent;
pub use crate::core::PragueRecvRfc8888AckEvent;
pub use crate::core::PragueSegmentReceiverSession;
pub use crate::core::PragueSegmentSendReport;
pub use crate::core::PragueSegmentSenderSession;
pub use crate::core::PragueSendAckEvent;
pub use crate::core::PragueSendDataEvent;
pub use crate::core::PragueSendFrameDataEvent;
pub use crate::core::PragueSendReport;
pub use crate::core::PragueSendRfc8888AckEvent;
pub use crate::core::PragueSenderSession;
pub use crate::core::PragueSessionConfig;
pub use crate::core::PragueVideoAckFeedback;
pub use crate::core::PragueVideoReceiverSession;
pub use crate::core::PragueVideoSendReport;
pub use crate::core::PragueVideoSenderSession;
pub use crate::core::PragueVideoSessionConfig;
pub use crate::core::Reporter;
pub use crate::core::RunnerConfig;
pub use crate::core::FRAME_DURATION;
pub use crate::core::FRAME_PER_SECOND;
pub use crate::core::PORT;
pub use crate::core::RFC8888_ACKPERIOD;
pub use crate::core::RunnerError;
pub use crate::core::UdpSocketError;
pub use crate::net::Endpoint;
pub use crate::net::SocketPlatformSupport;
pub use crate::net::UDPSocket;

Modules§

congestion
Prague congestion-control types and logic.
core
Reusable library runtime surface.
demo
Demo application compatibility layer.
facade
A “drop-in” compatibility facade that re-exports the primary types. Drop-in facade re-exporting the public API.
net
Network/socket backend used by the runtime.
protocol
UDP Prague packet formats and wire helpers.