1 Reply
      Latest reply on Oct 27, 2016 1:31 AM by eskimo
      THanekamp Level 1 Level 1 (0 points)



        For a client of ours I'm involved in development of a iOS application that uses socket connections over Wi-Fi to transmit data to a gateway device. In order to allow this without having to rely on Wi-Fi networks being available the gateway device creates its own Wi-Fi network on which the user of the application must connect. Up until the release of iOS 10 this all worked fine for us.


        With iOS 10 installed however our iPads/iPhones are still able to find the Wi-Fi network created by the device and connect to it (sort of, the Wi-Fi icon in the top bar isn't shown but it does list the network's SSID in both the preferences and when requeste via CNCopyCurrentNetworkInfo), but setting up the socket connection is no longer possible.


        At first I suspected that creating a unsecure socket connection to a IP and port might no longer be allowed on iOS 10. To test this I got some python script that gets my Macbook to listen to socket connections on a certain port and tried connecting on that socket with a iOS 10 application.


        What happens is that if I run this on our regular Wi-Fi network at work I can connect to the socket without problems. The same goes for using a Airport Time Capsule that is not connected to the internet as provider for the Wi-Fi network. As soon as I switch both the iPad and my Macbook onto the W-Fi network provided by the device however, I can no longer get the socket connection to open.


        Unfortunately I'm not much of a network expert so its hard for me to diagnose the differences between the networks. The one difference I could find is that the device Wi-Fi network seems to be the only one out of the three that does not supply a DNS.


        Does anybody know about any problems connection to networks that do not supply a DNS on iOS 10?

        If so, was that by design or is it a unforseen thing that (hopefully) will get fixed in future releases?

        Any tips on fixing the issue are off course also very welcome manually setting the DNS to (Google) won't work I'm afraid since the device's Wi-Fi network offers no internet.


        With regards,


        • Re: Network without DNS on iOS 10
          eskimo Apple Staff Apple Staff (13,875 points)

          In my experience the issue here isn’t DNS per se.  Rather, the absence of a DNS prevents iOS from making the Wi-Fi network the primary interface, and that cause other issues.

          You wrote:

          (sort of, the Wi-Fi icon in the top bar isn't shown …)

          Right.  The Wi-Fi icon is only shown when Wi-Fi becomes the primary interface.

          As to what is going on here, that really depends on how you’ve set up your network.  There’s two common ways of setting up this sort of thing:

          • no infrastructure at all — If the network provides no infrastructure at all, you’re into Bonjour territory.  This works just fine, but each of the devices on the network must support the various standards that underlie Bonjour [1].  Of these, the really critical one is link-local addressing.  If the devices supports IPv6 then you get link-local addressing for free, but if not you have to support RFC 3927.

          • dummy DHCP server — A more common (and less good IMO) approach is for some node on the network to provide a dummy DHCP server, one that hands out addresses but does not had out a gateway address or DNS info or both.  [Folks tend to do this because they need to deal with client devices that don’t support the above-mentioned Bonjour standards, which is weird because most major platforms do support those standards and all major platforms support RFC 3927.]  Unfortunately, it makes things more confusing because the device gets what looks like a routable IP address but isn’t.

          You can test the no infrastructure case very simply: set up an AirPort base station in bridge mode and then don’t plug the Ethernet into anything.

          Testing the dummy DHCP server case is harder because different dummy DHCP servers work in different ways (some hand out a gateway address but no DNS, some hand out neither the gateway address nor the DNS, and so on).

          Your next step here should be to figure out exactly what sort of network the device is providing.  A good first step is to use getifaddrs to get the IP address for the Wi-Fi interfaces (in practice this is always en0, although that’s not considered API).  From there, you should be able to work out how to get your connection to go through.

          Share and Enjoy

          Quinn “The Eskimo!”
          Apple Developer Relations, Developer Technical Support, Core OS/Hardware
          let myEmail = "eskimo" + "1" + "@apple.com"

          [1] Namely: