Strongly-Consistent Distributed Discrete-event Systems

Peter Donovan, Erling Jellum, Byeonggil Jun, Hokeun Kim, Edward A. Lee, Shaokai Lin, Marten Lohstroh, Anirudh RengarajanarXiv 2024 · DOI

TL;DR

This paper introduces a novel framework for coordinating distributed discrete-event systems that can handle "zero-delay cycles" (ZDCs), a common construct in real-time systems that was previously problematic. By formalizing the necessary information exchange and extending the Lingua Franca coordination language, they enable the execution of constructive programs with ZDCs, simplifying the design of strongly consistent distributed real-time systems.

What Problem Does This Paper Address?

Discrete-event (DE) systems are a powerful model for concurrent programming, especially in real-time applications, where components communicate via events tagged with a totally ordered set (often representing time). Distributed DE (DDE) systems extend this to networked environments. A key challenge in DDE systems, particularly those with cyclic dependencies between components, is the requirement for "logical delays" on communication channels. These delays ensure that events are processed in a consistent order, preventing causality violations. However, these delays are not always natural or desirable, and their absence in cycles (zero-delay cycles or ZDCs) has historically led to frameworks rejecting such programs or forcing developers to introduce artificial delays, which can complicate semantics and introduce errors. This paper addresses the need for a DDE framework that can robustly handle ZDCs in constructive programs without sacrificing strong consistency.

Methods

The core of the paper's contribution lies in a generalized DDE framework that supports ZDCs. This is achieved through:

  • Formal Model: A formal model is developed that precisely defines the information required for coordinating distributed components, even in the presence of ZDCs. This model exposes the necessary data exchange for enabling constructive programs with ZDCs.
  • Coordination Algorithm: The paper proposes a coordination algorithm that allows nodes to safely advance their logical time and process events, even when ZDCs are present. This involves a centralized coordinator (RTI - Runtime Infrastructure) that manages message exchange and tag advancement.
  • Message and Signal Types: A set of specific message and signal types (e.g., NET, TAG, PTAG, ABS) are defined for communication between nodes and the RTI to manage tag advancement and port status.
  • Earliest Future Incoming Message Tag (EIMT): A crucial concept, EIMT, is introduced to determine the earliest possible tag of future incoming messages for a node. This calculation is key to deciding whether to grant a TAG (guaranteeing all messages up to that tag have been seen) or a PTAG (a provisional grant, used when ZDCs might cause delays).
  • In-Transit Message Queue (Qi): To prevent incorrect TAG grants, especially in scenarios with ZDCs, the RTI maintains an in-transit message queue for each node. This queue tracks messages that have been sent but not yet processed, ensuring that TAG grants are truly safe.
  • Total Port Ordering (TPO): For managing dependencies between independently compiled nodes in a federated system, a Total Port Ordering (TPO) is introduced. This ensures that the composition of nodes with their locally computed reaction levels results in a globally deadlock-free execution.
  • Lingua Franca Extension: The proposed framework and coordination mechanisms are implemented as an extension to the open-source coordination language Lingua Franca (LF).

Datasets

Not discussed in the paper. The evaluation uses simulated network conditions (LAN and Wi-Fi) and a specific example program with a ZDC.

Key Insights and Ideas

  • ZDCs are not inherently problematic for constructive programs: The paper demonstrates that with the right coordination mechanisms, zero-delay cycles do not necessarily lead to causality violations or deadlocks in constructive DE systems.
  • Information is key to managing ZDCs: The core challenge is not the ZDC itself, but the lack of information about future event arrival times. The paper precisely identifies and formalizes the information needed by a central coordinator to manage this.
  • TAG vs. PTAG is crucial for ZDCs: The distinction between a definitive TAG grant and a provisional PTAG grant is essential for handling ZDCs. PTAGs allow progress but require careful management of port status.
  • In-transit message queues prevent subtle deadlocks: The necessity of the in-transit message queue (Qi) is highlighted as a mechanism to avoid incorrect TAG grants that could lead to subtle deadlocks or nondeterministic behavior, especially in complex ZDC scenarios.
  • TPO ensures global consistency from local decisions: Total Port Ordering provides a way to compose independently compiled nodes while guaranteeing global deadlock freedom, by establishing a consistent ordering at the boundaries between federates.

Key Results

  • The paper presents a formal model and a concrete implementation that extends Lingua Franca to support constructive distributed discrete-event systems with zero-delay cycles.
  • Experimental evaluation shows that the proposed approach has a negligible impact on performance (lag) compared to the conventional method of inserting microstep delays, especially in LAN environments.
  • In Wi-Fi environments, the proposed approach shows a similar breakdown period to the microstep delay approach, indicating comparable robustness.

Limitations and Future Work

  • Centralized Coordinator: The current implementation uses a centralized coordinator (RTI). While the authors note that its functionality could be distributed, this remains a potential area for future work to achieve a fully decentralized solution.
  • Performance in High-Latency Networks: While the paper shows negligible impact in LAN, further investigation into performance in highly variable or high-latency networks might be beneficial.
  • Complexity of PTAG Handling: The paper acknowledges that PTAG handling is more complex and can increase network traffic due to ABS messages. Future work could explore optimizations for PTAG usage.
  • Dynamic Topologies: The current work assumes a static topology for calculating Dij. Supporting dynamic topologies would require runtime updates to this information.

Summary updated

BibTeX
@misc{donovan2024strongly,
  author = {Peter Donovan and Erling Jellum and Byeonggil Jun and Hokeun Kim and Edward A. Lee and Shaokai Lin and Marten Lohstroh and Anirudh Rengarajan},
  title = {{Strongly-Consistent Distributed Discrete-event Systems}},
  year = {2024},
  eprint = {2405.12117},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2405.12117},
}

Loading related content...

Figure