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.

RTOS/TM4C1292NCPDT: Piggybacking support in TI NDK

Part Number: TM4C1292NCPDT
Other Parts Discussed in Thread: TDA2, AM3357

Tool/software: TI-RTOS

Hi,

Please find more about my product description in the below link.

Is there any option to configure TI NDK to support Piggybacking method for ACK packets?

Regards

Bala

  • Hi Bala,

    The only way you can disable TCP ACK behavior would be to modify the NDK TCP code.

    I can't really advise you on how to do this exactly, because from what I can tell, if you disable ACK packets then you're going to break TCP altogether.

    If that doesn't concern you for some reason, the code you would need to modify is in the NDK file ti/ndk/stack/tcp/tcpout.c, in the function TcpOutput.

    But, before I go any further, please note that should you pursue this route and run into problems, unfortunately TI won't be able to support you with modifications like this.

    Having said that ...

    In this function, you can see that an ACK packet will have the TF_ACKNOW or TF_DELACK flags set:

    // around line 543
    if( pt->t_flags & (TF_ACKNOW|TF_DELACK) )
    tcps.SndAcks++; /* Peek ACKS sent */

    So what you could do is use these flags in a similar if statement to filter out the call that actually sends the ACK packets out, IPTxPacket() around line 697.

    Again, I don't see how you could do this without breaking TCP ...

    Another thought, if your modbus protocol has ACKs built into it, why not run it on top of UDP?

    Best of Luck,

    Steve
  • Greetings,

    With only the most basic understanding of this subject - firm/I can, 'Recognize & Applaud' - your resourcefulness & care - in developing & outlining such a unique solution.

    Most excellent - know that your efforts are (both) recognized & well noted/appreciated!
  • Hello Steve,

    The overall idea is not to disable the ACK packet rather the ACK packet should be appended with Modbus Packet response.

    Please look at the diagram of Modbus communication below.  Since the Modbus TCP query will have the response packet always, so the ACK packet can be appended to the response packet and response packet ACk will be appended to the next Modbus query packet. This can be continued till end of socket close. if we do so, we are expecting network stack bandwidth can be reduced and increase Modbus transaction rate. 

    Please not that my third party Modbus library will not support TCP ACK packet and only it will respond for the Modbus query.

    Regards

    Bala

  • For a start, try setting the TCP option TCP_NODELAY using NDK_setsockopt().

  • Hello Matthew,

    Tested and found No effect in setting TCP_NODELAY for TCP option. still we see separate ACK packets between Modbus Query and Response.

    Regrads
    Bala
  • Hello Bala,

    This is unfortunate, since it is the only NDK TCP option that might have specified delayed ACK behavior, which
    is the typical way of implementing piggybacking. Others have posted to the TI forum with the same or similar problems, and have unsuccessfully tried TCP_NODELAY to implement delayed ACK. Evidently, this is a deficiency of the TI NDK TCP implementation.
    See posts:

    e2e.ti.com/.../2550591
    RTOS/TDA2: TCP ACK segments comprising payload

    e2e.ti.com/.../647489
    RTOS/AM3357: TCP in NDK 2.25.1.11
  • Hello Steve,

    Steven Connell said:

    In this function, you can see that an ACK packet will have the TF_ACKNOW or TF_DELACK flags set:

    // around line 543
    if( pt->t_flags & (TF_ACKNOW|TF_DELACK) )
    tcps.SndAcks++; /* Peek ACKS sent */

    So what you could do is use these flags in a similar if statement to filter out the call that actually sends the ACK packets out, IPTxPacket() around line 697.

    as you suggested, we done the modification in line number 697 of tcpout.c as below.

     

      /* Send the packet */

     

                    if( pt->t_flags & (TF_ACKNOW|TF_DELACK) )

                                    error = IPTxPacket( pPkt,

                            SockGetOptionFlags(pt->hSock) & FLG_IPTX_SOSUPPORTED );

    But still we are getting the ACK packet separately. Look at the wireshark capture below.

    Please suggest how we can delay the ACK packets in NDK?

    Regards

    Bala