Skip to content

Secure: send over TCP instead of UDP - #15

Merged
DavidCozens merged 1 commit into
mainfrom
secure-tcp
Jul 28, 2026
Merged

Secure: send over TCP instead of UDP#15
DavidCozens merged 1 commit into
mainfrom
secure-tcp

Conversation

@DavidCozens

@DavidCozens DavidCozens commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

What this tag adds

A plain TCP transport, replacing UDP: SolidSyslogStreamSender over
SolidSyslogLwipRawTcpStream, with the collector on 5601 and records framed by
octet count (RFC 6587). Moves toward secure.

TCP lands before TLS deliberately — it is the smaller step (a stream, a connect and
a framing rule, no certificates), and it gives store-and-forward somewhere to spool
before crypto arrives. It also complements the sequenceId added earlier: the
transport detects loss where it happens, the sequence only reveals it afterwards.

  Flash         7,664 B     (+548)
  Static RAM    2,784 B     (+180)
  Heap            -32 B       (-8)
  Log stack       448 B         (0)
  Service stack   784 B       (+8)

The log stack does not move — a task that calls Log is unaffected by the transport
underneath it, and the cost lands on the service task, which does the connecting.

Checklist

  • The diff is application-onlyapp/syslog/Syslog.c only. No build-system
    change was needed: SolidSyslogLwipRawTcpStream ships in the LwipRaw pack
    that is already named and linked.
  • measurements/<State>.csv committed, and a row added to measurements/tags.tsv.
    Secure's row is already present; its CSV is frozen at the end of Secure's work,
    not here — see conventions.md.
  • README cost table regenerated — nothing to regenerate until a state's CSV is
    frozen.
  • ./run.sh green (build + QEMU + baseline self-check), record delivered over
    TCP and confirmed in the collector output.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Syslog collection now uses a TCP connection for improved stream-based delivery.
    • The collector port has been updated to 5601.
  • Bug Fixes

    • Improved connection handling to prevent excessive retry spinning.
    • Updated verification results confirm successful delivery of boot messages with refreshed timestamps.

A StreamSender over an lwIP TCP stream replaces the UDP sender, and the collector
moves to 5601. Records are framed by octet count (RFC 6587), which is what a
receiver expects on a stream transport.

  Flash         7,664 B     (+548)
  Static RAM    2,784 B     (+180)
  Heap            -32 B       (-8)
  Log stack       448 B         (0)
  Service stack   784 B       (+8)

TCP before TLS is deliberate. It is the smaller step — a stream, a connect and a
framing rule, with no certificates in the picture — and it gives store-and-forward
somewhere to spool before crypto arrives. It also complements the sequenceId added
earlier: the transport now detects loss at the point it happens, where the sequence
only reveals it afterwards.

The log stack does not move at all. A task that calls Log is unaffected by the
transport underneath it, and what TCP costs lands on the service task, which is the
one that connects. The stream takes a Sleep callback because a connect is not
instantaneous and the library will not pick a blocking primitive on your behalf;
one vTaskDelay is the whole of it.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jul 28, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: d2d0d2bc-06b4-4b94-bf11-824ec44a9c49

📥 Commits

Reviewing files that changed from the base of the PR and between 9480f3a and 385737b.

📒 Files selected for processing (2)
  • app/syslog/Syslog.c
  • run-report.txt

📝 Walkthrough

Walkthrough

Syslog transmission changes from UDP datagrams to an LWIP raw TCP stream on port 5601. A delay helper bounds connection retries, sender setup uses TCP stream configuration, and the run report records updated measurements and collector timestamps.

Changes

Syslog TCP migration

Layer / File(s) Summary
Configure TCP stream transport
app/syslog/Syslog.c
Replaces UDP sender setup with LWIP raw TCP stream configuration, changes the collector port to 5601, and adds FreeRTOS-based retry delay handling.
Update runtime validation
run-report.txt
Updates simulated memory and stack measurements, size cross-check totals, and the timestamp of the collector-received BOOT event.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant SyslogLogger
  participant SolidSyslogStreamSender
  participant LwipRawTcpStream
  participant SyslogCollector
  SyslogLogger->>SolidSyslogStreamSender: enqueue and drain log messages
  SolidSyslogStreamSender->>LwipRawTcpStream: open TCP stream on port 5601
  LwipRawTcpStream->>SyslogCollector: deliver syslog stream
Loading

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: switching syslog delivery from UDP to TCP for a more secure transport.
Description check ✅ Passed The description matches the required template and covers the added capability, rationale, target component, and checklist items.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch secure-tcp

Comment @coderabbitai help to get the list of available commands.

@DavidCozens
DavidCozens merged commit 023d8c4 into main Jul 28, 2026
2 checks passed
@DavidCozens
DavidCozens deleted the secure-tcp branch July 28, 2026 09:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant