This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CC3220SF: Interface between CC3220 as Access Point and Apple iOS

Part Number: CC3220SF
Other Parts Discussed in Thread: UNIFLASH

We have the CC3220 set up as an access point on a memory card, so we can pull data off the card over WiFi.  We're able to connect to the card via a Windows laptop and then use Postman to send commands over WiFi.

Our customer has developed an app on an iPad to download the data over WiFi.  They have a problem with the initial connection between iOS and the device.  After iOS connects to the device, it sees there is a DNS server and it sends requests to the card asking for DNS mapping information like you would find in Zone files.  The DNS server on the CC3220 does not provide valid responses to iOS, so the calls are repeated until a timeout of one minute is reached.  The DNS question section of the response doesn't match the query, and Apple's resolver mDNSResponder ignores the response as unacceptable.

Our team figures that getting iOS working with a CC3220 configured as an Access Point has been done already.  We've tried enabling different applications in UniFlash, but that hasn't resolved the issue.  We haven't written any user code to deal with DNS, not even a call to turn off the server.  We're hoping someone can provide a solution.

  • Can you provide a sniffer log?

    I'm not sure i understand, does the problem relates to the specific application or to any connection from iOS to CC3230 in AP mode?

  • This problem is seen in my specific application, but I would expect the same problem for an IoT device configured as an Access Point.

    Here is more detailed data:

    When iOS sends DNS queries to the DNS Server on the CC3220 it replies with a return code of 3 (NXDOMAIN / Non-existent domain); however, the replies lack the expected corresponding Question section. Here's an example reply from a packet trace:

     

    Domain Name System (response)
    Transaction ID: 0x6e42
    Flags: 0x8003 Standard query response, No such name
    1... .... .... .... = Response: Message is a response
    .000 0... .... .... = Opcode: Standard query (0)
    .... .0.. .... .... = Authoritative: Server is not an authority for domain
    .... ..0. .... .... = Truncated: Message is not truncated
    .... ...0 .... .... = Recursion desired: Don't do query recursively
    .... .... 0... .... = Recursion available: Server can't do recursive queries
    .... .... .0.. .... = Z: reserved (0)
    .... .... ..0. .... = Answer authenticated: Answer/authority portion was not authenticated by the server
    .... .... ...0 .... = Non-authenticated data: Unacceptable
    .... .... .... 0011 = Reply code: No such name (3)
    Questions: 0
    Answer RRs: 0
    Authority RRs: 0
    Additional RRs: 0
    [Request In: 7471]
    [Time: 0.009002000 seconds]

     

    iOS flags this response as unacceptable, disregards it and tries again which introduces connection delays we want to avoid. RFC 1035 section 7.3 covers the recommended resolver strategy as:

     

    The recommended strategy is to do a preliminary matching using the ID field in the domain header, and then to verify that the question section corresponds to the information currently desired.

     

    The DNS Response, even for an NXDomain reply, should include the matching query like so:

     

    Domain Name System (response)
        Transaction ID: 0x1832
        Flags: 0x8583 Standard query response, No such name
            1... .... .... .... = Response: Message is a response
            .000 0... .... .... = Opcode: Standard query (0)
            .... .1.. .... .... = Authoritative: Server is an authority for domain
            .... ..0. .... .... = Truncated: Message is not truncated
            .... ...1 .... .... = Recursion desired: Do query recursively
            .... .... 1... .... = Recursion available: Server can do recursive queries
            .... .... .0.. .... = Z: reserved (0)
            .... .... ..0. .... = Answer authenticated: Answer/authority portion was not authenticated by the server
            .... .... ...0 .... = Non-authenticated data: Unacceptable
            .... .... .... 0011 = Reply code: No such name (3)
        Questions: 1
        Answer RRs: 0
        Authority RRs: 0
        Additional RRs: 0
        Queries
            example.invalid: type A, class IN
                Name: example.invalid
                [Name Length: 15]
                [Label Count: 2]
                Type: A (Host Address) (1)
                Class: IN (0x0001)

     

    This leads to several questions:

    1. Is this the expected response format from the built-in DNS Server? If so, we believe it's a bug as the response should include the corresponding query. 
    2. Is there any way to avoid setting a DNS server entry in the DHCP server configuration? 
    3. If we stop the DNS server with sl_NetAppStop(), would that resolve the problem.
  • It is strange that we are not aware of such issue from other users.

    E.g. i would expect that this would appear when using the SimpleLink Starter Pro application (when using the AP provisioning).

    I'm still not sure if your application uses any iOS API that internally triggers this specific DNS query. I would need to recreate this issue in order to provide a fix. 

    Anyway, if there is a bug in the DNS Server implementation - you can disable it with sl_NetAppStop and then you can add a DNS server implementation on the host. 

  • The following test was run by the customer while pointing to the CC3220 device..   On a device running macOS, he entered

    $ dig @192.168.10.1 example.invalid +noedns

    The response on the terminal was

    ; <<>> DiG 9.10.6 <<>> @192.168.10.1 example.invalid +noedns
    ; (1 server found)
    ;; global options: +cmd
    ;; Got answer:
    ;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 59534
    ;; flags: qr; QUERY: 0, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0

    ;; Query time: 12 msec
    ;; SERVER: 192.168.10.1#53(192.168.10.1)
    ;; WHEN: Mon Aug 09 12:02:05 CDT 2021
    ;; MSG SIZE rcvd: 12

    A WireShark session was used to capture data. The response was parsed to show

    Thanks Shaji - this definitely shows the same NXDomain response sans the matching question:

    Domain Name System (response)
    Transaction ID: 0x93b2
    Flags: 0x8003 Standard query response, No such name
    1... .... .... .... = Response: Message is a response
    .000 0... .... .... = Opcode: Standard query (0)
    .... .0.. .... .... = Authoritative: Server is not an authority for domain
    .... ..0. .... .... = Truncated: Message is not truncated
    .... ...0 .... .... = Recursion desired: Don't do query recursively
    .... .... 0... .... = Recursion available: Server can't do recursive queries
    .... .... .0.. .... = Z: reserved (0)
    .... .... ..0. .... = Answer authenticated: Answer/authority portion was not authenticated by the server
    .... .... ...0 .... = Non-authenticated data: Unacceptable
    .... .... .... 0011 = Reply code: No such name (3)
    Questions: 0
    Answer RRs: 0
    Authority RRs: 0
    Additional RRs: 0
    [Request In: 16]
    [Time: 0.008061000 seconds]

    I will open a ticket with TI via the support page, per a request from Apple iOS.

  • Thanks, we will try to resolve this, but it may take some time.

  • Are you using the latest SDK (5.20) and service pack (sp_3.20.0.1_2.7.0.0_2.2.0.7)?

  • I am pointing to simplelink_cc32xx_sdk_3_20_00_06, installed on 2/21/2020.  Is there an errata sheet for the SDK?

  • The is a known issues section in the release notes of the SDK.

  • There were no issues that mentioned the DNS server.  Nevertheless, I downloaded the latest 5.20 SDK and attempted to build with it in CCS.  The build failed with five errors in file pcmciaBoard_CC3220.c, all due to a change in the Timer_Config structure.  I resolved those issues and tried to build again, and then I saw 37 errors for unresolved symbols.  I did not attempt to resolve the symbols.  

  • try just using the latest SP (from 5.20).

  • When I downloaded the 5.20 SDK, I did not load any additional service pack, so that should have been the latest SP.  Do I have to pull in a set of pcmciaBoard_CC3220.[c,h] files from somewhere to fix the Timer_Config errors seen when I build?

  • The service pack is within the SDK, in <SDK>\tools\cc32xx_tools\servicepack-cc3x20\

    I'm not sure what is the pcmcia issue you are facing, but if you only install the new service pack (e.g. by uniflash) and keep using the old SDK (drivers+libs) - there shouldn't be any other requirement.

    br,

    Kobi

  • Kobi,

    I have SDK 3_20_00_06 with service pack 3.12.0.1_2.0.0.0_2.2.0.6.  That is what I have been using to build with CCS.

    I have SDK 5_20_00_06 with service pack 3.20.0.1_2.7.0.0_2.2.0.7.  If I build with this SDK in CCS, the build fails.

    Do I just have to point to service pack 3.20.0.1_2.7.0.0_2.2.0.7 in Uniflash when I create the image, using the bin file created in CCS with SDK 3_20_00_06?  I will try that later today.

  • I pointed to the SDK 5_20 service pack in Uniflash and built a new image.  I loaded the image on our card and then connected my phone to it over WiFi.  As a test, I tried to go to a website.  On my Android phone, after about 15 seconds I get an error telling me the site can't be reached, and its DNS address can't be found.  On an iPhone, the browser will sit and spin for about 30 seconds before timing out with an error message.  The problem has not been resolved.

  • Kobi,

       In one of the earlier entries you suggested that I turn off the embedded DNS server and run a DNS server that we added to our code.  Is there a CC3220 example project that contains code for a DNS task?  

  • We don't have such example. 

    We typically uses the internal DNS without any issue and (for internal tests) we used an entire external IP stack with DNS (we don't have  a public example for this currently).

  • Hi Chuck,

    Just to verify, can you take our network terminal example from the latest SDK. Build and flash this on your device. Then using the commands enable AP mode, and then try to connect using IOS. Does this issue reproduce?