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

BDP: properly update BGP route attributes based on confederation config #5008

Merged
merged 4 commits into from
Oct 16, 2019

Conversation

progwriter
Copy link
Contributor

No description provided.

@batfish-bot
Copy link

This change is Reviewable

Copy link
Contributor Author

@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.

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

a discussion (no related file):
working to include next hop ip here as well.


@codecov
Copy link

codecov bot commented Oct 16, 2019

Codecov Report

Merging #5008 into master will decrease coverage by <.01%.
The diff coverage is 92.5%.

@@             Coverage Diff              @@
##             master    #5008      +/-   ##
============================================
- Coverage     76.64%   76.63%   -0.01%     
+ Complexity    30032    30030       -2     
============================================
  Files          2399     2399              
  Lines        115712   115734      +22     
  Branches      13664    13667       +3     
============================================
+ Hits          88683    88690       +7     
- Misses        20318    20329      +11     
- Partials       6711     6715       +4
Impacted Files Coverage Δ Complexity Δ
...batfish/dataplane/protocols/BgpProtocolHelper.java 95.86% <100%> (+0.21%) 42 <0> (+1) ⬆️
...va/org/batfish/datamodel/bgp/BgpTopologyUtils.java 79.92% <100%> (+0.88%) 75 <0> (ø) ⬇️
.../org/batfish/dataplane/ibdp/BgpRoutingProcess.java 85.8% <100%> (+0.04%) 108 <0> (ø) ⬇️
...va/org/batfish/datamodel/BgpSessionProperties.java 82.5% <76.92%> (-1.06%) 52 <6> (+5)
.../src/main/java/org/batfish/datamodel/flow/Hop.java 53.33% <0%> (-6.67%) 5% <0%> (-1%)
...java/org/batfish/symbolic/state/EdgeStateExpr.java 73.91% <0%> (-4.35%) 10% <0%> (-1%)
...rc/main/java/org/batfish/datamodel/flow/Trace.java 87.09% <0%> (-3.23%) 12% <0%> (-1%)
...org/batfish/datamodel/flow/BidirectionalTrace.java 81.81% <0%> (-2.28%) 14% <0%> (-1%)
...col/src/main/java/org/batfish/role/InferRoles.java 90.11% <0%> (-1.53%) 63% <0%> (-2%)
...src/main/java/org/batfish/coordinator/PoolMgr.java 64.04% <0%> (-1.13%) 15% <0%> (-1%)
... and 3 more

Copy link
Contributor

@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.

Reviewed 6 of 6 files at r1.
Reviewable status: all files reviewed, 6 unresolved discussions (waiting on @progwriter)


projects/batfish/src/main/java/org/batfish/dataplane/protocols/BgpProtocolHelper.java, line 164 at r1 (raw file):

    }

    // Outgoing metric (MED) is preserved only if advertising to IBGP peer or within a confederation

Comment would be more useful as javadoc to advertiseUnchangedMed(). Same idea for local preference comment below.


projects/batfish/src/test/java/org/batfish/dataplane/protocols/BgpProtocolHelperTest.java, line 172 at r1 (raw file):

    // Append own as across border
    resetDefaultRouteBuilders();

why don't you just make all of these separate tests instead of calling this every time? (or possibly putting each test in its own scope would keep the builder clean for you? not sure)


projects/batfish/src/test/java/org/batfish/dataplane/protocols/BgpProtocolHelperTest.java, line 200 at r1 (raw file):

    transformBgpRoutePostExport(
        _baseBgpRouteBuilder, false, ConfedSessionType.WITHIN_CONFED, 6, DEST_IP, Ip.ZERO);
    assertThat(_baseBgpRouteBuilder.getAsPath(), equalTo(AsPath.empty()));

I think _baseBgpRouteBuilder should have an existing AsPath with both a confed and a non-confed AsSet for all of these tests so you can ensure that it is modified (or not) as expected


projects/batfish-common-protocol/src/main/java/org/batfish/datamodel/BgpSessionProperties.java, line 264 at r1 (raw file):

  }

  public boolean advertiseUnchanedLocalPref() {

typo Unchaned


projects/batfish-common-protocol/src/main/java/org/batfish/datamodel/BgpSessionProperties.java, line 345 at r1 (raw file):

  }

  /** For test use only. */

maybe add a warning "not for use with peers in confederations"

Copy link
Contributor Author

@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.

Reviewable status: 3 of 6 files reviewed, 3 unresolved discussions (waiting on @corinaminer and @progwriter)

a discussion (no related file):

Previously, progwriter (Victor Heorhiadi) wrote…

working to include next hop ip here as well.

done



projects/batfish/src/main/java/org/batfish/dataplane/protocols/BgpProtocolHelper.java, line 164 at r1 (raw file):

Previously, corinaminer (Corina Miner) wrote…

Comment would be more useful as javadoc to advertiseUnchangedMed(). Same idea for local preference comment below.

done


projects/batfish/src/test/java/org/batfish/dataplane/protocols/BgpProtocolHelperTest.java, line 172 at r1 (raw file):

Previously, corinaminer (Corina Miner) wrote…

why don't you just make all of these separate tests instead of calling this every time? (or possibly putting each test in its own scope would keep the builder clean for you? not sure)

too many names


projects/batfish-common-protocol/src/main/java/org/batfish/datamodel/BgpSessionProperties.java, line 264 at r1 (raw file):

Previously, corinaminer (Corina Miner) wrote…

typo Unchaned

unchained

Copy link
Contributor

@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.

Reviewed 3 of 3 files at r2.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @progwriter)


projects/batfish-common-protocol/src/main/java/org/batfish/datamodel/BgpSessionProperties.java, line 264 at r1 (raw file):

Previously, progwriter (Victor Heorhiadi) wrote…

unchained

⛓️ ⚒️

Copy link
Contributor Author

@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.

Reviewable status: 5 of 6 files reviewed, 1 unresolved discussion (waiting on @corinaminer and @progwriter)


projects/batfish/src/test/java/org/batfish/dataplane/protocols/BgpProtocolHelperTest.java, line 200 at r1 (raw file):

Previously, corinaminer (Corina Miner) wrote…

I think _baseBgpRouteBuilder should have an existing AsPath with both a confed and a non-confed AsSet for all of these tests so you can ensure that it is modified (or not) as expected

done

Copy link
Contributor

@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.

Reviewed 1 of 1 files at r3.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @progwriter)


projects/batfish/src/test/java/org/batfish/dataplane/protocols/BgpProtocolHelperTest.java, line 193 at r3 (raw file):

            AsPath.of(ImmutableList.<AsSet>builder().add(AsSet.of(2)).add(AsSet.of(777)).build())));

    // Clear confederations, prepend own AS

This test now redundant

Copy link
Contributor Author

@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 2 of 2 files at r4.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved


projects/batfish/src/test/java/org/batfish/dataplane/protocols/BgpProtocolHelperTest.java, line 193 at r3 (raw file):

Previously, corinaminer (Corina Miner) wrote…

This test now redundant

done


projects/batfish-common-protocol/src/main/java/org/batfish/datamodel/BgpSessionProperties.java, line 345 at r1 (raw file):

Previously, corinaminer (Corina Miner) wrote…

maybe add a warning "not for use with peers in confederations"

done

Copy link
Contributor

@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.

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

@progwriter progwriter merged commit b961a76 into batfish:master Oct 16, 2019
@progwriter progwriter deleted the confeds-in-session branch October 16, 2019 21:57
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