Skip to main content

Crate zerodds_transport_tsn

Crate zerodds_transport_tsn 

Source
Expand description

DDS Extensions for Time Sensitive Networking (DDS-TSN) 1.0.

Crate zerodds-transport-tsn. Safety classification: STANDARD. Spec formal/2024-05-16 (docs/standards/cache/omg/dds-tsn-1.0-beta2.pdf).

§Scope

We implement the configuration model PIM (Spec §7.2) and the DDSI-RTPS Ethernet PSM (Spec Annex A) as a pure-Rust no_std+alloc library:

  • IEEE802VlanTag (Spec Tab 7.21) — TPID + PCP + DEI + VID per IEEE 802.1Q.
  • IEEE802MacAddresses (Spec Tab 7.20) — 6-byte MAC with multicast/broadcast detection.
  • TrafficSpecification (Spec Tab 7.16) — Interval/Max-Frame-Size/ Max-Frames-per-Interval/Transmission-Selection per IEEE 802.1Qcc.
  • TimeAware (Spec Tab 7.17) — earliest/latest_transmit_offset + jitter per IEEE 802.1Qbv.
  • TsnTalker + TsnListener + TsnConfiguration (Spec Tab 7.15 + 7.24 + Figure 7.3) — stream configuration model incl. network_requirements + datawriter_ref.
  • NetworkRequirements (Spec Tab 7.18/7.25) — num_seamless_trees
    • max_latency (IEEE 802.1CB FRER redundancy + latency bound).
  • DataFrameSpecification (Spec Tab 7.19) — frame header filter with MAC + VLAN + IPv4/v6 tuple (incl. dscp from Tab 7.22/7.23).
  • Dscp (RFC 2474) — Differentiated Services Code Point.
  • YANG PSM (Spec §7.3.3, pim::yang) — transformation of the configuration model into group-talker/group-listener (UNI CUC→CNC), incl. stream-id-type, interface-capabilities and an RFC-7951 YANG-JSON renderer. The XML/JSON PSM (§7.3.1/§7.3.2) is in pim::xml/pim::json.
  • Live AF_PACKET transport (Spec Annex A, feature live, Linux) — socket::TsnTransport sends/receives RTPS directly in the Ethernet frame (EtherType 0x88B5); frame logic in live_frame.

§What is not covered

  • TSN UNI wire protocol — proprietary (caller layer, dependent on the bridge vendor such as Cisco IE/Hirschmann/etc.). We provide the YANG group representation (§7.3.3); its transport over the concrete UNI protocol is the caller layer.
  • Hardware acceleration (TX timestamping via SO_TIMESTAMPING/PHC) — caller layer with an OS-specific API.
  • gPTP / 802.1AS time-sync daemon — caller layer (typically linuxptp/ptp4l external).

§Hardware validation (as of 2026-06)

The configuration model, the PSM renderers (YANG/XML/JSON) and the frame/wire logic (ethernet_psm + live_frame) are hardware-independent and fully unit-tested. Not verified against real TSN hardware are the time-critical guarantees themselves — time-aware shaping (IEEE 802.1Qbv), frame preemption (802.1Qbu), FRER redundancy (802.1CB) and gPTP sync (802.1AS) — as well as the throughput/ latency of the live AF_PACKET path (socket, feature live). This is not a code blocker, but a pure validation gap: TSN-capable NIC/switch hardware (with a configured Qbv gate schedule + PTP grandmaster) is currently missing. On such hardware the live path is the integration point; the TSN guarantees are then provided by the network (bridges) + an external ptp4l/tc-taprio, which this library configures rather than enforces itself.

Re-exports§

pub use data_frame::DataFrameSpecification;
pub use data_frame::IPv4Tuple;
pub use data_frame::IPv6Tuple;
pub use dscp::Dscp;
pub use ethernet_psm::ETHERTYPE_RTPS;
pub use ethernet_psm::EthernetFrameHeader;
pub use mac::MacAddress;
pub use network_requirements::NetworkRequirements;
pub use stream::StreamIdentifier;
pub use stream::TsnConfiguration;
pub use stream::TsnListener;
pub use stream::TsnTalker;
pub use time_aware::TimeAware;
pub use traffic::TrafficSpecification;
pub use traffic::TransmissionSelection;
pub use vlan_tag::Ieee802VlanTag;
pub use vlan_tag::TPID_8021AD;
pub use vlan_tag::TPID_8021Q;
pub use config::ConfigError;
pub use config::DeploymentLibrary;
pub use config::DomainLibrary;
pub use config::QosProfileEntry;
pub use config::TsnQosLibrary;
pub use config::parse_xml_config;
pub use config::render_json_config;

Modules§

config
DDS-TSN PIM Configuration + PSM (XML/JSON) Loader.
data_frame
DataFrameSpecification — Spec §7.2.3 Tab 7.19/7.22/7.23.
dscp
Differentiated Services Code Point — RFC 2474.
ethernet_psm
DDSI-RTPS Ethernet PSM — Spec Annex A.
mac
IEEE 802 MAC address model — Spec §7.2.3 Tab 7.20.
network_requirements
NetworkRequirements — Spec §7.2.3.1.2 Tab 7.18 (Talker) + §7.2.3.2.1 Tab 7.25 (Listener).
pim
DDS-TSN Configuration Model PIM — Spec §7.2 + §7.3.
stream
TSN Stream Identifier + Talker/Listener + TsnConfiguration — Spec §7.2.3 Tab 7.15 + 7.24 + Figure 7.3.
time_aware
TimeAware Stream — Spec §7.2.3 Tab 7.17 (IEEE 802.1Qbv).
traffic
TrafficSpecification — Spec §7.2.3 Tab 7.16 (IEEE 802.1Qcc).
vlan_tag
IEEE 802.1Q VLAN Tag — Spec §7.2.3 Tab 7.21.