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.

Packet not full size TM4C1294

I have been toying with the TCP Echo example using TI-RTOS to continuously send packets of 1024 bytes (would like to increase to 1460 when working). What is happening though is I'm getting 2 smaller packets sent instead of just the one 1024 byte packet.

Setting a breakpoint on the send function and looping a send at a time seems to work most of the time however.

From Wireshark:

72428 22.591278000 192.168.0.2 192.168.0.1 TCP 490 1234→50914 [PSH, ACK] Seq=24717901 Ack=1 Win=1024 Len=436
72429 22.592141000 192.168.0.2 192.168.0.1 TCP 642 1234→50914 [PSH, ACK] Seq=24718337 Ack=1 Win=1024 Len=588

72430 22.592196000 192.168.0.1 192.168.0.2 TCP 54 50914→1234 [ACK] Seq=1 Ack=24718925 Win=63216 Len=0

My code is as follows:

I have tried to add TCP_NODELAY by adding the following:

setsockopt(server, IPPROTO_TCP, TCP_NODELAY, (void *)&i, sizeof(i));

Anyone have any ideas why the 1024 Byte packets is being split?

Regards,

Lee.

/*
 *    ======== tcpEcho.c ========
 *    Contains BSD sockets code.
 */

#include <string.h>

#include <xdc/std.h>
#include <xdc/cfg/global.h>
#include <xdc/runtime/Error.h>
#include <xdc/runtime/System.h>

#include <ti/sysbios/BIOS.h>
#include <ti/sysbios/knl/Task.h>
#include <ti/drivers/GPIO.h>

/* NDK BSD support */
#include <sys/socket.h>

/* Example/Board Header file */
#include "Board.h"

#define TCPPACKETSIZE 1024
#define NUMTCPWORKERS 1



const static char buffer[1024] = {
		'0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9',
		'0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9',
		'0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9',
		'0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9',
		'0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9',
		'0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9',
		'0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9',
		'0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9',
		'0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9',
		'0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9',
		'0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9',
		'0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9',
		'0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9',
		'0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9',
		'0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9',
		'0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9',
		'0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9',
		'0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9',
		'0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9',
		'0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9',
		'0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9',
		'0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9',
		'0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9',
		'0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9',
		'0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9',
		'0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9',
		'0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9',
		'0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9',
		'0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9',
		'0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9',
		'0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9',
		'0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9',
		'0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9',
		'0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9',
		'0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9',
		'0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9',
		'0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9'

};
/*
 *  ======== tcpWorker ========
 *  Task to handle TCP connection. Can be multiple Tasks running
 *  this function.
 */
Void tcpWorker(UArg arg0, UArg arg1)
{
    int  clientfd = (int)arg0;
    //int  bytesRcvd;
    int  bytesSent;
   // char buffer[TCPPACKETSIZE];

    System_printf("tcpWorker: start clientfd = 0x%x\n", clientfd);
    System_flush();


   // while ((bytesRcvd = recv(clientfd, buffer, TCPPACKETSIZE, 0)) > 0) {
    while(1){

        bytesSent = send(clientfd, buffer,TCPPACKETSIZE, 0);
        if (bytesSent < 0 ) {
            System_printf("Error: send failed.\n");
            System_flush();
            break;
        }
    }
    System_printf("tcpWorker stop clientfd = 0x%x\n", clientfd);
    System_flush();

    close(clientfd);
}
/*
Void tcpWorker(UArg arg0, UArg arg1)
{
    int  clientfd = (int)arg0;
    int  bytesRcvd;
    int  bytesSent;
    char buffer[TCPPACKETSIZE];

    System_printf("tcpWorker: start clientfd = 0x%x\n", clientfd);

    while ((bytesRcvd = recv(clientfd, buffer, TCPPACKETSIZE, 0)) > 0) {
        bytesSent = send(clientfd, buffer, bytesRcvd, 0);
        if (bytesSent < 0 || bytesSent != bytesRcvd) {
            System_printf("Error: send failed.\n");
            break;
        }
    }
    System_printf("tcpWorker stop clientfd = 0x%x\n", clientfd);

    close(clientfd);
}
*/
/*
 *  ======== tcpHandler ========
 *  Creates new Task to handle new TCP connections.
 */
Void tcpHandler(UArg arg0, UArg arg1)
{
    int                status;
    int                clientfd;
    int                server;
    struct sockaddr_in localAddr;
    struct sockaddr_in clientAddr;
    int                optval;
    int                optlen = sizeof(optval);
    socklen_t          addrlen = sizeof(clientAddr);
    Task_Handle        taskHandle;
    Task_Params        taskParams;
    Error_Block        eb;
    int i = 1;

    server = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
    if (server == -1) {
        System_printf("Error: socket not created.\n");
        goto shutdown;
    }


    memset(&localAddr, 0, sizeof(localAddr));
    localAddr.sin_family = AF_INET;
    localAddr.sin_addr.s_addr = htonl(INADDR_ANY);
    localAddr.sin_port = htons(arg0);

    status = bind(server, (struct sockaddr *)&localAddr, sizeof(localAddr));
    if (status == -1) {
        System_printf("Error: bind failed.\n");
        goto shutdown;
    }

    status = listen(server, NUMTCPWORKERS);
    if (status == -1) {
        System_printf("Error: listen failed.\n");
        goto shutdown;
    }

    if (setsockopt(server, SOL_SOCKET, SO_KEEPALIVE, &optval, optlen) < 0) {
        System_printf("Error: setsockopt failed\n");
        goto shutdown;
    }

      setsockopt(server, IPPROTO_TCP, TCP_NODELAY, (void *)&i, sizeof(i));

    while ((clientfd =
            accept(server, (struct sockaddr *)&clientAddr, &addrlen)) != -1) {

        System_printf("tcpHandler: Creating thread clientfd = %d\n", clientfd);

        /* Init the Error_Block */
        Error_init(&eb);

        /* Initialize the defaults and set the parameters. */
        Task_Params_init(&taskParams);
        taskParams.arg0 = (UArg)clientfd;
        taskParams.stackSize = 2560;
        taskHandle = Task_create((Task_FuncPtr)tcpWorker, &taskParams, &eb);
        if (taskHandle == NULL) {
            System_printf("Error: Failed to create new Task\n");
            close(clientfd);
        }

        /* addrlen is a value-result param, must reset for next accept call */
        addrlen = sizeof(clientAddr);
    }

    System_printf("Error: accept failed.\n");

shutdown:
    if (server > 0) {
        close(server);
    }
}

/*
 *  ======== main ========
 */
int main(void)
{
    /* Call board init functions */
    Board_initGeneral();
    Board_initGPIO();
    Board_initEMAC();

    System_printf("Starting the TCP Echo example\nSystem provider is set to "
                  "SysMin. Halt the target to view any SysMin contents in"
                  " ROV.\n");
    /* SysMin will only print to the console when you call flush or exit */
    System_flush();

    /* Start BIOS */
    BIOS_start();

    return (0);
}
/*
 *  ======== tcpEcho.cfg ========
 */

/* ================ General configuration ================ */
var Defaults = xdc.useModule('xdc.runtime.Defaults');
var Diags = xdc.useModule('xdc.runtime.Diags');
var Error = xdc.useModule('xdc.runtime.Error');
var Log = xdc.useModule('xdc.runtime.Log');
var Main = xdc.useModule('xdc.runtime.Main');
var Memory = xdc.useModule('xdc.runtime.Memory');
var System = xdc.useModule('xdc.runtime.System');
var Text = xdc.useModule('xdc.runtime.Text');

var BIOS = xdc.useModule('ti.sysbios.BIOS');
var Clock = xdc.useModule('ti.sysbios.knl.Clock');
var Task = xdc.useModule('ti.sysbios.knl.Task');
var Semaphore = xdc.useModule('ti.sysbios.knl.Semaphore');
var Hwi = xdc.useModule('ti.sysbios.hal.Hwi');
var HeapMem = xdc.useModule('ti.sysbios.heaps.HeapMem');
var LoggingSetup = xdc.useModule('ti.uia.sysbios.LoggingSetup');

BIOS.heapSize = 20480;
Task.idleTaskStackSize = 768;

/*
 *  Program.stack is ignored with IAR. Use the project options in
 *  IAR Embedded Workbench to alter the system stack size.
 */
if (!Program.build.target.$name.match(/iar/)) {
    /*
     *  Reducing the system stack size (used by ISRs and Swis) to reduce
     *  RAM usage.
     */
    Program.stack = 2048;
}

/* ================ System configuration ================ */
var SysMin = xdc.useModule('xdc.runtime.SysMin');
SysMin.bufSize = 128;
System.SupportProxy = SysMin;

/* Enable Semihosting for GNU targets to print to CCS console */
if (Program.build.target.$name.match(/gnu/)) {
    var SemiHost = xdc.useModule('ti.sysbios.rts.gnu.SemiHostSupport');
}

/* ================ NDK configuration ================ */
var Ndk       = xdc.loadPackage('ti.ndk.config');
var Global    = xdc.useModule('ti.ndk.config.Global');
var Ip        = xdc.useModule('ti.ndk.config.Ip');
var Udp       = xdc.useModule('ti.ndk.config.Udp');
var Tcp       = xdc.useModule('ti.ndk.config.Tcp');

Global.IPv6 = false;
Global.stackLibType = Global.MIN;
Global.networkOpenHook = "&netOpenHook";

/* automatically call fdOpen/CloseSession for our sockets Task */
Global.autoOpenCloseFD = true;

Global.pktNumFrameBufs = 10;
Global.memRawPageCount = 6;
Global.ndkThreadStackSize = 1536;
Global.lowTaskStackSize = 2048;
Global.normTaskStackSize = 2048;
Global.highTaskStackSize = 2048;
Tcp.transmitBufSize = 1460;
Tcp.receiveBufSize = 1024;


/* ================ Driver configuration ================ */
var TIRTOS = xdc.useModule('ti.tirtos.TIRTOS');
TIRTOS.useEMAC = true;
TIRTOS.useGPIO = true;
Ip.autoIp = false;
Ip.address = "192.168.0.2";
Tcp.maxNumReasmPkts = 1;
LoggingSetup.loadTaskLogging = true;
LoggingSetup.enableTaskProfiler = true;
Ip.socketBufMinRxSize = 100;

  • While the throughput is 1.1MBytes/s currently I feel I should be able to increase that if I can send maximum sized packets. Is there someone who has a knowledge of NDK/RTOS who can help me solve this issue??

    Regards,
    Lee.
  • Hi Leethal,

    can you inspect your .cfg file and see what your TCP.transmitBufSize value is?

    You may want to refer to this Wiki page also (specifically the Concerto Example). It discusses the tradeoffs when changing the memory buffers.

    The snippet below is taken from tcpEcho.cfg:

    /* ================ NDK configuration ================ */
    var Ndk       = xdc.loadPackage('ti.ndk.config');
    var Global    = xdc.useModule('ti.ndk.config.Global');
    var Ip        = xdc.useModule('ti.ndk.config.Ip');
    var Udp       = xdc.useModule('ti.ndk.config.Udp');
    var Tcp       = xdc.useModule('ti.ndk.config.Tcp');
    
    Global.IPv6 = false;
    Global.stackLibType = Global.MIN;
    Global.networkOpenHook = "&netOpenHook";
    
    /* automatically call fdOpen/CloseSession for our sockets Task */
    Global.autoOpenCloseFD = true;
    
    Global.pktNumFrameBufs = 10;
    Global.memRawPageCount = 6;
    Global.ndkThreadStackSize = 1536;
    Global.lowTaskStackSize = 1024;
    Global.normTaskStackSize = 1024;
    Global.highTaskStackSize = 1024;
    Tcp.transmitBufSize = 1024;
    Tcp.receiveBufSize = 1024;
    

  • Hi Tom,

    It is collapsed in the first post but here it is:

    Global.pktNumFrameBufs = 10;
    Global.memRawPageCount = 6;
    Global.ndkThreadStackSize = 1536;
    Global.lowTaskStackSize = 2048;
    Global.normTaskStackSize = 2048;
    Global.highTaskStackSize = 2048;
    Tcp.transmitBufSize = 1460;
    Tcp.receiveBufSize = 1024;

    I did manage to send 1024 Byte packets by increasing the PBM buffers to 3073 and decreasing frames to 6. So far so good.


    If I try to increase the packet to 1460 it does start to split the packets into 2 sends again. Changing the PBM buffers further has no effect that I've noticed. If I go too far it will fail to connect.

     I haven't bothered looking at the receive side as I'm only sending as fast as possible. Now up to 2.14M Bytes/s.

    1562 0.488223000 192.168.0.2 192.168.0.1 TCP 642 1234→52695 [PSH, ACK] Seq=758613 Ack=1 Win=1024 Len=588
    1563 0.489082000 192.168.0.2 192.168.0.1 TCP 926 1234→52695 [PSH, ACK] Seq=759201 Ack=1 Win=1024 Len=872
    1564 0.489110000 192.168.0.1 192.168.0.2 TCP 54 52695→1234 [ACK] Seq=1 Ack=760073 Win=64240 Len=0

    Current settings are:

    Global.pktNumFrameBufs = 6;
    Global.memRawPageCount = 6;
    Global.ndkThreadStackSize = 1536;
    Global.lowTaskStackSize = 2048;
    Global.normTaskStackSize = 2048;
    Global.highTaskStackSize = 2048;
    Tcp.transmitBufSize = 2048;
    Tcp.receiveBufSize = 1024;

    Tom, any ideas why it may be difficult to send single packets larger than 1024 Bytes. I did a screen capture of the execution graph as I thought this may help. Maybe not, I don't know a lot about using the RTOS as yet.



    Regards,
    Lee.

  • Lee,

    can you use "getsockopt()" to check the "SO_SNDLOWAT" option? It's good to know that it isn't lower than 1024.

    Can you a .c file showing what you're doing? It's confusing to see what is happening with the 'i' in "setsockopt(server, IPPROTO_TCP, TCP_NODELAY, (void *)&i, sizeof(i));"

  • Hi Tom,

    In the first post you can expand the source to see the .c file.

    I will try the getsockopt() and report back.

    Cheers,
    Lee.

  • Hi Tom,

    The Send Low Water Mark, optval = 100, optlen = 4.

    Doesn't sound promising.

    I added the following but it had no effect. I suspect I can't change the sndlowat in NDK. I can't see where it is defined to change this value either but I suspect its in the library file.

    int sndlowtr = 1460;

    setsockopt(server, SOL_SOCKET, SO_SNDLOWAT, (void *)& sndlowtr, sizeof(sndlowtr));

    getsockopt(server, SOL_SOCKET, SO_SNDLOWAT, &optval, &optlen);
    if (optval != 0) {
    System_printf("SO_SNDLOWAT = %d %d\n", optval,optlen);
    System_flush();
    }

    Any further ideas??

    Regards,
    Lee.

  • Hi Tom,

    I have been randomly playing with buffer values in the NDK  and have managed to have some of the packets sent as 1460 Bytes but on other sends  the data is split over 2 packets. If I increase the buffer values much more I fail to connect.

    /*
     * Copyright (c) 2014, Texas Instruments Incorporated
     * All rights reserved.
     *
     * Redistribution and use in source and binary forms, with or without
     * modification, are permitted provided that the following conditions
     * are met:
     *
     * *  Redistributions of source code must retain the above copyright
     *    notice, this list of conditions and the following disclaimer.
     *
     * *  Redistributions in binary form must reproduce the above copyright
     *    notice, this list of conditions and the following disclaimer in the
     *    documentation and/or other materials provided with the distribution.
     *
     * *  Neither the name of Texas Instruments Incorporated nor the names of
     *    its contributors may be used to endorse or promote products derived
     *    from this software without specific prior written permission.
     *
     * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
     * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
     * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
     * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
     * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
     * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
     * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
     * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
     * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
     * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     */
    
    /*
     *  ======== tcpEcho.cfg ========
     */
    
    /* ================ General configuration ================ */
    var Defaults = xdc.useModule('xdc.runtime.Defaults');
    var Diags = xdc.useModule('xdc.runtime.Diags');
    var Error = xdc.useModule('xdc.runtime.Error');
    var Log = xdc.useModule('xdc.runtime.Log');
    var Main = xdc.useModule('xdc.runtime.Main');
    var Memory = xdc.useModule('xdc.runtime.Memory');
    var System = xdc.useModule('xdc.runtime.System');
    var Text = xdc.useModule('xdc.runtime.Text');
    
    var BIOS = xdc.useModule('ti.sysbios.BIOS');
    var Clock = xdc.useModule('ti.sysbios.knl.Clock');
    var Task = xdc.useModule('ti.sysbios.knl.Task');
    var Semaphore = xdc.useModule('ti.sysbios.knl.Semaphore');
    var Hwi = xdc.useModule('ti.sysbios.hal.Hwi');
    var HeapMem = xdc.useModule('ti.sysbios.heaps.HeapMem');
    var LoggingSetup = xdc.useModule('ti.uia.sysbios.LoggingSetup');
    
    BIOS.heapSize = 20480;
    Task.idleTaskStackSize = 768;
    
    /*
     *  Program.stack is ignored with IAR. Use the project options in
     *  IAR Embedded Workbench to alter the system stack size.
     */
    if (!Program.build.target.$name.match(/iar/)) {
        /*
         *  Reducing the system stack size (used by ISRs and Swis) to reduce
         *  RAM usage.
         */
        Program.stack = 2048;
    }
    
    /* ================ System configuration ================ */
    var SysMin = xdc.useModule('xdc.runtime.SysMin');
    SysMin.bufSize = 128;
    System.SupportProxy = SysMin;
    
    /* Enable Semihosting for GNU targets to print to CCS console */
    if (Program.build.target.$name.match(/gnu/)) {
        var SemiHost = xdc.useModule('ti.sysbios.rts.gnu.SemiHostSupport');
    }
    
    /* ================ NDK configuration ================ */
    var Ndk       = xdc.loadPackage('ti.ndk.config');
    var Global    = xdc.useModule('ti.ndk.config.Global');
    var Ip        = xdc.useModule('ti.ndk.config.Ip');
    var Udp       = xdc.useModule('ti.ndk.config.Udp');
    var Tcp       = xdc.useModule('ti.ndk.config.Tcp');
    
    Global.IPv6 = false;
    Global.stackLibType = Global.MIN;
    Global.networkOpenHook = "&netOpenHook";
    
    /* automatically call fdOpen/CloseSession for our sockets Task */
    Global.autoOpenCloseFD = true;
    
    Global.pktNumFrameBufs = 6;
    Global.memRawPageCount = 6;
    Global.ndkThreadStackSize = 4096;
    Global.lowTaskStackSize = 4096
    Global.normTaskStackSize = 4096;
    Global.highTaskStackSize = 4096;
    Tcp.transmitBufSize = 4096;
    Tcp.receiveBufSize = 1024;
    
    
    /* ================ Driver configuration ================ */
    var TIRTOS = xdc.useModule('ti.tirtos.TIRTOS');
    TIRTOS.useEMAC = true;
    TIRTOS.useGPIO = true;
    Ip.autoIp = false;
    Ip.address = "192.168.0.2";
    Tcp.maxNumReasmPkts = 1;
    LoggingSetup.loadTaskLogging = true;
    LoggingSetup.enableTaskProfiler = true;
    Ip.socketBufMinRxSize = 100;
    Global.pktSizeFrameBuf = 4096;
    Global.netSchedulerPri = Global.NC_PRIORITY_HIGH;
    LoggingSetup.sysbiosHwiLogging = true;
    LoggingSetup.loadHwiLogging = true;
    Global.memRawPageSize = 4096;
    Ip.socketBufMinTxSize = 1460;
    

    I don't know if this is usual behavior for the NDK in that it can't continuously sent 1460 byte packets or if there is some sort of issue with configuration. I am willing to send the code and the client I am using if this helps.

    Regards,

    Lee.