Idea #7244

Create a reusable UDP FragmentGenerator

Added by Kurt Biery about 6 years ago. Updated over 4 years ago.

Target version:
Start date:
Due date:
% Done:


Estimated time:
40.00 h


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.


#1 Updated by Kurt Biery about 6 years ago

  • Estimated time set to 40.00 h

#2 Updated by Eric Flumerfelt about 6 years ago

  • Assignee set to Eric Flumerfelt

#3 Updated by Kurt Biery over 5 years ago

  • Target version changed from 577 to v1_12_10

#4 Updated by Eric Flumerfelt over 5 years ago

The implementation of a UDPReceiver_generator class has been done for the OTS DAQ proof-of-concept ( 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:

0 Read Register
1 Write Register
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:

0 Read Response
1 First in burst
2 Mid-burst
3 Last in burst

Second Hex: Data payload format:

0 Raw data
1 JSON string data

Byte 1: Sequence ID: Should increment for each packet sent (for UDP QOS, increments mid-burst as well)

#5 Updated by Kurt Biery over 5 years ago

  • Target version changed from v1_12_10 to v1_12_11

#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.

#7 Updated by Kurt Biery over 5 years ago

  • Target version changed from v1_12_11 to v1_12_13

#8 Updated by Kurt Biery about 5 years ago

  • Status changed from Assigned to Resolved

This functionality has been available in the artdaq-demo for some time.

#9 Updated by Eric Flumerfelt over 4 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF