Index: /trunk/BNC/src/RTCM3/RTCM3coDecoder.cpp
===================================================================
--- /trunk/BNC/src/RTCM3/RTCM3coDecoder.cpp	(revision 11073)
+++ /trunk/BNC/src/RTCM3/RTCM3coDecoder.cpp	(revision 11074)
@@ -223,4 +223,15 @@
     int bytesused = 0;
 
+    // message type of the frame at the start of the buffer (RTCM number,
+    // IGS-SSR 4076: 4076000 + subtype)
+    int msgType = -1;
+    if (_buffer.size() >= 6 && (unsigned char)_buffer[0] == 0xD3) {
+      const unsigned char* bb = reinterpret_cast<const unsigned char*>(_buffer.constData());
+      msgType = (bb[3] << 4) | (bb[4] >> 4);
+      if (msgType == 4076) {
+        msgType = 4076000 + (((bb[4] & 0x01) << 7) | (bb[5] >> 1));
+      }
+    }
+
     GCOB_RETURN irc = _ssrCorr->GetSSR(&_clkOrb, &_codeBias, &_vTEC, &_phaseBias, &_metaData, &_antenna,
                                        _buffer.data(), _buffer.size(), &bytesused);
@@ -272,4 +283,12 @@
           checkProviderID();
           sendResults();
+          // Pass on the epoch as soon as it is complete, not only when the
+          // next epoch arrives (one update interval later): complete when
+          // all message types of the previous epoch have arrived with
+          // Multiple Message Indicator 0. Consumers (PPP, combination) must
+          // not see an epoch partly, e.g. new clocks with old orbits.
+          if (irc == GCOBR_OK) {
+            checkEpochComplete(msgType);
+          }
           retCode = success;
         }
@@ -788,4 +807,45 @@
 }
 
+// Pass the current epoch on as soon as it is complete: every message type
+// due at this epoch has arrived with Multiple Message Indicator 0. A type is
+// due if its interval (learned from its previous epochs) has passed since
+// its last epoch; types missing for more than three intervals are no longer
+// expected. Until the intervals are known, and if a due type is missing,
+// the epoch is passed on when the next epoch arrives. Types arriving after
+// the epoch was passed on are passed on as soon as they are complete.
+////////////////////////////////////////////////////////////////////////////
+void RTCM3coDecoder::checkEpochComplete(int msgType) {
+  const bncTime& epoch = _lastTime;
+  if (_typeLast.contains(msgType)) {
+    if (!(_typeLast[msgType] < epoch)) {
+      if (epoch == _flushedEpoch) {
+        dumpEpochs(true);  // repeated type of an epoch already passed on
+      }
+      return;
+    }
+    _typeInt[msgType] = epoch - _typeLast[msgType];
+  }
+  _typeLast[msgType] = epoch;
+
+  if (epoch == _flushedEpoch) {
+    dumpEpochs(true);
+    return;
+  }
+  bool complete = !_typeInt.isEmpty();
+  QMapIterator<int, double> it(_typeInt);
+  while (it.hasNext()) {
+    it.next();
+    double sinceLast = epoch - _typeLast[it.key()];
+    if (sinceLast > 0.0 && sinceLast >= it.value() - 0.1 && sinceLast <= 3.0 * it.value()) {
+      complete = false;
+      break;
+    }
+  }
+  if (complete) {
+    dumpEpochs(true);
+    _flushedEpoch = epoch;
+  }
+}
+
 // Emit and write the collected corrections of all epochs older than
 // _lastTime (all epochs if all is set, e.g. at the end of a replay)
Index: /trunk/BNC/src/RTCM3/RTCM3coDecoder.h
===================================================================
--- /trunk/BNC/src/RTCM3/RTCM3coDecoder.h	(revision 11073)
+++ /trunk/BNC/src/RTCM3/RTCM3coDecoder.h	(revision 11074)
@@ -75,4 +75,5 @@
   void sendResults();
   void dumpEpochs(bool all);
+  void checkEpochComplete(int msgType);
   void reopen();
   void checkProviderID();
@@ -86,4 +87,9 @@
   // convention of old encoders (GLONASS: UTC seconds of day, BDS: BDT)
   double                                _igsRefEpoSec = -1.0;
+  // Per message type (RTCM number, IGS-SSR 4076000 + subtype): latest epoch
+  // completed (Multiple Message Indicator 0) and interval between epochs
+  QMap<int, bncTime>                    _typeLast;
+  QMap<int, double>                     _typeInt;
+  bncTime                               _flushedEpoch; // latest epoch passed on as complete
   QMap<QChar, bncTime>                  _legacyEpochWarned; // warned at most once per hour
   QMap<QChar, bncTime>                  _epochDiffWarned;   // warned at most once per hour
Index: /trunk/BNC/tests/cases/combi/case.json
===================================================================
--- /trunk/BNC/tests/cases/combi/case.json	(revision 11074)
+++ /trunk/BNC/tests/cases/combi/case.json	(revision 11074)
@@ -0,0 +1,24 @@
+{
+  "description": "17_Combi replay: Kalman filter combination of SSRA00CNE1 + SSRA00CHC1 + SSRA00BKG1 with CAS biases to SP3/CLK (upload to caster disabled), 11 min",
+  "config": "Example_Configs/17_Combi.bnc",
+  "raw": "data/combi_261005_11min.raw",
+  "exit_code": 5,
+  "timeout": 900,
+  "args": [
+    "-key",
+    "rawOutFile",
+    "",
+    "-key",
+    "uploadMountpointsOut",
+    ",,,2,,,IGS20,IGS-SSR,2,Output/BKG0MGXRTS${V3PROD}.SP3,Output/BKG0MGXRTS${V3PROD}.CLK,Output/BKG0MGXRTS${V3PROD}.BIA,,,,0 byte(s),"
+  ],
+  "outputs": [
+    "Output/*.SP3",
+    "Output/*.CLK",
+    "Output/*.BIA",
+    {
+      "glob": "Output/Combi.log_261005",
+      "name": "Combi.log"
+    }
+  ]
+}
Index: /trunk/BNC/tests/cases/combi_multi/case.json
===================================================================
--- /trunk/BNC/tests/cases/combi_multi/case.json	(revision 11074)
+++ /trunk/BNC/tests/cases/combi_multi/case.json	(revision 11074)
@@ -0,0 +1,27 @@
+{
+  "description": "17_Combi with 7 ACs (BKG1, CHC1, CNE1, GFZ1, GMV0, NRC0, SHA1; IGS-SSR and RTCM-SSR) from the operational combination, 5.5 min: legacy/erroneous epoch encodings, missing reference biases, inconsistent biases, persistent outliers",
+  "config": "Example_Configs/17_Combi.bnc",
+  "raw": "data/combi_multi_261002_5min.raw",
+  "exit_code": 5,
+  "timeout": 900,
+  "args": [
+    "-key",
+    "rawOutFile",
+    "",
+    "-key",
+    "cmbStreams",
+    "SSRA00BKG1 BKG 1.0  Computed ;SSRA00CHC1 CHC 1.0  Computed ;SSRA00CNE1 CNE 1.0  Computed ;SSRA01GFZ1 GFZ 1.0  Computed ;SSRA00GMV0 GMV 1.0  Computed ;SSRA00NRC0 NRC 1.0  Computed ;SSRA01SHA1 SHA 1.0  Computed ",
+    "-key",
+    "uploadMountpointsOut",
+    ",,,2,,,IGS20,IGS-SSR,2,Output/BKG0MGXRTS${V3PROD}.SP3,Output/BKG0MGXRTS${V3PROD}.CLK,Output/BKG0MGXRTS${V3PROD}.BIA,,,,0 byte(s),"
+  ],
+  "outputs": [
+    "Output/*.SP3",
+    "Output/*.CLK",
+    "Output/*.BIA",
+    {
+      "glob": "Output/Combi.log_261002",
+      "name": "Combi.log"
+    }
+  ]
+}
Index: /trunk/BNC/tests/cases/combi_ppp/case.json
===================================================================
--- /trunk/BNC/tests/cases/combi_ppp/case.json	(revision 11074)
+++ /trunk/BNC/tests/cases/combi_ppp/case.json	(revision 11074)
@@ -0,0 +1,25 @@
+{
+  "description": "18_CombiPPP replay: combination of SSRA00CHC1 + SSRA00CNE1 plus INTERNAL PPP of FFMJ00DEU0 with the combined corrections, 11 min",
+  "config": "Example_Configs/18_CombiPPP.bnc",
+  "raw": "data/combi_261005_11min.raw",
+  "exit_code": 5,
+  "timeout": 900,
+  "args": [
+    "-key",
+    "rawOutFile",
+    "",
+    "-key",
+    "uploadMountpointsOut",
+    ",,,2,,,IGS20,IGS-SSR,2,Output/BKG0MGXRTS${V3PROD}.SP3,Output/BKG0MGXRTS${V3PROD}.CLK,Output/BKG0MGXRTS${V3PROD}.BIA,,,,0 byte(s),"
+  ],
+  "outputs": [
+    "Output/*.SP3",
+    "Output/*.CLK",
+    "Output/*.BIA",
+    "Output/*.ppp",
+    {
+      "glob": "Output/CombiPPP.log_261005",
+      "name": "CombiPPP.log"
+    }
+  ]
+}
Index: /trunk/BNC/tests/cases/ppp_rt_has/case.json
===================================================================
--- /trunk/BNC/tests/cases/ppp_rt_has/case.json	(revision 11074)
+++ /trunk/BNC/tests/cases/ppp_rt_has/case.json	(revision 11074)
@@ -0,0 +1,19 @@
+{
+  "description": "13_PPPGalHAS replay: Quick-Start PPP with Galileo HAS corrections (SSRA00EUH0), GPS + Galileo, 11 min",
+  "config": "Example_Configs/13_PPPGalHAS.bnc",
+  "raw": "data/merged_260930_11min.raw",
+  "exit_code": 5,
+  "timeout": 900,
+  "args": [
+    "-key",
+    "rawOutFile",
+    ""
+  ],
+  "outputs": [
+    {
+      "glob": "Output/PPPGalHAS.log_260930",
+      "name": "PPPGalHAS.log"
+    },
+    "Output/*.ppp"
+  ]
+}
Index: /trunk/BNC/tests/cases/ppp_rt_net/case.json
===================================================================
--- /trunk/BNC/tests/cases/ppp_rt_net/case.json	(revision 11074)
+++ /trunk/BNC/tests/cases/ppp_rt_net/case.json	(revision 11074)
@@ -0,0 +1,19 @@
+{
+  "description": "09_PPPNet replay: real-time PPP for two stations (WTZR00DEU0, FFMJ00DEU0) with SSRA00CNE1, 11 min",
+  "config": "Example_Configs/09_PPPNet.bnc",
+  "raw": "data/merged_260930_11min.raw",
+  "exit_code": 5,
+  "timeout": 900,
+  "args": [
+    "-key",
+    "rawOutFile",
+    ""
+  ],
+  "outputs": [
+    {
+      "glob": "Output/PPPNet.log_260930",
+      "name": "PPPNet.log"
+    },
+    "Output/*.ppp"
+  ]
+}
Index: /trunk/BNC/tests/cases/replay_save_sp3_has/case.json
===================================================================
--- /trunk/BNC/tests/cases/replay_save_sp3_has/case.json	(revision 11074)
+++ /trunk/BNC/tests/cases/replay_save_sp3_has/case.json	(revision 11074)
@@ -0,0 +1,23 @@
+{
+  "description": "14_SaveSp3 replay with Galileo HAS (SSRA00EUH0) only: SP3/CLK from corrections off the sampling grid (epochs ...:02, ...:12), 11 min",
+  "config": "Example_Configs/14_SaveSp3.bnc",
+  "raw": "data/merged_260930_11min.raw",
+  "exit_code": 5,
+  "timeout": 900,
+  "args": [
+    "-key",
+    "rawOutFile",
+    "",
+    "-key",
+    "cmbStreams",
+    "SSRA00EUH0 EUH 1.0  Computed "
+  ],
+  "outputs": [
+    "Output/*.SP3",
+    "Output/*.CLK",
+    {
+      "glob": "Output/SaveSp3.log_260930",
+      "name": "SaveSp3.log"
+    }
+  ]
+}
Index: /trunk/BNC/tests/cases/ssr_qc/case.json
===================================================================
--- /trunk/BNC/tests/cases/ssr_qc/case.json	(revision 11074)
+++ /trunk/BNC/tests/cases/ssr_qc/case.json	(revision 11074)
@@ -0,0 +1,18 @@
+{
+  "description": "31_SsrQC replay: SSR QC report of the 7 AC streams of data/combi_multi_261002_5min.raw, 5 min report interval",
+  "config": "Example_Configs/31_SsrQC.bnc",
+  "raw": "data/combi_multi_261002_5min.raw",
+  "exit_code": 5,
+  "timeout": 600,
+  "args": [
+    "-key",
+    "ssrQcIntr",
+    "5 min"
+  ],
+  "outputs": [
+    {
+      "glob": "Output/SsrQC.txt",
+      "name": "ssrqc.txt"
+    }
+  ]
+}
Index: /trunk/BNC/tests/cases/upload_eph/case.json
===================================================================
--- /trunk/BNC/tests/cases/upload_eph/case.json	(revision 11074)
+++ /trunk/BNC/tests/cases/upload_eph/case.json	(revision 11074)
@@ -0,0 +1,31 @@
+{
+  "description": "19_UploadEph replay: broadcast ephemerides (BCEP00BKG0) without SBAS (their upload depends on timing: the current set is sent at wall-clock intervals and frequently changing SBAS ephemerides may be superseded before) encoded to RTCM3 and uploaded to a local fake caster, decoded again to RINEX nav, 5 min",
+  "config": "Example_Configs/19_UploadEph.bnc",
+  "raw": "data/upload_rtnet_5min.raw",
+  "exit_code": 5,
+  "timeout": 600,
+  "args": [
+    "-key",
+    "uploadEphMountpointsOut",
+    "127.0.0.1,21111,BCEP00TEST,2,user,pass,GRECJ,0 byte(s),"
+  ],
+  "fakecaster": {
+    "port": 21111,
+    "out": "Output/upload.raw",
+    "sta": "BCEP00TEST",
+    "time": "2026-10-01T09:33:00",
+    "timeout": 10
+  },
+  "post": [
+    {
+      "dir": "dec",
+      "config": "Example_Configs/02_RinexEph.bnc",
+      "raw": "Output/upload.raw",
+      "exit_code": 5,
+      "timeout": 300
+    }
+  ],
+  "outputs": [
+    "dec/Output/*.rnx"
+  ]
+}
Index: /trunk/BNC/tests/cases/upload_raw/case.json
===================================================================
--- /trunk/BNC/tests/cases/upload_raw/case.json	(revision 11074)
+++ /trunk/BNC/tests/cases/upload_raw/case.json	(revision 11074)
@@ -0,0 +1,31 @@
+{
+  "description": "20_UploadRaw replay: BCEP00BKG0 forwarded unchanged to a local fake caster, decoded again to RINEX nav, 5 min",
+  "config": "Example_Configs/20_UploadRaw.bnc",
+  "raw": "data/upload_rtnet_5min.raw",
+  "exit_code": 5,
+  "timeout": 600,
+  "args": [
+    "-key",
+    "uploadRawMountpointsOut",
+    "BCEP00BKG0,127.0.0.1,21121,BCEP00TEST,2,user,pass,0 byte(s),"
+  ],
+  "fakecaster": {
+    "port": 21121,
+    "out": "Output/upload.raw",
+    "sta": "BCEP00TEST",
+    "time": "2026-10-01T09:33:00",
+    "timeout": 10
+  },
+  "post": [
+    {
+      "dir": "dec",
+      "config": "Example_Configs/02_RinexEph.bnc",
+      "raw": "Output/upload.raw",
+      "exit_code": 5,
+      "timeout": 300
+    }
+  ],
+  "outputs": [
+    "dec/Output/*.rnx"
+  ]
+}
Index: /trunk/BNC/tests/cases/upload_rtnet/case.json
===================================================================
--- /trunk/BNC/tests/cases/upload_rtnet/case.json	(revision 11074)
+++ /trunk/BNC/tests/cases/upload_rtnet/case.json	(revision 11074)
@@ -0,0 +1,17 @@
+{
+  "description": "16_Upload replay: RTNET orbits/clocks/biases + BCEP00BKG0 encoded to IGS-SSR and uploaded (Ntrip 2, chunked) to a local fake caster; SP3/CLK/BIA written; the uploaded stream is decoded again (03_BrdcCorr), 5 min",
+  "config": "Example_Configs/16_Upload.bnc",
+  "raw": "data/upload_rtnet_5min.raw",
+  "exit_code": 5,
+  "timeout": 600,
+  "args": ["-key", "uploadMountpointsOut",
+           "127.0.0.1,21101,CLOCK,2,user,pass,IGS20,IGS-SSR,0,Output/BKG0MGXRTS${V3PROD}.SP3,Output/BKG0MGXRTS${V3PROD}.CLK,Output/BKG0MGXRTS${V3PROD}.BIA,,,,0 byte(s),"],
+  "fakecaster": {"port": 21101, "out": "Output/upload.raw", "sta": "SSRA00UPL1",
+                 "time": "2026-10-01T09:33:00", "timeout": 10},
+  "post": [{"dir": "dec", "config": "Example_Configs/03_BrdcCorr.bnc",
+            "raw": "Output/upload.raw", "exit_code": 5, "timeout": 300}],
+  "outputs": ["Output/*.SP3", "Output/*.CLK", "Output/*.BIA",
+              {"glob": "Output/Upload.log_261001", "name": "Upload.log"},
+              "dec/Output/*.ssr",
+              {"glob": "dec/stderr.txt", "name": "decode_trace.txt", "debug_trace": true}]
+}
Index: /trunk/BNC/tests/tools/fakecaster.py
===================================================================
--- /trunk/BNC/tests/tools/fakecaster.py	(revision 11074)
+++ /trunk/BNC/tests/tools/fakecaster.py	(revision 11074)
@@ -0,0 +1,128 @@
+#!/usr/bin/env python3
+"""Minimal Ntrip caster that accepts uploads (Ntrip 1 SOURCE or Ntrip 2 POST
+with chunked transfer encoding) and stores the received stream as a BNC raw
+file, so that it can be decoded again with  bnc --file .
+
+Any number of (re)connections is accepted, as BNC may close and reopen the
+upload connection; the payload of all connections is stored in arrival order.
+The BNC raw format needs an epoch per chunk (BNC derives the current time from
+it, e.g. to resolve SSR epoch times); all data are written as chunks stamped
+with --time, which should be close to the epochs of the uploaded data.
+
+    fakecaster.py --port 21011 --out upload.raw --sta CLOCK --time 2026-10-01T09:30:00
+"""
+
+import argparse
+import socket
+import sys
+import threading
+
+
+def dechunk(buf):
+    """Remove HTTP chunked transfer encoding; returns (payload, rest, done)."""
+    out = bytearray()
+    while True:
+        i = buf.find(b"\r\n")
+        if i < 0:
+            return bytes(out), buf, False
+        try:
+            n = int(buf[:i].split(b";")[0], 16)
+        except ValueError:
+            return bytes(out), b"", True
+        if len(buf) < i + 2 + n + 2:
+            return bytes(out), buf, False
+        out += buf[i + 2:i + 2 + n]
+        buf = buf[i + 2 + n + 2:]
+        if n == 0:
+            return bytes(out), b"", True
+
+
+class Store:
+    def __init__(self, path, sta, fmt, time):
+        self.lock = threading.Lock()
+        self.out = open(path, "wb")
+        self.out.write(b"1 Version of BNC raw file\n")
+        self.head = "%s %s %s" % (time, sta, fmt)
+        self.total = 0
+
+    def write(self, data):
+        if data:
+            with self.lock:
+                self.out.write(("%s %d\n" % (self.head, len(data))).encode())
+                self.out.write(data)
+                self.out.write(b"\n")
+                self.out.flush()
+                self.total += len(data)
+
+
+def serve(conn, store, timeout):
+    conn.settimeout(timeout)
+    buf = b""
+    try:
+        while b"\r\n\r\n" not in buf:
+            d = conn.recv(4096)
+            if not d:
+                return
+            buf += d
+        header, _, pending = buf.partition(b"\r\n\r\n")
+        chunked = b"chunked" in header.lower()
+        if header.startswith(b"SOURCE"):
+            conn.sendall(b"ICY 200 OK\r\n\r\n")
+        else:
+            conn.sendall(b"HTTP/1.1 200 OK\r\nNtrip-Version: Ntrip/2.0\r\n\r\n")
+        while True:
+            if chunked:
+                payload, pending, done = dechunk(pending)
+                store.write(payload)
+                if done:
+                    return
+            else:
+                store.write(pending)
+                pending = b""
+            d = conn.recv(65536)
+            if not d:
+                return
+            pending += d
+    except (socket.timeout, OSError):
+        return
+    finally:
+        conn.close()
+
+
+def main():
+    ap = argparse.ArgumentParser(description=__doc__,
+                                 formatter_class=argparse.RawDescriptionHelpFormatter)
+    ap.add_argument("--port", type=int, required=True)
+    ap.add_argument("--out", required=True)
+    ap.add_argument("--sta", default="CLOCK", help="station ID written to the raw file")
+    ap.add_argument("--format", default="RTCM_3.3")
+    ap.add_argument("--time", required=True, help="ISO epoch for the raw file chunks")
+    ap.add_argument("--timeout", type=float, default=600.0,
+                    help="stop after this many seconds without a new connection or data")
+    args = ap.parse_args()
+
+    store = Store(args.out, args.sta, args.format, args.time)
+    srv = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
+    srv.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
+    srv.bind(("127.0.0.1", args.port))
+    srv.listen(5)
+    srv.settimeout(args.timeout)
+    print("listening", flush=True)
+
+    threads = []
+    while True:
+        try:
+            conn, _ = srv.accept()
+        except socket.timeout:
+            break
+        t = threading.Thread(target=serve, args=(conn, store, args.timeout), daemon=True)
+        t.start()
+        threads.append(t)
+    for t in threads:
+        t.join(args.timeout)
+    print("received %d bytes in %d connection(s)" % (store.total, len(threads)), flush=True)
+    return 0
+
+
+if __name__ == "__main__":
+    sys.exit(main())
