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 BgpSessionProperties IPs instead peers' local IPs #3917

Merged
merged 5 commits into from
May 22, 2019

Conversation

corinaminer
Copy link
Contributor

The head and tail IPs in BgpSessionProperties are guaranteed to be nonnull, whereas BGP peer config IDs can have null local IPs even if they have edges in the BGP topology.

Separation of getBgpEdges() methods is solely for easier testing and should not affect functionality.

These IPs are nonnull; local IP in peer config can be null.
@batfish-bot
Copy link

This change is Reviewable

@codecov
Copy link

codecov bot commented May 21, 2019

Codecov Report

Merging #3917 into master will decrease coverage by 0.04%.
The diff coverage is 85.71%.

@@             Coverage Diff              @@
##             master    #3917      +/-   ##
============================================
- Coverage     74.87%   74.82%   -0.05%     
+ Complexity    24061    24043      -18     
============================================
  Files          2027     2027              
  Lines         96681    96622      -59     
  Branches      11496    11492       -4     
============================================
- Hits          72390    72301      -89     
- Misses        19034    19063      +29     
- Partials       5257     5258       +1
Impacted Files Coverage Δ Complexity Δ
...va/org/batfish/question/VIModelQuestionPlugin.java 97.32% <85.71%> (-2.09%) 4 <0> (-2)
...n/java/org/batfish/common/bdd/BDDFiniteDomain.java 51.16% <0%> (-44.4%) 8% <0%> (-11%)
.../src/main/java/org/batfish/datamodel/flow/Hop.java 53.33% <0%> (-6.67%) 5% <0%> (-1%)
...org/batfish/datamodel/flow/BidirectionalTrace.java 79.54% <0%> (-4.55%) 13% <0%> (-2%)
...c/main/java/org/batfish/dataplane/rib/RibTree.java 89.79% <0%> (-4.09%) 27% <0%> (-1%)
...col/src/main/java/org/batfish/role/InferRoles.java 91.24% <0%> (-0.37%) 68% <0%> (-1%)
...batfish/src/main/java/org/batfish/main/Driver.java 38.61% <0%> (-0.25%) 29% <0%> (ø)
...java/org/batfish/dataplane/ibdp/VirtualRouter.java 87.76% <0%> (-0.23%) 240% <0%> (-1%)
...tfish/representation/cisco/CiscoConfiguration.java 83.8% <0%> (-0.13%) 530% <0%> (-1%)
... and 2 more

Copy link
Contributor

@progwriter progwriter left a comment

Choose a reason for hiding this comment

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

Reviewed 1 of 2 files at r1, 1 of 1 files at r2.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @corinaminer)


projects/question/src/main/java/org/batfish/question/VIModelQuestionPlugin.java, line 238 at r2 (raw file):

        if (bgpPeerConfig != null && remoteBgpPeerConfig != null) {
          Ip localIp = sessionProperties.getTailIp();

isn't head the local IP?

Copy link
Contributor Author

@corinaminer corinaminer 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: all files reviewed, 1 unresolved discussion (waiting on @progwriter)


projects/question/src/main/java/org/batfish/question/VIModelQuestionPlugin.java, line 238 at r2 (raw file):

Previously, progwriter (Victor Heorhiadi) wrote…

isn't head the local IP?

i don't think so... i believe bgpTopology.edgeValue(id1, id2) gives the session where id1 is local and id2 is remote, so the local IP should be the tail, right?

If this were wrong, the test should surface the issue.

Copy link
Contributor Author

@corinaminer corinaminer 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 2 files reviewed, 1 unresolved discussion (waiting on @progwriter)


projects/question/src/main/java/org/batfish/question/VIModelQuestionPlugin.java, line 238 at r2 (raw file):

Previously, corinaminer (Corina Miner) wrote…

i don't think so... i believe bgpTopology.edgeValue(id1, id2) gives the session where id1 is local and id2 is remote, so the local IP should be the tail, right?

If this were wrong, the test should surface the issue.

actually the test wouldn't have surfaced the issue before, but now it should.

Copy link
Contributor

@progwriter progwriter left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewed 2 of 2 files at r3.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved


projects/question/src/main/java/org/batfish/question/VIModelQuestionPlugin.java, line 238 at r2 (raw file):

Previously, corinaminer (Corina Miner) wrote…

actually the test wouldn't have surfaced the issue before, but now it should.

Ah, I'm just in bdp-queue-mode.

@corinaminer corinaminer merged commit 4584bb2 into master May 22, 2019
@corinaminer corinaminer deleted the use-session-props-ips branch May 22, 2019 00:19
agember pushed a commit to colgate-cs-research/batfish that referenced this pull request May 28, 2019
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

3 participants