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

examples/svs/high-level/chat interop with ndn-svs/examples/chat #2

Open
yoursunny opened this issue Feb 9, 2023 · 0 comments
Open

Comments

@yoursunny
Copy link

yoursunny commented Feb 9, 2023

I want to verify interoperability of the SVS implementation in this library with the C++ reference implementation.
However, I cannot get the chat example to connect.

I think it's useful to include at least one example along with instructions to demonstrate the interoperability of this library with the reference implementation.
You can see NDNts sync-interop as an example.

Environment

  • Ubuntu 20.04 in LXC container on kernel 6.0.0-0.deb11.6-amd64
  • Go 1.19.3
  • ndn-cxx 0.8.1-1-g535bd332-nightly~focal
  • NFD 22.12-nightly~ndncxx0.8.1.1.g535bd332~focal
  • justincpresley/ndn-sync production branch, commit e57bd02 (2023-02-03)
  • ndn-svs commit e39538ed1ddd789de9a34c242af47c3ba4f3583d (2022-12-08)

In ndn-sync, FormalEncoding is enabled:

diff --git a/examples/svs/high-level/chat/main.go b/examples/svs/high-level/chat/main.go
index b705c0f..2e3761c 100644
--- a/examples/svs/high-level/chat/main.go
+++ b/examples/svs/high-level/chat/main.go
@@ -57,7 +57,9 @@ func main() {
                fmt.Print(input)
                inputMutex.Unlock()
        }
-       sync := svs.NewSharedSync(app, svs.GetBasicSharedConfig(sourceName, syncPrefix, callback), svs.GetDefaultConstants())
+       cfg := svs.GetBasicSharedConfig(sourceName, syncPrefix, callback)
+       cfg.FormalEncoding = true
+       sync := svs.NewSharedSync(app, cfg, svs.GetDefaultConstants())

In C++, HMAC signing is disabled and sync prefix is changed:

diff --git a/examples/chat.cpp b/examples/chat.cpp
index 42f5e77..d611d74 100644
--- a/examples/chat.cpp
+++ b/examples/chat.cpp
@@ -32,10 +32,7 @@ class Program
 public:
   Program(const Options &options) : m_options(options)
   {
-    // Use HMAC signing for Sync Interests
-    // Note: this is not generally recommended, but is used here for simplicity
     ndn::svs::SecurityOptions securityOptions(m_keyChain);
-    securityOptions.interestSigner->signingInfo.setSigningHmacKey("dGhpcyBpcyBhIHNlY3JldCBtZXNzYWdl");
 
     // Create the SVSync instance
     m_svs = std::make_shared<ndn::svs::SVSync>(
@@ -122,7 +119,7 @@ main(int argc, char **argv)
   }
 
   Options opt;
-  opt.prefix = "/ndn/svs";
+  opt.prefix = "/svs";
   opt.m_id = argv[1];
 
   Program program(opt);

Experiment Procedure

  1. Start NFD and set multicast strategy for /svs prefix.
  2. Start ndn-sync/examples/svs/high-level/chat instances A and B.
  3. Start ndn-svs/examples/chat instances C and D.
  4. Send one message from each of A, B, C, and D.
  5. Check which instances received the message.

Expect output is that each instance shall receive one message from each other instance.

Actual Result

The chat instances cannot receive messages sent from another implementation.

ubuntu@ndndev:~/ndn-sync$ go run ./examples/svs/high-level/chat/ -source A
Entered the chatroom /svs as /A.
To leave, Press CTRL-C.
/A: MSG-A
/B: MSG-B

ubuntu@ndndev:~/ndn-sync$ go run ./examples/svs/high-level/chat/ -source B
Entered the chatroom /svs as /B.
To leave, Press CTRL-C.
/A: MSG-A
/B: MSG-B

ubuntu@ndndev:~/ndn-svs$ LD_LIBRARY_PATH=build build/examples/chat C
SVS client starting:C
/D/svs/%01 : User D has joined the groupchat
MSG-C
/D/svs/%02 : MSG-D

ubuntu@ndndev:~/ndn-svs$ LD_LIBRARY_PATH=build build/examples/chat D
SVS client starting:D
/C/svs/%01 : User C has joined the groupchat
/C/svs/%02 : MSG-C
MSG-D
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

No branches or pull requests

1 participant