Tuesday 15 February 2011

udp - Linux Socket & IP_ADD_SOURCE_MEMBERSHIP -



udp - Linux Socket & IP_ADD_SOURCE_MEMBERSHIP -

scenario:

process 1 creates socket , subscribes multicast grouping using ip_add_source_membership alternative [group: 224.0.0.30 source: 192.168.0.1 device:eth0]. binds socket 224.0.0.30:5555.

process 2 creates socket , subscribes multicast grouping using ip_add_membership alternative [group: 224.0.0.30 device: eth0]. binds socket 224.0.0.30:5555.

both processes running simultaneously on same box.

a source ip 172.10.1.1 sends packet multicast destination 224.0.0.30:5555.

will process 1 receive multicast packet? or filtered out kernel?

thanks.

from man 7 ip:

ip_add_source_membership (since linux 2.4.22 / 2.5.68) bring together multicast grouping , allow receiving info specified source.,,,

this means first process not receive packets sent source 172.10.1.1. reading further:

... alternative can used multiple times allow receiving info more 1 source.

, might useful you.

sockets udp multicast

No comments:

Post a Comment