Copyright © https://mongoose-os.com

Mongoose OS Forum

frame

Ping Pong basic DNS-SD over mDNS

On two ESP8266 devices I'm running c_mdns example with following modifications:

in mgos.yaml

MGOS_ENABLE_WEB_CONFIG: 1 
APP_CONF_SCHEMA: src/config.yaml

in config.yaml

[
  ["debug.level", 3],
  ["wifi.sta.enable", true],
  ["wifi.sta.ssid", "SSID"],
  ["wifi.sta.pass", "Password"],
  ["wifi.ap.enable", false],
]

In log file I notice that one of devices queries another one, and another one queries first one see log dump as next post (192.168.1.221 and 192.168.1.182 are devices IP).

Tested with Android device with ZeroConf Browser.

Why devices send such questions? Is that normal behaviour?

Comments

  • ipenevipenev Sofia, Bulgaria

    Log 192.168.1.182

    handler              ---- DNS packet from from 192.168.1.221 (1 questions)
    handler                -- Q type 12 name _myservice._tcp.local (QM) from 192.168.1.221
    enumerate_services   Enumerating service foobar._myservice._tcp.local
    handler              sending reply as multicast, size 90
    handler              ---- DNS packet from from 192.168.1.221 (2 questions)
    handler                -- Q type 12 name _services._dns-sd._udp.local (QM) from 192.168.1.221
    enumerate_types      Enumerating type _myservice._tcp.local
    enumerate_types      Enumerating type _mongoose-os._tcp.local
    handler                -- Q type 12 name _teamviewer._tcp.local (QM) from 192.168.1.221
    handler              sending reply as multicast, size 185
    handler              ---- DNS packet from from 192.168.1.221 (2 questions)
    handler                -- Q type 12 name _mongoose-os._tcp.local (QM) from 192.168.1.221
    enumerate_services   Enumerating service mongoose-os-C36A72._mongoose-os._tcp.local
    handler              sending reply as multicast, size 126
    handler              not sending reply, closing
    handler              not sending reply, closing
    handler              not sending reply, closing
    handler              not sending reply, closing
    handler              not sending reply, closing
    handler              not sending reply, closing
    handler              ---- DNS packet from from 192.168.1.221 (2 questions)
    handler                -- Q type 12 name _services._dns-sd._udp.local (QM) from 192.168.1.221
    enumerate_types      Enumerating type _myservice._tcp.local
    enumerate_types      Enumerating type _mongoose-os._tcp.local
    handler                -- Q type 12 name _teamviewer._tcp.local (QM) from 192.168.1.221
    handler              sending reply as multicast, size 185
    handler              not sending reply, closing
    handler              not sending reply, closing
    handler              not sending reply, closing
    handler              not sending reply, closing
    handler              ---- DNS packet from from 192.168.1.221 (2 questions)
    handler                -- Q type 12 name _services._dns-sd._udp.local (QM) from 192.168.1.221
    enumerate_types      Enumerating type _myservice._tcp.local
    enumerate_types      Enumerating type _mongoose-os._tcp.local
    handler                -- Q type 12 name _teamviewer._tcp.local (QM) from 192.168.1.221
    handler              sending reply as multicast, size 185
    handler              not sending reply, closing
    handler              not sending reply, closing
    handler              not sending reply, closing
    handler              not sending reply, closing
    handler              ---- DNS packet from from 192.168.1.221 (2 questions)
    handler                -- Q type 12 name _services._dns-sd._udp.local (QM) from 192.168.1.221
    enumerate_types      Enumerating type _myservice._tcp.local
    enumerate_types      Enumerating type _mongoose-os._tcp.local
    handler                -- Q type 12 name _teamviewer._tcp.local (QM) from 192.168.1.221
    handler              sending reply as multicast, size 185
    handler              not sending reply, closing
    handler              not sending reply, closing
    handler              not sending reply, closing
    handler              not sending reply, closing
    handler              ---- DNS packet from from 192.168.1.221 (2 questions)
    handler                -- Q type 12 name _services._dns-sd._udp.local (QM) from 192.168.1.221
    enumerate_types      Enumerating type _myservice._tcp.local
    enumerate_types      Enumerating type _mongoose-os._tcp.local
    handler                -- Q type 12 name _teamviewer._tcp.local (QM) from 192.168.1.221
    handler              sending reply as multicast, size 185
    handler              not sending reply, closing
    handler              not sending reply, closing
    handler              not sending reply, closing
    handler              not sending reply, closing

    Log 192.168.1.221

    handler              ---- DNS packet from from 192.168.1.236 (1 questions)
    handler                -- Q type 12 name _myservice._tcp.local (QM) from 192.168.1.236
    enumerate_services   Enumerating service foobar._myservice._tcp.local
    handler              sending reply as multicast, size 90
    handler              ---- DNS packet from from 192.168.1.173 (2 questions)
    handler              not sending reply, closing
    handler              not sending reply, closing
    handler              not sending reply, closing
    handler              not sending reply, closing
    handler              not sending reply, closing
    handler              not sending reply, closing
    handler              not sending reply, closing
    handler              not sending reply, closing
    handler              ---- DNS packet from from 192.168.1.182 (2 questions)
    handler                -- Q type 12 name _mongoose-os._tcp.local (QM) from 192.168.1.182
    enumerate_services   Enumerating service mongoose-os-0E2B83._mongoose-os._tcp.local
    handler              sending reply as multicast, size 126
    handler              ---- DNS packet from from 192.168.1.182 (1 questions)
    handler                -- Q type 12 name _myservice._tcp.local (QM) from 192.168.1.182
    enumerate_services   Enumerating service foobar._myservice._tcp.local
    handler              sending reply as multicast, size 90
    handler              not sending reply, closing
    handler              not sending reply, closing
    handler              not sending reply, closing
    handler              not sending reply, closing
    handler              not sending reply, closing
    handler              ---- DNS packet from from 192.168.1.182 (2 questions)
    handler                -- Q type 12 name _services._dns-sd._udp.local (QM) from 192.168.1.182
    enumerate_types      Enumerating type _myservice._tcp.local
    enumerate_types      Enumerating type _mongoose-os._tcp.local
    handler                -- Q type 12 name _teamviewer._tcp.local (QM) from 192.168.1.182
    handler              sending reply as multicast, size 185
    handler              ---- DNS packet from from 192.168.1.182 (2 questions)
    handler                -- Q type 12 name _services._dns-sd._udp.local (QM) from 192.168.1.182
    enumerate_types      Enumerating type _myservice._tcp.local
    enumerate_types      Enumerating type _mongoose-os._tcp.local
    handler                -- Q type 12 name _teamviewer._tcp.local (QM) from 192.168.1.182
    handler              sending reply as multicast, size 185
    handler              ---- DNS packet from from 192.168.1.182 (2 questions)
    handler                -- Q type 12 name _mongoose-os._tcp.local (QM) from 192.168.1.182
    enumerate_services   Enumerating service mongoose-os-0E2B83._mongoose-os._tcp.local
    handler              sending reply as multicast, size 126
    handler              ---- DNS packet from from 192.168.1.182 (1 questions)
    handler                -- Q type 12 name _myservice._tcp.local (QM) from 192.168.1.182
    enumerate_services   Enumerating service foobar._myservice._tcp.local
    handler              sending reply as multicast, size 90
    handler              not sending reply, closing
    handler              not sending reply, closing
    handler              not sending reply, closing
    handler              not sending reply, closing
    handler              ---- DNS packet from from 192.168.1.182 (2 questions)
    handler                -- Q type 12 name _mongoose-os._tcp.local (QM) from 192.168.1.182
    enumerate_services   Enumerating service mongoose-os-0E2B83._mongoose-os._tcp.local
  • ipenevipenev Sofia, Bulgaria
  • rojerrojer Dublin, Ireland

    i have no idea. mOS does not perform any mdns queries by default. it will respond with RPC services if asked (and RPC is enabled), but will not actively ask.

    in your log i see this:

    enumerate_services   Enumerating service mongoose-os-0E2B83._mongoose-os._tcp.local
    

    there is no enumerate_service in our repo, so this must be something you have in your fork.

  • rojerrojer Dublin, Ireland

    sorry, github search playing tricks on me. we do in fact have enumerate_services in the repo, but it is a function that produces list of services in response to a query.
    i'm still pretty sure vanilla mOS does not initiate dns-sd queries though, this must be something in your own code.

  • ipenevipenev Sofia, Bulgaria

    I'm running c_mdns example, just added some modification in config files. See first post.
    Scanning is done with ZeroConf Browser for Android https://play.google.com/store/apps/details?id=com.melloware.zeroconf
    "avahi-browse -a" on linux didn't find device.

  • rojerrojer Dublin, Ireland

    hm... why in the world mOS would be asking about _teamviewer._tcp.local? there's not even a mention of teamviewer in the sources.

  • ipenevipenev Sofia, Bulgaria

    Probably somekind of rely or repeat is happened.
    Actually those devices should only respond on query, I think.
    Is it correct to requery another device and why should do that?

  • rojerrojer Dublin, Ireland
    edited January 23

    are you sure you're compiling with vanilla mOS and not your modification?
    i can't see a any code in our repo that sends dns-sd questions, only one that handles them and sends replies.
    the history of dns-sd support was that it was added for a particular project, but the project fell by the wayside and it was never actually used by us. so it's kind of in this dormant, listening-only state.

  • ipenevipenev Sofia, Bulgaria

    I'm sure, here are start of boot log. + is comming from config modifications.
    You could reproduce with two devices in same network, and start some scan from third device - Android phone.

    esp_mgos_init        c_mdns 1.0 (20170117-125813/master@2423aac9+)
    esp_mgos_init        Mongoose OS Firmware 2017011712 (20170117-125813/master@2423aac9+)
    esp_mgos_init        SDK 2.0.0(656edbf), RAM: 48792 total, 45596 free
    esp_print_reset_info Reset cause: 0 (power on)
    fs_mount             Mounting FS: 131072 @ 0xdb000

    esp_mgos_init        c_mdns 1.0 (20170117-124834/master@2423aac9+)
    esp_mgos_init        Mongoose OS Firmware 2017011712 (20170117-124834/master@2423aac9+)
    esp_mgos_init        SDK 2.0.0(656edbf), RAM: 48792 total, 45596 free
    esp_print_reset_info Reset cause: 6 (sys reset)
    fs_mount             Mounting FS: 131072 @ 0xdb000
  • rojerrojer Dublin, Ireland

    sorry, haven't had time to investigate this yet. will have a look a bit later.

  • ipenevipenev Sofia, Bulgaria

    Thanks! I'll wait for result.

Sign In or Register to comment.