USNavalResearchLaboratory / norm

NACK-Oriented Reliable Multicast (NORM) implementation & tools (RFCs 5740, 5401)
https://www.nrl.navy.mil/Our-Work/Areas-of-Research/Information-Technology/NCS/NORM/
Other
98 stars 36 forks source link

.NET NORM Extension #85

Open mullerj opened 6 months ago

mullerj commented 6 months ago

Added a .NET extension that provides a .NET wrapper so that .NET applications can access the NORM C API. It is modeled after the Java extension for NORM. Also, added integration tests to verify functionality and demonstrate usage. Added GitHub actions to run tests and publish the .NET extension to GitHub Packages. Included Dev Container to simplify the process of setting up a development environment. This closes #84.

bebopagogo commented 6 months ago

Thanks! – I will take a look at this as quickly as possible.  This sounds like a useful addition for many.

Best regards,

Brian

From: mullerj @.> Reply-To: USNavalResearchLaboratory/norm @.> Date: Thursday, March 28, 2024 at 2:32 PM To: USNavalResearchLaboratory/norm @.> Cc: Subscribed @.> Subject: [USNavalResearchLaboratory/norm] .NET NORM Extension #84 (PR #85)

Added a .NET extension that provides a .NET wrapper so that .NET applications can access the NORM C API. It is modeled after the Java extension for NORM. Also, added integration tests to verify functionality and demonstrate usage. Added GitHub actions to run tests and publish the .NET extension to GitHub Packages. Included Dev Container to simplify the process of setting up a development environment. This closes #84.

You can view, comment on, or merge this pull request online at: https://github.com/USNavalResearchLaboratory/norm/pull/85 Commit Summary 3a20a8b .NET Extension Design (#5) 2694446 .NET Extension Design Implementation (#10) 701360a NormSession typos in comments (#12) db20c64 Feature/9 net norm extension target architecture packages (#13) 86d8fb1 Merge branch 'USNavalResearchLaboratory:master' into master 96476ff Codespace Configurations (#15) a1dcbf1 .NET norm extension GitHub actions (#16) e60a3af Update dotnet-publish.yml to use source branch (#18) 47bf91a .NET norm package publish (#19) 7d7de23 Publish test results (#21) 2d8768c Dev Container extensions (#23) 2be146c Dev Container performance (#25) 43c0736 Revert "Dev Container performance (#25)" (#27) b04acd3 Merge branch 'USNavalResearchLaboratory:master' into master 034980e Update action versions for dotnet-publish.yml b5d2e87 Update action versions for dotnet.yml File Changes (66 files) A .devcontainer/devcontainer.json (39) A .gitattributes (1) A .github/workflows/dotnet-publish.yml (141) A .github/workflows/dotnet.yml (49) M .gitignore (279) A .vscode/extensions.json (5) A README-DotNet.md (72) A src/dotnet/Mil.Navy.Nrl.Norm.sln (85) A src/dotnet/design/Mil/Navy/Nrl/Norm/Enums/NormAckingStatus.puml (8) A src/dotnet/design/Mil/Navy/Nrl/Norm/Enums/NormEventType.puml (33) A src/dotnet/design/Mil/Navy/Nrl/Norm/Enums/NormFecType.puml (7) A src/dotnet/design/Mil/Navy/Nrl/Norm/Enums/NormFlushMode.puml (7) A src/dotnet/design/Mil/Navy/Nrl/Norm/Enums/NormNackingMode.puml (7) A src/dotnet/design/Mil/Navy/Nrl/Norm/Enums/NormObjectType.puml (8) A src/dotnet/design/Mil/Navy/Nrl/Norm/Enums/NormProbingMode.puml (7) A src/dotnet/design/Mil/Navy/Nrl/Norm/Enums/NormRepairBoundary.puml (6) A src/dotnet/design/Mil/Navy/Nrl/Norm/Enums/NormSyncPolicy.puml (7) A src/dotnet/design/Mil/Navy/Nrl/Norm/Enums/NormTrackingStatus.puml (9) A src/dotnet/design/Mil/Navy/Nrl/Norm/IO/INormEventListener.puml (5) A src/dotnet/design/Mil/Navy/Nrl/Norm/IO/NormInputStream.puml (42) A src/dotnet/design/Mil/Navy/Nrl/Norm/IO/NormOutputStream.puml (49) A src/dotnet/design/Mil/Navy/Nrl/Norm/IO/StreamBreakException.puml (6) A src/dotnet/design/Mil/Navy/Nrl/Norm/NormApi.puml (119) A src/dotnet/design/Mil/Navy/Nrl/Norm/NormData.puml (7) A src/dotnet/design/Mil/Navy/Nrl/Norm/NormEvent.puml (14) A src/dotnet/design/Mil/Navy/Nrl/Norm/NormFile.puml (9) A src/dotnet/design/Mil/Navy/Nrl/Norm/NormInstance.puml (24) A src/dotnet/design/Mil/Navy/Nrl/Norm/NormNode.puml (20) A src/dotnet/design/Mil/Navy/Nrl/Norm/NormObject.puml (18) A src/dotnet/design/Mil/Navy/Nrl/Norm/NormSession.puml (74) A src/dotnet/design/Mil/Navy/Nrl/Norm/NormStream.puml (18) A src/dotnet/design/SequenceDiagrams/NormFileSend.puml (49) A src/dotnet/pack-linux-x64.sh (12) A src/dotnet/pack-win-x64.bat (14) A src/dotnet/pack-win-x86.bat (14) A src/dotnet/src/Mil.Navy.Nrl.Norm.linux-x64/Mil.Navy.Nrl.Norm.linux-x64.csproj (22) A src/dotnet/src/Mil.Navy.Nrl.Norm.win-x64/Mil.Navy.Nrl.Norm.win-x64.csproj (22) A src/dotnet/src/Mil.Navy.Nrl.Norm.win-x86/Mil.Navy.Nrl.Norm.win-x86.csproj (22) A src/dotnet/src/Mil.Navy.Nrl.Norm/Enums/NormAckingStatus.cs (28) A src/dotnet/src/Mil.Navy.Nrl.Norm/Enums/NormEventType.cs (194) A src/dotnet/src/Mil.Navy.Nrl.Norm/Enums/NormFecType.cs (21) A src/dotnet/src/Mil.Navy.Nrl.Norm/Enums/NormFlushMode.cs (22) A src/dotnet/src/Mil.Navy.Nrl.Norm/Enums/NormNackingMode.cs (21) A src/dotnet/src/Mil.Navy.Nrl.Norm/Enums/NormObjectType.cs (25) A src/dotnet/src/Mil.Navy.Nrl.Norm/Enums/NormProbingMode.cs (24) A src/dotnet/src/Mil.Navy.Nrl.Norm/Enums/NormRepairBoundary.cs (22) A src/dotnet/src/Mil.Navy.Nrl.Norm/Enums/NormSyncPolicy.cs (22) A src/dotnet/src/Mil.Navy.Nrl.Norm/IO/INormEventListener.cs (7) A src/dotnet/src/Mil.Navy.Nrl.Norm/IO/NormInputStream.cs (332) A src/dotnet/src/Mil.Navy.Nrl.Norm/IO/NormOutputStream.cs (392) A src/dotnet/src/Mil.Navy.Nrl.Norm/IO/StreamBreakException.cs (9) A src/dotnet/src/Mil.Navy.Nrl.Norm/Mil.Navy.Nrl.Norm.csproj (10) A src/dotnet/src/Mil.Navy.Nrl.Norm/NormApi.cs (1133) A src/dotnet/src/Mil.Navy.Nrl.Norm/NormData.cs (39) A src/dotnet/src/Mil.Navy.Nrl.Norm/NormEvent.cs (112) A src/dotnet/src/Mil.Navy.Nrl.Norm/NormFile.cs (54) A src/dotnet/src/Mil.Navy.Nrl.Norm/NormInstance.cs (235) A src/dotnet/src/Mil.Navy.Nrl.Norm/NormNode.cs (147) A src/dotnet/src/Mil.Navy.Nrl.Norm/NormObject.cs (163) A src/dotnet/src/Mil.Navy.Nrl.Norm/NormSession.cs (918) A src/dotnet/src/Mil.Navy.Nrl.Norm/NormStream.cs (182) A src/dotnet/src/Mil.Navy.Nrl.Norm/Usings.cs (3) A src/dotnet/tests/Mil.Navy.Nrl.Norm.IntegrationTests/Mil.Navy.Nrl.Norm.IntegrationTests.csproj (34) A src/dotnet/tests/Mil.Navy.Nrl.Norm.IntegrationTests/NormInstanceTests.cs (261) A src/dotnet/tests/Mil.Navy.Nrl.Norm.IntegrationTests/NormSessionTests.cs (2139) A src/dotnet/tests/Mil.Navy.Nrl.Norm.IntegrationTests/Usings.cs (1) Patch Links: https://github.com/USNavalResearchLaboratory/norm/pull/85.patch https://github.com/USNavalResearchLaboratory/norm/pull/85.diff — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.Message ID: @.***>

mullerj commented 6 months ago

Great! Please let me know if you have any questions or comments.

bebopagogo commented 4 months ago

Yes - the NormDataEnqueue() call pass the pointer to the application memory block and the application is responsible for keeping it intact and unmodified while the NORM sender has access to it. This is sort of an anachronism from the early days of our reliable multicast effort where we were focused on transfer of "bulky" content and when passinng very large objects in memory and NORM keep a potentially large cache of objects to provide repair/retransmissions for, it wasn't prudent for NORM to keep an internal copy of something the application was maintaining anyway. For smaller data object like messages, it is practical for NORM to maintain its own copy of the data and I have thought about allowing for that. In fact, the API may have a way to pass deallocation control down to NORM (if not, an option that could be added with appropriate use of accompanying NormAlloc() and NormDealloc() calls).

BTW - also posting here that I have been tracking this pull request loosely. Since there is some additional engagement on this and I've been busy, I haven't yet dived into closely review this request. If you both thinks it's ready for that, I will do that ASAP. Thanks for your contribution!

lbargaoanu commented 4 months ago

Having NORM copy on enqueue and deallocate when needed would certainly simplify things for the .NET code. Otherwise we're left with pinning or doing the exact same thing in C#. The performance impact of pinning seems difficult to estimate without measuring a real use case. But it negatively affects GC performance due to fragmentation and it would increase with the size of the transmit cache.

mullerj commented 4 months ago

@bebopagogo Thanks for checking on the pull request and for clarifying NormDataEnqueue(). I am currently working on a feature branch to address the NormDataEnqueue() comments. The rest could use further review if time is available.

mullerj commented 1 month ago

@lbargaoanu Pushed an update for the last set of comments. Please verify if the comments have been addressed and if there are other recommendations.