Update MethodsV2 to match Basic01#1287
Conversation
Based on zonemaster/zonemaster#1287 - Update Zonemaster::Engine::TestMethodsV2->get_parent_ns_ips() code - Add new message tag 'LOOP_PROTECTION' (used in three places) - Add loop protection mechanism - Update unit tests data
There was a problem hiding this comment.
LGTM.
Implementation is done in zonemaster/zonemaster-engine#1373. Current implementation details to note:
- The method returns
Zonemaster::Engine::Nameserverobjects, not just IP addresses as the specification describes. It is necessary to have such objects in Engine to be able to perform queries. The method could then be renamed as simplyget_parent_ns, or a disclaimer can be added (just like with the new test case specifications). - The method will return
undefif there are more than one parent found (I assume this should not be possible from this new algorithm but still, it is a precaution) - A loop protection mechanism (currently set to 1000) is in place for the loop processing at step 5.11.
Based on zonemaster/zonemaster#1287 - Update Zonemaster::Engine::TestMethodsV2->get_parent_ns_ips() code - Add new message tag 'LOOP_PROTECTION' (used in three places) - Add loop protection mechanism - Update unit tests data
Based on zonemaster/zonemaster#1287 - Update Zonemaster::Engine::TestMethodsV2->get_parent_ns_ips() code - Add new message tag 'LOOP_PROTECTION' (used in three places) - Add loop protection mechanism - Update unit tests data
Currently the test case specifications only use the parent name server IP addresses, not the names, so the method only needs to find the addresses. There is no issue if the implementation must have a name as long as we do not start using the name as such. I see no need of update of the specification.
There are still situations when there is more than one parent. Let us say that cc.xa has two NS. One has a delegation to bb.cc.xa and the other to aa.bb.cc.xa. And parent.grandparent.xa has two NS and both has a delegation aa.bb.cc.xa. The NS for aa.bb.cc.xa are the same in both delegations. Which is the parent of aa.bb.cc.xa? Except DNSSEC aa.bb.cc.xa will work. The two delegations could be different and it could still work if the zone data is the same, or at least relevant data is the same. I just saw some errors in the specification, and then I again thought about the NXDOMAIN and NODATA situations. Since they do not give any delegation they could be ignored for the method (but not for Basic01). Now NXDOMAIN and NODATA are handled inconsistently by error. I will do an update where both are ignored (not considered to be a parent).
I am not sure how you count, but if there are many NS (both v4 and v6) and many levels (like IPv6 reverse) do you see a risk of reaching the limit? Will there be a message (DEBUG) if the loop protection breaks? It would be interesting to see how many loops the code will do in the normal case. Have you checked? |
|
I will adjust the expected parent data from some of the scenarios (remove server outputting NXDOMAIN or NODATA). |
Ah great, I was about to write a comment about that, as I'm currently testing zonemaster/zonemaster-engine#1351 with the changes in zonemaster/zonemaster-engine#1373. While troubleshooting scenario
I will check now, and adjusts the break counter if needed (1000 seemed reasonable enough at first glance). There is a DEBUG2 message in place when that happens yes. |
Ok, I'll make the necessary changes in the implementation. But maybe the specification needs to be more explicit then? i.e., step 6. |
Is it this step 6 you mean? It just refers to parent name server IP addresses, not parent zone. |
Based on zonemaster/zonemaster#1287 - Update Zonemaster::Engine::TestMethodsV2->get_parent_ns_ips() code - Add new message tag 'LOOP_PROTECTION' (used in three places) - Add loop protection mechanism - Update unit tests data
Based on zonemaster/zonemaster#1287 - Update Zonemaster::Engine::TestMethodsV2->get_parent_ns_ips() code - Add new message tag 'LOOP_PROTECTION' (used in three places) - Add loop protection mechanism - Update unit tests data
* Removes adding to list of parents if NXDOMAIN. * Removes adding to list of parents if NODATA and name is child zone. * Renames set of parent IPs. Parent zone is not relevant. * Some editorial updates.
9fd28a2 to
7b85ac8
Compare
For Basic01, using the test zones in |
Based on zonemaster/zonemaster#1287 - Update Zonemaster::Engine::TestMethodsV2->get_parent_ns_ips() code - Add new message tag 'LOOP_PROTECTION' (used in three places) - Add loop protection mechanism - Update unit tests data
Purpose
Method
Get parent NS IP addressesin MethodsV2 should use the same algorithm as Basic01, which was true before the change introduced by #1257 which modifies the way the tree is traversed to find the parent zone and its name servers. This PR adapts to that modification.The change should better match the intention of what the parent zone is. And the change should match the test scenarios created in #1254.
Context
How to test this PR
Review the changes.