-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add FORWARD node type and implementation (#552)
* Add intf read/writer * add fwd node type definition * fix fwd proto * add forward container * add license * fix test * lint * lint
- Loading branch information
Showing
24 changed files
with
1,493 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
name: "forward-basic" | ||
nodes: { | ||
name: "r1" | ||
vendor: OPENCONFIG | ||
model: "LEMMING" | ||
} | ||
nodes: { | ||
name: "r2" | ||
vendor: OPENCONFIG | ||
model: "LEMMING" | ||
} | ||
nodes: { | ||
name: "fwd1" | ||
vendor: FORWARD | ||
config: { | ||
image: "forward:latest" | ||
vendor_data { | ||
[type.googleapis.com/forward.ForwardConfig] { | ||
wires: { | ||
a: { | ||
interface: { | ||
name: "eth1" | ||
} | ||
} | ||
z: { | ||
local_node: { | ||
name: "fwd2" | ||
interface: "eth1" | ||
} | ||
} | ||
} | ||
wires: { | ||
a: { | ||
local_node: { | ||
name: "fw2" | ||
interface: "eth2" | ||
} | ||
} | ||
z: { | ||
interface: { | ||
name: "eth2" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
nodes: { | ||
name: "fwd2" | ||
vendor: FORWARD | ||
config: { | ||
image: "forward:latest" | ||
vendor_data { | ||
[type.googleapis.com/forward.ForwardConfig] { | ||
wires: { | ||
a: { | ||
interface: { | ||
name: "eth2" | ||
} | ||
} | ||
z: { | ||
local_node: { | ||
name: "fwd1" | ||
interface: "eth2" | ||
} | ||
} | ||
} | ||
wires: { | ||
a: { | ||
local_node: { | ||
name: "fw1" | ||
interface: "eth1" | ||
} | ||
} | ||
z: { | ||
interface: { | ||
name: "eth1" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
links: { | ||
a_node: "r1" | ||
a_int: "eth1" | ||
z_node: "fwd1" | ||
z_int: "eth1" | ||
} | ||
links: { | ||
a_node: "fwd2" | ||
a_int: "eth1" | ||
z_node: "r2" | ||
z_int: "eth1" | ||
} | ||
links: { | ||
a_node: "r2" | ||
a_int: "eth2" | ||
z_node: "fwd2" | ||
z_int: "eth2" | ||
} | ||
links: { | ||
a_node: "fwd1" | ||
a_int: "eth2" | ||
z_node: "r1" | ||
z_int: "eth2" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
// Copyright 2024 Google LLC | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
syntax = "proto3"; | ||
|
||
package forward; | ||
|
||
option go_package = "github.com/openconfig/kne/proto/forward"; | ||
|
||
// Forward specific config data for KNE | ||
message ForwardConfig { | ||
repeated Wire wires = 1; | ||
} | ||
|
||
// Wire is a connection between two endpoints intended to forward | ||
// data bidirectionally between them. One of the endpoints must be | ||
// of type Interface. | ||
message Wire { | ||
// The a endpoint serves as the client endpoint in the bidirectional stream. | ||
Endpoint a = 1; | ||
// The z endpoint serves as the server endpoint in the bidirectional stream. | ||
Endpoint z = 2; | ||
} | ||
|
||
message Endpoint { | ||
oneof endpoint { | ||
// Interface is a local interface (ex. eth0) on the node. | ||
Interface interface = 1; | ||
// LocalNode is a node in the same cluster. | ||
LocalNode local_node = 2; | ||
// RemoteNode is a node in a different cluster. | ||
RemoteNode remote_node = 3; | ||
} | ||
} | ||
|
||
message Interface { | ||
string name = 1; | ||
// TODO: Add MTU and other configurable fields. | ||
} | ||
|
||
message LocalNode { | ||
string name = 1; | ||
string interface = 2; | ||
} | ||
|
||
message RemoteNode { | ||
string addr = 1; | ||
string interface = 2; | ||
} |
Oops, something went wrong.