Skip to content

Add UDP packet format docs#205

Open
Tom-Willemsen wants to merge 5 commits into
masterfrom
ds_packet_formats
Open

Add UDP packet format docs#205
Tom-Willemsen wants to merge 5 commits into
masterfrom
ds_packet_formats

Conversation

@Tom-Willemsen

Copy link
Copy Markdown
Member

No description provided.

@Tom-Willemsen Tom-Willemsen marked this pull request as draft May 20, 2026 08:25
- **Bits 0..=3**: Reserved for header type
- **Bits 4..=8**: Length of header
- **Bits 9..=10**: Not used
- **Bit 11**: Bad frame

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What exactly constitutes a "bad frame"?

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was what that bit was used for in DAE2/3. Not sure if it was actually implemented on those designs.
So far it isn't used and I have no plans to at the moment.
Could probably make bits 31-9 "not used"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need a version number in the header for if we do change layout? Or can we be sure we will always be able to update all possible clients and not need to read any old data?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

or that a board with old firmware gets used and confuses/crashes new clients

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think having a header type makes sense if it helps provides some flexibility in the future.
Not sure if we do want a separate marker for header length or if we combine the two.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't word 2 bits 4..=8 already "length of header"?

We could almost certainly accomodate different-length headers later if they had e.g. a different "header information" word (maybe later we have a 'EndOfRunHeaderV2' header type)?

@FreddieAkeroyd FreddieAkeroyd Jun 3, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess i had a bit of a general design question here in that should we have a standard ISIS UDP header format that we use for anything we might do, be it detector streaming or something else in future, with the idea to be extensible and avoid the problem of some software misinterpreting a UDP packet. Maybe word 0 (marker byte) could do this to some level. Currently word 0 is fixed, word 1 is some detector specific flags, word 2 has a header type (4 bits) plus some other detector/dae specific stuff. It feels header type should be earlier on in the structure as it is more general than the information in word 1 if we think of header type as not just being "detector header type" but a general packet type?

Comment thread doc/specific_iocs/datastreaming/Datastreaming_udp_packet_formats.md Outdated
- **Bit 0**: FIFO veto
- **Bit 1**: SMP veto
- **Bit 2**: TS2 pulse veto
- **Bit 3**: Wrong pulse veto

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What exactly is a "wrong pulse"?

Is this e.g. not the first TS1 pulse when someone has selected "First TS1" timing source?

- **Bit 2**: TS2 pulse veto
- **Bit 3**: Wrong pulse veto
- **Bit 4**: Unused
- **Bit 5**: ISIS slow

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What exactly does this mean?

Comment thread doc/specific_iocs/datastreaming/Datastreaming_udp_packet_formats.md

### Word 15: checksum

- **Bits 0..=31**: Pre-DDR checksum

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Think we decided to drop this checksum at this level...

### Word 8: protons-per-pulse

- **Bits 0..=7**: protons-per-pulse in this ISIS frame.
- **Bits 8..=31**: unused

@FreddieAkeroyd FreddieAkeroyd May 20, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DAE3 seems to send a 10 bit PPP looking at the packet definition, but i guess we don't expect to need that amount?

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The DAE3 maybe sends a 10 bit PPP but the two lowest bits are padded with 0s. If required I can pad it with 0s to make it 10 bit?

### Word 6: period number

- **Bits 0..=15**: Period number
- **Bits 16..=31**: Not used

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in event mode period number is just an extra metadata tag - is it worth just letting it be 32 bits?

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yea, just an extra metadata tag in event mode so I don't really mind either was on this.
Leaving it as 16 bits leaves us another 16 bits to do something else with at a later date without having to change the header length so keeps it a bit more flexible.

- **Bits 6..=9**: External vetoes
- **Bits 10..=13**: Fast chopper vetoes
- **Bits 14..=15**: Reserved vetoes
- **Bits 16..=23**: Unused

@FreddieAkeroyd FreddieAkeroyd May 20, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there also a "isis not at 50hz" veto? (or is that "isis slow")

@DaveTempleman DaveTempleman left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few comments on some of the questions raised

- **Bits 0..=3**: Reserved for header type
- **Bits 4..=8**: Length of header
- **Bits 9..=10**: Not used
- **Bit 11**: Bad frame

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was what that bit was used for in DAE2/3. Not sure if it was actually implemented on those designs.
So far it isn't used and I have no plans to at the moment.
Could probably make bits 31-9 "not used"

Comment thread doc/specific_iocs/datastreaming/Datastreaming_udp_packet_formats.md Outdated
### Word 6: period number

- **Bits 0..=15**: Period number
- **Bits 16..=31**: Not used

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yea, just an extra metadata tag in event mode so I don't really mind either was on this.
Leaving it as 16 bits leaves us another 16 bits to do something else with at a later date without having to change the header length so keeps it a bit more flexible.

Comment thread doc/specific_iocs/datastreaming/Datastreaming_udp_packet_formats.md
### Word 8: protons-per-pulse

- **Bits 0..=7**: protons-per-pulse in this ISIS frame.
- **Bits 8..=31**: unused

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The DAE3 maybe sends a 10 bit PPP but the two lowest bits are padded with 0s. If required I can pad it with 0s to make it 10 bit?

Comment thread doc/specific_iocs/datastreaming/Datastreaming_udp_packet_formats.md Outdated
@Tom-Willemsen Tom-Willemsen marked this pull request as ready for review June 2, 2026 16:25
### Word 2: Information

- **Bits 0..=3**: Reserved for header type
- **Bits 4..=8**: Length of header

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bytes or words?

Comment on lines +20 to +24
- **Bit 0**: End of run header marker (active low)
- **Bit 1**: Veto frame packet header marker (active low)
- **Bit 2**: Sample environment packet header marker (active low)
- **Bit 3**: Not used
- **Bits 4..=31**: Always `0xFFFFFFF`

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If all bits are high is that a neutron data packet?

Comment on lines +7 to +8
The data comes in over UDP packets, each of which is made up of 32-bit words. All data is transmitted in big-endian
format.

@Tom-Willemsen Tom-Willemsen Jun 4, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can have multiple "messages" (headers + their data) within a single UDP packet, right?

Comment on lines +7 to +8
The data comes in over UDP packets, each of which is made up of 32-bit words. All data is transmitted in big-endian
format.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can/will the UDP packets have trailing padding bytes?

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.

3 participants