vsomeip
vsomeip copied to clipboard
[BUG]: Client subscribes events incorrectly when multiple provided services shares same port
vSomeip Version
v3.4.10
Boost Version
1.71
Environment
Embedded Linux
Describe the bug
When two provided services share the same port, the first client subscribing events to the first provided service ends up subscribing to events in both services. In addition, no subscribe message is sent by vsomeip when the second client tries to subscribe events.
When the provided services are both on the same port, the the first client ends up subscribing events to both services. The second client, despite asking it to subscribe events, does not send any subscription messages.
This is similar to the behavior described in #380, but only when offered services share the same port.
Reproduction Steps
Server config:
{
"network": "Server_VLAN17",
"unicast": "172.31.17.18",
"netmask": "255.255.255.0",
"applications": [
{
"name": "Server_VLAN17",
"id": 1
}
],
"services": [
{
"service": 36867,
"instance": 1,
"unreliable": 35699,
"reliable": 0,
"events": [
{
"event": 32775,
"is_field": false,
"is_reliable": false,
"cycle": 0
}
],
"eventgroups": [
{
"eventgroup": 1,
"events": [
32775
]
}
]
},
{
"service": 36866,
"instance": 1,
"unreliable": 35699,
"reliable": 0,
"events": [
{
"event": 32769,
"is_field": false,
"is_reliable": false,
"cycle": 0
}
],
"eventgroups": [
{
"eventgroup": 1,
"events": [
32769
]
}
]
}
],
"clients": [],
"routing": "Server_VLAN17",
"service-discovery": {
"enable": true,
"multicast": "239.127.3.1",
"port": 30490,
"protocol": "UDP",
"initial_delay_min": 9,
"initial_delay_max": 50,
"repetitions_base_delay": 50,
"repetitions_max": 3,
"ttl": 3,
"cyclic_offer_delay": 1000,
"request_response_delay": 50
}
}
Client config:
{
"network": "Consumer_VLAN17",
"unicast": "172.31.17.6",
"netmask": "255.255.255.0",
"applications": [
{
"name": "Consumer_VLAN17",
"id": 2
}
],
"services": [],
"clients": [
{
"service": 36866,
"instance": 1,
"unreliable": [
39503
],
"reliable": []
},
{
"service": 36867,
"instance": 1,
"unreliable": [
55504
],
"reliable": []
}
],
"routing": "Consumer_VLAN17",
"service-discovery": {
"enable": true,
"multicast": "239.127.3.1",
"port": 30490,
"protocol": "UDP",
"initial_delay_min": 0,
"initial_delay_max": 0,
"repetitions_base_delay": 0,
"repetitions_max": 3,
"ttl": 3
}
}
- Offer all events from both services in server config (notice both services are offered on the same UDP port).
- Try to subscribe events of both services from the client.
- Monitor the traffic on Wireshark and observe that the first client service from port
39503subscribes to events of both services36866(0x9002) and36867(0x9003), while the second client service from port55503does not subscribe any events.
Expected behaviour
The first client service from port 39503 should subscribe to the events of 36866 (0x9002), while the second client service from port 55503 should subscribe events of 36867 (0x9003)
This happens only when service 36866 and 36867 are NOT offered on the same port:
Logs and Screenshots
No response