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

RT-1.51: BGP multipath ECMP and RT-1.52 bgp_multipath_wecmp_test.go : Added deviation #2547

Merged
merged 52 commits into from
Jun 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
8ec47da
updated with deviation
cprabha Jan 13, 2024
c864ec5
Merge branch 'main' into bgpEcmp
arulkumarsekar Jan 18, 2024
61cc7b0
Merge branch 'main' into bgpEcmp
cprabha Jan 19, 2024
5fa3584
Resovled conflicts
cprabha Jan 19, 2024
391a824
Resovled conflicts
cprabha Jan 19, 2024
39b1cbb
Merge branch 'main' into bgpEcmp
cprabha Jan 19, 2024
7e32b27
Merge branch 'main' into bgpEcmp
arulkumarsekar Jan 26, 2024
1b17368
Merge branch 'main' into bgpEcmp
cprabha Feb 8, 2024
f922bc6
Resolving conflicts
cprabha Feb 8, 2024
7a82f4e
Merge branch 'main' into bgpEcmp
cprabha Feb 26, 2024
9c34cc1
Resolving conflicts
cprabha Feb 26, 2024
e0de796
updated with deviation
cprabha Feb 26, 2024
2d56bbd
Added deviation to script
cprabha Mar 8, 2024
6acc2ec
Merge branch 'main' into bgpEcmp
cprabha Mar 8, 2024
9ef24d0
Added deviation to wecmp script
cprabha Mar 8, 2024
493e9d0
Merge branch 'main' into bgpEcmp
cprabha Mar 8, 2024
b767e2c
Merge branch 'main' into bgpEcmp
cprabha Mar 11, 2024
05801ed
Resolving merge conflicts
mohanasm Mar 15, 2024
5616702
Merge branch 'main' into bgpEcmp
mohanasm Mar 15, 2024
77ba327
Resolving conflict
mohanasm Mar 15, 2024
923d4fe
Merge branch 'main' into bgpEcmp
cprabha Mar 18, 2024
385dffd
Resolvng coflicts
cprabha Mar 18, 2024
ba91bf8
Merge branch 'main' into bgpEcmp
cprabha Mar 18, 2024
89fa802
Merge branch 'main' into bgpEcmp
cprabha Mar 19, 2024
4a618bd
resolving conflicts
cprabha Mar 19, 2024
1fc8520
Merge branch 'main' into bgpEcmp
cprabha Mar 25, 2024
6704653
Resolving conflicts
cprabha Mar 25, 2024
471d896
updated version
cprabha Mar 25, 2024
a08fddc
Merge branch 'main' into bgpEcmp
cprabha Apr 22, 2024
4e7f659
Resolving conflicts
cprabha Apr 22, 2024
14a3be0
Merge branch 'main' into bgpEcmp
cprabha Apr 23, 2024
3ed6cfa
Resolving conflicts
cprabha Apr 23, 2024
9dc491d
Merge branch 'main' into bgpEcmp
cprabha Apr 25, 2024
5492831
Merge branch 'main' into bgpEcmp
cprabha May 8, 2024
1c9e079
Resolved conflicts
cprabha May 8, 2024
fdb8d10
Merge branch 'main' into bgpEcmp
cprabha May 16, 2024
9e0c5e7
updated README
cprabha May 16, 2024
668c991
updated README
cprabha May 16, 2024
7be3dc8
Resolving conflicts
cprabha May 16, 2024
5768a37
Resolving conflicts
cprabha May 16, 2024
2eb8304
Resolving conflicts
cprabha May 16, 2024
97e059f
Resolving conflicts
cprabha May 16, 2024
a543eef
Added deviation for multipath config at peer level
mohanasm May 17, 2024
3cfab63
Added deviations to configure multipath at peer level and updated tra…
mohanasm May 17, 2024
66e4bb4
Merge branch 'main' into bgpEcmp
mohanasm May 17, 2024
f833841
Merge branch 'main' into bgpEcmp
cprabha May 28, 2024
d2a6ec2
Resolving conflicts
cprabha May 28, 2024
fb39123
Merge branch 'main' into bgpEcmp
cprabha May 31, 2024
d719f85
Resolving conflicts
cprabha May 31, 2024
371dd78
Merge branch 'main' into bgpEcmp
cprabha Jun 4, 2024
0bbc587
resolving conflicts
cprabha Jun 4, 2024
2a0cda2
Merge branch 'main' into bgpEcmp
ram-mac Jun 5, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,11 @@ Validate BGP in multipath scenario

## OpenConfig Path and RPC Coverage


```yaml
rpcs:
gnmi:
gNMI.Get:
gNMI.Subscribe:

```

## Required DUT platform
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,8 @@ func configureFlow(t *testing.T, bs *cfgplugins.BGPSession) {
e := flow.Packet().Add().Ethernet()
e.Src().SetValue(bs.ATEPorts[0].MAC)
v4 := flow.Packet().Add().Ipv4()
v4.Src().Increment().SetStart(bs.ATEPorts[0].IPv4).SetCount(prefixesCount)
v4.Dst().Increment().SetStart(prefixesStart).SetCount(prefixesCount)
v4.Src().Increment().SetCount(1000).SetStep("0.0.0.1").SetStart(bs.ATEPorts[0].IPv4)
v4.Dst().Increment().SetCount(4).SetStep("0.0.0.1").SetStart(prefixesStart)
udp := flow.Packet().Add().Udp()
udp.SrcPort().SetValues(randRange(t, 34525, 65535, 500))
udp.DstPort().SetValues(randRange(t, 49152, 65535, 500))
Expand All @@ -117,6 +117,7 @@ func configureFlow(t *testing.T, bs *cfgplugins.BGPSession) {
}

func verifyECMPLoadBalance(t *testing.T, ate *ondatra.ATEDevice, pc int, expectedLinks int) {
dut := ondatra.DUT(t, "dut")
framesTx := gnmi.Get(t, ate.OTG(), gnmi.OTG().Port(ate.Port(t, "port1").ID()).Counters().OutFrames().State())
expectedPerLinkFms := framesTx / uint64(expectedLinks)
t.Logf("Total packets %d flow through the %d links and expected per link packets %d", framesTx, expectedLinks, expectedPerLinkFms)
Expand All @@ -134,12 +135,15 @@ func verifyECMPLoadBalance(t *testing.T, ate *ondatra.ATEDevice, pc int, expecte
t.Logf("Traffic %d is in expected range: %d - %d, Load balance Test Passed", framesRx, min, max)
got++
} else {
t.Errorf("Traffic is expected in range %d - %d but got %d. Load balance Test Failed", min, max, framesRx)
if !deviations.BgpMaxMultipathPathsUnsupported(dut) {
t.Errorf("Traffic is expected in range %d - %d but got %d. Load balance Test Failed", min, max, framesRx)
}
}
}

if got != expectedLinks {
t.Errorf("invalid number of load balancing interfaces, got: %d want %d", got, expectedLinks)
if !deviations.BgpMaxMultipathPathsUnsupported(dut) {
if got != expectedLinks {
t.Errorf("invalid number of load balancing interfaces, got: %d want %d", got, expectedLinks)
}
}
}

Expand Down Expand Up @@ -223,8 +227,12 @@ func TestBGPSetup(t *testing.T) {
prefix := prefixesStart + "/" + strconv.Itoa(prefixP4Len)
ipv4Entry := gnmi.Get[*oc.NetworkInstance_Afts_Ipv4Entry](t, bs.DUT, aftsPath.Ipv4Entry(prefix).State())
hopGroup := gnmi.Get[*oc.NetworkInstance_Afts_NextHopGroup](t, bs.DUT, aftsPath.NextHopGroup(ipv4Entry.GetNextHopGroup()).State())
if got, want := len(hopGroup.NextHop), tc.expectedPaths; got != want {
t.Errorf("prefix: %s, found %d hops, want %d", ipv4Entry.GetPrefix(), got, want)
if deviations.BgpMaxMultipathPathsUnsupported(bs.DUT) {
tc.expectedPaths = 3
} else {
if got, want := len(hopGroup.NextHop), tc.expectedPaths; got != want {
t.Errorf("prefix: %s, found %d hops, want %d", ipv4Entry.GetPrefix(), got, want)
}
}

sleepTime := time.Duration(totalPackets/trafficPps) + 5
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@ platform_exceptions: {
skip_afi_safi_path_for_bgp_multiple_as: true
}
}
platform_exceptions: {
platform: {
vendor: JUNIPER
}
deviations: {
bgp_max_multipath_paths_unsupported: true
}
}
platform_exceptions: {
platform: {
vendor: NOKIA
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,14 @@ Validate BGP in multipath UCMP support with link bandwidth community
* /network-instances/network-instance/afts/next-hop-groups/next-hop-group[id=<id>]/state
* /network-instances/network-instance/afts/next-hop-groups/next-hop-group/next-hops

## Protocol/RPC Parameter Coverage

* gNMI
* Set
* Subscribe

## OpenConfig Path and RPC Coverage

```yaml
rpcs:
gnmi:
gNMI.Get:
gNMI.Subscribe:
```
## Required DUT platform

* FFF - Fixed Form Factor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ func configureOTG(t *testing.T, bs *cfgplugins.BGPSession) {
routeAddress.SetPrefix(prefixP4Len)
routeAddress.SetCount(prefixesCount)
bgp4PeerRoute.AddPath().SetPathId(pathID)
bgp4PeerRoute.ExtendedCommunities().Add().NonTransitive2OctetAsType().LinkBandwidthSubtype().SetBandwidth(float32(linkBw[i-2] * 1000))
bgpExtCom := bgp4PeerRoute.ExtendedCommunities().Add()
bgpExtCom.NonTransitive2OctetAsType().LinkBandwidthSubtype().SetBandwidth(float32(linkBw[i-2] * 1000))
}

configureFlow(bs)
Expand All @@ -79,7 +80,7 @@ func configureFlow(bs *cfgplugins.BGPSession) {
bs.ATETop.Flows().Clear()

var rxNames []string
for i := 1; i < len(bs.ATEPorts); i++ {
for i := 2; i < len(bs.ATEPorts); i++ {
rxNames = append(rxNames, bs.ATEPorts[i].Name+".BGP4.peer.rr4")
}
flow := bs.ATETop.Flows().Add().SetName("flow")
Expand All @@ -94,8 +95,8 @@ func configureFlow(bs *cfgplugins.BGPSession) {
e := flow.Packet().Add().Ethernet()
e.Src().SetValue(bs.ATEPorts[0].MAC)
v4 := flow.Packet().Add().Ipv4()
v4.Src().SetValue(bs.ATEPorts[0].IPv4)
v4.Dst().SetValue(prefixesStart)
v4.Src().Increment().SetCount(1000).SetStep("0.0.0.1").SetStart(bs.ATEPorts[0].IPv4)
v4.Dst().Increment().SetCount(3).SetStep("0.0.0.1").SetStart(prefixesStart)
}

func checkPacketLoss(t *testing.T, ate *ondatra.ATEDevice) {
Expand All @@ -115,8 +116,8 @@ func checkPacketLoss(t *testing.T, ate *ondatra.ATEDevice) {

func verifyECMPLoadBalance(t *testing.T, ate *ondatra.ATEDevice, pc int, expectedLinks int) {
framesTx := gnmi.Get(t, ate.OTG(), gnmi.OTG().Port(ate.Port(t, "port1").ID()).Counters().OutFrames().State())
expectedPerLinkFmsP3 := (linkBw[0] / (linkBw[0] + linkBw[1])) * int(framesTx)
expectedPerLinkFmsP4 := (linkBw[1] / (linkBw[0] + linkBw[1])) * int(framesTx)
expectedPerLinkFmsP3 := int(float32(linkBw[0]) / (float32(linkBw[0] + linkBw[1])) * float32(framesTx))
expectedPerLinkFmsP4 := int(float32(linkBw[1]) / (float32(linkBw[0] + linkBw[1])) * float32(framesTx))
t.Logf("Total packets %d flow through the %d links and expected per link packets: %d, %d", framesTx, expectedLinks, expectedPerLinkFmsP3, expectedPerLinkFmsP4)

p3Min := expectedPerLinkFmsP3 - (expectedPerLinkFmsP3 * lbToleranceFms / 100)
Expand Down Expand Up @@ -145,6 +146,10 @@ func TestBGPSetup(t *testing.T) {
bs.WithEBGP(t, []oc.E_BgpTypes_AFI_SAFI_TYPE{oc.BgpTypes_AFI_SAFI_TYPE_IPV4_UNICAST}, []string{"port3", "port4"}, true, false)
dni := deviations.DefaultNetworkInstance(bs.DUT)
bgp := bs.DUTConf.GetOrCreateNetworkInstance(dni).GetOrCreateProtocol(oc.PolicyTypes_INSTALL_PROTOCOL_TYPE_BGP, "BGP").GetOrCreateBgp()
if deviations.MultipathUnsupportedNeighborOrAfisafi(bs.DUT) {
bgp.GetOrCreatePeerGroup(cfgplugins.BGPPeerGroup1).GetOrCreateUseMultiplePaths().Enabled = ygot.Bool(true)
bgp.GetOrCreatePeerGroup(cfgplugins.BGPPeerGroup1).GetOrCreateUseMultiplePaths().GetOrCreateEbgp().AllowMultipleAs = ygot.Bool(true)
}
gEBGP := bgp.GetOrCreateGlobal().GetOrCreateAfiSafi(oc.BgpTypes_AFI_SAFI_TYPE_IPV4_UNICAST).GetOrCreateUseMultiplePaths().GetOrCreateEbgp()
bgp.GetOrCreatePeerGroup(cfgplugins.BGPPeerGroup1).GetOrCreateAfiSafi(oc.BgpTypes_AFI_SAFI_TYPE_IPV4_UNICAST).GetOrCreateUseMultiplePaths().Enabled = ygot.Bool(true)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,14 @@ platform_exceptions: {
ipv4_missing_enabled: true
}
}
platform_exceptions: {
platform: {
vendor: JUNIPER
}
deviations: {
multipath_unsupported_neighbor_or_afisafi: true
}
}
platform_exceptions: {
platform: {
vendor: NOKIA
Expand Down
10 changes: 10 additions & 0 deletions internal/deviations/deviations.go
Original file line number Diff line number Diff line change
Expand Up @@ -1023,3 +1023,13 @@
func DefaultRoutePolicyUnsupported(dut *ondatra.DUTDevice) bool {
return lookupDUTDeviations(dut).GetDefaultRoutePolicyUnsupported()
}

// Devices does not support bgp max multipaths.

Check failure on line 1027 in internal/deviations/deviations.go

View workflow job for this annotation

GitHub Actions / Static Analysis

comment on exported function BgpMaxMultipathPathsUnsupported should be of the form "BgpMaxMultipathPathsUnsupported ..."
func BgpMaxMultipathPathsUnsupported(dut *ondatra.DUTDevice) bool {
return lookupDUTDeviations(dut).GetBgpMaxMultipathPathsUnsupported()
}

// Devices does not support multipath under neighbor or afisafi

Check failure on line 1032 in internal/deviations/deviations.go

View workflow job for this annotation

GitHub Actions / Static Analysis

comment on exported function MultipathUnsupportedNeighborOrAfisafi should be of the form "MultipathUnsupportedNeighborOrAfisafi ..."
func MultipathUnsupportedNeighborOrAfisafi(dut *ondatra.DUTDevice) bool {
return lookupDUTDeviations(dut).GetMultipathUnsupportedNeighborOrAfisafi()
}
9 changes: 7 additions & 2 deletions proto/metadata.proto
Original file line number Diff line number Diff line change
Expand Up @@ -557,8 +557,13 @@ message Metadata {
bool default_route_policy_unsupported = 190;
// CISCO: b/339801843
bool slaac_prefix_length128 = 191;


// Devices does not support bgp max multipaths
// Juniper: b/319301559
bool bgp_max_multipath_paths_unsupported = 192;
// Devices does not multipath config at neighbor or afisafi level
// Juniper: b/341130490
bool multipath_unsupported_neighbor_or_afisafi = 193;

// Reserved field numbers and identifiers.
reserved 84, 9, 28, 20, 90, 97, 55, 89, 19;
}
Expand Down
Loading
Loading