Skip to content

CRT topology change#37

Open
denizergonul wants to merge 9 commits intodevelopfrom
dte/crt_topology_change
Open

CRT topology change#37
denizergonul wants to merge 9 commits intodevelopfrom
dte/crt_topology_change

Conversation

@denizergonul
Copy link
Contributor

@denizergonul denizergonul commented Mar 6, 2026

SocketWriter does the following:

  1. Create a writer for each SocketDataSender.
  • Get remote IP from SocketReceiver.
  • Get socket type (TCP/UDP), local port and remote port and local IP from sender.
  1. Map source IDs to writers such that all streams of the same sender are assigned to a single writer. This is because we don't want the same socket connection twice.
    e.g.
    1007->writer1
    1008->writer1
    1009->writer2
    1010->writer2
  2. Create raw data callbacks which call the assigned writer's enqueue function with the received payload.

Writers enqueue function does the following:

  1. Enqueue the payload.
  2. If there's no write in progress, spawn the writing coroutine. (The coroutine writes to the socket until there are no payloads left in the queue.)
    This is to prevent multiple async writes on the same socket.

Changed writers to bind their sockets to local_ip:local_port. Previously, it was left to the OS.

SocketReader does the following:

  1. Create a reader for each SocketDataSender.
  • Get local IP from SocketReceiver.
  • Get socket type (TCP/UDP), local port and remote port and remote IP from sender.
  1. Map the pair of sender and stream ID to sources. This is to be able to figure out the right callback/DHL for a packet.
    {Sender1,Stream ID:0}->DHL1007
    {Sender1,Stream ID:1}->DHL1008
    {Sender2,Stream ID:0}->DHL1009
    {Sender2,Stream ID:1}->DHL1010
    (Identify senders by remote IP-remote port pair.)

If TCPReader, sender is identified during socket creation.
If UDPReader, sender is identified for each received packet.


appmodel PR dte/crt_topology_change
daqsystemtest PR dte/crt_topology_change
crtmodules PR dte/crt_topology_change
asiolibs PR dte/crt_topology_change
daqconf PR dte/crt_cb_update
datahandlinglibs PR dte/cb_acquire
fdreadoutmodules PR dte/crt_rates

crt-readout-cb drawio

This diagram shows the relationships between configuration objects and modules. Here, SocketDetectorToDaqConnection1 represents socket_crt in the example config in daqsystemtest.

CRT readers communicate with socket writers via callbacks.
Socket readers communicate with DHLs via callbacks.

To try out:

  • drunc-unified-shell ssh-standalone config/daqsystemtest/example-configs.data.xml local-socket-1x1-config ${USER}-local-test
  • pytest -s integtest/socket_reader_test.py

Type of change

  • New feature or enhancement (non-breaking change which adds functionality)

Testing checklist

  • Python tests pass if applicable (e.g. python -m pytest)

Further checks

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