Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
20 years ago

LwIP Configuration problem

I follow the document " Using Lightweight IP with the NiosII Processor Tutorial " to optimize LwIP Throughput .

On page B-2 , it suggest that the optimal value of TCP_WND is 32768 . (The original value of TCP_WND is 2048 )

The TCP_WND effect the Maximum window size ( receive buffer space in bytes ) .

When I set the value of TCP_WND for 32768 , I can not receive total data that had been transmitted to my 1c20 board.

How to solve this problem ?

thanks a lot ~

5 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    I'm afraid you need to give a lot more detail if anyone is going to be able to help you. The best first place to start is to get a packet log using something like ethereal.

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    I use the simple socket server project which provided by NiosII IDE.

    I modify the sss_handle_receive( ) in simple_socket_server.c and use sss_handle_receive( ) to receive data which sent by PC.

    The sss_handle_receive( ) use the code as below to receive data .

    rx_code = recv(conn->fd, conn->rx_buffer, data_length , 0);

    For optimizing the LwIP Throughput , I use the NiosII IDE to set the value of TCP_WND .

    When I set the value of TCP_WND for 32768 , the data I obtained is smaller than data_length .

    But it is normal , if the value of TCP_WND is 2048 .

    How can I do to solve the problem ?

    thanks~
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    To solve a problem like this, you need to look at the packets actually being sent on the network. You need to get a packet log using a tool such as ethereal to narrow down where the problem is.

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    you can look tt_nios2_lwip_tutorial.pdf file in altera\kits\nios2\documents

    it is very helpful !

    good luck to you !