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

add design doc for grpc_client #972

Merged
merged 28 commits into from
May 12, 2023
Merged

Conversation

vdahiya12
Copy link
Contributor

Signed-off-by: vaibhav-dahiya vdahiya@microsoft.com

Signed-off-by: vaibhav-dahiya <vdahiya@microsoft.com>
and do this within SONiC PMON docker


Challenge: to provide an interface for gRPC daemon to exchange RPC's with the gRPC server running on the SoC
Copy link
Contributor

Choose a reason for hiding this comment

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

Please follow the other templates and have this as part of "Requirement" section

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

```
sudo ip route add <soc IP> via <vlan IP> src <Loopback IP>
```
- Te issue with adding a Kernel Route is the route_cheker will fail for this, since vlan IP is the HOST's own vlan IP within SONiC as such no real neighbor is present
Copy link
Contributor

Choose a reason for hiding this comment

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

The -> typo

sudo ip route add <soc IP> via <vlan IP> src <Loopback IP>
```
- Te issue with adding a Kernel Route is the route_cheker will fail for this, since vlan IP is the HOST's own vlan IP within SONiC as such no real neighbor is present
- SWSS orchagent will complain about not able to istall the entry in ASIC, the entry will be present in APP DB but not present inside ASIC. This would deem more worarounds necessary to be able to use this approach.
Copy link
Contributor

Choose a reason for hiding this comment

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

install - typo. Please fix typos in the doc.. I see it it multiple places

LINKMGR_CABLE|PORTNAME
soc_ipv4: <soc IP>
```
- The update_control_plane_nat_acls in caclmgrd will look for the above configuration and upon getting the config, it will add the POSTROUTING nat rules
Copy link
Contributor

Choose a reason for hiding this comment

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

Please specify what NAT rules are installed currently and if it has any dependencies. How about restarting caclmgrd? Please capture in the doc

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

#### Rationale


- This approach would add the rule for all the soc IP's contained to DualToR, and SoC server and gRPC client would be able to communicate over agreed IP
Copy link
Contributor

Choose a reason for hiding this comment

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

This approach shall add..

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

Signed-off-by: vaibhav-dahiya <vdahiya@microsoft.com>
Signed-off-by: vaibhav-dahiya <vdahiya@microsoft.com>
Signed-off-by: vaibhav-dahiya <vdahiya@microsoft.com>
Signed-off-by: vaibhav-dahiya <vdahiya@microsoft.com>
Signed-off-by: vaibhav-dahiya <vdahiya@microsoft.com>
@yxieca yxieca force-pushed the master branch 2 times, most recently from 8498931 to 8837dc2 Compare April 15, 2022 16:51
Signed-off-by: vaibhav-dahiya <vdahiya@microsoft.com>
Signed-off-by: vaibhav-dahiya <vdahiya@microsoft.com>
Signed-off-by: vaibhav-dahiya <vdahiya@microsoft.com>
Signed-off-by: vaibhav-dahiya <vdahiya@microsoft.com>
Signed-off-by: vaibhav-dahiya <vdahiya@microsoft.com>
Signed-off-by: vaibhav-dahiya <vdahiya@microsoft.com>
Signed-off-by: vaibhav-dahiya <vdahiya@microsoft.com>
Signed-off-by: vaibhav-dahiya <vdahiya@microsoft.com>
Signed-off-by: vaibhav-dahiya <vdahiya@microsoft.com>
Signed-off-by: vaibhav-dahiya <vdahiya@microsoft.com>
Signed-off-by: vaibhav-dahiya <vdahiya@microsoft.com>
Signed-off-by: vaibhav-dahiya <vdahiya@microsoft.com>
Signed-off-by: vaibhav-dahiya <vdahiya@microsoft.com>
Signed-off-by: vaibhav-dahiya <vdahiya@microsoft.com>
Signed-off-by: vaibhav-dahiya <vdahiya@microsoft.com>
Signed-off-by: vaibhav-dahiya <vdahiya@microsoft.com>
Signed-off-by: vaibhav-dahiya <vdahiya@microsoft.com>
Signed-off-by: vaibhav-dahiya <vdahiya@microsoft.com>
| Rev | Date | Author | Change Description |
|:---:|:--------:|:---------------:|--------------------|
| 0.1 | 04/1/22 | Vaibhav Dahiya | Initial version |
| 0.2 | 02/1/22 | Vaibhav Dahiya | Make chnages to be shared to Core Team |
Copy link
Contributor

Choose a reason for hiding this comment

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

0.2 date shouldn't be the date after 0.1 MM:DD:YY ?


## Requirements

- provide a service/daemon in SONiC to run in DualToR mode, which can interact with Platform API as well interact with state machine(aka Linkmgr) and orchagent to provide capability for it to get/set Link State/Forwarding State etc. from SoC(gRPC server listening to the client)
Copy link
Contributor

Choose a reason for hiding this comment

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

isn't gRPC service running on PMON is stateless?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

its stateless


HOST and FPGA functionality is explained in this diagram

![Hardware Overview](images/gRPC_host.png)
Copy link
Contributor

Choose a reason for hiding this comment

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

What is the blue line X for within FPGA indicating?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

explained offline

Comment on lines +170 to +201
- Ycabled would exchange data/state with orchagent and linkmgr with the following schema:

```
APP_DB
MUX_CABLE_TABLE| PORTNAME; written by linkmgrd react on orchagent
- state: active | standby
HW_ MUX_CABLE_TABLE | PORTNAME; written by orchagent react on ycabled (its replacement)
- state: active | standby
FORWARDING_STATE_COMMAND | PORTNAME:
- command: probe | set_active_self | set_standby_self | set_standby_peer ;written by linkmgrd react on ycabled
FORWARDING_STATE_RESPONSE | PORTNAME
- response: active | standby | unknown | error ;written by ycabled react by linkmgrd
- response_peer: active | standby | unknown | error ;written by ycabled react by linkmgrd
PORT_TABLE|PORTNAME
- oper_status: up|down; written by swss react by linkmgrd
PORT_TABLE_PEER|PORT
- oper_status: up|down; written by ycabled react by linkmgrd
HW_FORWARDING_STATE_PEER|PORTNAME; written by linkmgrd react by ycabled
- state: active|standby|unknown
MUX_SERVICE_NOTIFICATION|PORT
- notify_type:control/data
- msg_type:begin/end
- guid:<guid>
- service_time:<time> //seconds

STATE_DB
MUX_CABLE_TABLE| PORTNAME
- State: active|standby|unknown; written by orchagent react on linkmgrd
HW_MUX_CABLE_TABLE| PORTNAME
- State: acative|standby|unknown; written by ycabled react on orchagent
HW_MUX_CABLE_TABLE_PEER| PORTNAME
- state: active |standby|unknown; written by ycabled react on linkmgrd
Copy link
Contributor

Choose a reason for hiding this comment

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

How is this relavant to grpc?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

this section is just making this commensurate to our design doc

vdahiya12 and others added 4 commits March 9, 2023 02:46
Signed-off-by: vaibhav-dahiya <vdahiya@microsoft.com>
Signed-off-by: vaibhav-dahiya <vdahiya@microsoft.com>
@vdahiya12 vdahiya12 merged commit 4862072 into sonic-net:master May 12, 2023
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.

4 participants