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

[BUG]: Compliance issue that offer the same serviceID-instanceID with different major versions is not supported #809

Open
zhaoxin39913 opened this issue Nov 15, 2024 · 6 comments
Labels

Comments

@zhaoxin39913
Copy link

vSomeip Version

v3.4.10

Boost Version

1.7.6

Environment

Ubuntu 20.04

Describe the bug

Hi vsomeip experts,

To follow up #797. I have tested PRS_SOMEIPSD_00512 in SOME/IP SD Spec and confirmed that offering the same serviceID-instanceID with different major versions within the same VLAN is not supported in current vsomeip library.

In my test, I have set up two devices running different vsomeip applications. device A offers service 0x1234/0x5678 with majvor version 0xA, deviceB offers service 0x1234/0x5678 with major version 0xB. After device A has offered the service, next when device B offers the same service with version 0xB, it always reports below error message:

[error] routing_manager_impl::handle_local_offer_service: rejecting service registration. Application: 0201 is trying to offer [1234.5678.11.0] already offered ..

And from the wireshark I confirmed that the service 0x1234/0x5678/0xB is not offered. It seems like a missing feature that vsomeip stack need to support PRS_SOMEIPSD_00512 (Supporting multiple versions of the same service),

Reproduction Steps

100% reproduced.

Expected behaviour

vsomeip stack need to support PRS_SOMEIPSD_00512 (Supporting multiple versions of the same service)

Logs and Screenshots

[error] routing_manager_impl::handle_local_offer_service: rejecting service registration. Application: 0201 is trying to offer [1234.5678.11.0] already offered

@zhaoxin39913 zhaoxin39913 changed the title [BUG]: <Compliance issue that offer the same serviceID-instanceID with different major versions is not supported> [BUG]: Compliance issue that offer the same serviceID-instanceID with different major versions is not supported Nov 15, 2024
@KareemLMR
Copy link

Hello,
How did you set the major version of the services you offered?
Have you set the major version in offer_service API:
image

@zhaoxin39913
Copy link
Author

Hi @KareemLMR

Yes, I set the major version in offer_service() API and the minor version keeps the default version:
app->offer_service(0x1234, 0x5678, 0xa);

@KareemLMR
Copy link

KareemLMR commented Nov 23, 2024

Hello @zhaoxin39913
There is something I doubt, but I need to check with you. Open the vsomeip source code and navigate to the file implementation/routing/src/routing_manager_base.cpp at this function routing_manager_base::offer_service to be specific
image

And add a log to this if condition marked by the red arrow:
if (!its_info->is_local()) {
return false;
}
and if you can add more logs throughout this function then recompile and reinstall the binaries and let me see the logs of your test. If the log you added in that if condition appeared, then there is an issue as you said. If not then it is something else we will see.

@zhaoxin39913
Copy link
Author

Hi @KareemLMR,

I have made below changes per as your request:

if (!its_info->is_local()) {
    VSOMEIP_INFO << "rm_base::offer_service !its_info->is_local ("
            << std::hex << std::setfill('0')
            << std::setw(4) << _client << "): ["
            << std::setw(4) << _service << "."
            << std::setw(4) << _instance << ":"
            << std::dec
            << static_cast<std::uint32_t>(its_info->get_major()) << ":"
            << its_info->get_minor() << "] passed: "
            << static_cast<std::uint32_t>(_major) << ":"
            << _minor;
    return false;

And after change I have triggered "notify-sample" to offer the second service instance 0x1234/0x5678 with version 0xA (There is already a service instance 0x1234/0x5678 with version 0x12 offered by another device within the same network). And from the wireshark we can see that the first time notify-sample was successful to offer the service 0x1234/0x5678 version 0xA, but after call stop_offer() and then start_offer() in "notify-sample", it failed to offer the service again. Below are full log messages from notify-sample:

zhax@zhax-desktop:~/work/COVESA/src/vsomeip-3.4.10/build/examples$ VSOMEIP_APPLICATION_NAME=service-sample ./notify-sample
2024-11-28 14:44:42.707338 [info] Using configuration folder: "/home/zhax/work/COVESA/src/config".
2024-11-28 14:44:42.709307 [info] Parsed vsomeip configuration in 1ms
2024-11-28 14:44:42.709649 [info] Configuration module loaded.
2024-11-28 14:44:42.709911 [info] Security disabled!
2024-11-28 14:44:42.710142 [info] Initializing vsomeip (3.4.10) application "service-sample".
2024-11-28 14:44:42.711782 [info] Instantiating routing manager [Host].
2024-11-28 14:44:42.714633 [info] create_routing_root: Routing root @ /tmp/vsomeip-0
2024-11-28 14:44:42.716890 [info] Service Discovery enabled. Trying to load module.
2024-11-28 14:44:42.725771 [info] Service Discovery module loaded.
2024-11-28 14:44:42.726925 [info] Application(service-sample, 1277) is initialized (11, 100).
2024-11-28 14:44:42.727391 [info] offer_event: Event [1234.5678.9999] uses configured cycle time 0ms
2024-11-28 14:44:42.728266 [info] REGISTER EVENT(1277): [1234.5678.9999:is_provider=true]
2024-11-28 14:44:42.728753 [info] Starting vsomeip application "service-sample" (1277) using 2 threads I/O nice 255
2024-11-28 14:44:42.731711 [info] main dispatch thread id from application: 1277 (service-sample) is: ffffbc79f060 TID: 189214
2024-11-28 14:44:42.732672 [info] shutdown thread id from application: 1277 (service-sample) is: ffffbbf8f060 TID: 189215
2024-11-28 14:44:42.733317 [info] create_local_server: Listening @ /tmp/vsomeip-1277
2024-11-28 14:44:42.734978 [info] OFFER(1277): [1234.5678:10.0] (true)
2024-11-28 14:44:42.732532 [info] Client [1277] routes unicast:192.168.225.3, netmask:255.255.255.0
Setting event (Length=1).
2024-11-28 14:44:42.739600 [info] Watchdog is disabled!
Application service-sample is registered.
2024-11-28 14:44:42.741732 [info] io thread id from application: 1277 (service-sample) is: ffffbec44020 TID: 189210
2024-11-28 14:44:42.741929 [info] io thread id from application: 1277 (service-sample) is: ffffbaf6f060 TID: 189217
2024-11-28 14:44:42.743662 [info] vSomeIP 3.4.10 | (default)
2024-11-28 14:44:42.744930 [info] Network interface "eth0" state changed: up
2024-11-28 14:44:42.746798 [info] Route "default route (0.0.0.0/0) if: eth0 gw: 192.168.225.1" state changed: up
2024-11-28 14:44:42.748222 [info] udp_server_endpoint_impl: SO_RCVBUF is: 212992 (1703936) local port:30490
2024-11-28 14:44:42.748774 [debug] Joining to multicast group 224.0.0.1 from 192.168.225.3
2024-11-28 14:44:42.750352 [info] udp_server_endpoint_impl: SO_RCVBUF is: 212992 (1703936) local port:30509
2024-11-28 14:44:42.750775 [info] SOME/IP routing ready.
2024-11-28 14:44:42.750875 [info] udp_server_endpoint_impl<multicast>: SO_RCVBUF is: 212992 (1703936) local port:30490
2024-11-28 14:44:42.752166 [warning] Route "224.0.0.1/32 if: eth0 gw: n/a" state changed: up
2024-11-28 14:44:43.334512 [error] routing_manager_impl::add_routing_info: rejecting routing info. Remote: 192.168.225.2 is trying to offer [1234.5678.18.878082192] on port 12344 offered previously on this node: [1234.5678.10.0]
Setting event (Length=2).
Setting event (Length=3).
2024-11-28 14:44:45.339291 [error] routing_manager_impl::add_routing_info: rejecting routing info. Remote: 192.168.225.2 is trying to offer [1234.5678.18.878082192] on port 12344 offered previously on this node: [1234.5678.10.0]
Setting event (Length=4).
Setting event (Length=5).
2024-11-28 14:44:47.349538 [error] routing_manager_impl::add_routing_info: rejecting routing info. Remote: 192.168.225.2 is trying to offer [1234.5678.18.878082192] on port 12344 offered previously on this node: [1234.5678.10.0]
Setting event (Length=6).
Setting event (Length=7).
2024-11-28 14:44:49.357992 [error] routing_manager_impl::add_routing_info: rejecting routing info. Remote: 192.168.225.2 is trying to offer [1234.5678.18.878082192] on port 12344 offered previously on this node: [1234.5678.10.0]
Setting event (Length=8).
Setting event (Length=9).
2024-11-28 14:44:51.367642 [error] routing_manager_impl::add_routing_info: rejecting routing info. Remote: 192.168.225.2 is trying to offer [1234.5678.18.878082192] on port 12344 offered previously on this node: [1234.5678.10.0]
Setting event (Length=1).
2024-11-28 14:44:52.746252 [info] vSomeIP 3.4.10 | (default)
2024-11-28 14:44:52.748212 [info] STOP OFFER(1277): [1234.5678:10.0] (true)
2024-11-28 14:44:53.376311 [warning] process_offerservice_serviceentry: Remote offer type changed [1234.5678]
2024-11-28 14:45:02.748736 [info] vSomeIP 3.4.10 | (default)
2024-11-28 14:45:02.763922 [info] rm_base::offer_service !its_info->is_local (1277): [1234.5678:18:878082192] passed: 10:0
2024-11-28 14:45:02.764833 [error] routing_manager_impl::handle_local_offer_service: rejecting service registration. Application: 1277 is trying to offer [1234.5678.10.0]] already offered remotely
2024-11-28 14:45:02.765169 [info] offer_service (1277): [1234.5678:10.0] (true) not offering, returned from handle_local_offer_service!
Setting event (Length=2).
Setting event (Length=3).
Setting event (Length=4).
Setting event (Length=5).
Setting event (Length=6).
Setting event (Length=7).
Setting event (Length=8).
Setting event (Length=9).
Setting event (Length=1).
Setting event (Length=2).
2024-11-28 14:45:12.752146 [info] vSomeIP 3.4.10 | (default)
2024-11-28 14:45:12.778179 [info] STOP OFFER(1277): [1234.5678:10.0] (true)
2024-11-28 14:45:12.779683 [warning] stop_offer_service received STOP_OFFER(1277): [1234.5678:10.0] for remote service --> ignore
2024-11-28 14:45:22.755800 [info] vSomeIP 3.4.10 | (default)
2024-11-28 14:45:22.794124 [info] rm_base::offer_service !its_info->is_local (1277): [1234.5678:18:878082192] passed: 10:0
2024-11-28 14:45:22.795834 [error] routing_manager_impl::handle_local_offer_service: rejecting service registration. Application: 1277 is trying to offer [1234.5678.10.0]] already offered remotely
2024-11-28 14:45:22.796629 [info] offer_service (1277): [1234.5678:10.0] (true) not offering, returned from handle_local_offer_service!
Setting event (Length=3).
Setting event (Length=4).
Setting event (Length=5).
Setting event (Length=6).
Setting event (Length=7).
Setting event (Length=8).
Setting event (Length=9).
Setting event (Length=1).
Setting event (Length=2).
Setting event (Length=3).
2024-11-28 14:45:32.758869 [info] vSomeIP 3.4.10 | (default)
2024-11-28 14:45:32.809674 [info] STOP OFFER(1277): [1234.5678:10.0] (true)
2024-11-28 14:45:32.810830 [warning] stop_offer_service received STOP_OFFER(1277): [1234.5678:10.0] for remote service --> ignore
2024-11-28 14:45:42.762672 [info] vSomeIP 3.4.10 | (default)
2024-11-28 14:45:42.825814 [info] rm_base::offer_service !its_info->is_local (1277): [1234.5678:18:878082192] passed: 10:0
2024-11-28 14:45:42.831568 [error] routing_manager_impl::handle_local_offer_service: rejecting service registration. Application: 1277 is trying to offer [1234.5678.10.0]] already offered remotely
2024-11-28 14:45:42.832564 [info] offer_service (1277): [1234.5678:10.0] (true) not offering, returned from handle_local_o

@KareemLMR
Copy link

Ok, I see the log you added appeared. That's good. I saw what I wanted to see. Let me try a change at my side and send it to you to try when it is successful.

@zhaoxin39913
Copy link
Author

Thanks @KareemLMR. I think here we should allow to offer the second same service instance if its major verion is different from the existing same service instance in the network.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants