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

chore: prefer NIR over RIR #341

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

kiraum
Copy link

@kiraum kiraum commented May 12, 2024

Overview
This pull request introduces significant updates to the PrefixCollector class within the irrexplorer/api/collectors.py module, specifically aimed at refining the logic used to determine the responsible RIR/NIR for a given IP prefix. Additionally, it integrates a new NIR enum to the irrexplorer/state.py module to classify specific RIR entries that are considered National Internet Registries (NIRs).

Changes

  • PrefixCollector Logic Update:
    The method _rir_for_prefix has been overhauled to not only find the RIR responsible for a given prefix but also to prefer NIRs over other RIRs when applicable. This change ensures that NIRs are prioritized in the selection process, reflecting a more nuanced approach to registry classification.
    The previous implementation used a generator expression to filter relevant RIR statistics. The new implementation uses a more explicit loop that allows for additional checks and prioritization of NIRs.

  • Introduction of NIR Enum:
    A new enum, NIR, has been added to classify specific entries as National Internet Registries. This addition allows the system to easily identify and prioritize NIRs during the RIR selection process.
    The NIR enum currently includes REGISTROBR as a member, representing the Brazilian Internet Registry.

Benefits

  • Improved Accuracy: By prioritizing NIRs, the system more accurately reflects the hierarchical structure of internet registries.
  • Enhanced Readability and Maintainability: The refactored code in _rir_for_prefix uses explicit control structures that improve the readability and maintainability of the code.
  • Scalability: The introduction of the NIR enum provides a scalable way to add more NIRs in the future, should they become relevant.

Impact
This update requires careful review to ensure that the prioritization logic correctly reflects the intended behavior, especially in edge cases where multiple RIRs might overlap with a given prefix.
Additional tests may be necessary to cover the new logic paths and ensure that NIR prioritization functions as expected.

Testing
The changes have been locally tested to ensure that the new logic correctly identifies and prioritizes NIRs.
Further integration testing is recommended to validate the changes across the system.

This update aims to enhance the functionality of the IRRExplorer by refining how it identifies the responsible RIRs, ensuring that NIRs are given precedence in a manner that aligns with global internet governance practices.

Additionally, this PR resolves the issues found in Issue #308 and Issue #263, enhancing the accuracy and functionality of the IRRExplorer.

image image

Thanks for maintaining this amazing project! =D

@kiraum
Copy link
Author

kiraum commented Sep 28, 2024

Should I keep or close this PR? If no answers, I will move forward and close it.

@teunvink
Copy link
Member

We have a meeting with our external developer next week on bugs, features and works for IRR Explorer in which we will also discuss this PR as well.

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.

RIR column - Registro.BR - No matching to some blocks LACNIC & Registro.BR uncertainty
3 participants