vsomeip
vsomeip copied to clipboard
Unable to communicate with an application running outside docker container from an application running inside a docker container using someIP
vSomeip Version
v3.5.4
Boost Version
1.74
Environment
Ubuntu 20.04
Describe the bug
Hi Covesa group,
Stuck in a weird situation.
We have two applications - one running inside a container and another outside the container directly on the Ubuntu Host.
Both the apps are using someIP for communication.
Agenda : The application inside the container should be able to discover the service outside the container and able to communicate with it via someIP.
Issue : Containerized application is not able discover & communicate with service running outside in the host.
**Configuration json for the app outside docker container as producer `:**`
{
"unicast": "192.168.226.193",
"applications": [
{
"name" : "Producer",
"id": "0x1001"
}
],
"services": [
{
"service": "0x1234",
"instance": "0x5678",
"unreliable" : "30509",
"events":[
`{`
"event" : "0x4321"
}
],
"eventgroups":[
{
"eventgroup" : "0x8765",
"events" : [ "0x4321"],
"multicast" :
{
"address" : "224.225.226.233",
"port" : "32344"
}
}
],
"multicast" :
{
"address" : "224.225.226.234",
"port" : "32344"
}
}
],
"routing" : "Producer",
"service-discovery" :
{
"enable" : "true",
"multicast" : "224.244.224.245",
"port" : "30490",
"protocol" : "udp"
}
}
**Configuration of the application running inside the container as consumer:**
{
"unicast": "172.17.0.2",
"applications": [
{
"name" : "Consumer",
"id": "0x1002"
}
],
"clients" :
[
{
"service" : "0x1234",
"instance" : "0x5678",
"unreliable" : [ 30509, 32344 ]
}
],
"routing" : "Consumer",
"service-discovery" :
{
"enable" : "true",
"multicast" : "224.244.224.245",
"port" : "30490",
"protocol" : "udp",
"initial_delay_min" : "10",
"initial_delay_max" : "100",
"repetitions_base_delay" : "200",
"repetitions_max" : "3",
"ttl" : "3",
"cyclic_offer_delay" : "2000",
"request_response_delay" : "1500"
}
}
Network level configurations : Host : sudo ip route add 224.0.0.0/4 dev enp0s3 sudo route add -host 224.244.224.245 dev enp0s3
Container : ip route add 224.0.0.0/4 dev eth0 route add -host 224.244.224.245 dev eth0
Approaches tried :
- Tried to ping host IP (192.168.226.193) from the container, and it worked.
- Tried to send UDP multicast packet from the host to the container and it worked : Container : tcpdump -i eth0 port 30490 Host : echo -n “Hello SOME/IP” | nc -u -w1 172.17.0.2 30490
Worked, UDP packet reaches container from the host.
- Tried with --network host, Macvlan and normal Bridge networks, still didn’t work.
Seems the issue is not with network route, but with the someIP configuration that doesn't allow consumer to discover the service or may be an issue from producer end while offering the service.
Any help will be useful.
I am attaching the producer and consumer contents as separate zip files.
Reproduction Steps
Run the producer code :
Prerequisite : Install vsomeip 3.5.4. compile the producer_someip.cpp :
- Extract the folder producer.zip
- g++ -o producer_app producer_someip.cpp -lpthread -lvsomeip3
- ./entry_script_local.sh ./producer_app
P.S : enrty_script_local.sh will do some network configuration on the host, fetch the host IP and assign to the unicast field of the someIP config for the producer, then export the env variables for someIP, and run the executable.
Run the consumer code :
Extract the consumer.zip Build the docker image : docker build -t cons-someip-img .
run the container : docker run --rm -it -d --cap-add=NET_ADMIN --name consumer-cont cons-someip-img
Once the above two are up and running ideally, consumer should be able to request and subscribe to the service offered by producer, but the same is not happening.
Expected behaviour
No response
Logs and Screenshots
No response