Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Checksum support in SPARK #276

Open
senier opened this issue Jun 4, 2020 · 4 comments
Open

Checksum support in SPARK #276

senier opened this issue Jun 4, 2020 · 4 comments
Labels
generator Related to generator package (SPARK code generation)

Comments

@senier
Copy link
Member

senier commented Jun 4, 2020

Cf. #240, #222

@senier senier created this issue from a note in RecordFlux 0.5 (To do) Jun 4, 2020
@senier senier added the generator Related to generator package (SPARK code generation) label Jun 4, 2020
@senier senier moved this from To do to In progress in RecordFlux 0.5 Jul 24, 2020
@treiher treiher assigned senier and unassigned senier Jul 24, 2020
@treiher treiher moved this from In progress to To do in RecordFlux 0.5 Jul 27, 2020
@treiher treiher changed the title Checksum support Checksum support in SPARK Jul 29, 2020
@treiher
Copy link
Collaborator

treiher commented Jul 29, 2020

The current design (#222) allows to specify checksums which depend fields following a checksum field. This is required for example for ICMP messages, where all fields must be set before the checksum function could be called.

The generated SPARK code only allows to set fields in order of their occurrence. If any previously set field is changed, all subsequent fields would be invalidated. In case of ICMP this would mean that at first all fields of a ICMP would need to be set, before the checksum function can be used. If the result of the checksum function is used to set the checksum field, all subsequent field would be invalidated and must be set again.

Solutions

  1. Removing the invalidation of subsequent fields by allowing fields to be set in "any" order (Lazy message parsing and generation #107)
  2. Adding a function for setting a checksum field (based on the provided checksum function) which does not invalidate subsequent fields (this would require that the structure of a message does not depend on the value of the checksum field)

@senier
Copy link
Member Author

senier commented Jul 29, 2020

I'd prefer the more generic solution of #107 in favor of a special case handling proposed in 2. Question is, how complicated is the implementation of #107 going to be?

@treiher
Copy link
Collaborator

treiher commented Jul 30, 2020

The changes would be quite big. My optimistic estimate would be 5-8 person days just for the relevant parts of #107 with a high risk of finding unforeseen problems.

@senier
Copy link
Member Author

senier commented Jul 30, 2020

Then we should go for option 2 and validate that the structure of the message really does not depend on the checksum field (which should normally be the case as the checksum is set to 0 and filled in later in most protocols).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
generator Related to generator package (SPARK code generation)
Projects
No open projects
Development

No branches or pull requests

2 participants