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

Use final L3 topology for OSPF session compatibility #6561

Merged
merged 3 commits into from
Jan 27, 2021

Conversation

ratulm
Copy link
Member

@ratulm ratulm commented Jan 12, 2021

Without this change, any OSPF edges that get established later (e.g., tunnel-based edges) were not being considered.

@ratulm ratulm requested a review from dhalperi January 12, 2021 22:19
@batfish-bot
Copy link

This change is Reviewable

Copy link
Member

@dhalperi dhalperi left a comment

Choose a reason for hiding this comment

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

Reviewable status: 0 of 1 files reviewed, 1 unresolved discussion (waiting on @dhalperi, @progwriter, and @ratulm)

a discussion (no related file):
Hmm, usually the "compatibility" version is Pre-Dataplane and the "status" version is Post-Dataplane.

The Post-Dataplane version can indeed have edges that don't appear pre-dataplane.


Copy link
Member

@dhalperi dhalperi left a comment

Choose a reason for hiding this comment

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

Reviewable status: 0 of 1 files reviewed, 2 unresolved discussions (waiting on @dhalperi, @progwriter, and @ratulm)


projects/question/src/main/java/org/batfish/question/ospfsession/OspfSessionCompatibilityAnswerer.java, line 64 at r1 (raw file):

_batfish.getSnapshot()

definitely don't want this change -- the snapshot passed in is the one to use.

Copy link
Member Author

@ratulm ratulm left a comment

Choose a reason for hiding this comment

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

Reviewable status: 0 of 1 files reviewed, 2 unresolved discussions (waiting on @dhalperi, @progwriter, and @ratulm)

a discussion (no related file):

Previously, dhalperi (Dan Halperin) wrote…

Hmm, usually the "compatibility" version is Pre-Dataplane and the "status" version is Post-Dataplane.

The Post-Dataplane version can indeed have edges that don't appear pre-dataplane.

I see. There is no 'status' version for OSPF. Let's close this PR if that is the invariant we want to maintain. The PR was inspired by user confusion in which there edges in ospfEdges question that didn't appear in ospfSessionCompatibility question. If we don't make this change, we should update the documentation for ospfSessionCompatibility.


Copy link
Member

@dhalperi dhalperi left a comment

Choose a reason for hiding this comment

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

Reviewable status: 0 of 1 files reviewed, 2 unresolved discussions (waiting on @progwriter and @ratulm)

a discussion (no related file):

Previously, ratulm wrote…

I see. There is no 'status' version for OSPF. Let's close this PR if that is the invariant we want to maintain. The PR was inspired by user confusion in which there edges in ospfEdges question that didn't appear in ospfSessionCompatibility question. If we don't make this change, we should update the documentation for ospfSessionCompatibility.

We could rename this one to status, use the final topology, and then fix it up, too. Compatibility vs Status may make less sense for OSPF than BGP?


@codecov
Copy link

codecov bot commented Jan 12, 2021

Codecov Report

Merging #6561 (c7e28c0) into master (c6c9ec9) will decrease coverage by 0.00%.
The diff coverage is 0.00%.

@@             Coverage Diff              @@
##             master    #6561      +/-   ##
============================================
- Coverage     73.39%   73.38%   -0.01%     
+ Complexity    35804    35797       -7     
============================================
  Files          2840     2840              
  Lines        144549   144549              
  Branches      17491    17491              
============================================
- Hits         106092   106080      -12     
- Misses        30044    30051       +7     
- Partials       8413     8418       +5     
Impacted Files Coverage Δ Complexity Δ
.../ospfsession/OspfSessionCompatibilityAnswerer.java 73.56% <0.00%> (ø) 12.00 <0.00> (ø)
.../ospfsession/OspfSessionCompatibilityQuestion.java 76.47% <0.00%> (ø) 5.00 <0.00> (ø)
.../org/batfish/dataplane/rib/RouteAdvertisement.java 83.67% <0.00%> (-4.09%) 18.00% <0.00%> (-1.00%)
...ain/java/org/batfish/symbolic/IngressLocation.java 65.78% <0.00%> (-2.64%) 15.00% <0.00%> (-1.00%)
...org/batfish/datamodel/flow/BidirectionalTrace.java 81.81% <0.00%> (-2.28%) 14.00% <0.00%> (-1.00%)
...col/src/main/java/org/batfish/role/InferRoles.java 89.54% <0.00%> (-1.37%) 50.00% <0.00%> (-1.00%)
...java/org/batfish/dataplane/ibdp/VirtualRouter.java 90.45% <0.00%> (-0.32%) 206.00% <0.00%> (-1.00%)
...tfish/representation/cisco/CiscoConfiguration.java 86.51% <0.00%> (-0.14%) 508.00% <0.00%> (-1.00%)

@saparikh
Copy link
Contributor

There is value in having a compatibility check for OSPF. 2 routers could be physically connected, but the MTU, area number, md5 key, network type (p2p, broadcast, nbma), etc... could be wrong. Also, in some scenarios like nbma you configure the remote peer ip explicitly, instead of relying on multicast to discover the remote end.

@ratulm
Copy link
Member Author

ratulm commented Jan 26, 2021

Circling back here, it looks like BGP compatibility considers all possible pairs (modulo some gaps around NAT of course) and judges that based on config settings. BGP status will then help decide if connections happens in the data plane.

Taking that view, I think we should leave this question as OspfSessionCompatibility since it considers configuration-level compatibility and simply expand the set of pairs considered. An OspfStatus question will then judge actual sessions (which may still get blocked via L2/L3 ACLs).

@dhalperi - makes sense? (I will fix the which-snapshot-to-use thing).

Copy link
Member

@dhalperi dhalperi left a comment

Choose a reason for hiding this comment

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

Reviewable status: 0 of 1 files reviewed, 3 unresolved discussions (waiting on @progwriter and @ratulm)

a discussion (no related file):
Planned change makes sense.

  • mark the question are requiring dataplane
  • update templates/tests
  • update docs, if needed, in pybatfish

Copy link
Member

@dhalperi dhalperi left a comment

Choose a reason for hiding this comment

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

Reviewed 4 of 4 files at r2.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @progwriter)

@ratulm ratulm merged commit 5202aaf into master Jan 27, 2021
@ratulm ratulm deleted the ospf-session-compat branch January 27, 2021 02:01
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.

None yet

4 participants