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

Implicit withdrawals are now generated also on correct subprefix routing #439

Merged
merged 6 commits into from
Oct 5, 2020

Conversation

vkotronis
Copy link
Member

@vkotronis vkotronis commented Oct 3, 2020

Description of PR

What component(s) does this PR affect?

  • Back-End (Database, Detection/Configuration/etc. Microservices)
  • Front-End (Flask, API, UI, etc)
  • Monitor (RIPE RIS, BGPStream RV/RIS/CAIDA, etc.)
  • Docs (incl. wiki)
  • Build System

Does the PR require changes on other components? If yes, please mark the components:

  • Back-End (Database, Detection/Configuration/etc. Microservices)
  • Front-End (Flask, API, UI, etc)
  • Monitor (RIPE RIS, BGPStream RV/RIS/CAIDA, etc.)
  • Docs (incl. wiki)
  • Build System

Related Issue

Resolves #438

Blocks #436 #437

Solution

The main logic of this PR is the following:

  1. Assume we have an active hijack for prefix N/M (where N = network address and M = prefix length) .
  2. Currently, we treat correct routing updates for N/M as implicit withdrawals for the monitor that saw both the hijack and the "healed" path.
  3. With this adjustment, we also treat correct routing updates for either N_1/M+1 or N_2/M+1 (where N_1, N_2 the network addresses of the direct more specifics of the original prefix) as implicit withdrawals for the hijacked N/M.

Note that in a future issue we need to carefully account for what prefix space is currently healed; this PR is an approximation for direct more specifics advertised during the deaggregation process (it is OK to assume that subprefix routing done for the entire prefix space will result in the hijack being mitigated, even if we do not wait to see all subprefix announcements).

Type

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Docs update
  • None of the above

Checklist:

  • I have read the contributing guide and my code conforms to the guidelines.
  • This change requires a change in the documentation.
  • I have updated the documentation accordingly.

@vkotronis vkotronis self-assigned this Oct 3, 2020
@vkotronis vkotronis changed the title WIP: implicit withdrwals to be also generated on correct subprefix routing Implicit withdrawals are now generated also on correct subprefix routing Oct 3, 2020
@artemis-pr-bot
Copy link
Collaborator

artemis-pr-bot commented Oct 3, 2020

🏃 Benchmark Results 🏃

  • RMQ Update inserts: 463/s
  • RMQ Hijack inserts: 154/s
  • PG Update inserts: 194/s
  • PG Update updates: 153/s
  • PG Hijack inserts: 153/s

@vkotronis vkotronis changed the title Implicit withdrawals are now generated also on correct subprefix routing WIP: Implicit withdrawals are now generated also on correct subprefix routing Oct 3, 2020
@vkotronis vkotronis added this to the release-.1.6.0 milestone Oct 3, 2020
@vkotronis vkotronis force-pushed the implicit-W-on-subprefix branch from 52c5d86 to deab222 Compare October 3, 2020 16:16
@vkotronis vkotronis changed the title WIP: Implicit withdrawals are now generated also on correct subprefix routing Implicit withdrawals are now generated also on correct subprefix routing Oct 3, 2020
@vkotronis vkotronis marked this pull request as ready for review October 3, 2020 16:25
@vkotronis vkotronis requested a review from slowr October 3, 2020 16:25
@codecov
Copy link

codecov bot commented Oct 3, 2020

Codecov Report

Merging #439 into master will increase coverage by 0.03%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #439      +/-   ##
==========================================
+ Coverage   81.87%   81.91%   +0.03%     
==========================================
  Files           6        6              
  Lines        2047     2051       +4     
==========================================
+ Hits         1676     1680       +4     
  Misses        371      371              
Impacted Files Coverage Δ
backend/core/database.py 94.73% <ø> (+<0.01%) ⬆️
backend/core/detection.py 97.36% <ø> (+0.01%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 774a932...89921ba. Read the comment docs.

Copy link
Member

@slowr slowr left a comment

Choose a reason for hiding this comment

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

Can you provide unittests for this part of the code? (with mocking redis)

@vkotronis
Copy link
Member Author

vkotronis commented Oct 4, 2020

Can you provide unittests for this part of the code? (with mocking redis)

@slowr I added the unit tests, just let me know if we have a good way of also simulating redis state on the fly (I tried mockredis but it does not create state as expected).

@vkotronis
Copy link
Member Author

unit tests with mock redis exists also added.

@vkotronis
Copy link
Member Author

Note that full partial withdrawal support will be implemented in 2.0.0 (issue #440)

@vkotronis vkotronis requested a review from slowr October 4, 2020 11:59
Copy link
Member

@slowr slowr left a comment

Choose a reason for hiding this comment

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

LGTM! Only comment I have is for maybe moving the rules within the unit tests instead (have like a static function to set them inside the unit test itself or something)

@vkotronis
Copy link
Member Author

LGTM! Only comment I have is for maybe moving the rules within the unit tests instead (have like a static function to set them inside the unit test itself or something)

Will be addressed in separate issue #441

@vkotronis vkotronis merged commit 82d4713 into master Oct 5, 2020
@vkotronis vkotronis deleted the implicit-W-on-subprefix branch October 5, 2020 06:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implicit withdrawals to be also generated on correct subprefix routing
3 participants