lwip-users
[Top][All Lists]
Advanced

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

[lwip-users] [Issue] TCP fragmentation over PPP - fragments are lost in


From: Marco Jakobs
Subject: [lwip-users] [Issue] TCP fragmentation over PPP - fragments are lost in LwIP if data is queued for sending
Date: Thu, 24 Nov 2016 17:19:23 +0100

Hi,

 

I'm experiencing an issue in LwIP 1.4.1 using PPP.

I have set the TCP_MSS to 1024 bytes and an application is sending large packets of up to 1400 bytes. On the wire the fragmentation works, my test setup sends 2 times 1400 bytes via NETCONN_WRITE into an open TCP link. On the wireshark the output is:

 

- Fragment of 1024 bytes (Seq. 1, next Seq. 1025)

- Fragment of 376 bytes (Seq. 1025, next Seq. 1401)

- Fragment of 1024 bytes (Seq. 1401, next Seq. 2425)

- Fragment of 376 bytes (Seq. 2425, next Seq. 2801)

 

So that's working pretty well and also the sequence numbers are indicating nothing is lost.

 

 

Once I'm running the same on the low PPP link, the output via PPP is:

 

- Fragment of 1024 bytes (Seq. 1, next Seq. 1025)

- Fragment of 1024 bytes (Seq. 1025, next Seq. 1401)

 

So the second segment of 376 bytes for each packet gets lost. Interesting: ***The sequence numbers are correct!***

 

So it's not a real "lost fragment" on the wire, in this case the segment numbers would be out of order and the missing segment would be retransmitted. Wireshark would indicate an error in that case.

 

For the slow PPP link the data must be queued in LwIP. So we basically have 4 segments in the TCP send queue:

 

- 1) 1024 bytes

- 2) 376 bytes

- 3) 1024 bytes

- 4) 376 bytes

 

It looks as if the second packet of 1400 bytes (starting with 3), which is written on the connection before 1) was already sent over the PPP link, overwrites the already queued segment 2).

On the other side I'd expect that in this case the last 376 bytes 4) would be also sent. But that's not the case – just the two 1024 byte fragments 1) and 3) are sent over the PPP link – but with correct sequence numbers as if the small fragments just would not be there.

 

Also interesting: If I send only ONE 1400 byte packet, both fragments are happily transmitted.

 

The data loss does only appear, if a second packet is queued while the first packet was not yet sent over the link. And it does only appear if the packets must be fragmented.

 

It might be that this would also happen via Ethernet, but I'm not seeing this. But this might be as the link is that quick that the first 2 segments are already sent when the second packet is written to the connection.

 

Any ideas how to fix this are highly appreciated ;-)

 

Thanks,

Marco


reply via email to

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