Create a reusable UDP FragmentGenerator
In our discussions with potential artdaq users, we've heard that it would be nice to have artdaq easily handle the receiving of UDP data packets from hardware modules. Given that, it would probably be worthwhile to create a simple UDP packet FragmentGenerator that would listen for UDP packets and stuff them into artdaq::Fragments, as usual. If we make this FragmentGenerator part of the artdaq package, then it could simply be used out-of-the-box when someone wants such functionality.
Of course, there should probably be associated work to define some of the details of the UDP packet. For example, if the UDP packets that are sent to this FragmentGenerator all have a sequence number in a well-defined place, the FragmentGenerator could use that as the artdaq::Fragment sequence number, or at least cross-check the two.
#4 Updated by Eric Flumerfelt almost 6 years ago
The implementation of a UDPReceiver_generator class has been done for the OTS DAQ proof-of-concept (https://cdcvs.fnal.gov/redmine/projects/otsdaqpoc). Once the reference implementation is complete, it will be ported into one of the artdaq repositories (probably artdaq-demo). The UDPReceiver_generator implements the CAPTAN UDP protocol, which uses the first two bytes out of a standard MTU 1500 UDP packet to describe the data, and the rest of the packet is user-configured data payload.
A summary of the CAPTAN protocol:
Control Packet: From ARTDAQ to UDP-sending hardware:
Byte 0: OpCode: Defined values:
|2||Burst Data Start (Start Run)|
|3||Burst Data Stop (End Run)|
Byte 1: CmdSize: Size of data to Read/Write (if Write, data is from the payload of the packet)
Bytes 2-9: Address: 64-bit register address for Read/Write
Data packet: From UDP-sending hardware to software:
Byte 0: Packet Type:
First Hex: Data stream type:
|1||First in burst|
|3||Last in burst|
Second Hex: Data payload format:
|1||JSON string data|
Byte 1: Sequence ID: Should increment for each packet sent (for UDP QOS, increments mid-burst as well)
#6 Updated by Eric Flumerfelt over 5 years ago
- Status changed from New to Assigned
- % Done changed from 0 to 90
Code has been imported from artdaq-ots to artdaq-demo (branch feature/UDPReceiver). A corresponding UDPFragment class has also been created for artdaq-core-demo (same branch name). The code should be vetted before being included in the official artdaq-demo releases.