Skip to content

Adds specification of default query and response handling#1000

Merged
matsduf merged 16 commits into
zonemaster:developfrom
matsduf:add-specification-for-queries-and-responses
Jan 28, 2022
Merged

Adds specification of default query and response handling#1000
matsduf merged 16 commits into
zonemaster:developfrom
matsduf:add-specification-for-queries-and-responses

Conversation

@matsduf

@matsduf matsduf commented Oct 24, 2021

Copy link
Copy Markdown
Contributor

Purpose

This PR adds a specification for the default setting of the DNS queries that the test cases emit. Test cases are to refer to this specification and use the default setting or specify the deviation.

  1. By having a shared specification the test cases will be more consistent.
  2. The test case specifications do not have to specify the DNS query when default values are used.

The specification also has default handling of the response, and that will give consistent handling in the test cases.

@matsduf matsduf added the A-TestCase Area: Test case specification or implementation of test case label Oct 24, 2021
@matsduf matsduf added this to the v2022.1 milestone Oct 24, 2021
@matsduf matsduf requested a review from vlevigneron October 24, 2021 22:16
@matsduf matsduf changed the title First version Adds specification default DNS query and default handling of DNS response for the test case specifications Oct 24, 2021
@matsduf matsduf changed the title Adds specification default DNS query and default handling of DNS response for the test case specifications Adds specification of default DNS query and default handling of DNS response Oct 26, 2021
@matsduf matsduf changed the title Adds specification of default DNS query and default handling of DNS response Adds specification of default query and response handling Oct 26, 2021
@matsduf

matsduf commented Nov 1, 2021

Copy link
Copy Markdown
Contributor Author

@vlevigneron, do you have a comment on this PR?

@matsduf matsduf requested a review from mattias-p November 15, 2021 10:55

@mattias-p mattias-p left a comment

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 really like this document!

The filename is misspelled. Also, maybe call it DNSQueryAndResponseDefaults.md?

Comment thread docs/specifications/tests/DNSQueryAndResponsSpecification.md Outdated
Comment thread docs/specifications/tests/DNSQueryAndResponsSpecification.md Outdated
Comment thread docs/specifications/tests/DNSQueryAndResponsSpecification.md Outdated
Comment thread docs/specifications/tests/DNSQueryAndResponsSpecification.md Outdated
Comment thread docs/specifications/tests/DNSQueryAndResponsSpecification.md Outdated

@matsduf matsduf left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The document is renamed as suggested. Also the headline is changed accordingly.

Comment thread docs/specifications/tests/DNSQueryAndResponsSpecification.md Outdated
Comment thread docs/specifications/tests/DNSQueryAndResponsSpecification.md Outdated
Comment thread docs/specifications/tests/DNSQueryAndResponsSpecification.md Outdated
Comment thread docs/specifications/tests/DNSQueryAndResponsSpecification.md Outdated
Comment thread docs/specifications/tests/DNSQueryAndResponsSpecification.md Outdated
@matsduf matsduf requested a review from mattias-p November 15, 2021 18:12
@matsduf

matsduf commented Nov 15, 2021

Copy link
Copy Markdown
Contributor Author

@vlevigneron, could you review?

mattias-p
mattias-p previously approved these changes Nov 15, 2021

@mattias-p mattias-p left a comment

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.

LGTM

Comment thread docs/specifications/tests/DNSQueryAndResponseDefaults.md Outdated
@matsduf

matsduf commented Dec 10, 2021

Copy link
Copy Markdown
Contributor Author

@mattias-p, updated after our discussion. Please review again.

@matsduf matsduf requested review from a user and tgreenx January 4, 2022 15:05
@matsduf

matsduf commented Jan 4, 2022

Copy link
Copy Markdown
Contributor Author

@mattias-p, @vlevigneron, @PNAX and @tgreenx, please review this.

@ghost ghost 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.

This looks good and would definitely remove some redundancy across tests specifications.

Just a question on the handling of an EDNS or DNSSEC response. If the OPT flag or the DO flag are missing, the default handling says that a warning should be raised. However the comment suggest this warning could be downgraded to a DEBUG message.
Are responses without the OPT flag or DO flag valid responses? If so why raising a warning?
Or if they are invalid, should we only display a DEBUG message?
Or am I missing something else?

Comment thread docs/specifications/tests/DNSQueryAndResponseDefaults.md Outdated
Comment thread docs/specifications/tests/DNSQueryAndResponseDefaults.md Outdated
@matsduf

matsduf commented Jan 4, 2022

Copy link
Copy Markdown
Contributor Author

Just a question on the handling of an EDNS or DNSSEC response. If the OPT flag or the DO flag are missing, the default handling says that a warning should be raised. However the comment suggest this warning could be downgraded to a DEBUG message.

Bad wording. I have rephrased it. Please re-reveiw.

Are responses without the OPT flag or DO flag valid responses? If so why raising a warning? Or if they are invalid, should we only display a DEBUG message? Or am I missing something else?

Not really. Either the OPT should be included, or FORMERR is expected. The handling should be set in the test case specification, but at least a debug message should be issued.

@matsduf matsduf requested a review from a user January 4, 2022 16:24
ghost
ghost previously approved these changes Jan 4, 2022

@ghost ghost 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.

Thanks for the explanation. Then indeed it seems reasonable to let the test case implementation deal with the missing flag.

tgreenx
tgreenx previously approved these changes Jan 26, 2022
Comment thread docs/specifications/tests/DNSQueryAndResponseDefaults.md Outdated
Comment thread docs/specifications/tests/DNSQueryAndResponseDefaults.md Outdated
@matsduf

matsduf commented Jan 26, 2022

Copy link
Copy Markdown
Contributor Author

@mattias-p, @PNAX and @mattias-p, please re-review.

tgreenx
tgreenx previously approved these changes Jan 27, 2022
Comment on lines +127 to +132
* The first CNAME in the chain must match *Query Name*.
* The last record in the chain must either be a CNAME or a record matching
*Query Type*.
* For each owner name of the CNAME records in the chain there must not be any
additional CNAME records in the answer section (only one CNAME record per
owner name).

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'm curious about an edge case here. Let's say we're following a CNAME chain and the query name is example.com. The answer section contains the following CNAME records:

error.com    3600  IN  CNAME  example.com
example.com  3600  IN  CNAME  other.com

The way I read the specification there's one chain in the answer section, and the first CNAME is error.com, which is different from the query name, so none of these records should be fetched. Is that the intended behavior?

I believe the "The first CNAME in the chain must match Query Name." item should be removed from the list of criteria and added as a definition instead.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I'm curious about an edge case here. Let's say we're following a CNAME chain and the query name is example.com. The answer section contains the following CNAME records:

error.com    3600  IN  CNAME  example.com
example.com  3600  IN  CNAME  other.com

The way I read the specification there's one chain in the answer section, and the first CNAME is error.com, which is different from the query name, so none of these records should be fetched. Is that the intended behavior?

Yes.

I believe the "The first CNAME in the chain must match Query Name." item should be removed from the list of criteria and added as a definition instead.

I disagree, but I will change the wording somewhat to make intended behavior clear.

|AA flag | unset | yes | |
|TC flag | unset | yes | |
|OpCode | "query" | X | |
|QR flag | unset | X | Always unset in a query |

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Why specify here in the comment that the parameter is unset since it is already fixed to unset?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

To underline that fact.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

And this fact is not as important for other fixed unset parameters? (I don't know, it's just I was wondering why only this one had the comment).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It is just a comment. The choice of the other fixed, and default, values could also be commented, but I have not done that.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Removed.

@matsduf

matsduf commented Jan 27, 2022

Copy link
Copy Markdown
Contributor Author

@mattias-p, I have updated based on your comment. Please re-review.

@tgreenx, I have done som updates based on comments from @mattias-p. Please re-review.

@matsduf

matsduf commented Jan 27, 2022

Copy link
Copy Markdown
Contributor Author

@PNAX, please re-review.


* Authority and additional sections are by default ignored.

The test case specification may prescribe that CNAME records are handled in an a

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

typo: an a -> a

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

* The chain is, by default, considered to be valid if the following criteria
are met:
* It must be possible to arrange all CNAME records from the answer section
into a contiguous logical chain with a posisble addition of a non-CNAME

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

typo: posisble -> possible

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

@ghost

ghost commented Jan 27, 2022

Copy link
Copy Markdown

I think I said it before, but I think this is a good document to have that we can refer to.

@matsduf

matsduf commented Jan 27, 2022

Copy link
Copy Markdown
Contributor Author

@PNAX, please re-review.

tgreenx
tgreenx previously approved these changes Jan 27, 2022
Comment thread docs/specifications/tests/DNSQueryAndResponseDefaults.md Outdated
@matsduf

matsduf commented Jan 28, 2022

Copy link
Copy Markdown
Contributor Author

@tgreenx, please re-review.

@mattias-p mattias-p left a comment

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.

Awesome!

@matsduf matsduf merged commit f00b86b into zonemaster:develop Jan 28, 2022
@matsduf matsduf deleted the add-specification-for-queries-and-responses branch January 28, 2022 21:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-TestCase Area: Test case specification or implementation of test case

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants