From sean at powerset.com Mon Oct 29 20:51:01 2007 From: sean at powerset.com (Sean Tempesta) Date: Mon, 29 Oct 2007 17:51:01 -0700 Subject: [dnssd-developers] mDNS only working over one interface? Message-ID: Hi. I started working with your library and noticed that mDNS queries aren't going over all multicast enabled interfaces -- only the first one (eth0 on linux in my case). Any ideas why this is happening or how I can fix it? How to replicate: On a linux box with two interfaces (eth0,eth1) open up 3 terminals: TERM1: sudo tcpdump -ieth0 src host bkp1.hq.powerset.com and src port 5353 TERM2: sudo tcpdump -ieth1 src host bkp1.hq.powerset.com and src port 5353 TERM3: irb Run the following irb session: [sean at bkp1 ~]$ irb irb(main):001:0> require 'rubygems' => true irb(main):002:0> require 'net/dns/mdns-sd' => true irb(main):003:0> require 'net/dns/resolv-replace' => true irb(main):004:0> DNSSD = Net::DNS::MDNSSD => Net::DNS::MDNSSD irb(main):005:0> DNSSD.resolve("testing", "_http._tcp") => #, @name=#, @queue=#], @que=[]>, @type=Resolv::DNS::Resource::IN::ANY> You should see the following: TERM1: 00:39:42.385227 IP bkp1.hq.powerset.com.mdns > 224.0.0.251.mdns: 0 ANY? testing._http._tcp.local. (42) 00:39:43.486218 IP bkp1.hq.powerset.com.mdns > 224.0.0.251.mdns: 0 ANY? testing._http._tcp.local. (42) 00:39:45.592185 IP bkp1.hq.powerset.com.mdns > 224.0.0.251.mdns: 0 ANY? testing._http._tcp.local. (42) 00:39:49.596274 IP bkp1.hq.powerset.com.mdns > 224.0.0.251.mdns: 0 ANY? testing._http._tcp.local. (42) 4 packets captured 28 packets received by filter 0 packets dropped by kernel TERM2: tcpdump: verbose output suppressed, use -v or -vv for full protocol decode listening on eth1, link-type EN10MB (Ethernet), capture size 96 bytes 0 packets captured 267 packets received by filter 196 packets dropped by kernel Thanks, Sean From sroberts at uniserve.com Tue Oct 30 00:17:51 2007 From: sroberts at uniserve.com (Sam Roberts) Date: Mon, 29 Oct 2007 21:17:51 -0700 Subject: [dnssd-developers] mDNS only working over one interface? In-Reply-To: References: Message-ID: <20071030041751.GB1241@ensemble.local> Quoting sean at powerset.com, on Mon, Oct 29, 2007 at 05:51:01PM -0700: > Hi. I started working with your library and noticed that mDNS queries > aren't going over all multicast enabled interfaces -- only the first one > (eth0 on linux in my case). Any ideas why this is happening Its not supported. The DNS-SD variant that uses apple's responder should do this correctly. > or how I can fix it? You can find a way to enumerate all ethernet interfaces (this will involve ioctl pain + non-portable code, I suspect), and then bind to them, and then modify the responder to answer queries in an interface aware fashion (its not enough just to blast the same packets out each interface). Well, thats the right way. You might have better luck just hack mdns so you can construct a seperate instance on each network interface, and interact with them in parallel. If it was easier, it would be done already. :-( Sam