buglwIP - A Lightweight TCP/IP stack - Bugs: bug #58612, TCP SACK and Fast retransmission...


You are not allowed to post comments on this tracker with your current authentication level.

bug #58612: TCP SACK and Fast retransmission error

Submitted by:  hanhui <hanhui03>
Submitted on:  Thu 18 Jun 2020 03:32:15 PM UTC  
Category:  TCP Severity:  3 - Normal
Item Group:  Faulty Behaviour Status:  None
Privacy:  Public Assigned to:  None
Open/Closed:  Open Planned Release:  None
lwIP version:  git head

Sat 27 Jun 2020 02:03:11 AM UTC, comment #3: 

It is recommended that you can judge when the TCP packet is sent by the tcp_output_segment() function. If it is a retransmission, fill in the TCP packet header source port again:

   len = (u16_t)((u8_t )seg->tcphdr-(u8_t )seg->p->payload);
   if (len == 0) {
     /** Exclude retransmitted segments from this count. */
   } else {
     /** NAT output local tcp packet will change the packet source port
      * If this is retransmit packet the header source port has already changed
      * so here we change it back */
     seg->tcphdr->src = lwip_htons(pcb->local_port);

Of course, if there is no NAT, the previous code behavior is correct.

hanhui <hanhui03>
Wed 24 Jun 2020 05:22:10 AM UTC, comment #2: 

So it's not an lwIP bug? Can I close this then?

Simon Goldschmidt <goldsimon>
Project Administrator
Sat 20 Jun 2020 04:14:35 AM UTC, comment #1: 

The problem is found, the source port of the TCP retransmission packet is modified by the previous NAT

hanhui <hanhui03>
Thu 18 Jun 2020 03:32:15 PM UTC, original submission:  

LWIP_TCP_SACK_OUT was enabled when compiling lwIP, packet lost occurred during TCP communication, the remote sent an ACK packet with SACK option, lwIP did not retransmit, but continued to send data, Later, the remote sent a fast retransmission request, lwIP did not retransmit the data, but continued to send data.

The attachment is the network packet capture data.

You can use the "tcp && tcp.port==1081" condition to filter out other packets.

hanhui <hanhui03>


Attached Files
file #49308:  en2.pcap added by hanhui03 (212KiB - application/octet-stream)


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by goldsimon (Posted a comment)
  • -email is unavailable- added by hanhui03 (Submitted the item)

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.




    Follows 1 latest change.

    Date Changed by Updated Field Previous Value => Replaced by
    2020-06-18 hanhui03 Attached File- => Added en2.pcap, #49308

    Back to the top

    Powered by Savane 3.7