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 support for TWAMP-LIGHT API #1786

Merged

Conversation

AlanYoush
Copy link
Contributor

Define SAI layerTWAMP-LIGHT function API in saitwamp.h

@AlanYoush AlanYoush force-pushed the devpr_centec_sai_twamp branch from 079753f to 135c203 Compare April 6, 2023 09:07
@kcudnik
Copy link
Collaborator

kcudnik commented Apr 6, 2023

please fix errors, api not defined for new header

@kcudnik
Copy link
Collaborator

kcudnik commented Jun 29, 2023

/azp run

@azure-pipelines
Copy link

Pull request contains merge conflicts.

@rlhui
Copy link
Collaborator

rlhui commented Jul 13, 2023

@xinliu-seattle @kcudnik Could you help arrange a review meeting for this proposal, Thanks very much.

@AlanYoush - ocp SAI meeting is Thur 8am PST. Does this time work for you? would you please reach out to me ritahui@microsoft.com, thanks.

@AlanYoush AlanYoush force-pushed the devpr_centec_sai_twamp branch 7 times, most recently from 994ae2b to 0cf5490 Compare July 20, 2023 13:12
@AlanYoush
Copy link
Contributor Author

/azp run

@azure-pipelines
Copy link

Commenter does not have sufficient privileges for PR 1786 in repo opencomputeproject/SAI

@AlanYoush AlanYoush force-pushed the devpr_centec_sai_twamp branch 4 times, most recently from 8bc974b to 355d745 Compare July 21, 2023 05:59
@AlanYoush
Copy link
Contributor Author

We had reivewed and discussed this PR during this week's SAI community meeting, please help to review this PR more detaily, @rlhui @kcudnik @JaiOCP @clarklee-guizhao @marian-pritsak,Thanks very much. If you have any questions, please feel free to contact us by @AlanYoush or @guxianghong.

We expect the TWAMP Light SAI to be pushed in the release version on August 28, because TWAMP Light feature in SONiC(sonic-net/SONiC#1192) has a dependency on these APIs.

@AlanYoush AlanYoush force-pushed the devpr_centec_sai_twamp branch 3 times, most recently from ca6fc3c to a7479df Compare August 7, 2023 08:33
@AlanYoush AlanYoush force-pushed the devpr_centec_sai_twamp branch 2 times, most recently from 70403bb to 0716b70 Compare August 15, 2023 01:22
@AlanYoush AlanYoush force-pushed the devpr_centec_sai_twamp branch from 0716b70 to 3ae2036 Compare August 16, 2023 00:53
@AlanYoush AlanYoush force-pushed the devpr_centec_sai_twamp branch 2 times, most recently from 722a7bd to 4f48467 Compare August 16, 2023 02:06
@AlanYoush
Copy link
Contributor Author

We have implemented TWAMP Light in SONiC and verified TWAMP Light SAI APIs feasible. And we expect this PR merged in the release version on August 28 to support SONiC TWAMP Light feature. Please review and merge this PR @rlhui @kcudnik. Thanks very much.

If you have any questions, please feel free to contact us by @AlanYoush or @guxianghong.

@kcudnik
Copy link
Collaborator

kcudnik commented Aug 24, 2023

there are conflicts on this branch, please resolve

@AlanYoush AlanYoush force-pushed the devpr_centec_sai_twamp branch 2 times, most recently from e73b8ca to 2ce9ffb Compare August 24, 2023 12:39
@AlanYoush
Copy link
Contributor Author

I have fixed conflicts. Please help to review again and merge it. Thanks very much. @kcudnik @rlhui

@AlanYoush AlanYoush force-pushed the devpr_centec_sai_twamp branch from 2ce9ffb to ee5cd5d Compare August 30, 2023 00:17
@guxianghong
Copy link

All confilicts have been fixed, could you please help to merge this PR, Thanks very much. @kcudnik @rlhui

*
* @type sai_twamp_mode_t
* @flags MANDATORY_ON_CREATE | CREATE_ONLY
*/

Choose a reason for hiding this comment

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

what is the default ? Light ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for comments.
TWAMP Light is simple version of TWAMP. When you create a twamp session, you must configure the attribute as TWAMP or TWAMP Light, so there is no default value and it is mandatory. We provide this attribute because it may support TWAMP feature in the furture.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is different between TWAMP and TWAMP Light for configuration.

*
* @type sai_twamp_session_role_t
* @flags MANDATORY_ON_CREATE | CREATE_ONLY
*/

Choose a reason for hiding this comment

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

Need a default here ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There are two roles of the TWAMP session. One is sender and the other is reflector. Users must assign the role of the twamp session when they create a twamp session. So there is no default value required and it is MANDATORY_ON_CREATE.

![Continuous](./figures/TWAMP_Light_continuous.png "Figure 2: Continuous Mode")

## How to get measurement data ##
It provides two methods to get measurement data for application.

Choose a reason for hiding this comment

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

what is the way to configure one of them or both ?

Copy link
Contributor Author

@AlanYoush AlanYoush Aug 31, 2023

Choose a reason for hiding this comment

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

There are two methods to get measurement data.
One is that the sai plugin proactively reports measurement data periodically through the callback function called "sai_twamp_session_event_notification_fn". It is the default method and should be implemented and supported by sai plugin.
The other is that the application can actively retrieve measurement data through "sai_get_twamp_session_stats_fn" or "sai_get_twamp_session_stats_ext_fn" when the application wants to get the measurement data immediately. It is an additional and optional method.
So these two methods are not conflict when they are both supported. The first one is defaultly supported by sai plugin. The other is optional and depends on the appliction.

Copy link
Contributor Author

@AlanYoush AlanYoush Aug 31, 2023

Choose a reason for hiding this comment

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

The SAI Callback function "sai_twamp_session_state_change_notification_fn" in MD file has been modified as "sai_twamp_session_event_notification_fn" based on the file "saitwamp.h"

Since TWAMP Light is a simple and lightweight protocol, it is easy for vendors to implement TWAMP Light in their ASIC, which can improve performance and reduce CPU overload on network devices. TWAMP Light offloading in ASIC should work for sending and receiving TWAMP Light packets, collecting measurement data such as latency, jitter and packet loss. And also, RFC-5357 TWAMP Light should be followed. For TWAMP Light hardware solution, the main requirements are as follows:
* Can be deployed as one sender
* Construct Test-request packets based on configuration including IP header, UDP port, etc.
* Transmit Test-request packets to a reflector within tx timestamps which are captured in ASIC.

Choose a reason for hiding this comment

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

"within" or "with" ?

Copy link
Contributor Author

@AlanYoush AlanYoush Aug 31, 2023

Choose a reason for hiding this comment

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

Sorry, I misunderstood. It means that the timestamp should be encoded in packets and use "with". I have modified it

* Receive Test-request packets from a sender and capture rx timestamps in ASIC.
* Construct Test-response packets based on configuration including IP header, UDP port, etc.
* Encode rx timestamps of Test-request packets into Test-response packets.
* Reflect Test-response packets back to a sender within tx timestamps which are captured in ASIC.

Choose a reason for hiding this comment

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

"within" or "with" ?

Copy link
Contributor Author

@AlanYoush AlanYoush Aug 31, 2023

Choose a reason for hiding this comment

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

Sorry, I misunderstood. It means that the timestamp should be encoded in packets and use "with". I have modified it

Signed-off-by: yoush <yoush@centec.com>
@AlanYoush AlanYoush force-pushed the devpr_centec_sai_twamp branch from ee5cd5d to 317bfa8 Compare August 31, 2023 01:48
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.

5 participants