Multicast not being sent to all Docker containers -
i have 3 services defined in docker-compose. 1 of them sends multicast should received other 2 services, 1 of them receives it. 2 receivers in different networks, , sender part of both networks.
docker-compose.yml:
services: sender: networks: - network_a - network_b receiver1: networks: - network_a depends_on: - sender receiver2: networks: - network_b depends_on: - sender networks: network_a: ipam: driver: default config: - subnet: 172.20.1.0/24 gateway: 172.20.1.1 network_b: ipam: driver: default config: - subnet: 172.20.2.0/24 gateway: 172.20.2.1
receiver1 gets multicast receiver2 doesn't.
if remove network_a sender networks field, receiver2 receives message. somehow multicast doesn't work on multiple networks.
does know why happens?
i'm going answer myself found out problem.
the problem isn't docker or related docker, it's strictly multicast issue.
basically, multicast works in 1 network , if want send multicast message in multiple networks have iterate through networks interfaces used.
for example, in java, have call setinterface() method before sending multicast message specify used network. https://docs.oracle.com/javase/7/docs/api/java/net/multicastsocket.html#setinterface(java.net.inetaddress)
Comments
Post a Comment