Closed Bug 1286636 Opened 8 years ago Closed 8 years ago

[FlyWeb] Use unbound UDP socket for mDNS queries

Categories

(Core :: Networking, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla50
Tracking Status
firefox50 --- fixed

People

(Reporter: djvj, Assigned: djvj)

References

Details

(Whiteboard: [necko-active])

Attachments

(1 file, 1 obsolete file)

One of the implementation issues we ran into on Windows 10 is that win10 system processes open and hold UDP port 5353 on the mDNS multicast address.

Our current fallback implementation also uses a SO_REUSE UDP socket on port 5353, but is hampered by conflicts.  The main issue is that only broadcast packets sent to the multicast group are delivered to the gecko UDP socket.  Directed UDP messages to the machine on that port are not delivered, and presumably go to the system socket instead.

The workaround suggested is to use a single query socket opened on an arbitrary port.  The query socket does NOT join the mDNS multicast IP group, but DOES send packets to that group.  Since this socket is assigned its own unique port, query responses addressed to it will resolve properly.
Attached patch use-unbound-query-socket.patch (obsolete) — Splinter Review
Tested this on Linux, Android, and my Win10 box.  Seems to work quite well.
Attachment #8770685 - Flags: review?(jdarcangelo)
Assignee: nobody → kvijayan
Whiteboard: [necko-active]
Comment on attachment 8770685 [details] [diff] [review]
use-unbound-query-socket.patch

Review of attachment 8770685 [details] [diff] [review]:
-----------------------------------------------------------------

LGTM. See my comment about removing the old block of commented-out code.

::: netwerk/dns/mdns/libmdns/fallback/MulticastDNS.jsm
@@ +343,5 @@
>        sockets.forEach((socket) => {
>          socket.send(MDNS_MULTICAST_GROUP, MDNS_PORT, data, data.length);
>        });
>      });
> +    */

We should probably just remove this block instead of commenting it out.
Attachment #8770685 - Flags: review?(jdarcangelo) → review+
Updated patch.
Attachment #8770685 - Attachment is obsolete: true
Attachment #8771453 - Flags: review?(jdarcangelo)
Attachment #8771453 - Flags: review?(jdarcangelo) → review+
Pushed by kvijayan@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/048a09249037
Use dedicated custom-port query socket to do mDNS queries.  Respond to queries using per-interface sockets. r=justindarc
Blocks: flyweb
https://hg.mozilla.org/mozilla-central/rev/048a09249037
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla50
this caused a small perf improvement on android (nexus 4.1: https://treeherder.mozilla.org/perf.html#/alerts?id=2167 ):
Summary of tests that improved:

  remote-blank summary android-4-2-armv7-api15 opt - 2.08% better


thanks for the win!
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: