-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Vladimir Popov
committed
Nov 24, 2020
1 parent
fe601f8
commit 24a6093
Showing
19 changed files
with
331 additions
and
321 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
# Functional requirements | ||
|
||
There are some common chain elements that we expect to have in every client chain to make NSM working. Instead of that, | ||
there are few different scenarios when we need to create a client chain to initiate NSM request: | ||
1. Client to NSMgr - simple case when there is an application requesting some L2/L3 connection from the NSMgr. | ||
* no incoming L2/L3 request - client itself is a request generator | ||
* single request receiver - clients requests only the NSMgr, we need only ony GRPC client | ||
``` | ||
Client --Request--> NSMgr | ||
| | | ||
|---L2/L3 connection---| | ||
| | | ||
``` | ||
2. Server to NSMgr client - we already have application running as a NSM endpoint receiving request to L2/L3 connection, | ||
but it also needs to request some other L2/L3 connection from the NSMgr. | ||
* there is an incoming L2/L3 request - we need to generate an outgoing L2/L3 request, but the connection we return | ||
is an incoming connection | ||
* single request receiver - server requests only the NSMgr, we need only one GRPC client | ||
``` | ||
... Endpoint --Request--> NSMgr | ||
| | | | ||
|---L2/L3 connection---|---L2/L3 connection---| | ||
| | | | ||
``` | ||
3. Server to endpoint client - we already have application running as a NSM endpoint receiving request to L2/L3 | ||
connection, but it also needs to request some other L2/L3 connection from some other endpoint. | ||
* there is an incoming L2/L3 request - we need to generate an outgoing L2/L3 request, but the connection we return | ||
is an incoming connection | ||
* multiple request receivers - server requests different endpoints, we need multiple GRPC clients | ||
``` | ||
... Endpoint --Request--> Endpoint | ||
| | | | ||
|---L2/L3 connection---|---L2/L3 connection---| | ||
| | | | ||
``` | ||
4. Proxy to NSMgr client - we already have application running as a NSM server, but it doesn't provide L2/L3 | ||
connection, it simply passes the request to the NSMgr. | ||
* there is an incoming L2/L3 request but we simply forward it | ||
* single request receiver - proxy requests only the NSMgr, we need only one GRPC client | ||
``` | ||
... Proxy --Request--> NSMgr | ||
| | | | ||
|---------------L2/L3 connection--------------| | ||
| | | | ||
``` | ||
5. Proxy to endpoint client - we already have application running as a NSM server, but it doesn't provide L2/L3 | ||
connection, it simply passes the request to some other endpoint. | ||
* there is an incoming L2/L3 request but we simply forward it | ||
* multiple request receivers - proxy requests different endpoints, we need multiple GRPC clients. | ||
``` | ||
... Proxy --Request--> Endpoint | ||
| | | | ||
|---------------L2/L3 connection--------------| | ||
| | | | ||
``` | ||
# Implementation | ||
## client.NewClient(..., grpcCC, ...additionalFunctionality) | ||
It is a solution for the (1.) case. Client appends `additionalFunctionality` to the default client chain and passes | ||
incoming request to the NSMgr over the `grpcCC`. Since (4.) case doesn't need incoming request to be translated, this | ||
also can be used for the (4.) case. | ||
## client.NewServerClient(..., grpcCC, ...additionalFunctionality) | ||
It is a solution for the (2.) case. It differs with `client.NewClient` because it generates new outgoing request and | ||
passes it to the NSMgr over the `grpcCC` but returns incoming connection. | ||
## client.NewServerClientFactory(..., ...additionalFunctionality) | ||
It is a solution for the (3.) case. Now we don't have some predefined `grpcCC` and so we create a new GRPC client on | ||
each new client URL received from the incoming request, then we process it like (2.) | ||
## client.NewProxyClientFactory(..., ...additionalFunctionality) | ||
It is a solution for the (5.) case. We create a new GRPC client on each new client URL received, but process like (1.) |
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 was deleted.
Oops, something went wrong.
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 was deleted.
Oops, something went wrong.
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
Oops, something went wrong.