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

Communication with two devices and IPv6 does not work with Service Discovery #521

Closed
nachtfuchs opened this issue Sep 15, 2023 · 1 comment

Comments

@nachtfuchs
Copy link

nachtfuchs commented Sep 15, 2023

My setup:

  • vsomeip 3.3.8
  • Two Xenomai machines (Debian 11) connected via network switch
  • "Mirrored services" on the two devices. Service 4433.2211 is offered and service 1234.5678 is requested on node 1. Node 2 does the oppposite

My observations:

  • Running the applications with IPv4 addresses creates the expected behavior. The two applications exchange data.
  • Running the same applications with IPv6 addresses AND deactivated service discovery AND hard coded IPv6 addresses of the respective clients runs with only one service. Depending on which machine starts first, its either [4433.2211] or [1234.5678]. Anyways, it shows that my machines are capable to communicate using IPv6.
  • ⚠️ PROBLEM: Using active service discovery (without hard coded unicast addresses of the services), there is no communication between the two applications.

My commands in both Xenomai machines when using active service discovery:

  • sudo ip -6 route add ff0e::1 dev eno1 [note: this is the multicast address for service discovery]
  • start the respective application on both nodes env VSOMIP_CONFIGURATION...

My json file for node 1:

{
"unicast" : "4242::1",
"logging" :
{
"level" : "trace",
"console" : "true",
"file" : { "enable" : "true", "path" : "/usr/cppPlayground/requestResponse2DevicesIpv6/node1.log" },
"dlt" : "false"
},
"applications" :
[
{
"name" : "request-response",
"id" : "0x1"
}
],
"services" :
[
{
"service" : "0x4433",
"instance" : "0x2211",
"unreliable" : "30510"
}
],
"routing" : "request-response",
"service-discovery" :
{
"enable" : "true",
"multicast" : "ff0e::1",
"port" : "30490",
"protocol" : "udp",
"initial_delay_min" : "10",
"initial_delay_max" : "100",
"repetitions_base_delay" : "200",
"repetitions_max" : "10",
"ttl" : "3",
"cyclic_offer_delay" : "2000",
"request_response_delay" : "1500"
}
}

My json file for node 2:

{
"unicast" : "4242::2",
"logging" :
{
"level" : "trace",
"console" : "true",
"file" : { "enable" : "true", "path" : "/usr/CppPlayground/requestResponseMirrored2DevicesIpv6/node2.log" },
"dlt" : "false"
},
"applications" :
[
{
"name" : "request-response-mirrored",
"id" : "0x9"
}
],
"services" :
[
{
"service" : "0x1234",
"instance" : "0x5678",
"unreliable" : "30509"
}
],
"routing" : "request-response-mirrored",
"service-discovery" :
{
"enable" : "true",
"multicast" : "ff0e::1",
"port" : "30490",
"protocol" : "udp",
"initial_delay_min" : "10",
"initial_delay_max" : "100",
"repetitions_base_delay" : "200",
"repetitions_max" : "10",
"ttl" : "3",
"cyclic_offer_delay" : "2000",
"request_response_delay" : "1500"
}
}

The log file for node 1 (started AFTER node 2):

2023-09-15 15:35:21.279421 [info] Using configuration file: "vsomeip-local_IPv6.json".
2023-09-15 15:35:21.281261 [info] Parsed vsomeip configuration in 2ms
2023-09-15 15:35:21.281666 [info] Configuration module loaded.
2023-09-15 15:35:21.282017 [info] Initializing vsomeip (3.3.8) application "request-response".
2023-09-15 15:35:21.282568 [info] Instantiating routing manager [Host].
2023-09-15 15:35:21.283269 [info] create_routing_root: Routing root @ /tmp/vsomeip-0
2023-09-15 15:35:21.283987 [info] Service Discovery enabled. Trying to load module.
2023-09-15 15:35:21.285998 [info] Service Discovery module loaded.
2023-09-15 15:35:21.286556 [info] Application(request-response, 0001) is initialized (11, 100).
2023-09-15 15:35:21.287161 [info] Starting vsomeip application "request-response" (0001) using 2 threads I/O nice 255
2023-09-15 15:35:21.287993 [info] Client [0001] routes unicast:4242::1, prefix:24
2023-09-15 15:35:21.287908 [info] main dispatch thread id from application: 0001 (request-response) is: 7f6d7edde700 TID: 1378
2023-09-15 15:35:21.288016 [info] shutdown thread id from application: 0001 (request-response) is: 7f6d7e5dd700 TID: 1379
2023-09-15 15:35:21.289400 [info] Watchdog is disabled!
2023-09-15 15:35:21.290087 [info] REQUEST(0001): [1234.5678:255.4294967295]
2023-09-15 15:35:21.290180 [info] io thread id from application: 0001 (request-response) is: 7f6d7d5db700 TID: 1381
2023-09-15 15:35:21.290169 [info] io thread id from application: 0001 (request-response) is: 7f6d7fedcec0 TID: 1375
2023-09-15 15:35:21.290694 [info] create_local_server: Listening @ /tmp/vsomeip-1
2023-09-15 15:35:21.292821 [info] OFFER(0001): [4433.2211:0.0] (true)
2023-09-15 15:35:21.293393 [info] vSomeIP 3.3.8 | (default)
2023-09-15 15:35:21.293815 [info] Network interface "eno1" state changed: up
2023-09-15 15:35:21.294766 [info] Route "ff00::/8 if: eno1 gw: n/a" state changed: up
2023-09-15 15:35:21.295200 [info] udp_server_endpoint_impl: SO_RCVBUF is: 212992 (1703936) local port:30490
2023-09-15 15:35:21.295432 [debug] Joining to multicast group ff0e::1 from 4242::1
2023-09-15 15:35:21.295805 [info] udp_server_endpoint_impl: SO_RCVBUF is: 212992 (1703936) local port:30510
2023-09-15 15:35:21.295976 [info] udp_server_endpoint_impl: SO_RCVBUF is: 212992 (1703936) local port:30490
2023-09-15 15:35:21.296000 [info] SOME/IP routing ready.
2023-09-15 15:35:22.293609 [info] OFFER(0001): [4433.2211:0.0] (true)
2023-09-15 15:35:22.294419 [warning] routing_manager_impl::handle_local_offer_service: Application: 0001 is offering: [4433.2211.0.0] offered previously by itself.
2023-09-15 15:35:23.294958 [info] OFFER(0001): [4433.2211:0.0] (true)
2023-09-15 15:35:23.295723 [warning] routing_manager_impl::handle_local_offer_service: Application: 0001 is offering: [4433.2211.0.0] offered previously by itself.
[... all the same as the two messages before...]
2023-09-15 15:35:29.039199 [info] STOP OFFER(0001): [4433.2211:0.0] (true)
2023-09-15 15:35:29.039906 [info] RELEASE(0001): [1234.5678]
2023-09-15 15:35:30.304243 [info] Stopping vsomeip application "request-response" (0001).

The log file for node 2 (started first):

2023-09-15 13:30:12.103566 [info] Using configuration file: "vsomeip-local_IPv6.json".
2023-09-15 13:30:12.104440 [info] Parsed vsomeip configuration in 0ms
2023-09-15 13:30:12.104668 [info] Configuration module loaded.
2023-09-15 13:30:12.104874 [info] Initializing vsomeip (3.3.8) application "request-response-mirrored".
2023-09-15 13:30:12.105322 [info] Instantiating routing manager [Host].
2023-09-15 13:30:12.106091 [info] create_routing_root: Routing root @ /tmp/vsomeip-0
2023-09-15 13:30:12.106628 [info] Service Discovery enabled. Trying to load module.
2023-09-15 13:30:12.108561 [info] Service Discovery module loaded.
2023-09-15 13:30:12.109099 [info] Application(request-response-mirrored, 0009) is initialized (11, 100).
2023-09-15 13:30:12.109498 [info] Starting vsomeip application "request-response-mirrored" (0009) using 2 threads I/O nice 255
2023-09-15 13:30:12.110156 [info] Client [0009] routes unicast:4242::2, prefix:24
2023-09-15 13:30:12.110075 [info] main dispatch thread id from application: 0009 (request-response-mirrored) is: 7f4e8a3c8700 TID: 1286
2023-09-15 13:30:12.110182 [info] shutdown thread id from application: 0009 (request-response-mirrored) is: 7f4e89bc7700 TID: 1287
2023-09-15 13:30:12.111531 [info] Watchdog is disabled!
2023-09-15 13:30:12.112176 [info] io thread id from application: 0009 (request-response-mirrored) is: 7f4e8b4c6ec0 TID: 1283
2023-09-15 13:30:12.112298 [info] REQUEST(0009): [4433.2211:255.4294967295]
2023-09-15 13:30:12.113470 [info] create_local_server: Listening @ /tmp/vsomeip-9
2023-09-15 13:30:12.113826 [info] OFFER(0009): [1234.5678:0.0] (true)
2023-09-15 13:30:12.114455 [info] vSomeIP 3.3.8 | (default)
2023-09-15 13:30:12.115075 [info] Network interface "eno1" state changed: up
2023-09-15 13:30:12.116039 [info] Route "ff00::/8 if: eno1 gw: n/a" state changed: up
2023-09-15 13:30:12.116450 [info] udp_server_endpoint_impl: SO_RCVBUF is: 212992 (1703936) local port:30490
2023-09-15 13:30:12.116704 [debug] Joining to multicast group ff0e::1 from 4242::2
2023-09-15 13:30:12.117146 [info] udp_server_endpoint_impl: SO_RCVBUF is: 212992 (1703936) local port:30509
2023-09-15 13:30:12.117379 [info] udp_server_endpoint_impl: SO_RCVBUF is: 212992 (1703936) local port:30490
2023-09-15 13:30:12.117409 [info] SOME/IP routing ready.
2023-09-15 13:30:12.117468 [info] io thread id from application: 0009 (request-response-mirrored) is: 7f4e88bc5700 TID: 1289
2023-09-15 13:30:13.114652 [info] OFFER(0009): [1234.5678:0.0] (true)
2023-09-15 13:30:13.115488 [warning] routing_manager_impl::handle_local_offer_service: Application: 0009 is offering: [1234.5678.0.0] offered previously by itself.
2023-09-15 13:30:14.116664 [info] OFFER(0009): [1234.5678:0.0] (true)
2023-09-15 13:30:14.117961 [warning] routing_manager_impl::handle_local_offer_service: Application: 0009 is offering: [1234.5678.0.0] offered previously by itself.
2023-09-15 13:30:15.118709 [info] OFFER(0009): [1234.5678:0.0] (true)
2023-09-15 13:30:15.119364 [warning] routing_manager_impl::handle_local_offer_service: Application: 0009 is offering: [1234.5678.0.0] offered previously by itself.
[... all the same as the two messages before...]
2023-09-15 13:30:24.380703 [info] STOP OFFER(0009): [1234.5678:0.0] (true)
2023-09-15 13:30:24.381558 [info] RELEASE(0009): [4433.2211]
2023-09-15 13:30:25.147091 [info] Stopping vsomeip application "request-response-mirrored" (0009).

Note: timestamps are different by two hours, because operating system times are set differently.

Does anyone know why the nodes do not communicate? Is there anything else I need to set for IPv6 communication? @BrunoLSilvaCTW : Maybe you have an idea based on your answer in #500 ?

@nachtfuchs
Copy link
Author

It's a bug! vsomeip 3.3.8 does not support Service Discovery with IPv6, because the remote address from the received multicast is not processed correctly. Pull-Request exists in: #462 . Please merge it!

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