This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Keil RTX TCP/IP Transmit Rate

Hello,

I have some questions about the Transmitrate over TCP/IP with the AT91SAM7x256 and RTX RL-ARM 412.

I modifyed the Telnet demo and added a Task for an TCP Blaster Test. It's a communication from an Win XP PC to the Developmentkit AT91SAM7X-DK.

The SAM7X sends the Data and the PC is receiving. It shows me a datarate of ~320 bytes/sec

I think thats a little bit slow. Maybe someone can tell me something about good settings for the TCP/IP Task/Handling ... Heap, Tasksize, Taskdelay etc.

This is what I have added in the telnet demo:

opened a socket:

#define SENDLEN  32     /* Number of bytes to send */

  socket_tcp = tcp_get_socket (TCP_TYPE_CLIENT, 0, 10, tcp_callback);

create a task:

  os_tsk_create (tcp_BlasterTask, 25);


task code:

__task void tcp_BlasterTask (void) {
        U8 *sendbuf;
        U8 ucI = 0;
        U8 tcpState = 0;

        tcpState = tcpState;

        while (1) {
                /* TCP */
                if (socket_tcp != 0)
                {
                        /* Start Connection */
                        switch (tcpState = tcp_get_state(socket_tcp)) {
                          case TCP_STATE_FREE:
                          case TCP_STATE_CLOSED:
                            tcp_connect (socket_tcp, Rem_IP, PORT_NUM, 0);
                            break;
                          case TCP_STATE_CONNECT:
                            if (tcp_check_send (socket_tcp) == __TRUE) {
                              sendbuf = tcp_get_buf(SENDLEN);
                                  for ( ucI = 0; ucI < SENDLEN; ucI++)
                                  {
                                        sendbuf[ucI] = ucI;
                                  }
                              tcp_send (socket_tcp, sendbuf, SENDLEN);
                            }
                            break;
                        }

                }
            os_dly_wait(5);
        }
}

Thx for your Help!

Parents Reply Children
  • You can increase the throughput by using the TCP_TYPE_DELAY_ACK option. See the documentation for tcp_get_socket().

    By default, Windows (and most operating systems) use something like a 200 ms delay before sending an ack for a single packet. The assumption is that more packets are coming and it will save network traffic, and increase overall throughput if the multiple packets are ack'd at once.

    By using the TCP_TYPE_DELAY_ACK option, the stack will split your packet into two. The second one will only have 4 bytes. That will cause an immediate ACK from the host. So you can then send another packet right away. Otherwise, as you are saying, your throughput is limited to about 7300 bytes/sec.

    Everything else works exactly the same, and in my testing only a single ACK will come back even though two packets are actually getting sent. From your application level there is still just one ACK in the callback for each call to tcp_send().

    This is not documented well at all in the TCPnet manual...