Skip to content
This repository was archived by the owner on Mar 31, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
78 commits
Select commit Hold shift + click to select a range
04cbb1e
Update router manager api
DavidLiu506 Jun 29, 2021
4c100e5
Update code
DavidLiu506 Jun 29, 2021
e38bcf9
Update code
DavidLiu506 Jun 30, 2021
067a988
Update router manager
DavidLiu506 Jul 1, 2021
dd5dafd
Update router manager
DavidLiu506 Jul 1, 2021
aa76562
Merge router manager service api code
DavidLiu506 Jul 2, 2021
8ae37db
Fix getVpcRouteTables
DavidLiu506 Jul 2, 2021
f0462ae
Fix getVpcRouteTable
DavidLiu506 Jul 2, 2021
976883f
Update RouterController
DavidLiu506 Jul 6, 2021
ef7a2d2
Update code
DavidLiu506 Jul 6, 2021
670dcc6
Update code
DavidLiu506 Jun 29, 2021
59a65f0
Update code
DavidLiu506 Jun 30, 2021
1178f61
pull alcor code
DavidLiu506 Jul 9, 2021
5a98d10
Merge branch 'futurewei-cloud:master' into master
DavidLiu506 Jul 21, 2021
e4e0792
Merge branch 'master' of https://github.com/futurewei-cloud/alcor
DavidLiu506 Aug 13, 2021
ae15be0
Merge branch 'futurewei-cloud:master' into master
DavidLiu506 Aug 15, 2021
9c88b19
Merge branch 'futurewei-cloud:master' into master
DavidLiu506 Aug 21, 2021
9be2bb9
Merge branch 'futurewei-cloud:master' into master
DavidLiu506 Sep 13, 2021
733872a
Merge branch 'master' of https://github.com/futurewei-cloud/alcor
DavidLiu506 Oct 19, 2021
b3154ae
Merge branch 'futurewei-cloud:master' into master
DavidLiu506 Oct 21, 2021
e2bed17
Merge branch 'master' of https://github.com/DavidLiu506/alcor
DavidLiu506 Oct 21, 2021
7c5013e
Merge branch 'futurewei-cloud:master' into master
DavidLiu506 Oct 23, 2021
ac7acf8
Merge branch 'master' of https://github.com/futurewei-cloud/alcor
DavidLiu506 Oct 28, 2021
bcc0716
Merge branch 'futurewei-cloud:master' into master
DavidLiu506 Nov 3, 2021
c499d9c
Merge branch 'futurewei-cloud:master' into master
DavidLiu506 Nov 30, 2021
329e216
Merge branch 'master' of https://github.com/futurewei-cloud/alcor
DavidLiu506 Dec 9, 2021
43435bd
Merge branch 'futurewei-cloud:master' into master
DavidLiu506 Dec 11, 2021
9b51767
Merge branch 'master' of https://github.com/futurewei-cloud/alcor
DavidLiu506 Dec 13, 2021
2f68edb
Merge branch 'futurewei-cloud:master' into master
DavidLiu506 Dec 13, 2021
a6b1122
Merge branch 'master' of https://github.com/DavidLiu506/alcor
DavidLiu506 Dec 13, 2021
5dd29ef
Merge branch 'futurewei-cloud:master' into master
DavidLiu506 Jan 13, 2022
59d0f9b
Merge branch 'futurewei-cloud:master' into master
DavidLiu506 Jan 20, 2022
3d350a7
Merge branch 'master' of https://github.com/futurewei-cloud/alcor
DavidLiu506 Jan 20, 2022
dbf2aaf
Merge branch 'futurewei-cloud:master' into master
DavidLiu506 Feb 1, 2022
3499f7d
Merge branch 'master' of https://github.com/futurewei-cloud/alcor
DavidLiu506 Feb 1, 2022
c11e915
Merge branch 'futurewei-cloud:master' into master
DavidLiu506 Feb 3, 2022
22cc3af
Merge branch 'master' of https://github.com/futurewei-cloud/alcor
DavidLiu506 Feb 3, 2022
38d0798
Merge branch 'futurewei-cloud:master' into master
DavidLiu506 May 27, 2022
4a62be1
Add consistent hash
DavidLiu506 May 28, 2022
7be13f8
Add consistent hash
DavidLiu506 May 28, 2022
8c3b223
Merge pull request #1 from DavidLiu506/gateway
DavidLiu506 May 28, 2022
6b798e0
Update code
DavidLiu506 May 31, 2022
260565a
Merge branch 'master' of https://github.com/DavidLiu506/alcor
DavidLiu506 May 31, 2022
fabd939
Revert "Update code"
DavidLiu506 May 31, 2022
ac01902
Update code
DavidLiu506 May 31, 2022
053d5ab
Revert "Update code"
DavidLiu506 May 31, 2022
ebbeefa
Update code
DavidLiu506 May 31, 2022
c1beae4
Update code
DavidLiu506 Jun 8, 2022
ce0ad7a
Update code
DavidLiu506 Jun 8, 2022
f518986
Update code
DavidLiu506 Jun 8, 2022
3fba144
Update code
DavidLiu506 Jun 8, 2022
aa43fc6
Update code
DavidLiu506 Jun 8, 2022
da6ed64
Update code
DavidLiu506 Jun 13, 2022
276b205
Merge branch 'master' of https://github.com/futurewei-cloud/alcor int…
DavidLiu506 Jun 16, 2022
85a9b3e
Merge branch 'master' of https://github.com/DavidLiu506/alcor into al…
DavidLiu506 Jun 16, 2022
5741f07
Add arion watch service for arion wing
DavidLiu506 Jun 16, 2022
ad57f7b
Update code
DavidLiu506 Jun 16, 2022
bea71bb
Update code
DavidLiu506 Jun 16, 2022
df7f8e7
Update code
DavidLiu506 Jun 16, 2022
5936c4b
Update code
DavidLiu506 Jun 16, 2022
45cb7e2
Update code
DavidLiu506 Jun 16, 2022
24896a8
Update code
DavidLiu506 Jun 16, 2022
243c799
Update code
DavidLiu506 Jun 16, 2022
5ba0d9a
Update code
DavidLiu506 Jun 16, 2022
79832ef
Update code
DavidLiu506 Jun 17, 2022
b067987
Update code
DavidLiu506 Jun 17, 2022
e4793c5
Update code
DavidLiu506 Jun 17, 2022
7122cc8
Update code
DavidLiu506 Jun 17, 2022
ba723d5
Update code
DavidLiu506 Jun 22, 2022
3d233c9
Update code
DavidLiu506 Jun 23, 2022
f2213d5
Update code
DavidLiu506 Jun 23, 2022
b2f22d8
Update code
DavidLiu506 Jul 2, 2022
92ad98a
Update code
DavidLiu506 Jul 2, 2022
85f8dce
Update code
DavidLiu506 Jul 2, 2022
f09eb24
Update code
DavidLiu506 Jul 5, 2022
ada7d09
Update code
DavidLiu506 Jul 5, 2022
0d784fa
Update code
DavidLiu506 Jul 7, 2022
378b557
Update code
DavidLiu506 Jul 7, 2022
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
5 changes: 5 additions & 0 deletions kubernetes/services/dpm_manager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,11 @@ data:
host.ip.to.group.topic.map=group-topic1:192.168.131.131,10.10.10.11 group-topic2:192.168.131.131,11.11.11.12
group.topic.to.multicast.topic.map=multicast-topic1:group-topic1,group-topic3 multicast-topic2:group-topic2,group-topic4


arionGateway.enabled = false
arionMaster.server = 127.0.0.1
arionMaster.port = 9090

zetaGateway.enabled=false
zetaGateway.node.mac=e0:97:96:02:45:53
microservices.node.service.url=http://nodemanager-service.default.svc.cluster.local:9007/nodes
Expand Down
8 changes: 4 additions & 4 deletions lib/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -81,22 +81,22 @@ Copyright(c) 2020 Futurewei Cloud
<dependency>
<groupId>io.grpc</groupId>
<artifactId>grpc-netty-shaded</artifactId>
<version>1.23.0</version>
<version>1.42.2</version>
</dependency>
<dependency>
<groupId>io.grpc</groupId>
<artifactId>grpc-protobuf</artifactId>
<version>1.23.0</version>
<version>1.42.2</version>
</dependency>
<dependency>
<groupId>io.grpc</groupId>
<artifactId>grpc-stub</artifactId>
<version>1.23.0</version>
<version>1.42.2</version>
</dependency>
<dependency>
<groupId>io.grpc</groupId>
<artifactId>protoc-gen-grpc-java</artifactId>
<version>1.23.0</version>
<version>1.42.2</version>
<type>pom</type>
</dependency>

Expand Down
10 changes: 5 additions & 5 deletions schema/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,22 +36,22 @@
<dependency>
<groupId>io.grpc</groupId>
<artifactId>grpc-netty-shaded</artifactId>
<version>1.23.0</version>
<version>1.42.2</version>
</dependency>
<dependency>
<groupId>io.grpc</groupId>
<artifactId>grpc-protobuf</artifactId>
<version>1.23.0</version>
<version>1.42.2</version>
</dependency>
<dependency>
<groupId>io.grpc</groupId>
<artifactId>grpc-stub</artifactId>
<version>1.23.0</version>
<version>1.42.2</version>
</dependency>
<dependency>
<groupId>io.grpc</groupId>
<artifactId>protoc-gen-grpc-java</artifactId>
<version>1.23.0</version>
<version>1.42.2</version>
<type>pom</type>
</dependency>
<dependency>
Expand All @@ -62,7 +62,7 @@
<dependency>
<groupId>io.grpc</groupId>
<artifactId>grpc-testing</artifactId>
<version>1.23.0</version>
<version>1.42.2</version>
<scope>test</scope>
</dependency>
</dependencies>
Expand Down
10 changes: 10 additions & 0 deletions schema/proto3/gateway.proto
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ enum GatewayType {
TGW = 2; // Transit Gateway
IGW = 3; // Internet Gateway
NGW = 4; // NAT Gateway
ARION = 5;
}

message GatewayConfiguration {
Expand All @@ -50,8 +51,17 @@ message GatewayConfiguration {
uint32 port_inband_operation = 1;
}

message arion {
string vpc_id = 1;
uint32 vni = 2;
string subnet_id = 3;
// port for in-band (same NIC channel) operation
uint32 port_inband_operation = 4;
Comment on lines +58 to +59
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this a port id or?

Copy link
Contributor

Choose a reason for hiding this comment

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

This is the port number for the in-band operation. Say, port_inband_operation=1234, then when ACA receives this Gateway State, it creates a UDP server at this port(1234) to receive the OAM packet sent by an Arion Wing.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@zzxgzgz thank you!

Copy link
Contributor

Choose a reason for hiding this comment

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

@zzxgzgz based on the new design, the OAM packet is sent by a local OAM agent, not the Arion Wing, right?

}

oneof extra_info {
zeta zeta_info = 6;
arion arion_info = 7;
}
}

Expand Down
10 changes: 10 additions & 0 deletions schema/proto3/goalstateprovisioner.proto
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ option java_package = "com.futurewei.alcor.schema";

import "common.proto";
import "goalstate.proto";
import "neighbor.proto";

service GoalStateProvisioner {

Expand Down Expand Up @@ -49,6 +50,8 @@ service GoalStateProvisioner {
rpc RequestGoalStates (HostRequest) returns (HostRequestReply) {
}

rpc PushGoalstates (NeighborRulesRequest) returns (GoalStateOperationReply) {
}
}

message HostRequest {
Expand Down Expand Up @@ -83,6 +86,13 @@ message HostRequestReply {
uint32 total_operation_time = 3;
}

message NeighborRulesRequest {
uint32 format_version = 1;
string request_id = 2;

repeated NeighborState neigborstates = 3;
}

message GoalStateOperationReply {
uint32 format_version = 1;

Expand Down
3 changes: 3 additions & 0 deletions schema/proto3/neighbor.proto
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ message NeighborConfiguration {
NeighborType neighbor_type = 1;
string subnet_id = 2;
string ip_address = 3;
string arion_group = 4;
Copy link
Contributor

Choose a reason for hiding this comment

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

@DavidLiu506 Let us discuss this. Hopefully we could reuse Alcor basic data structure to support Arion.

uint32 tunnel_id = 5;
string mac_address = 6;
}

message AllowAddressPair {
Expand Down
6 changes: 5 additions & 1 deletion services/data_plane_manager/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,11 @@ Copyright(c) 2020 Futurewei Cloud
<artifactId>junit-jupiter</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>com.github.ishugaliy</groupId>
<artifactId>allgood-consistent-hash</artifactId>
<version>1.0.0</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
/*
MIT License
Copyright(c) 2020 Futurewei Cloud

Permission is hereby granted,
free of charge, to any person obtaining a copy of this software and associated documentation files(the "Software"), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and / or sell copies of the Software, and to permit persons
to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
package com.futurewei.alcor.dataplane.cache;

import com.futurewei.alcor.common.db.CacheException;
import com.futurewei.alcor.common.db.CacheFactory;
import com.futurewei.alcor.common.db.ICache;
import com.futurewei.alcor.common.stats.DurationStatistics;
import com.futurewei.alcor.dataplane.entity.ArionGroup;
import com.futurewei.alcor.dataplane.entity.ArionWing;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.stereotype.Repository;

import java.util.Collection;
import java.util.Map;
import java.util.Set;

@Repository
@ComponentScan(value="com.futurewei.alcor.common.db")
public class ArionWingCache {

// arionWingCache store Arion wing meta data. key is Arion Wing hash code and value is Arion wing meta data.
private ICache<String, ArionWing> arionWingCache;

// arionWingGroupCache store Arion group meta data. key is Arion wing group name, value is Arion group meta data.
private ICache<String, ArionGroup> arionWingGroupCache;
private CacheFactory cacheFactory;

@Autowired
public ArionWingCache(CacheFactory cacheFactory) {
this.cacheFactory = cacheFactory;
arionWingCache = cacheFactory.getCache(ArionWing.class);
arionWingGroupCache = cacheFactory.getCache(ArionGroup.class);
}

@DurationStatistics
public ArionWing getArionWing (String resourceId) throws CacheException {
return arionWingCache.get(resourceId);
}

@DurationStatistics
public Collection<ArionWing> getArionWings () throws CacheException {
return arionWingCache.getAll().values();
}

@DurationStatistics
public Map<String, ArionWing> getAllSubnetPorts(Map<String, Object[]> queryParams) throws CacheException {
return arionWingCache.getAll(queryParams);
}

@DurationStatistics
public Collection<ArionWing> getArionWings (Set<String> keys) throws CacheException {
return arionWingCache.getAll(keys).values();
}

@DurationStatistics
public void insertArionWing (ArionWing arionWing) throws CacheException {
arionWingCache.put(String.valueOf(arionWing.hashCode()), arionWing);
}

@DurationStatistics
public void deleteArionWing (String resourceId) throws CacheException {
arionWingCache.remove(resourceId);
}

@DurationStatistics
public Object getArionGroup (String resourceId) throws CacheException {
return arionWingGroupCache.get(resourceId);
}

@DurationStatistics
public void insertArionGroup (String resourceId) throws CacheException {
System.out.println("Insert arion group: " + resourceId);
arionWingGroupCache.put(resourceId, new ArionGroup(resourceId));
}

@DurationStatistics
public void deleteArionGroup (String resourceId) throws CacheException {
arionWingGroupCache.remove(resourceId);
}

@DurationStatistics
public Map<String, ArionGroup> getAllArionGroup () throws CacheException {
return arionWingGroupCache.getAll();
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,15 @@ public class DataPlaneClientImplV2 implements DataPlaneClient<UnicastGoalStateV2
// prints out UUID and time, when sending a GoalState to any of the monitorHosts
private ArrayList<String> monitorHosts;

@Value("${arionGateway.enabled:false}")
private boolean arionGatwayEnabled;

@Value("${arionGateway.server:127.0.0.1}")
private String arionMasterServer;

@Value("${arionGateway.port:9090}")
private int arionMasterPort;

@Value("${microservices.connectTimeout:300}")
private String connectTimeout;

Expand All @@ -72,6 +81,9 @@ public List<String> sendGoalStates(List<UnicastGoalStateV2> unicastGoalStates) t
for (UnicastGoalStateV2 unicastGoalState : unicastGoalStates) {
goalStateBuilder = getGoalState(goalStateBuilder, unicastGoalState);
}
if (arionGatwayEnabled) {
doSendGoalStateToArionMaster(goalStateBuilder);
}
doSendGoalState(goalStateBuilder.build(), finishLatch, results);

if (!finishLatch.await(Integer.parseInt(connectTimeout), TimeUnit.SECONDS)) {
Expand Down Expand Up @@ -149,8 +161,8 @@ public List<String> sendGoalStates(List<UnicastGoalStateV2> unicastGoalStates, M
return null;
}

private GrpcChannelStub createGrpcChannelStub(String hostIp) {
ManagedChannel channel = ManagedChannelBuilder.forAddress(hostIp, this.hostAgentPort)
private GrpcChannelStub createGrpcChannelStub(String hostIp, int port) {
ManagedChannel channel = ManagedChannelBuilder.forAddress(hostIp, port)
.usePlaintext()
.keepAliveWithoutCalls(true)
.keepAliveTime(Long.MAX_VALUE, TimeUnit.SECONDS)
Expand All @@ -160,30 +172,31 @@ private GrpcChannelStub createGrpcChannelStub(String hostIp) {
return new GrpcChannelStub(channel, asyncStub);
}

private GrpcChannelStub getOrCreateGrpcChannel(String hostIp) {
if (!this.hostIpGrpcChannelStubMap.containsKey(hostIp)) {
this.hostIpGrpcChannelStubMap.put(hostIp, createGrpcChannelStubArrayList(hostIp));
private GrpcChannelStub getOrCreateGrpcChannel(String hostIp, Integer port) {
if (!this.hostIpGrpcChannelStubMap.containsKey(hostIp + port)) {

this.hostIpGrpcChannelStubMap.put(hostIp + port, createGrpcChannelStubArrayList(hostIp, port));
LOG.info("[getOrCreateGrpcChannel] Created a channel and stub to host IP: " + hostIp);
}
int usingChannelWithThisIndex = ThreadLocalRandom.current().nextInt(0, numberOfGrpcChannelPerHost);
ManagedChannel chan = this.hostIpGrpcChannelStubMap.get(hostIp).get(usingChannelWithThisIndex).channel;
ManagedChannel chan = this.hostIpGrpcChannelStubMap.get(hostIp + port).get(usingChannelWithThisIndex).channel;
//checks the channel status, reconnects if the channel is IDLE

ConnectivityState channelState = chan.getState(true);
if (channelState != ConnectivityState.READY && channelState != ConnectivityState.CONNECTING && channelState != ConnectivityState.IDLE) {
GrpcChannelStub newChannelStub = createGrpcChannelStub(hostIp);
this.hostIpGrpcChannelStubMap.get(hostIp).set(usingChannelWithThisIndex, newChannelStub);
GrpcChannelStub newChannelStub = createGrpcChannelStub(hostIp, port);
this.hostIpGrpcChannelStubMap.get(hostIp + port).set(usingChannelWithThisIndex, newChannelStub);
LOG.info("[getOrCreateGrpcChannel] Replaced a channel and stub to host IP: " + hostIp);
}
LOG.info("[getOrCreateGrpcChannel] Using channel and stub index " + usingChannelWithThisIndex + " to host IP: " + hostIp);
return this.hostIpGrpcChannelStubMap.get(hostIp).get(usingChannelWithThisIndex);
return this.hostIpGrpcChannelStubMap.get(hostIp + port).get(usingChannelWithThisIndex);
}

private ArrayList<GrpcChannelStub> createGrpcChannelStubArrayList(String hostIp) {
private ArrayList<GrpcChannelStub> createGrpcChannelStubArrayList(String hostIp, int port) {
long start = System.currentTimeMillis();
ArrayList<GrpcChannelStub> arr = new ArrayList<>();
for (int i = 0; i < numberOfGrpcChannelPerHost; i++) {
GrpcChannelStub channelStub = createGrpcChannelStub(hostIp);
GrpcChannelStub channelStub = createGrpcChannelStub(hostIp, port);
// Using Linkerd load balance
//warmUpChannelStub(channelStub, hostIp);
arr.add(channelStub);
Expand Down Expand Up @@ -232,10 +245,34 @@ public void onCompleted() {
return;
}

private String doSendGoalStateToArionMaster (Goalstate.GoalStateV2.Builder goalStateV2) {
GrpcChannelStub channelStub = getOrCreateGrpcChannel(arionMasterServer, arionMasterPort);
GoalStateProvisionerGrpc.GoalStateProvisionerStub asyncStub = channelStub.stub;
var neighborStateRequestBuilder = Goalstateprovisioner.NeighborRulesRequest.newBuilder();
neighborStateRequestBuilder.addAllNeigborstates(goalStateV2.getNeighborStatesMap().values());
asyncStub.pushGoalstates(neighborStateRequestBuilder.build(), new StreamObserver<Goalstateprovisioner.GoalStateOperationReply>() {
@Override
public void onNext(Goalstateprovisioner.GoalStateOperationReply goalStateOperationReply) {
LOG.info("Get response: " + goalStateOperationReply.toString());
}

@Override
public void onError(Throwable throwable) {
LOG.info(throwable.getMessage());
}

@Override
public void onCompleted() {

}
});
return null;
}

private String doSendGoalState(Goalstate.GoalStateV2 goalStateV2, CountDownLatch finishLatch, List<String> replies) {
String hostIp = netwconfigmanagerGrpcServiceUrl;
long start = System.currentTimeMillis();
GrpcChannelStub channelStub = getOrCreateGrpcChannel(hostIp);
GrpcChannelStub channelStub = getOrCreateGrpcChannel(hostIp, hostAgentPort);
long chan_established = System.currentTimeMillis();
LOG.info("[doSendGoalState] Established channel, elapsed Time in milli seconds: " + (chan_established - start));
GoalStateProvisionerGrpc.GoalStateProvisionerStub asyncStub = channelStub.stub;
Expand Down Expand Up @@ -371,10 +408,10 @@ private Goalstate.GoalStateV2.Builder getGoalState(Goalstate.GoalStateV2.Builder


if (goalStateBuilder.containsRouterStates(unicastGoalStateV2.getHostIp() + "/" + entry.getKey())) {
Router.RouterConfiguration.Builder routerConfigurationBuilder = goalStateBuilder.getRouterStatesMap().get(unicastGoalStateV2.getHostIp() + "/" + entry.getKey()).getConfiguration().toBuilder();
routerConfigurationBuilder.addAllSubnetRoutingTables(entry.getValue().getConfiguration().getSubnetRoutingTablesList());
Router.RouterState.Builder routerStateBuilder = goalStateBuilder.getRouterStatesMap().get(unicastGoalStateV2.getHostIp() + "/" + entry.getKey()).toBuilder();
routerStateBuilder.setConfiguration(routerConfigurationBuilder);
Router.RouterConfiguration.Builder routerConfigurationBuilder = goalStateBuilder.getRouterStatesMap().get(unicastGoalStateV2.getHostIp() + "/" + entry.getKey()).getConfiguration().toBuilder();
routerConfigurationBuilder.addAllSubnetRoutingTables(entry.getValue().getConfiguration().getSubnetRoutingTablesList());
Router.RouterState.Builder routerStateBuilder = goalStateBuilder.getRouterStatesMap().get(unicastGoalStateV2.getHostIp() + "/" + entry.getKey()).toBuilder();
routerStateBuilder.setConfiguration(routerConfigurationBuilder);
} else {
goalStateBuilder.putRouterStates(unicastGoalStateV2.getHostIp() + "/" + entry.getKey(), entry.getValue());
}
Expand Down
Loading