<?xml-model href='http://www.tei-c.org/release/xml/tei/custom/schema/relaxng/tei_all.rng' schematypens='http://relaxng.org/ns/structure/1.0'?><TEI xmlns="http://www.tei-c.org/ns/1.0">
	<teiHeader>
		<fileDesc>
			<titleStmt><title level='a'>Improving the Efficiency of Coordinating Timed Events in Distributed Systems</title></titleStmt>
			<publicationStmt>
				<publisher>ACM</publisher>
				<date>06/22/2025</date>
			</publicationStmt>
			<sourceDesc>
				<bibl> 
					<idno type="par_id">10667366</idno>
					<idno type="doi">10.1145/3726301.3728399</idno>
					
					<author>Byeonggil Jun</author><author>Edward A Lee</author><author>Marten Lohstroh</author><author>Hokeun Kim</author>
				</bibl>
			</sourceDesc>
		</fileDesc>
		<profileDesc>
			<abstract><ab><![CDATA[Not Available]]></ab></abstract>
		</profileDesc>
	</teiHeader>
	<text><body xmlns="http://www.tei-c.org/ns/1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xlink="http://www.w3.org/1999/xlink">
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="1">Introduction</head><p>Fine-grained timing control over the network is often required in distributed cyber-physical systems (CPS) consisting of computing components that interact with the physical world and are connected through networks. One of the important challenges in such "nedgrained timing control is determinism, which ensures exactly one behavior for the same given initial conditions and inputs. The High-Level Architecture (HLA), an IEEE standard for discrete event (DE) system simulation <ref type="bibr">[20]</ref>, is one of the ways to support "ne-grained timing control with determinism in distributed CPS. HLA can also be used for the execution of DE-based distributed CPS using a run-time infrastructure (RTI) such as CERTI <ref type="bibr">[35]</ref>, an open-source RTI. HLA-style methods have also been adapted to include features speci"c to system implementation (vs. simulation), such as asynchronous injection of unanticipated events and zerodelay cycles, which are common in control systems <ref type="bibr">[5]</ref>.</p><p>An HLA-based system is composed of federates, which are individual distributed nodes, and an RTI, which is software that provides services to support executions of federates . Each federate reacts to events in logical time order, and each event is tagged with a timestamp representing a logical time <ref type="bibr">[28]</ref>. To ensure that federates execute events in logical time order, federates and the RTI exchange signals including timing information. For example, a federate reports its next event's logical time to the RTI each time the federate tries to advance its logical time. The RTI will grant logical time advancement when it can assure that the federate has seen all input events with earlier timestamps. However, this frequent exchange of signals increases network overhead and can a!ect the feasibility (ability to meet deadlines) of a system. Jun et al. <ref type="bibr">[22]</ref> identify certain ine#ciencies in the HLA-based system.</p><p>Consider sensing systems that require frequent sensing, as illustrated in Figure <ref type="figure">1</ref>. In a defect detection system shown in Figure <ref type="figure">1a</ref>, a sensor checks the conditions of products and reports defective products so that a robot arm picks out the defective products. Assume a local edge server controls those components. Suppose we adopt HLA to build this system. The sensor federate must send its next event timestamp to the RTI every time it senses and wait for the RTI to grant logical time advancement. Thus, the round-trip network delay limits the sensing period.</p><p>Figure <ref type="figure">1b</ref> describes another application that requires frequent sensing, connected autonomous vehicles at an intersection. When a vehicle detects an object, it reports the caution to the roadside unit (RSU) <ref type="bibr">[4]</ref>, a communication node installed within the tra#c infrastructure, and the RSU broadcasts the information to others. Similarly, a car needs to be sensing frequently and requires con"rmation from the RTI to advance its tag. This paper introduces methods enabling "ne-grained control of timing and reducing the number of signals in distributed systems using HLA-style timing coordination. We set our baseline to an open-source software runtime and coordination language, Lingua Franca (LF) <ref type="bibr">[29]</ref> because the time management mechanism of LF's centralized coordinator is roughly based on HLA <ref type="bibr">[5]</ref> and provides an extended, working implementation with mechanisms resembling HLA, but also supports asynchronous injection of unanticipated events and other real-time implementation-oriented features. A detailed comparison between traditional HLA/RTI and LF's RTI is developed in Section 3.5. We examine scenarios where ine#ciently used signals a!ect the program's feasibility. Then, we provide solutions to enable precision timing control by eliminating redundant signals while preserving determinism.</p><p>In summary, the contributions of this paper are: &#8226; Identifying ine#ciencies in state-of-the-art HLA-based timing coordination techniques for distributed systems <ref type="bibr">[5,</ref><ref type="bibr">22]</ref> and their challenges in "ne-grained timing control, &#8226; Proposing a methodology to address the identi"ed ine#ciencies via in-depth analysis of timing-related signals and eliminating non-essential signals, and &#8226; Case studies of common patterns in distributed CPS followed by evaluation of the proposed methodology through experiments demonstrating the e!ectiveness of the proposed approach.</p><p>2 Related Work</p><p>Among algorithms and methods for synchronization mechanisms for distributed discrete event (DDE) simulation <ref type="bibr">[21]</ref>, HLA <ref type="bibr">[20]</ref> has been pervasively used and standardized by the IEEE. Examples using HLA for DDE simulation include continuous simulation by Awais et al. <ref type="bibr">[3]</ref>, using HLA with the functional mock-up interface (FMI) <ref type="bibr">[7]</ref>, and integrating heterogeneous simulators for complex embedded systems by Brito et al. <ref type="bibr">[8]</ref>.</p><p>HLA has also been used for distributed simulation of real-time systems and CPS. For example, Lasnier et al. <ref type="bibr">[24]</ref> propose a simulation framework for real-time CPS with heterogeneous components using CERTI <ref type="bibr">[35]</ref>, an open-source RTI for HLA. The PRISE project <ref type="bibr">[11,</ref><ref type="bibr">12]</ref> achieves real-time performance of distributed simulation for systems with hard real-time constraints using CERTI. Ptolemy-HLA <ref type="bibr">[9]</ref> gives an HLA implementation for DDE integrated with Ptolemy II <ref type="bibr">[37]</ref>, an open-source CPS modeling tool supporting a variety of models of computation.</p><p>Some prior research has explored various approaches to enhance the e#ciency in time management of DDE systems and HLA with RTI. Notable contributions include minimizing the communication in DDE systems through the development of optimal communication sets, as demonstrated by Rudie et al. <ref type="bibr">[38]</ref>. While Wang and Turner <ref type="bibr">[40]</ref> propose optimistic time synchronization with rollback capabilities in HLA and Marotta et al. <ref type="bibr">[31]</ref> improves the e!ectiveness of accessing the committed state in speculative parallel DE simulation, such methods are limited to simulation environments and cannot be applied to actual deployment of HLA-based systems where rollbacks are infeasible. The COSSIM simulation framework <ref type="bibr">[39]</ref> introduces $exible time synchronization mechanisms for CPS simulation by allowing tradeo!s between time precision and performance through its IEEE HLA-compatible interface. In contrast to these approaches, our approach focuses on achieving improved e#ciency in DDE systems while ensuring strict synchronization through enhanced HLA implementations.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="3">Background 3.1 Lingua Franca</head><p>Lingua Franca (LF) is an open-source coordination language and runtime designed to implement reactors <ref type="bibr">[27,</ref><ref type="bibr">30]</ref>. Reactors integrate bene"cial semantic features from well-established models of computation, such as actors <ref type="bibr">[2]</ref>, logical execution time <ref type="bibr">[23]</ref>, synchronous reactive languages <ref type="bibr">[6]</ref>, and discrete event systems <ref type="bibr">[25]</ref> including DEVS <ref type="bibr">[41]</ref> and SystemC <ref type="bibr">[26]</ref>. In CPS interacting with the physical world in real time, treating time as a purely logical concept is not su#cient. To address the limitation of logical time, LF allows physical and logical timelines to interact deterministically <ref type="bibr">[29]</ref>.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="3.2">Tags</head><p>In LF, every event is timestamped by logical time and executed in order of logical time. Table <ref type="table">1</ref> demonstrates the de"nitions of sets N, T, and G, that are used for formally de"ning logical time in LF. Logical time is represented by a tag &#119871; &#8599; G, which is a pair of a time value &#119872; &#8599; T and a microstep &#119873; &#8599; N where microstep is introduced in the superdense model of time <ref type="bibr">[29]</ref>. A sequence of tagged events that occur at the "same time" can be represented with the microstep <ref type="bibr">[14]</ref>.</p><p>In LF, &#119874; max , the maximum microstep value, is reserved for the upper bound of the microstep. Ideally, an in"nite number of events can happen at the same time, i.e., microstep can be in"nity. However, in LF, the microstep is saturated to &#119874; max . In this paper, we assume that a tagged event never reaches a maximal microstep, (&#119872;, &#119874; max ) because we will almost never see that 4 billion events occur at the same time in practical applications.</p><p>The set of tags, G, forms a totally ordered set where, given two tags &#119871; &#119874; = (&#119872; &#119874; , &#119873; &#119874; ) and &#119871; &#119875; = (&#119872; &#119875; , &#119873; &#119875; ), &#119871; &#119874; &lt; &#119871; &#119875; if and only if &#119872; &#119874; &lt; &#119872; &#119875; or &#119872; &#119874; = &#119872; &#119875; and &#119873; &#119874; &lt; &#119873; &#119875; .</p><p>For simplicity, in this paper, we use the elapsed time and microstep since the startup tag (the beginning of the execution) of the program to represent an event's tag, instead of using an actual tag with the time elapsed since January 1, 1970. For example, an event can be scheduled at the startup tag, e.g., (1728963084, 0). Instead of using the actual tag, we say the event is scheduled at (0, 0). Delays A out1 out2 out3 B in out C in out D in out E in1 in2 in3 20 ms 0 100 ms 0 40 ms Figure 2: An example LF program with delays. MSG Tagged Message Handler IDLE QueueEvent MSG / queue(MSG) New_NET() / send(NET) NET Input: MSG -Tagged Message Output: NET -Next Event Tag Signal &#172;New_NET() / Help Functions: queue(), New_NET(), send() (described in Section 3.4) Figure 3: A state machine handling tagged messages.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="3.3">Delays</head><p>TAG Tag Advance Grant Handler Variable: g -This federate's current tag Input: TAG -Tag Advance Grant Signal NET LTC MSG IDLE g = peekNextEvent().tag / processNextEvent() Process Event msg() / send(MSG) g != peekNextEvent().tag / send(LTC); send(NET); Loop G(TAG) &gt;= peekNextEvent().tag / g := peekNextEvent().tag Outputs: MSG -Tagged Messsage NET -Next Event Tag Signal LTC -Latest Tag Complete Signal Help Functions: getNextEvent(), send(), msg() (described in Section 3.4) Figure 4: A state machine handling tag advance grant signals. classes &#119880;, &#119881;, &#119882;, &#119883; and &#119884;, respectively. The cloud icon next to the program's name indicates this program is federated (distributed), where each top-level reactor is a separate program called a federate.</p><p>Each federate is compiled into an independent executable binary to be deployed on distributed nodes. Dark gray chevrons illustrate reactions, procedures that are executed when triggered. For example, the reaction in &#119875; is triggered by the startup trigger (denoted by a white circle), causing the reaction to be triggered at the beginning of the execution of the LF program. The body of the reaction can be implemented in C, Python, and Typescript. LF's syntax allows logical time to elapse on a connection using the concept of logical delay. For example, the connection from &#119880; to &#119881; in Figure <ref type="figure">2</ref> has 20 &#119873;&#119885; of logical delay, meaning that a tag of a message increases by 20 ms while going through the connection. A tagged message originating from the out1 port of &#119880; with a tag (0, 0) will have a tag (20 &#119873;&#119885;, 0) when it arrives at the in port of &#119881;. LF distinguishes no delay and zero delay; speci"cally, no delay on a connection means there is no increment to the timestamp or microstep, whereas zero delay increments the microstep by 1. For example, a tagged message sent by &#119880; at (0, 0) will have a tag (0, 1) when &#119883; receives that message because of the zero delay.</p><p>Because a delay can increment either time or microstep from the originating tag, we de"ne tag increment over a connection to compute a message's tag. The function &#119882; : T &#8595;&#8594; G is de"ned for converting a delay represented by time to a tag <ref type="bibr">[22]</ref>:</p><p>For example, the tag increment between &#119880; and &#119881; in Figure <ref type="figure">2</ref> is (20 &#119873;&#119885;, 0) and between &#119880; and &#119883; is (0, 1). If there is no delay (&#8595;&#8596;), like between &#119882; and &#119884;, the tag increment is (0, 0), and if there is no connection, the tag increment is represented by (&#8596;, &#119874; max ).</p><p>When there are multiple concatenated connections, a single message can cause a lot more messages downstream. For example, in Figure <ref type="figure">2</ref>, a message sent from &#119880; may eventually cause a message to &#119882;. Suppose &#119880; sends a message with the tag (20 &#119873;&#119885;, 0) to &#119881;. Federate &#119881; may send a message with the tag (20 &#119873;&#119885;, 1) to &#119882;. Thus, we say that there is a tag increment of (20 &#119873;&#119885;, 1) between &#119880; and &#119882;.</p><p>To calculate tag increments and the tag of tagged messages, LF de"nes a function &#119880;, an operation like tag addition. When a federate sends a message at tag &#119871; &#119874; = (&#119872; &#119874; , &#119873; &#119874; ) through a connection with a tag increment &#119871; &#119875; = (&#119872; &#119875; , &#119873; &#119875; ), the message's tag is computed by &#119880;(&#119871; &#119874; , &#119871; &#119875; ). The key challenge here is handling over$ow. Currently, in LF, over$ows of the time value and the microstep are treated as errors. Here, we handle over$ow in the formalization. Yet, we recognize that useful programs should not encounter over$ow since the time value of signed 64-bit int in nanoseconds over$ows approximately after 226.4 years, over$owing in the year 2262. The microstep over$ows if 4 billion events occur at the same nanosecond. The function &#119880; : G &#8600; G &#119877; &#8595;&#8594; G is de"ned as shown below <ref type="bibr">[22]</ref>:</p><p>where G &#119877; is G\{(&#8595;&#8596;, 0), (&#8596;, &#119874; max )}. Because the second operand &#119871; &#119875; is the tag increment between two federates, &#119871; &#119875; cannot be (&#8595;&#8596;, 0) because no delay is encoded to (0, 0) and &#119871; &#119875; of (&#8596;, &#119874; max ) indicates there is no connection between the two federates and makes no meaningful sense. Note that if &#119872; &#119875; is greater than 0, the result &#119880;((&#119872; &#119874; , &#119873; &#119874; ), (&#119872; &#119875; , &#119873; &#119875; )) yields a tag that has &#119873; &#119875; as the microstep, effectively ignoring &#119873; &#119874; . For example, if &#119880; produces a message at a tag (0, 3) to &#119882;, the message will have a tag (20 &#119873;&#119885;, 1). We do not defend this decision but accept this as the behavior exhibited by LF. We can also compute the tag increment over multiple concatenated connections by adding delays on each connection. For example, the tag increment between &#119880; and &#119882; in Figure <ref type="figure">2</ref> can be computed by &#119880;((20 &#119873;&#119885;, 0), (0, 1)), which is (20 &#119873;&#119885;, 1). Thus, an event of &#119880; at tag (&#119872;, &#119873;) can cause a message to &#119882; at tag &#119880;((&#119872;, &#119873;), (20 &#119873;&#119885;, 1)).</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="3.4">Centralized Coordination</head><p>LF has its own version of an RTI for coordinating federates. From now on, we use the term LF-RTI to distinguish LF's RTI from the traditional HLA RTI. An in-depth discussion of the di!erence between LF and HLA is given in Section 3.5.</p><p>To ensure that a federate executes events in tag order, federates send their current states, and LF-RTI keeps track of each federate's state and updates a tag barrier to allow federates to advance their tags. The "rst column of Table <ref type="table">2</ref> summarizes the types of messages and signals, and the second and third columns show the variables used for tracking each federate's state. Signals and messages have tags in the payload, and we use a function &#119886; to represent the associated tag of a signal or a message. For instance, &#119886; (MSG &#119880; &#119881; ) is the tag of the message MSG &#119880; &#119881; . LTC &#119881; (Latest Tag Complete) is a signal sent from a federate &#119887; to LF-RTI to report that &#119887; has completed every event at the tag &#119886; (LTC &#119881; ). NET &#119881; (Next Event Tag) is a signal sent from federate &#119887; to LF-RTI to report the tag of &#119887;'s earliest unprocessed event. TAG &#119880; (Tag Advance Grant) is a signal sent by LF-RTI to federate &#119888; to notify that &#119888; has received all messages with a tag that is less than or equal to &#119886; (TAG &#119880; ).</p><p>The state machines in Figure <ref type="figure">3</ref> and Figure <ref type="figure">4</ref> illustrate how a federate handles events, signals, and messages. Transitions marked with dotted lines denote default transitions that are enabled when no other transitions are enabled. When federate &#119888; receives MSG &#119880; &#119881; , it creates events corresponding to the message and schedules those events (enqueues to a queue of events), which is done by the function queue(MSG) in Figure <ref type="figure">3</ref>. If an enqueued event is the new earliest next event, the predicate new_NET() becomes true and the function send(MSG) sends a new NET signal with the tag of the new event.</p><p>When a federate &#119888; receives a TAG signal, it can process events with tags earlier than or equal to &#119886; (TAG &#119880; ). Figure <ref type="figure">4</ref> describes how a federate handles TAG signals and processes events. The function peekNextEvent() returns the earliest unprocessed event. If &#119886; (TAG) is later than or equal to the next earliest event's tag, the federate advances its current tag g to the next event's tag. Then, the federate executes every event scheduled at the current tag g using the function processNextEvent(). New events can be scheduled and new tagged messages can be sent from the federate during processing of the event. If an event produces a new message to other federates (through LF-RTI), the function msg() returns true and the function send(MSG) sends the tagged message to LF-RTI. After processing every event at the current tag, the federate sends LTC with the tag g and NET with the next earliest event's tag. Now, we discuss the behavior of LF-RTI, which is responsible for guaranteeing that a federate is safe to advance its tag. To predict the behavior of each federate and send proper control signals, LF-RTI maintains variables storing each federate's information and the relationships between federates. The second and third columns of Table <ref type="table">2</ref> summarize these variables. For each federate &#119887;, LF-RTI maintains variables &#119889; &#119881; to store the most recent &#119886; (NET &#119881; ), &#119890; &#119881; to store the most recent &#119886; (LTC &#119881; ), and the in-transit message queue &#119891; &#119881; , a priority queue sorted by tag, to store tags of in-$ight messages sent to &#119887;. When LF-RTI forwards MSG &#119880; &#119881; to &#119887;, it enqueues the tag in &#119891; &#119881; , and when LF-RTI receives LTC &#119881; , it dequeues tags earlier than or equal to &#119886; (LTC &#119881; ) from &#119891; &#119881; .</p><p>LF-RTI stores the information on how federates are connected as well as the delay between them. &#119892; &#119880; contains the set of immediate upstream federates of &#119888; (those with direct connections), &#7713;&#119880; contains the set of "transitive" upstream federates of &#119888;. For example, regarding federate &#119882; in Figure <ref type="figure">2</ref>, &#119892; &#119888; has only &#119881; but &#7713;&#119888; has both &#119880; and &#119881;.</p><p>X&#119880; contains the set of "transitive" downstream federates. &#119883; &#119880; &#119881; denotes the minimum tag increment from federate &#119887; to &#119888;. When there are multiple paths between two federates, the minimum tag increment is required to predict a federate's next behavior. For example, in Figure <ref type="figure">2</ref>, a message from &#119880; can trigger three messages to &#119884; through three di!erent paths: Among those, the path through</p><p>Name in HLA Name in Lingua Franca (LF) TSO message Tagged Message Next Message Request (or Available) Next Event Tag Least Incoming TimeStamp Earliest Incoming Message Tag Time Advance Grant (or Available) Tag Advance Grant</p><p>Table 3: Naming of LF messages corresponding to HLA. &#119881; and &#119882; has the minimum tag increment (20 &#119873;&#119885;, 1) and thus, &#119883; &#119878;&#119889; is (20 &#119873;&#119885;, 1). &#119883; &#119880; &#119881; indicates that if a federate &#119887; sends a message with a tag &#119871; &#119881; , this may cause a message for &#119888; with a tag &#119880;(&#119871; &#119881; , &#119883; &#119880; &#119881; ), but no earlier.</p><p>There could be no message at all because any reaction along the way may choose not to send an outgoing message.</p><p>For a federate &#119888;, LF-RTI predicts that &#119888;'s earliest next event has the tag min(&#119889; &#119880; , (&#119891; &#119880; )). Thus, when min(&#119889; &#119880; , (&#119891; &#119880; )) is changed, LF-RTI decides whether to send TAG &#119880; . First, LF-RTI utilizes LTC signals from the federates in &#119892; &#119880; . LF-RTI knows that a federate &#119887; &#8599; &#119892; &#119880; will not generate a message originated from &#119890; &#119881; . However, this doesn't guarantee that &#119887; will not send a message with a tag &#119880;(&#119890; &#119881; , &#119883; &#119880; &#119881; ), because &#119887; may send messages with the tag &#119880;(&#119890; &#119881; , &#119883; &#119880; &#119881; ) when the time value of &#119883; &#119880; &#119881; is greater than 0.</p><p>For example, suppose a federate &#119887; originates messages at (0, 0) and (0, 1) to &#119888; and &#119883; &#119880; &#119881; is (20 &#119873;&#119885;, 0). Both the messages will have the same tag, (20 &#119873;&#119885;, 0). Thus, in this situation, LF-RTI can guarantee that &#119887; will not send TAG &#119880; &#119881; with the tag (19 &#119873;&#119885;, &#119874; max ), not (20 &#119873;&#119885;, 0). LF-RTI looks up every immediate upstream federate and "nds a tag &#119871;, the maximum tag that LF-RTI can allow &#119888; to advance using LTC signals. We use (&#119891; &#119880; ) to denote the tag of the message at the head of the queue &#119891; &#119880; . If the tag &#119871; is later than or equal to min(&#119889; &#119880; , (&#119891; &#119880; )), LF-RTI grants TAG &#119880; with the tag &#119871;.</p><p>If &#119871; &lt; min(&#119889; &#119880; , (&#119891; &#119880; )), LF-RTI needs to determine &#119881; &#119880; , the earliest (future) incoming message tag for node &#119888; <ref type="bibr">[15]</ref>, and this will require looking further upstream beyond the federates in &#119892; &#119880; . For an immediate upstream federate &#119887; &#8599; &#119892; &#119880; , the tag of the earliest possible future message from &#119887; is &#119880;(min(&#119889; &#119881; , (&#119891; &#119881; ), &#119881; &#119881; ), &#119883; &#119880; &#119881; ), where (&#119891; &#119881; ) denotes the tag of &#119891; &#119881; 's head. Thus, we can compute &#119881; &#119880; as:</p><p>LF-RTI can send TAG &#119880; with a tag min(&#119889; &#119880; , (&#119891; &#119880; )) only if &#119881; &#119880; is strictly greater than min(&#119889; &#119880; , (&#119891; &#119880; )). If there is no cycle in the program (paths from &#119888; back to itself), then LF-RTI can easily calculate this quantity. If there are only cycles that have at least one a"er delay, then again, this is easy to calculate. If there is a cycle with no a"er delays, handling this gets much more subtle, requiring extra coordination <ref type="bibr">[15]</ref>. Thus, for the discussion of the rest of this paper, we do not consider the federates within zero-delay cycles.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="3.5">Comparison between HLA and LF</head><p>Table 3 relates the terminology of HLA with the terminology of Lingua Franca (LF) we use in this paper. Time management in HLA is similar in that each federate sends a signal Next Message Request (NMR) to advance its tag and the RTI sends a signal Time Advance Grant computed by the Least Incoming Timestamp. The latest tag complete (LTC) signals in LF resemble the NULL messages in the algorithm proposed by Chandy and Misra <ref type="bibr">[10]</ref>. HLA uses NULL messages to address in-transit messages or to manage logical time by indicating the time advancement of each federate <ref type="bibr">[13,</ref><ref type="bibr">17]</ref>. We point out that HLA assumes two types of federates, timestepped and event-stepped. HLA provides a Time Advancement Request signal to support time-stepped federates. Because timestepped federates are special cases of event-stepped federates, LF only provides the signal NET which resembles the signal NMR.</p><p>We also note that LF-RTI is a centralized standalone coordinator whereas in HLA, the RTI can be implemented in either a centralized or decentralized manner. For example, in poRTIco <ref type="bibr">[36]</ref> v2.1.0, decentralized local RTI components communicate with each other without a centralized server <ref type="bibr">[18]</ref>. However, regardless of the underlying implementation, federates must exchange NMR and TAG signals with the RTI to advance their logical time, an ine#ciency intrinsic to the HLA protocol itself, as identi"ed in Section 4.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="3.6">Downstream Next Event Tag</head><p>Jun et al. <ref type="bibr">[22]</ref> propose to remove some unnecessary signals to address the ine#ciency in LF's HLA-based timing coordination. LF-RTI uses NET &#119880; from federate &#119888; to compute TAG signals for &#119888;'s downstream federates and to send a TAG &#119880; to allow &#119888; to advance its tag. Thus, a NET &#119880; signal is not necessary if it does not lead to a TAG signal for &#119888;'s downstream federates and if &#119888; itself can advance to the tag &#119886; (NET &#119880; ) without further con"rmation by LF-RTI.</p><p>Speci"cally, to remove unnecessary NET signals, Jun et al.</p><p>[22] make LF-RTI send a signal called Downstream Next Event Tag (DNET) to notify a federate that the federate only needs to send NET signals with tags later than the payload tag &#119886; (DNET). In other words, NET signals with tags earlier than or equal to &#119886; (DNET) will not cause any TAG signals downstream.</p><p>LF-RTI needs to look up transitive downstream federates in X &#119881; to compute the upper bound tag of unnecessary NET &#119881; signals from a federate &#119887;. For a federate &#119888; &#8599; X &#119881; , if &#119880;(min(&#119889; &#119881; , (&#119891; &#119881; )), &#119883; &#119880; &#119881; ), the earliest incoming message tag caused by &#119887;, is earlier than or equal to min(&#119889; &#119880; , (&#119891; &#119880; )), the tag of &#119888;'s next event, LF-RTI cannot send TAG &#119880; with the tag min(&#119889; &#119880; , (&#119891; &#119880; )). Let a tag &#119871; &#119880; be the tag satis"es the condition &#119880;(&#119871; &#119880; , &#119883; &#119880; &#119881; ) &#8771; min(&#119889; &#119880; , (&#119891; &#119880; )). Then, NET &#119881; with tags earlier than or equal to &#119871; &#119880; is unnecessary for granting a TAG signal to &#119888;. For computing &#119871; &#119880; , the function &#119894; : G &#8600; G &#119877; &#8595;&#8594; G is de"ned <ref type="bibr">[22]</ref>: where</p><p>the value &#119883; &#119880; &#119881; cannot be (&#8596;, &#119874; max ) because &#119883; &#119880; &#119881; of (&#8596;, &#119874; max ) means there is no path from &#119887; to &#119888;. Also, &#119883; &#119880; &#119881; cannot be (&#8595;&#8596;, 0) because &#119883; &#119880; &#119881; is always greater than or equal to (0, 0) ("no delay" is encoded to (0, 0)). The tag &#119871; &#119880; can be computed as &#119894; (min(&#119889; &#119880; , (&#119891; &#119880; )), &#119883; &#119880; &#119881; ). Finally, we can compute &#119886; (DNET &#119881; ) as: min &#119880; &#8599; &#257; &#119875; (&#119894; (min(&#119889; &#119881; , (&#119891; &#119881; )), &#119883; &#119880; &#119881; )) (5) 4 Challenges and Ine"ciencies in Current State-of-the-Art Timing Coordination This section discusses ine#ciencies in up-to-date LF's HLA-based timing coordination and how they can a!ect a program's feasibility. 4.1 NET for Requesting TAG By using the DNET signals described in Section 3.4, current LF can eliminate NET &#119880; signals from federate &#119888; that are unnecessary for granting TAG signals to &#119888;'s downstream federates. Another essential role of NET &#119880; signals is to request a TAG &#119880; signal for itself. As explained in Section 3.4, LF-RTI sends a TAG &#119880; signal to federate &#119888; with a tag min(&#119889; &#119880; , (&#119891; &#119880; )) if &#119881; &#119880; &gt; min(&#119889; &#119880; , (&#119891; &#119880; )) when using EIMT for granting a tag. However, this TAG &#119880; proves overly conservative, potentially resulting in redundant NET &#119880; signals if &#119881; &#119880; is much later than &#119889; &#119880; . Given that &#119881; &#119880; represents the earliest tag that &#119888; might receive, we can grant any tag earlier than &#119881; &#119880; .</p><p>Consider the LF program in Figure <ref type="figure">5</ref> and its execution trace in Figure <ref type="figure">6</ref>. We assume that Sender sends a message at the tag (1 &#119885;, 0), not at (0 , 0). Federate &#119895; _&#119896; sends NET &#119891; _&#119892; with the tag (0, 0) in 1 &#8594; to request a TAG signal. Upon receiving the NET signal, LF-RTI computes the DNET value, which is &#119894; (min(&#119889; &#119891; _ , (&#119891; &#119891; _ )), &#119883; &#119891; _&#119892; &#119891; _ ). In this case, the value is (0, 0) because &#119889; &#119891; _ is (0, 0), (&#119891; &#119891; _ ) is (&#8596;, &#119874; max ) as &#119895; _&#119885; does not have any in-transit messages, and &#119883; &#119891; _&#119892; &#119891; _ is (0, 0) since there is no delay between the two federates.</p><p>After completing the tag (0, 0), federate &#119895; _&#119885; sends LTC &#119891; _ ((0, 0)) and NET &#119891; _ ((1 &#119885;, 0)) to LF-RTI. By NET &#119891; _ in 1 &#8594;, LF-RTI knows that &#119895; _&#119896; will not later receive any messages with tags earlier than (1 &#119885;, 0). Nevertheless, LF-RTI sends TAG &#119891; _&#119892; ((0, 0)) to &#119895; _&#119896; because &#119889; &#119891; _&#119892; , the most recent NET tag from &#119895; _&#119896; is (0, 0). Thus, &#119895; _&#119896; and LF-RTI exchange NET and TAG signals every 10 ms unnecessarily as shown in the box labeled "Ine#cient Communication" in Figure <ref type="figure">6</ref>.</p><p>This also a!ects the feasibility of the program. Suppose there is a network delay of 15 ms between LF-RTI and federate &#119895; _&#119896; . Although the period of the timer is 10 ms in terms of the logical time, the period in physical time between the events cannot be less than 15 s_s RTI s_r &#9312; NET((&#8734;, MMax)) &#9313;DNET((&#8734;, MMax)) LTC((20 ms, 0)) LTC((0, 0)) LTC((40 ms, 0)) LTC((60 ms, 0)) LTC((80 ms, 0)) MSG((100 ms, 0)) MSG((100 ms, 0))</p><p>&#9314;DNET((100 ms, 0)) &#9315;LTC((100 ms, 0)) &#9316;NET((120 ms, 0)) &#9317;TAG((100 ms, 0))</p><p>&#9318;LTC((100 ms, 0))</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>NET((&#8734;, MMax))</head><p>A message is produced at 100 ms No messages are produced until 100 ms ms because of the process of sending a NET signal and waiting for the corresponding TAG signal. Section 5 describes a method to exploit EIMT to address this ine#ciency.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="4.2">Latest Tag Complete</head><p>Figure <ref type="figure">7</ref> shows a simple LF program with two federates. The reaction in federate &#119885; is triggered every 20 ms by the timer. Figure <ref type="figure">8</ref> illustrates the trace of the program when &#119885;_&#119885; sends messages every 100 ms starting from the tag (100 &#119873;&#119885;, 0). The trace only shows the "rst 100 ms of the execution without including the initialization process for simplicity. Since federate &#119885;_&#119896; purely reactive, it sends NET _&#119892; with the tag (&#8596;, &#119874; max ) in 1 &#8594; indicating that it has no events to process. This results in DNET _ in 2 &#8594; and let &#119885;_&#119885; skip sending any NET signals until it sends a message. At (100 &#119873;&#119885;, 0), a message is sent from &#119885;_&#119885; to &#119885;_&#119896; via LF-RTI and the new DNET _ with (100 &#119873;&#119885;, 0) in 3</p><p>&#8594; is sent to &#119885;_&#119885;. In response to that DNET signal, &#119885;_&#119885; sends NET _ with the tag (120 &#119873;&#119885;, 0) in 5</p><p>&#8594; so that LF-RTI can send TAG _&#119892; in 6</p><p>&#8594;. Although DNET signals can eliminate unnecessary NET signals, LTC signals are also sent from the sender federate every time and this is redundant. When LF-RTI receives an LTC &#119881; from a federate &#119887;, LF-RTI uses &#119886; (LTC &#119881; ) for the following two purposes: 1. To remove tags from the in-transit message queue &#119891; &#119881; . Concretely, LF-RTI removes the tag &#119886; (LTC &#119880; ) from &#119891; &#119880; . 2. To compute TAGs for federates &#119888; where &#119887; &#8599; &#119892; &#119880; .</p><p>For example, in Figure <ref type="figure">8</ref>, with LTC _ with the tag (100 &#119873;&#119885;, 0) in 4 &#8594;, LF-RTI can send the TAG signal 6 &#8594; as explained in Algorithm 1. In the trace, the TAG signal is sent after receiving the NET signal in 5</p><p>&#8594; because, according to the behavior of federates in Figure <ref type="figure">4</ref>, usually a federate sends LTC and NET signals together. The LTC signal in 7</p><p>&#8594; is used for removing a tag from &#119891; _&#119892; , the in-transit message queue of &#119885;_&#119896; . LF-RTI enqueues the tag (100 &#119873;&#119885;, 0) to &#119891; _&#119892; when forwarding the tagged message to &#119885;_&#119896; . Upon receiving the LTC signal with (100 &#119873;&#119885;, 0), LF-RTI dequeues the tag as it knows that the federate receives and processes the message.</p><p>So LF-RTI has nothing to do with the other LTC signals with tags earlier than (100 &#119873;&#119885;, 0) (in the box labeled "No messages are produced until 100 ms" in Figure <ref type="figure">8</ref>) and those redundant LTC signals incur network overhead since &#119885;_&#119885; sends them every 20 ms. We show how we can determine whether an LTC signal is essential and remove it in Section 5.2.2.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="5">Proposed Approach</head><p>This section provides in-depth discussions of our approach to improving the e#ciency of coordinating timed events in DDE systems.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="5.1">Enabling Fine-grained Timing Control</head><p>A federate with any upstream federate must send a NET signal regardless of receiving DNET signals when the federate cannot advance to its next event tag. However, as described in Section 4.1, LF-RTI grants TAG signals too conservatively, which may result in the excessive delay of events. This section discusses a technique that helps federates avoid waiting for TAG signals unnecessarily.</p><p>To address this ine#ciency, we make LF-RTI compute &#119886; (TAG &#119877;_&#119894; ) using &#119881; &#119877;_&#119894; . Let us de"ne a function &#119890;&#119884; for this computation. For a federate &#119888;, &#119890;&#119884; takes a tag &#119871; = &#119881; &#119880; as an input and returns the latest tag that LF-RTI can grant to &#119888;. For example, if &#119881; &#119880; is (1 &#119885;, 1), &#119890;&#119884; (&#119881; &#119880; ) will be (1 &#119885;, 0). Also, if &#119881; &#119880; is (2 &#119885;, 0), &#119890;&#119884; (&#119881; &#119880; ) will be (2 &#119885; &#8595; 1 &#119897;&#119885;, &#119874; max ). Formally, we de"ne &#119890;&#119884; : G &#8595;&#8594; G as:</p><p>In most cases, &#119890;&#119884; (&#119871;) returns the latest tag earlier than &#119871;. If &#119871; is (&#8595;&#8596;, 0), &#119890;&#119884; (&#119871;) must also be (&#8595;&#8596;, 0) as there is no tag earlier than &#119871;. If &#119871; is (&#8596;, &#119874; max ), &#119890;&#119884; (&#119871;) must be (&#8596;, &#119874; max ) because (&#8596;, &#119874; max ) of &#119881; &#119880; means that &#119888; can advance to any tag. With the function &#119890;&#119884;, for each federate &#119888;, we can compute &#119886; (TAG &#119880; ) by &#119890;&#119884; (&#119881; &#119880; ).</p><p>Algorithm 1 shows the procedure of computing &#119886; (TAG &#119880; ). As described in Section 3.4, LF-RTI "rst calculates &#119886; (TAG &#119880; ) using LTC signals. The following Section 5.2.1 covers an in-depth discussion on computing &#119886; (TAG &#119880; ) using LTC signals. When LF-RTI cannot grant a TAG signal using LTC signals, LF-RTI calculates &#119881; &#119880; , the earliest incoming message tag of &#119888;. We improve the baseline we use by making LF-RTI grant &#119890;&#119884; (&#119881; &#119880; ) instead of min(&#119889; &#119880; , (&#119891; &#119880; )) as shown in Line 10.</p><p>By granting TAG signals using EIMT (&#119881; &#119891; _&#119892; ), as shown in Figure <ref type="figure">9</ref>, we can eliminate redundant NET and TAG signals shown in Figure <ref type="figure">6</ref>. In Figure <ref type="figure">9</ref>, after LF-RTI receives signal 2 &#8594;, LF-RTI can send TAG &#119891; _&#119892; (1 &#119885; &#8595; 1 &#119897;&#119885;, &#119874; max ) instead of signal 3 &#8594;. Then, &#119895; _&#119896; will not send NET signals unless &#119895; _&#119896; sends a message to &#119895; _&#119885; or its next event's tag is later than or equal to (1 &#119885;, 0).</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="5.2">Improving E"ciency of LTC Signals</head><p>Among the two purposes of LTC &#119881; explained in Section 4.2 (i.e., 1. to remove tags from the in-transit message queue &#119891; &#119881; and 2. to &#119871; Compute the maximum tag to grant using LTC signals.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>4:</head><p>&#119871; If that tag allows &#119880; to advance its tag, grant it. &#119871; Compute the EIMT of &#119880; for granting TAG signals.</p><p>8: &#119887; &#119874; &#8659; min &#119875; &#8599;&#119876; &#119874; (&#119878;(min(&#119885; &#119875; , &#119895; (&#119882; &#119875; ), &#119887; &#119875; ), &#119886; &#119874; &#119875; ) ) 9: if &#119887; &#119874; &gt; min(&#119885; &#119874; , &#119895; (&#119882; &#119874; ) ) then 10: send TAG &#119874; where &#119896; (TAG &#119874; ) = &#119884;&#119889; (&#119887; &#119874; ) 11: end if 12: end if 13: &#119871; A helper function for the main algorithm above. 14: function TAG!"LTC() 15: &#119892;&#119897;&#119894;&#119898;&#119871; &#8659; (&#8596;, &#119873; max ) 16: for &#119881; &#8599; &#119883; &#119874; do 17:</p><p>&#119871; Compute the candidate using &#119884; &#119875; and the delay. </p><p>&#119871; Adjust the candidate to avoid a wrong TAG signal.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>21:</head><p>&#119888;&#119874;&#119899;&#119877; &#8659; &#119884;&#119889; (&#119888;&#119874;&#119899;&#119877; )</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>22:</head><p>end if</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>23:</head><p>if &#119892;&#119897;&#119894;&#119898;&#119871; &gt; &#119888;&#119874;&#119899;&#119877; then 24:</p><p>&#119871; Find the minimum among candidates.</p><p>25: &#119892;&#119897;&#119894;&#119898;&#119871; &#8659; &#119888;&#119874;&#119899;&#119877; 26: end if 27: end for 28: return &#119892;&#119897;&#119894;&#119898;&#119871; 29: end function compute TAGs for federates &#119888; where &#119887; &#8599; &#119892; &#119880; ), only the former is the essential role of LTC &#119881; . In other words, federate &#119887; does not have to send an LTC signal if that signal will not remove a tag from &#119891; &#119881; because LF-RTI can grant TAG signals without those LTC signals.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>5.2.1</head><p>Compute &#119886; (TAG) using LTC signals. Lines 14-29 in Algorithm 1 describe the function to compute the TAG &#119880; value using LTC signals. For each federate &#119887; &#8599; &#119892; &#119880; , LF-RTI "nds the tag &#119871; that &#119887; will not send MSG &#119880; &#119881; with tags earlier than or equal to the tag &#119871;. Notice that if &#119887; is the immediate upstream of &#119888;, &#119883; &#119880; &#119881; can only be (0, 0), (0, 1), and (&#119872;, 0) where 0 &lt; &#119872; &lt; &#8596;. Naively, given that &#119887; completes the tag &#119890; &#119881; , LF-RTI can predict that &#119887; will not send any MSG &#119880; &#119881; with tags earlier than equal to &#119880;(&#119890; &#119881; , &#119883; &#119880; &#119881; ).</p><p>However, the federate &#119887; may send MSG &#119880; &#119881; with the tag &#119880;(&#119890; &#119881; , &#119883; &#119880; &#119881; ) (but not earlier) in the following cases:</p><p>&#8226; &#119883; &#119880; &#119881; is (&#119872;, 0) where &#119872; &gt; 0 and &#119890; &#119881; is (&#119872; &#119881; , &#119873; &#119881; ) where 0 &#8771; &#119872; &#119881; &lt; &#8596; and &#119873; &#119881; &lt; &#119874; max . Suppose &#119887; has an event at (&#119872; &#119881; , &#119873; &#119881; + 1). The tag &#119880;(&#119890; &#119881; , &#119883; &#119880; &#119881; ) is (&#119872; + &#119872; &#119881; , 0) since the delay greater than 0 ignores the originated microstep. Federate &#119887; may send another message at (&#119872; + &#119872; &#119881; , 0) cause &#119880;((&#119872; &#119881; , &#119873; &#119881; + 1), &#119883; &#119880; &#119881; ) is also (&#119872; + &#119872; &#119881; , 0) &#8226; &#119883; &#119880; &#119881; is (0, 1) and &#119890; &#119881; is &#119880;(&#119872;, &#119874; max &#8595; 1) where 0 &#8771; &#119872; &lt; &#8596;. The tag &#119880;(&#119890; &#119881; , &#119883; &#119880; &#119881; ) is (&#119872; &#119881; , &#119874; max ). Assume &#119887; has an event at (&#119872;, &#119874; max ). Federate &#119887; may send another message at (&#119872;, &#119874; max ) because the microstep is saturated to &#119874; max . Consequently, the tag &#119871; must be &#119890;&#119884; (&#119880;(&#119890; &#119881; , &#119883; &#119880; &#119881; )) in these situations as shown in lines ??-22 of Algorithm 1. To demonstrate that computing &#119886; (TAG) values is not the essential role of LTC signals, we present the following Theorem 1 proving that the potential range of &#119886; (TAG &#119880; ) computed by &#119881; &#119880; includes the range of possible &#119886; (TAG &#119880; ) attained by &#119890; &#119881; . Theorem 1. The &#119886; (TAG &#119880; ) value computed by &#119890; &#119881; where &#119887; &#8599; &#119892; &#119880; is always earlier than or equal to the &#119886; (TAG &#119880; ) value computed by &#119881; &#119880; . Assumption 1. When federate &#119887; !nishes a tag, it sends LTC &#119881; and NET &#119881; together, and LF-RTI receives them almost at the same time. Assumption 2. When LF-RTI receives LTC &#119881; and NET &#119881; , LF-RTI removes the tag &#119886; (LTC &#119881; ) from &#119891; &#119881; and computes the TAG &#119881; value.</p><p>Lemma 1.1. When LF-RTI computes a &#119886; (TAG &#119880; ) value, for every federate &#119887; &#8599; &#119892; &#119880; , &#119890; &#119881; is earlier than equal to &#119890;&#119884; (min(&#119889; &#119881; , (&#119891; &#119881; ), &#119881; &#119881; )). P!""# "# L$%%&amp; 1.1. &#119890; &#119881; is the tag that &#119887; has already "nished and min(&#119889; &#119881; , (&#119891; &#119881; ), &#119881; &#119881; ) is the earliest tag that &#119887; is expected to advance. Thus, &#119890; &#119881; must be strictly earlier than min(&#119889; &#119881; , (&#119891; &#119881; ), &#119881; &#119881; ) and earlier than or equal to &#119890;&#119884; min(&#119889; &#119881; , (&#119891; &#119881; ), &#119881; &#119881; ). &#8621; Lemma 1.2. Let &#119871; &#119884;&#119900;&#119876; &#119875; be the tag such that LF-RTI guarantees that federate &#119887; &#8599; &#119892; &#119880; will not send MSG &#119880; &#119881; with any tags earlier than or equal to the tag &#119871; &#119884;&#119900;&#119876; &#119875; using &#119890; &#119881; . Similarly, let &#119871; &#119885; &#119889;&#119900; &#119875; be the tag that LF-RTI assures that federate &#119887; &#8599; &#119892; &#119880; will not send MSG &#119880; &#119881; with any tags earlier than or equal to these tags. The tag &#119871; &#119884;&#119900;&#119876; &#119875; is always earlier than or equal to the tag &#119871; &#119885; &#119889;&#119900; &#119875; . P!""# "# L$%%&amp; 1.2. Suppose &#119890; &#119881; is (&#119872; &#119898; , &#119873; &#119898; ) and &#119883; &#119880; &#119881; is (&#119872; &#119877; , &#119873; &#119877; ). Moreover, let &#119871; &#119899; = (&#119872; &#119899; , &#119873; &#119899; ) denote min(&#119889; &#119881; , (&#119891; &#119881; ), &#119881; &#119881; ). We know that &#119871; &#119899; is strictly later than &#119890; &#119881; by Lemma 1.1. Using &#119871; &#119899; , LF-RTI predicts that the earliest possible tag of MSG &#119880;&#119901; is &#119880;(&#119871; &#119899; , &#119883; &#119880;&#119901; ) and hence, &#119871; &#119885; &#119889;&#119900; is &#119890;&#119884; (&#119880;(&#119871; &#119899; , &#119883; &#119880;&#119901; )). Consider the following two cases depending on how we compute &#119871; &#119884;&#119900;&#119876; .</p><p>1. The tag &#119871; &#119884;&#119900;&#119876; is computed by &#119890;&#119884; (&#119880;(&#119890; &#119901; , &#119883; &#119880;&#119901; )) as &#119883; &#119880; &#119881; and &#119890; &#119881; satis-"es the condition described in Lines ??-19. We already know that &#119871; &#119885; &#119889;&#119900; &#119875; is computed by &#119890;&#119884; (&#119880;(&#119871; &#119899; , &#119883; &#119880; &#119881; )) and &#119890; &#119881; &lt; &#119871; &#119899; . &#119880;(&#119890; &#119901; , &#119883; &#119880;&#119901; ) can be identical to &#119880;(&#119871; &#119899; , &#119883; &#119880;&#119901; ) if the time values are identical. For example, if &#119890; &#119901; is (0, 0), &#119871; &#119899; is (0, 3) and &#119883; &#119880; &#119881; is (1, 0), both &#119880;(&#119890; &#119901; , &#119883; &#119880;&#119901; ) and &#119880;(&#119871; &#119899; , &#119883; &#119880;&#119901; ) are (1, 0). However, &#119880;(&#119890; &#119901; , &#119883; &#119880;&#119901; ) cannot be later than &#119880;(&#119871; &#119899; , &#119883; &#119880;&#119901; ), 2. The tag &#119871; &#119884;&#119900;&#119876; &#119875; is computed by &#119880;(&#119890; &#119881; , &#119883; &#119880; &#119881; ). In this case, &#119883; &#119880; &#119881; is (0, 0) or &#119883; &#119880; &#119881; is (0, 1) while &#119890; &#119881; is not (&#119872;, &#119874; max &#8595; 1) where 0 &#8771; &#119872; &lt; &#8596; . When there is no delay, i.e., &#119883; &#119880; &#119881; = (0, 0), &#119871; &#119884;&#119900;&#119876; &#119875; is &#119890; &#119881; and &#119871; &#119885; &#119889;&#119900; &#119875; is &#119890;&#119884; (&#119880;(&#119871; &#119899; , &#119883; &#119880; &#119881; )), which is &#119890;&#119884; (&#119871; &#119899; ). By Lemma 1.1, &#119871; &#119884;&#119900;&#119876; = &#119890; &#119901; is earlier than or equal to &#119871; &#119885; &#119889;&#119900; = &#119890;&#119884; (&#119871; &#119899; ).</p><p>s_s RTI s_r NET((&#8734;, MMax)) DNET((&#8734;, MMax)) No messages are produced until 100 ms MSG((100 ms, 0)) MSG((100 ms, 0)) DNET((100 ms, 0)) NET((120 ms, 0)) TAG((100 ms, 0)) LTC((100 ms, 0))</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>NET((&#8734;, MMax))</head><p>A message is produced at 100 ms When there is a microstep delay, i.e., &#119883; &#119880; &#119881; = (0, 1), &#119871; &#119884;&#119900;&#119876; would be &#119880;(&#119890; &#119901; , (0, 1)); we need to consider two cases, whether an over$ow occurs in the microstep or not:</p><p>where 0 &#8771; &#119872; &#119898; &lt; &#8596;, the tag &#119871; &#119884;&#119900;&#119876; , which is &#119880;(&#119890; &#119881; , &#119883; &#119880; &#119881; ), is (&#119872; &#119898; , &#119874; max ) cause the microstep is saturated to &#119874; max . The earliest possible &#119871; &#119899; is (&#119872; &#119898; +1, 0) because &#119871; &#119899; must be strictly later than &#119890; &#119881; . Thus, &#119871; &#119885; &#119889;&#119900; must be later than or equal to &#119890;&#119884; (&#119880;((&#119872; &#119898; + 1, 0), (0, 1))), which is (&#119872; &#119898; + 1, 0). De"netely the tag &#119871; &#119885; &#119889;&#119900; , (&#119872; &#119898; + 1, 0), is later than</p><p>Similarly, the earliest possible &#119871; &#119899; is (&#119872; &#119898; , &#119873; &#119898; + 1) and &#119871; &#119885; &#119889;&#119900; must be later than or equal to &#119890;&#119884; (&#119880;(&#119871; &#119899; , &#119883; &#119880;&#119901; )), which is (&#119872; &#119898; , &#119873; &#119898; + 1). So the tag &#119871; &#119885; &#119889;&#119900; , (&#119872; &#119898; , &#119873; &#119898; + 1), must be later than &#119871; &#119884;&#119900;&#119876; , (&#119872; &#119898; , &#119873; &#119898; + 1).</p><p>Consequently, in every situation, the tag &#119871; &#119885; &#119889;&#119900; &#119875; is later than or equal to the tag &#119871; &#119884;&#119900;&#119876; &#119875; . &#8621; P!""# "# T'$"!$% 1. The TAG &#119880; value computed by LTC signals is min &#119901; &#8599;&#119883; &#119874; (&#119871; &#119884;&#119900;&#119876; &#119877; ) and the TAG &#119880; value computed by EIMT is min &#119901; &#8599;&#119883; &#119874; (&#119871; &#119885; &#119889;&#119900; &#119877; ). Thus, by L#$$% 1.2, the potential range of &#119886; (TAG &#119880; ) computed by &#119881; &#119880; includes the range of possible &#119886; (TAG &#119880; ) attained by &#119890; &#119881; . &#8621;</p><p>According to T&amp;#'(#$ 1, we know &#119886; (TAG &#119880; ) computed by &#119881; &#119880; is more e#cient than &#119886; (TAG &#119880; ) computed by LTC signals, in that the former always allows federate &#119888; to advance to a later (or at least the same) tag. However, T&amp;#'(#$ 1 is valid only if federates send LTC signals to remove tags from the in-transit message queue correctly. Section 5.2.2 explains how we can assure a federate &#119888; sends an LTC &#119880; signal only when that signal removes any tag from &#119891; &#119880; .</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="5.2.2">Latest Tag Confirmed.</head><p>When LF-RTI receives LTC &#119880; with a tag greater than or equal to (&#119891; &#119880; ), LF-RTI can remove the tag (&#119891; &#119880; ) from &#119891; &#119880; . Hence, when a federate &#119888; completes a tag &#119871; &#119880; , the federate &#119888; needs to send LTC &#119880; only if &#119871; &#119880; is later than or equal to (&#119891; &#119880; ). Now, the signal LTC &#119880; con!rms that a federate has received tagged messages with tags earlier than or equal to &#119886; (LTC &#119880; ) and completed the tag &#119886; (LTC &#119880; ), rather than just informing of &#119888;'s latest completed tag. Thus, we also rename the signal to Latest Tag Con!rmed (with the same acronym of LTC) to better re$ect the role of this signal.</p><p>A simple way to send LTC signals considering the in-transit message queue is to let each federate &#119888; maintain a queue of tagged messages they have received. Intuitively, this is federate &#119888;'s copy of LF-RTI's &#119891; &#119880; . Let &#119891; &#8660; &#119880; be the queue maintained by federate &#119888;. When federate &#119888; completes a tag &#119871; &#119880; , it checks (&#119891; &#8660; &#119880; ), the head of &#119891; &#8660; &#119880; , and sends LTC &#119880; with &#119871; &#119880; if &#119871; &#119880; = (&#119891; &#8660; &#119880; ).  The only downside of this approach is the memory overhead to maintain the copies of LF-RTI's in-transit message queues. In LF, each tag occupies 12 Bytes of memory. To reduce such memory overhead, we leverage LF's network input reaction, a special reaction generated for each input port to receive input network messages. When a federate receives a tagged message with a tag &#119871; &#119880; via an input port &#119898;, the network input reaction for the port &#119898; is scheduled at the tag &#119871; &#119880; . That is, if any of the network input reactions is triggered at the tag &#119871; &#119880; , the federate knows that it has received a tagged message with the tag &#119871; &#119880; . Thus, the federate only needs to maintain one global $ag indicating whether a network input reaction has been triggered at the current tag. When the federate completes the current tag and the global $ag is 1, the federate sends an LTC with the completed tag and resets the global $ag to 0.</p><p>Figure <ref type="figure">10</ref> shows the trace when we apply the Latest Tag Con-"rmed signal to an LF program in Figure <ref type="figure">7</ref>. As &#119885;_&#119885; has no upstream federate, it does not receive any messages and does not need to send any LTC signals. On the other hand, &#119885;_&#119896; sends LTC _&#119892; ((100 &#119873;&#119885;, 0)) because it has received the message with the tag (100 &#119873;&#119885;, 0).</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="6">Case Studies</head><p>In this section, we introduce case studies to show how our approach can be applied to the real-world scenarios of distributed CPS.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="6.1">Distance Sensing System</head><p>Figure <ref type="figure">11</ref> shows an LF program that senses an object using an ultrasonic sensor. Federate &#119878;_&#119872; measures the ambient temperature and reports it to federate &#119878;_&#119899; to compensate for the temperature e!ect on the ultrasonic sensor. Examples of such systems include industrial high-accuracy ultrasonic ranging sensors, such as Siemens SITRANS LU150/LU180 ultrasonic level transmitters<ref type="foot">foot_0</ref> used in various applications <ref type="bibr">[32,</ref><ref type="bibr">34]</ref>. In this example, Federate &#119878;_&#119899; polls the sensor every 20 ms and sends a tagged message to &#119878;_&#119875; if the distance is smaller than the given threshold (for handling an emergency). &#9317; DNET((200 ms, MMax)) LTC((100 ms, 0)) &#9314; NET((120 ms, 0)) &#9315; TAG((220 ms -1 ns, MMax)) End of (100 ms, 0) Skip sending NET signals Start of (200 ms, 0) &#9316; T_MSG((300 ms, 0)) T_MSG((300 ms, 0)) Figure 14: An execution trace of the LF program in Figure 13.</p><p>Federate &#119878;_&#119872; polls the temperature sensor every minute because the temperature sensing does not require a high resolution.</p><p>Figure <ref type="figure">12</ref> shows the trace of the program in Figure <ref type="figure">11</ref>. Thanks to DNET &#119877;_&#119894; ((&#8596;, &#119874; max )) in 1 &#8594;, &#119878;_&#119899; does not need to send &#119889; &#119884;&#119900; &#119877;_&#119894; unless it should request additional TAG &#119877;_&#119894; signal to advance its tag. LF-RTI sends TAG &#119877;_&#119894; ((60 &#119897;&#119885; &#8595; 1, 0)) in 3</p><p>&#8594; after receiving NET &#119877;_&#119871; ((60 &#119885;, 0)) in 2</p><p>&#8594; because &#119881; &#119877;_&#119894; is (60 &#119873;&#119885;, 0) and &#119878;_&#119899; can advance its tag to any tags earlier than (60 &#119885;, 0). Without our approach, the &#119886; (TAG &#119877;_&#119894; ) would be (0, 0), which is &#119889; &#119877;_&#119894; , and federate &#119878;_&#119899; and LF-RTI needs to exchange NET and TAG signals every 20 ms. The NET and TAG signal in the box marked No signal until 60 s shows the exchange of signals in the situation that the TAG &#119877;_&#119894; value is decided by NET &#119877;_&#119894; instead of &#119890;&#119884; (&#119881; &#119877;_&#119894; ).</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="6.2">Cycle with Delay</head><p>We can also exploit our solution for federates composing a cycle with delays, like the LF program in Figure <ref type="figure">13</ref>. The LF program is designed for the defective product detection system in Figure <ref type="figure">1a</ref>. A sensor scans products and noti"es the robot arm if there is a defective product. Because the sensor and the robot are apart by some distance, we add a 100 ms logical delay between federate &#119877;_&#119885; and &#119877;_&#119896; . The robot picks out the defective product 100 ms after the sensor detects it. Federate &#119877;_&#119896; sends a message to federate &#119877;_&#119885; to con"rm the robot's operation. If the robot fails to pick out the target product, the system needs to stop the conveyor belt and invoke an error handling protocol. For simplicity, the program in Figure <ref type="figure">13</ref> only shows the robot arm and the sensor.</p><p>Figure <ref type="figure">14</ref> shows an execution trace of the program. We assume that defective products appear and &#119877;_&#119885; send messages every 200 ms starting from (0, 0). At (100 &#119873;&#119885;, 0), LF-RTI receives NET &#119888;_&#119892; ((&#8596;, &#119874; max )) in 1 &#8594;, resulting in DNET &#119888;_ ((&#8596;, &#119874; max )) in 2 &#8594;. Also, &#119877;_&#119885; sends NET &#119888;_ ((120 &#119873;&#119885;, 0)) in 3 &#8594; after completing (100 &#119873;&#119885;, 0). Then LF-RTI sends TAG &#119888;_ ((220 &#119873;&#119885; &#8595; 1 &#119897;&#119885;, &#119874; max )), calculated by &#119890;&#119884; (&#119881; &#119888;_ ) = &#119890;&#119884; ((220 &#119873;&#119885;, 0)). As a result of signals 2 &#8594; and 4</p><p>&#8594;, &#119877;_&#119885; skips sending NET &#119888;_ until (200 &#119873;&#119885;, 0).</p><p>The message and signal 5 &#8594; and 6 &#8594; show how the DNET value is calculated when there is a delay on a connection. After LF-RTI receives the message 5 &#8594;, min(&#119889; &#119888;_&#119892; , (&#119891; &#119888;_&#119892; )) is (300 &#119873;&#119885;, 0) and the delay, &#119883; &#119888;_&#119892;&#119888;_ , is (100 &#119873;&#119885;, 0). Thus, LF-RTI computes the DNET value as &#119894; ((300 &#119873;&#119885;, 0), (100 &#119873;&#119885;, 0)) = (200 &#119873;&#119885;, &#119874; max ).</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="7">Evaluation</head><p>For evaluation, we compare the following approaches:</p><p>1. HLA-like: the current implementation of LF 2. SOTA: the implementation with DNET (explained in Section 3.6) applied to the HLA-like implementation 3. Our solution: the approach presented in Section 5</p><p>We note that neither HLA-like nor SOTA approaches implement the traditional HLA. However, the HLA-like approach coordinates timing in a manner similar to HLA with minor modi"cations described in Section 3.5 with the same core timing mechanisms. Thus, we expect the performance di!erences observed in our experiments to be consistent with those found when comparing against a traditional HLA implementation.</p><p>We select the three examples in Figure <ref type="figure">7</ref>, Figure <ref type="figure">11</ref>, and Figure <ref type="figure">13</ref> as benchmarks. We simulate the examples and compare the lag, de"ned as the time di!erence between the physical time (wallclock time) and the logical time of reactions responsible for polling a sensor. Speci"cally, we measure the lag in:</p><p>&#8226; The reaction of federate &#119885;_&#119885; in SporadicSender (Figure <ref type="figure">7</ref>),</p><p>&#8226; Reaction 1 of federate &#119878;_&#119899; in DistanceSensing (Figure <ref type="figure">11</ref>), and &#8226; Reaction 1 of federate &#119877;_&#119885; in CycleWithDelay (Figure <ref type="figure">13</ref>).</p><p>If the lags in those reactions exceed the timer period, the system will fail to meet the real-time requirements. Also, we evaluate the e#ciency of our solution by comparing the number of control signals, NET, LTC, TAG, and DNET signals.</p><p>We run the federates and LF-RTI on a Raspberry Pi 4 Model B 4GB, communicating through the loopback interface (127.0.0.1). For realistic network conditions, we emulate arti"cial network latency using NetEm, Linux's tra#c control (tc) tool <ref type="bibr">[19]</ref>. As 10 ms of endto-end latency is required for industrial automation <ref type="bibr">[16]</ref>, we set a mean delay to 5 ms to achieve a 10 ms end-to-end delay between federates (through LF-RTI). Additionally, we add a jitter of &#177;1 ms with the tool NetEm <ref type="bibr">[19]</ref> for a more realistic simulation.</p><p>We note that clock synchronization is critical in real-world distributed CPS. Although there is no clock synchronization error in our experiments because every process runs on the same device, we believe the real-world CPS can also achieve the same behavior with the network time protocol (NTP) <ref type="bibr">[33]</ref> over the local network, which provides time synchronization under 1 ms, or the hardware-assisted precision time protocol (PTP) <ref type="bibr">[1]</ref>, which provides synchronization precision below ten nanoseconds.</p><p>In each example, we assume that actual messages are sent every 5 seconds (e.g., whenever the sensor detects events that require communication) while we adjust the sensing intervals (or timer periods). However, in real-world scenarios, actual detection often happens far less frequently. For instance, in a smart factory's defect detection system or a vehicle's emergency braking system, defects or too-close objects ideally do not appear every 5 seconds.  SporadicSender (Figure 7) HLA-like SOTA Our Solution Timer Period 5ms 10ms 20ms 50ms 100ms Timer Period 5ms 10ms 20ms 50ms 100ms Timer Period 5ms 10ms 20ms 50ms 100ms NET 100,159 50,155 25,161 10,152 5,163 NET 654 458 346 261 255 NET 647 450 357 261 271 LTC 100,102 50,102 25,102 10,102 5,102 LTC 100,102 50,102 25,102 10,102 5,102 LTC 100 100 100 100 100 TAG 294 195 102 102 102 TAG 296 197 102 102 102 TAG 291 192 101 101 101 DNET 0 0 0 0 0 DNET 199 200 200 200 199 DNET 200 200 200 200 200 Total 200,555 100,452 50,365 20,356 10,367 Total 101,251 50,957 25,750 10,665 5,658 Total 1,238 942 758 662 672 DistanceSensing (Figure 11) HLA-like SOTA Our Solution Timer Period 5ms 10ms 20ms 50ms 100ms Timer Period 5ms 10ms 20ms 50ms 100ms Timer Period 5ms 10ms 20ms 50ms 100ms NET 48,049 48,113 25,825 10,784 5,820 NET 48,080 48,038 25,811 10,787 5,802 NET 1,326 1,306 1,306 1,329 1,300 LTC 100,512 50,512 25,512 10,512 5,512 LTC 100,512 50,512 25,512 10,512 5,512 LTC 509 509 509 509 509 TAG 98,938 50,633 25,510 10,504 5,504 TAG 97,504 50,540 25,511 10,504 5,504 TAG 520 520 520 519 520 DNET 0 0 0 0 0 DNET 714 954 1,010 1,010 1,010 DNET 1,009 1,010 1,010 1,009 1,010 Total 247,499 149,258 76,847 31,800 16,836 Total 246,810 150,044 77,844 32,813 17,828 Total 3,364 3,345 3,345 3,366 3,339 CycleWithDelay (Figure 13) HLA-like SOTA Our Solution Timer Period 5ms 10ms 20ms 50ms 100ms Timer Period 5ms 10ms 20ms 50ms 100ms Timer Period 5ms 10ms 20ms 50ms 100ms NET 98,440 0 0 0 0 0 DNET 201 201 301 301 301 DNET 301 301 301 301 301 Total 297,018 148,974 75,755 30,478 15,371 Total 297,170 149,135 76,073 30,773 15,678 Total 11,120 11,128 11,131 10,980 10,860</p><p>Table 4: Number of exchanged signals during the 500 sec of runtime with timer periods from 5 ms to 100 ms. Figure <ref type="figure">15</ref> illustrates the measured lags when the timer period is 5, 10, and 20 ms. The graphs do not show the results of 50 and 100 ms because they are almost identical to the result of 20 ms. Figure <ref type="figure">15a</ref> demonstrates the lag of federate &#119885;_&#119885;'s reaction of the program in Figure <ref type="figure">7</ref>. The average lag is always around 0.09 ms, negligible compared to the timer periods, even with the 5 ms period, because &#119885;_&#119885; can advance its tag without TAG signals.</p><p>Our experimental results demonstrate that our solution allows "ne-grained timing control in distributed CPS with "ne-grained timer periods even in challenging networks. Speci"cally, Figure <ref type="figure">15b</ref> and Figure <ref type="figure">15c</ref> show the average lags measured in reactions of the programs in Figure <ref type="figure">11</ref> and Figure <ref type="figure">13</ref>. Federates &#119878;_&#119885; and &#119877;_&#119885; su!er excessive lags when the timer period is 5 ms or 10 ms because they must receive TAG signals from LF-RTI to advance their tag, rendering the "ne-grained timing control infeasible. In the HLA-like and SOTA implementations, a federate waits for one round trip delay because of sending NET and receiving TAG in order to advance its tag each time. Thus, if the sensing period is smaller than the round trip delay, the lag grows unboundly. We note that the system cannot recover from the accumulated lag unless it periodically drops piled up events, which violates LF execution semantics. However, with our solution, a federate can advance its tag without having to wait for LF-RTI's TAG signal every time, thanks to TAG signals computed by EIMT. This enables the system to operate with higher-resolution sensing even under challenging network conditions. Also, the experimental results show that our solution drastically reduces the communication overhead for timing information. Table <ref type="table">4</ref> shows the number of signals for each signal type. Our solution signi"cantly reduces the total number of signals for each example compared to the HLA-like and SOTA implementations. In Sporadic-Sender (Figure <ref type="figure">7</ref>), DistanceSensing (Figure <ref type="figure">11</ref>), and CycleWithDelay (Figure <ref type="figure">13</ref>), the number of signals is reduced by 8.4 to 162.0 times, 5.0 to 73.6 times, and 1.4 to 26.7 times, respectively. The results show that our approach is more e!ective as message-sending events become relatively sparser (i.e., the timer period becomes shorter with the constant message-sending period of 5 seconds).</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="8">Conclusion</head><p>This paper proposes an e#cient coordination scheme for timed events in DDE systems to enable "ne-grained timing control in runtime deployment as well as in simulation. We outline the inef-"cient use of signals for timing coordination in centralized DDE systems, which incurs excessive cost and, in the worst case, makes it infeasible to build systems requiring high-precision timing control. Our evaluation using the state-of-the-art open-source DDE system and real-world use cases con"rms our solution eliminates the ine#ciencies by reducing the overhead of network signals and enabling precise timing control even under challenging environments with a delay greater than the sensing period and a moderate level of jitter.</p></div><note xmlns="http://www.tei-c.org/ns/1.0" place="foot" n="1" xml:id="foot_0"><p>https://www.siemens.com/us/en/products/automation/process-instrumentation/ level-measurement/continuous/ultrasonic/sitrans-lu150-lu180.html</p></note>
			<note xmlns="http://www.tei-c.org/ns/1.0" place="foot" xml:id="foot_1"><p>49,414 25,150 10,173 5,166 NET 98,425 49,405 25,167 10,167 5,172 NET 5,284 5,290 5,294 5,216 5,159 LTC 100,102 50,102 25,102 10,102 5,102 LTC 100,102 50,102 25,102 10,102 5,102 LTC 198 198 198 198 198 TAG 98,476 49,458 25,503 10,203 5,103 TAG 98,442 49,427 25,503 10,203 5,103 TAG 5,337 5,339 5,338 5,265 5,202 DNET</p></note>
		</body>
		</text>
</TEI>
