[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lwip-devel] [patch #9555] Add MDNS probing

From: Jens Nielsen
Subject: [lwip-devel] [patch #9555] Add MDNS probing
Date: Sun, 28 Jan 2018 02:41:51 -0500 (EST)
User-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36


                 Summary: Add MDNS probing
                 Project: lwIP - A Lightweight TCP/IP stack
            Submitted by: deft
            Submitted on: Sun 28 Jan 2018 07:41:50 AM UTC
                Category: apps
                Priority: 5 - Normal
                  Status: None
                 Privacy: Public
             Assigned to: None
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
         Planned Release: None




I had a go at MDNS probing, as described in RFC 6762 Section 8.1. The
implementation I have here basically just covers my needs and is barely tested
and most likely contains a few bugs, but I add it here as a request for
comments to see if we can agree on a path to get it into lwip

Patch 1 contains the basics, send 3 probe queries before responding to any
queries, and abort if someone answers. I know this breaks backwards
compatibility in the api by adding the _start() and _restart() functions but I
don't know how else I can differentiate the three distinct events: 1. User
saying "all services are added, go ahead", 2. Cable has been reconnected or
administrative interface came up after being down and probing must be
restarted, and 3. The IP address has changed, send a new announce message but
don't restart probing.
I'm also aware this doesn't comply with some other MUST requirements (such as
the 5 second delay or using the 5353 source port for queries if that applies
here) but the whole probing section is a MUST so, one step at a time...

Patch 2 contains a minimal set of what I need to handle conflict, a simple
callback with a result. If result is 0 I call mdns_resp_remove_netif() and try
again with a new name, if result is 1 I can write the name to nonvolatile
storage. This works for me since I will use same name for host and services
but probably needs to be extended to cover the case where someone has
different names, though I don't really understand the use case for that in an
embedded device... I couldn't come up with a decent api to cover that so I
left it out but should probably be considered if merging.

Patch 3 contains an approach to populate the authoritative section of the
probe request, according to Section 8.2. Strictly not needed for probing but
there was a comment somewhere in the RFC that this could be used to
differentiate a probe from a normal query.

Also attached a wireshark trace to show what it looks like. is
some other computer on my network, is my lwip device that I had
configured to use the same host name as that computer.


File Attachments:

Date: Sun 28 Jan 2018 07:41:50 AM UTC  Name:
0001-MDNS-send-probes-to-verify-domain-before-use.patch  Size: 14KiB   By:

Date: Sun 28 Jan 2018 07:41:50 AM UTC  Name:
0002-Add-callback-to-user-to-notify-result-of-mdns-probe.patch  Size: 3KiB  
By: deft

Date: Sun 28 Jan 2018 07:41:50 AM UTC  Name:
0003-Populate-MDNS-probes-authoritative-section.patch  Size: 6KiB   By: deft

Date: Sun 28 Jan 2018 07:41:50 AM UTC  Name: mdns probe.pcap  Size: 1KiB   By:



Reply to this item at:


  Message sent via/by Savannah

reply via email to

[Prev in Thread] Current Thread [Next in Thread]