<?xml version="1.0" encoding="UTF-8"?>
  <?xml-stylesheet type="text/xsl" href="rfc2629.xslt" ?>
  <!-- generated by https://github.com/cabo/kramdown-rfc version  (Ruby 3.2.3) -->


<!DOCTYPE rfc  [
  <!ENTITY nbsp    "&#160;">
  <!ENTITY zwsp   "&#8203;">
  <!ENTITY nbhy   "&#8209;">
  <!ENTITY wj     "&#8288;">

]>


<rfc ipr="trust200902" docName="draft-dohmeyer-chainsync-04" category="info" submissionType="IETF" xml:lang="en">
  <front>
    <title abbrev="ChainSync">ChainSync: A Synchronization Protocol for Strict Sequential Execution in Linear Distributed Pipelines</title>

    <author initials="" surname="Douglas Dohmeyer" fullname="Douglas Russell Dohmeyer">
      <organization>Independent Researcher</organization>
      <address>
        <postal>
          <country>US</country>
        </postal>
        <email>douglas.dohmeyer@protonmail.com</email>
      </address>
    </author>

    <date year="2026" month="July" day="21"/>

    <area>General</area>
    <workgroup>Independent Submission</workgroup>
    <keyword>distributed</keyword> <keyword>synchronization</keyword> <keyword>pipeline</keyword> <keyword>execution</keyword> <keyword>ordered</keyword> <keyword>coordination</keyword> <keyword>protocol</keyword>

    <abstract>


<t>ChainSync is a lightweight application-layer protocol that runs over reliable TCP connections 
to synchronize a fixed linear chain of distributed processes 
such that they execute their local tasks in strict sequential order 
and only after every process in the chain has confirmed it is ready.
The protocol has four phases:
1) a forward "readiness" wave,
2) a backward "start" wave,
3) a forward "execution" wave,
and 4) a backward exit wave.</t>

<t>The design guarantees strict ordering even when 
nodes become ready at very different times 
and requires only point-to-point TCP connections along the chain, 
thus no central coordinator is needed.</t>



    </abstract>



  </front>

  <middle>


<section anchor="introduction"><name>Introduction</name>

<t>Many distributed workflows (pipeline parallelism in machine-learning training, 
staged data processing, multi-organization business processes, 
ordered multi-phase computation, etc.) require that tasks execute in a fixed 
order across different machines, yet must not begin until every participant is ready.</t>

<t>Standard barriers do not enforce execution order.
Token-passing or leader-based schemes introduce complexity and single points of failure.</t>

<t>ChainSync solves this with a simple, fully decentralized four-wave algorithm on a line topology that guarantees:</t>

<t><list style="numbers">
  <t>No process starts until the entire chain is ready.</t>
  <t>Execution order is strictly A -&gt; B -&gt; ... -&gt; N.</t>
  <t>Clean backward-propagating exit after N finishes.</t>
</list></t>

<t>The protocol requires exactly 4(n-1) messages per synchronization round for an n-node chain (one READY and one START per directed link; and one COMPLETE in each direction).</t>

</section>
<section anchor="requirements-language"><name>Requirements Language</name>

<t>The key words "<bcp14>MUST</bcp14>", "<bcp14>MUST NOT</bcp14>", "<bcp14>REQUIRED</bcp14>", "<bcp14>SHALL</bcp14>", "<bcp14>SHALL
NOT</bcp14>", "<bcp14>SHOULD</bcp14>", "<bcp14>SHOULD NOT</bcp14>", "<bcp14>RECOMMENDED</bcp14>", "<bcp14>NOT RECOMMENDED</bcp14>",
"<bcp14>MAY</bcp14>", and "<bcp14>OPTIONAL</bcp14>" in this document are to be interpreted as
described in BCP 14 <xref target="RFC2119"/> <xref target="RFC8174"/> when, and only when, they
appear in all capitals, as shown here.</t>

</section>
<section anchor="topology-and-configuration"><name>Topology and Configuration</name>

<t>The processes form a static logical chain:</t>

<figure><artwork><![CDATA[
(Head) A <-> B <-> C <-> ... <-> N (Tail)
]]></artwork></figure>

<t>Each process knows:</t>

<t><list style="symbols">
  <t>The IP address and port of its predecessor (Head has none)</t>
  <t>The IP address and port of its successor (Tail has none)</t>
  <t>Whether it is Head, Tail, or intermediate (inferable from the presence/absence of a predecessor/successor)</t>
</list></t>

<t>Each adjacent pair maintains a single persistent bidirectional TCP connection.</t>

</section>
<section anchor="states"><name>States</name>

<texttable>
      <ttcol align='left'>State</ttcol>
      <ttcol align='left'>Meaning</ttcol>
      <c>SYNC</c>
      <c>Initial state; waiting for READY from the predecessor (Head starts here but moves to READY when locally ready)</c>
      <c>READY</c>
      <c>Chain segment to the left is ready; has sent READY to the successor (if not Tail)</c>
      <c>WATCH</c>
      <c>Has propagated START leftward; waiting for COMPLETE from the predecessor (if not Head)</c>
      <c>START</c>
      <c>Currently executing its local task</c>
      <c>COMPLETE</c>
      <c>Local task finished; has sent COMPLETE to its successor (if any)</c>
</texttable>

</section>
<section anchor="message-types"><name>Message Types</name>

<t>Messages are simple ASCII text lines terminated by LF. Recommended format:</t>

<t><spanx style="verb">&lt;COMMAND&gt;[:&lt;ROUND-ID&gt;]\n</spanx></t>

<t>Defined commands:</t>

<t><list style="symbols">
  <t><spanx style="verb">READY[:&lt;ROUND-ID&gt;]</spanx></t>
  <t><spanx style="verb">START[:&lt;ROUND-ID&gt;]</spanx></t>
  <t><spanx style="verb">COMPLETE[:&lt;ROUND-ID&gt;]</spanx></t>
</list></t>

<t><spanx style="verb">&lt;ROUND-ID&gt;</spanx> is optional but <bcp14>RECOMMENDED</bcp14> (e.g., UUID) to support multiple concurrent rounds on the same connection. Implementations running only one round at a time <bcp14>MAY</bcp14> omit it.</t>

</section>
<section anchor="protocol-operation"><name>Protocol Operation</name>

<section anchor="phase-1-readiness-collection-forward-wave"><name>Phase 1 -- Readiness Collection (Forward Wave)</name>

<t><list style="symbols">
  <t>Head (A), when locally ready, moves from SYNC to READY and sends <spanx style="verb">READY</spanx> to its successor.</t>
  <t>Every other node starts in SYNC. When it receives <spanx style="verb">READY</spanx> from predecessor <strong>and</strong> becomes locally ready, it moves from SYNC to READY and sends <spanx style="verb">READY</spanx> to successor.</t>
  <t>When Tail (N) enters READY, Phase 2 begins automatically.</t>
</list></t>

</section>
<section anchor="phase-2-start-trigger-propagation-backward-wave"><name>Phase 2 -- Start Trigger Propagation (Backward Wave)</name>

<t><list style="symbols">
  <t>Tail, upon entering READY, sends <spanx style="verb">START</spanx> to its predecessor and moves to WATCH.</t>
  <t>An intermediate node, upon receiving <spanx style="verb">START</spanx> from its successor:
  <list style="numbers">
      <t>Sends <spanx style="verb">START</spanx> to its predecessor</t>
      <t>Moves to WATCH and waits for <spanx style="verb">COMPLETE</spanx> from its predecessor</t>
    </list></t>
  <t>Head, upon receiving <spanx style="verb">START</spanx>, has no predecessor and therefore moves directly to START and begins execution.</t>
</list></t>

<t>This phase completes in O(n) messages and guarantees every node knows the entire chain is ready before any node starts.</t>

</section>
<section anchor="phase-3-execution-trigger-propagation-forward-wave"><name>Phase 3 -- Execution Trigger Propagation (Forward Wave)</name>

<t><list style="symbols">
  <t>A node in WATCH that receives <spanx style="verb">COMPLETE</spanx> from its predecessor moves to START and begins execution.</t>
  <t>When a node finishes its task, it moves from START to COMPLETE and sends <spanx style="verb">COMPLETE</spanx> to its successor (triggers successor to start)</t>
</list></t>

<t>Execution order is therefore strictly A -&gt; B -&gt; C -&gt; ... -&gt; N.</t>

</section>
<section anchor="phase-4-backward-propagating-exit-backward-wave"><name>Phase 4 -- Backward Propagating Exit (Backward Wave)</name>

<t><list style="symbols">
  <t>Tail, upon entering COMPLETE has no successor and therefore immediately sends <spanx style="verb">COMPLETE</spanx> to its predecessor and <bcp14>MAY</bcp14> terminate.</t>
  <t>An intermediate node in COMPLETE that receives <spanx style="verb">COMPLETE</spanx> from its successor sends <spanx style="verb">COMPLETE</spanx> to its predecessor and <bcp14>MAY</bcp14> terminate.</t>
  <t>Head, upon receiving <spanx style="verb">COMPLETE</spanx> from its successor <bcp14>MAY</bcp14> terminate.</t>
</list></t>

<t>The completion of this phase guarantees the Head node knows all nodes have completed execution.</t>

</section>
</section>
<section anchor="waiting-in-watch-state"><name>Waiting in WATCH State</name>

<t>The <bcp14>RECOMMENDED</bcp14> approach is <strong>push-based</strong>: the node simply blocks on read() from the predecessor's TCP socket. When the predecessor finishes, it pushes <spanx style="verb">COMPLETE</spanx>. An alternative approach is to poll the predecessor's TCP socket.</t>

<t>Both approaches are compliant.</t>

</section>
<section anchor="example-message-flow-a-b-c-d"><name>Example Message Flow (A-B-C-D)</name>
<t>RD: READY<br />
ST: START<br />
CM: COMPLETE</t>

<t>A.....B.....C.....D<br />
|-RD-&gt;|.....|.....| Phase 1 <br />
|.....|-RD-&gt;|.....|<br />
|.....|.....|-RD-&gt;|<br />
|.....|.....|&lt;-ST-| Phase 2<br />
|.....|&lt;-ST-|.....|<br />
|&lt;-ST-|.....|.....| Phase 3<br />
|.....|.....|.....| A starts immediately<br />
|-CM-&gt;|.....|.....| A finishes and B starts<br />
|.....|-CM-&gt;|.....| B finishes and C starts<br />
|.....|.....|-CM-&gt;| C finishes and D starts<br />
|.....|.....|.....| Phase 4<br />
|.....|.....|&lt;-CM-| D finishes <br />
|.....|&lt;-CM-|.....X D exits<br />
|&lt;-CM-|.....X...... C exits<br />
|.....X............ B exits<br />
X.................. A exits</t>

</section>
<section anchor="error-handling"><name>Error Handling</name>

<t>This protocol intentionally does not prescribe error handling.</t>

</section>
<section anchor="IANA"><name>IANA Considerations</name>

<t>This memo includes no request to IANA.</t>

</section>
<section anchor="Security"><name>Security Considerations</name>

<t>Connections <bcp14>SHOULD</bcp14> use TLS 1.3. Production deployments <bcp14>SHOULD</bcp14> use mutual TLS with certificate pinning or pre-shared keys to prevent node impersonation.
This protocol implicitly trusts every node in the chain.
Mutual TLS does not defend against compromised nodes.
It only prevents untrusted nodes from joining the chain.</t>

</section>


  </middle>

  <back>


    <references title='Normative References'>



<reference anchor='RFC2119'>
  <front>
    <title>Key words for use in RFCs to Indicate Requirement Levels</title>
    <author fullname='S. Bradner' initials='S.' surname='Bradner'/>
    <date month='March' year='1997'/>
    <abstract>
      <t>In many standards track documents several words are used to signify the requirements in the specification. These words are often capitalized. This document defines these words as they should be interpreted in IETF documents. This document specifies an Internet Best Current Practices for the Internet Community, and requests discussion and suggestions for improvements.</t>
    </abstract>
  </front>
  <seriesInfo name='BCP' value='14'/>
  <seriesInfo name='RFC' value='2119'/>
  <seriesInfo name='DOI' value='10.17487/RFC2119'/>
</reference>

<reference anchor='RFC8174'>
  <front>
    <title>Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words</title>
    <author fullname='B. Leiba' initials='B.' surname='Leiba'/>
    <date month='May' year='2017'/>
    <abstract>
      <t>RFC 2119 specifies common key words that may be used in protocol specifications. This document aims to reduce the ambiguity by clarifying that only UPPERCASE usage of the key words have the defined special meanings.</t>
    </abstract>
  </front>
  <seriesInfo name='BCP' value='14'/>
  <seriesInfo name='RFC' value='8174'/>
  <seriesInfo name='DOI' value='10.17487/RFC8174'/>
</reference>




    </references>



<section numbered="false" anchor="Acknowledgements"><name>Acknowledgements</name>
<t>The author thanks Grok, an AI system developed by xAI, for assistance in drafting portions of this document based on provided specifications, for editing, for suggestions on the ROUND-ID mechanism for concurrent rounds, and the backward propagation of COMPLETE messages to ensure clean termination.</t>

</section>


  </back>

<!-- ##markdown-source:
H4sIAAAAAAAAA51Z63LbuBX+z6dAnR+1PaI2djzTrjbNVJaUjWd8q6XMNrPd
aSASkrCmCJUAbatJ3qXP0ifrdw7Am+Rk2+qHROJ2rt+5QHEcR9bJPP27zEyu
BsIVpYr0puAn605fvvz+5WmUSDcQOl+YyJbztbZWm9xtN1h/MZm9jWSh5ED8
qHJVyCx6XGI4T9VG4St3YlpviaLUJLlcY19ayIWLU7Naq60q4mQldW63eRK/
PIsip12GNQcjGp1idCCGgn5Xhcn1P6XDWeK2MM4kJhMLU4ipK3QCUuofJUhq
mYnJk0pKXqhzcalzJQsx1hbr5qVTqbjVG5Vh2B5Ecj4v1MNA1OSiTOYQQuXR
/eMgEiIWabOT322XGR7bhBP5RVXk+c0UqSrC1sTgTeetfUGQSJZuZYpBFINl
OxBjUy4zafHrlYTFXnfVxF1prcqy9gJT7Cj/TllInqx4NjFl7ortQLyf4k2t
pc5gCX9av7LFn5mfnCb7iVlHuSnWYPZBkSbu3o5OT06+H4gX4m5yezkcTSJy
i3pFFMexkHMoSyYuimqNCm2FFJlertyjom8hN5tMJ6yFOJOgW+tBuJV0oihz
K8wDxgtoVc4zJWajW4iQ5yqhXVZEzrQMoUBgoZ9g2sxbm31KmEXbeEQkUVAb
dtsyWXlabqW2wWKKXnQhMpPAiZy095YcyHr/so1/sUlFBOgIk2dbAXfGuwLD
24oIbcRpgZEVLAbuF7pYgw/tSCXATbrtRzMsqqWndQtTQh94UnYQnRyRZ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