[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lwip-users] Re-Transmission from PC is ignored due to sequence number

From: Daniel L
Subject: [lwip-users] Re-Transmission from PC is ignored due to sequence number
Date: Fri, 20 Apr 2018 02:57:20 -0700 (MST)

Hi there,

I'm using lwip 2.0.2 on a Renesas Rh850 Embedded Device with freeRTOS.

In our network setup, we have a master (PC with Win7) and a slave (embedded
The master sends cyclic requests to the slave. The slave has to answer them
(we are running Modbus over TCP, for the sake of completeness).
Everything is running fine, however, sometimes the PC does not receive our
response (this is also verified in Wireshark on the same machine).
The PC then sends a retransmission after 300ms. The retransmission is
basically the same frame as the previous one, including the previous
sequence number).
Our embedded device receives the retransmission, but it does not pass the
payload to our modbus application software. Instead, lwip sends an empty
acknowledge because the sequence number is not within range.

I'll try to summarize:
1) PC sends request
2) lwip receives request, updates sequence number (tcp_inc.c:1443;
pcb->rcv_nxt = seqno + tcplen;)
3) payload is passed to our application
4) application triggers transmission of response
5) response is sent
6) microcontroller generates a Tx interrupt, indicating everything is fine
7) Wireshark on PC does not show the answer frame
8) after 300ms PC sends retransmission
9) lwip receives retransmission
10) lwip refuses retransmission because sequence number is out of range
(tcp_inc.c:1361; if (TCP_SEQ_BETWEEN(seqno, pcb->rcv_nxt,
                        pcb->rcv_nxt + pcb->rcv_wnd - 1))
11) lwip does not pass payload to our application, but sends empty

Well, I do not know why the response frame is lost.
This may be an issue of our hardware setup and we are investigating this.
However, I'm wondering if lwip is acting correct. Dropping retransmission
seems bad. The PC sends a retransmission because he is waiting for an
answer. When lwip drops the retransmission due to wrong sequence number, the
PC will never get an answer, no matter how many retransmission it does.
Also, for our embedded application there is no way to know that something is
going wrong?

Is lwip acting correct?
Are there possibilities to handle this problem?

Sent from: http://lwip.100.n7.nabble.com/lwip-users-f3.html

reply via email to

[Prev in Thread] Current Thread [Next in Thread]