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.

NDK for TM4C129 ARP re-sending timing setting

Hi Champs,

We would like to improve ARP re-sending time after failed connection.

*Condition

Device: TM4C129

NDK version :v2.24

protocol :UDP

Currently, we are sending datal per 50ms using sendto().

However, when TM4C129 didn't find slave device and failed ARP connection, 2nd time ARP connection request interval per 26sec.

And we down sendto data frequency per 1s , ARP re-connection interval change to per 1sec.

We would like to change ARP re-connection interal per less than 1sec and keeping sending data per 50ms interval with sendto().

Do you have any paramter that reduce ARP re-sending interval after failed address resolution ?

Is this 50ms sendto() data interval to short for this system ?

Please let us know your opinion.

Regards,

Kaz

  • Hi Kaz,

    I have forwarded your query to our NDK expert. He is out for the weekend, so we'll have to get back to you next week.

    Best regards,
    Vincent
  • Hi Kaz,

    Is this the initial attempt to send data to the “slave device?”

    We are wondering if this is the first communication (so initial ARP requests are made to find the other host’s MAC address) vs. the scenario in which communication already occurred (ie. ARP resolution happened previously) and now the ARP entry for the “slave device” is being removed.

    Also, could you send us a Wireshark capture that shows the issue?

    Thanks,
    Vincent
  • Hi Vincent or Another RTOS team,
    You used to request me this detail set up. So, I write down detail

    EVM : EK-TM4C129
    Sample code is : C:\ti\tirtos_tivac_2_14_04_31\tirtos_tivac_2_14_04_31_examples\TI\EK_TM4C1294XL\udpEcho (TI-RTOS)

    And lower library for udp.c and ipout.c ,etc version is ndk2.24
    Then, they sending data via sendto() 50ms period.

    Actually, after sendto() command , and wait 50ms for select.
    If data is not able to get , program counter go back to sendto() again.
    This period is 50ms.

    PC side doesn’t need any special application.
    They changed ip address after 71sec by manual change on windows7.


    Regards,
    Kz777
  • Hi Kaz,

     

    Thanks for providing all of that information.

     

    I’ve analyzed the Wireshark capture. I don’t think increasing the ARP times will help you. I think the problem is that the NDK is not updating its ARP table when it receives the gratuitous ARP from the PC (PC announcing its new IP address).

     

    By default, the NDK is configured to drop/ignore all gratuitous ARP packets. The following configuration parameter governs this behavior:

     

    CFGITEM_IP_RTGARP /* How to handle received gratuitous ARP */

                                           /* 0 : discard them. (Default) */

                                           /* 1 : update MAC address of HOST, if it */

                                           /*     is already in the routing table. */

                                           /* 2 : add HOST to routing table, if it */

                                           /*     does NOT exist. If exists, update */

                                           /*     MAC address. */

     

    Can you try adding the following configuration code to change the behavior for gratuitous ARPs? Note that you need to do this in C code at runtime, and a good place to do that is one of the NDK hook functions. The following steps should help you:

     

    1. Update the application configuration file (*.cfg file) with the following code to add an NDK hook function:
    var Global = xdc.useModule('ti.ndk.config.Global');
    
    Global.stackInitHook = '&myInitFxn';

    2. Add the following C code, that implements the myInitFxn() to configure the gratuitous ARP setting:

    #include <netmain.h>
    
    #include <stkmain.h>
    
    void myInitFxn(HANDLE hCfg)
    
    {
    
       int garpValue = 1;
    
       CfgAddEntry(hCfg, CFGTAG_IP, CFGITEM_IP_RTGARP, CFG_ADDMODE_UNIQUE,
    
               sizeof(uint), (UINT8 *)&garpValue, 0);
    
    }

    Steve

     

  • Hi Steve,

    Thanks. We worked it with your recommend code.
    I appriciate it.

    Regards,
    Kz777