[bug #57976] TCP data communication broken due to ACK transmission delay

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

[bug #57976] TCP data communication broken due to ACK transmission delay

Ashley Duncan
URL:
  <https://savannah.nongnu.org/bugs/?57976>

                 Summary: TCP data communication broken due to ACK
transmission delay
                 Project: lwIP - A Lightweight TCP/IP stack
            Submitted by: praveen_embedded
            Submitted on: Mon 09 Mar 2020 10:41:34 AM UTC
                Category: IPv4
                Severity: 3 - Normal
              Item Group: Faulty Behaviour
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any
         Planned Release: None
            lwIP version: 2.0.3

    _______________________________________________________

Details:

Hi ,
we are using LWIP 2.0.3 for one of our project to establish the TCP connection
from ECU and Atmel micro.
We got the LWIP from atmel itself and i have modified little to support VLAN
data receive and transmit.
But now we are seeing some issue during data transmission.
When the ECU goes to sleep, it cut down the Ethernet link and when it wakes up
it will establish the Ethernet connection.
But here when the ECU wakes up the communication is not going well from our
LWIP stack. We are seeing multiple re transmissions which are causing issues
in data transmission.
I have seen new behavior like when i received new frame on TCP, i am trying to
ACK back using ACK now function(pcb->prio =
TCP_PRIO_MAX;tcp_ack_now(pcb);tcp_send_empty_ack(pcb);tcp_output(pcb);), but i
am seeing the ACK packet after my data packet is been transferred.
This i didn't understand like why the ACK packet is transferred after data
packet? this is also one of the reason for us to see communication failure.
Can someone please help me here that how to send ACK immediately after
receiving the TCP packet(currently my data packets are sent out every 10ms
once and the ACK is transmitted after data packet is being sent out). Please
let know how to send ACK immediate, currently we are stuck here and our
communication is not proper.
I am attaching the images for our communication issues.
Here LWIP_IP: 192.168.6.182
     ECU IP : 192.168.6.144
If you see LWIP_TCP_DataSentoutFirst.JPG, the data is send first and ACK is
sent after that even though the ACK transmission is initiated first with
priority level set to MAX.

Thanks & Regards,
PraveenKumar.



    _______________________________________________________

File Attachments:


-------------------------------------------------------
Date: Mon 09 Mar 2020 10:41:34 AM UTC  Name: LWIP_TCP_DataSentoutFirst.JPG
Size: 121KiB   By: praveen_embedded

<http://savannah.nongnu.org/bugs/download.php?file_id=48564>
-------------------------------------------------------
Date: Mon 09 Mar 2020 10:41:34 AM UTC  Name: LWIPCommunicationIssue.JPG  Size:
296KiB   By: praveen_embedded

<http://savannah.nongnu.org/bugs/download.php?file_id=48565>

    _______________________________________________________

Reply to this item at:

  <https://savannah.nongnu.org/bugs/?57976>

_______________________________________________
  Message sent via Savannah
  https://savannah.nongnu.org/


_______________________________________________
lwip-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-devel
Reply | Threaded
Open this post in threaded view
|

[bug #57976] TCP data communication broken due to ACK transmission delay

Ashley Duncan
Follow-up Comment #1, bug #57976 (project lwip):

Please, *no pictures*. If you *do* have pcaps worthy of attaching, attach
them, don't attach pictures.

Anyway, from file #48564, it seems like when frame #12 is transmitted, frame
#11 hasn't been processed, yet. Seems like a performance issue of your
hardware?

    _______________________________________________________

Reply to this item at:

  <https://savannah.nongnu.org/bugs/?57976>

_______________________________________________
  Message sent via Savannah
  https://savannah.nongnu.org/


_______________________________________________
lwip-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-devel
Reply | Threaded
Open this post in threaded view
|

[bug #57976] TCP data communication broken due to ACK transmission delay

Ashley Duncan
Follow-up Comment #2, bug #57976 (project lwip):

Hi Simon,

Thanks for quick reply.

We are not seeing this issue in initial communication state.
We are seeing this issue when the ECU goes to sleep and wakeup. After ECU wake
up, TCP sync will be sent from ECU and start the communication again. In this
cycle, the communication is not going well.

I will call tcp_close() before ECU goes to sleep. After that i will call
tcp_bind(), tcp_listen() & tcp_accept() and when ECU wakes up, it will send
SYNC message again and starts transferring the data. From the second cycle
which explained above onwords, we are seeing the communication issue.

I have tried in different ways to solve the issue but i couldn't. I removed
tcp_close() and other followed functions mentioned above but still issue is
not resolved.

Here i attached the TCP logs(pcap)files for your reference.
Please check and suggest something to resolve our issue.

Regards,
PraveenKumar.

(file #48566, file #48567)
    _______________________________________________________

Additional Item Attachment:

File name: Cycle1_No Issues in TCP comm.pcap Size:716 KB
    <https://savannah.nongnu.org/file/Cycle1_No Issues in TCP
comm.pcap?file_id=48566>

File name: Cycle2_TCP Comm Fail.pcap      Size:618 KB
    <https://savannah.nongnu.org/file/Cycle2_TCP Comm Fail.pcap?file_id=48567>



    _______________________________________________________

Reply to this item at:

  <https://savannah.nongnu.org/bugs/?57976>

_______________________________________________
  Message sent via Savannah
  https://savannah.nongnu.org/


_______________________________________________
lwip-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-devel
Reply | Threaded
Open this post in threaded view
|

[bug #57976] TCP data communication broken due to ACK transmission delay

Ashley Duncan
Follow-up Comment #3, bug #57976 (project lwip):

I won't go through a pcap of multiple 100K and search for the right line that
you think is an error. Again, I can see no bug in lwIP here. You might want to
explain further.

    _______________________________________________________

Reply to this item at:

  <https://savannah.nongnu.org/bugs/?57976>

_______________________________________________
  Message sent via Savannah
  https://savannah.nongnu.org/


_______________________________________________
lwip-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-devel
Reply | Threaded
Open this post in threaded view
|

[bug #57976] TCP data communication broken due to ACK transmission delay

Ashley Duncan
Update of bug #57976 (project lwip):

                  Status:                    None => Works For Me          


    _______________________________________________________

Reply to this item at:

  <https://savannah.nongnu.org/bugs/?57976>

_______________________________________________
  Message sent via Savannah
  https://savannah.nongnu.org/


_______________________________________________
lwip-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-devel
Reply | Threaded
Open this post in threaded view
|

[bug #57976] TCP data communication broken due to ACK transmission delay

Ashley Duncan
Follow-up Comment #4, bug #57976 (project lwip):

Hi Simon,

In Cycle2 log, if you see line number 3,4,5 - The TCP packet is received from
ECU at time 0.009955 seconds, immediately I will initiate TCP ACk packet and
tcp_output(). But at the same time, data packet needs to be sent to ECU every
10ms once. So I will initiate tcp_write(data) with tcp_output().
Later when I see the packets in wireshark, I am seeing the ACK & SEQ number
which needs to be updated with ACK packet, are updated in data packet and sent
out, and later around 100uS, the ACK pack t is transmitted with different ACK
& SEQ numbers.

As the ACK & SEQ numbers are different in acknowledgment packet, our ECU is
recording error and initiating re-transmission.
This is happening very frequently and recording an error in ECU system.

So I just want to know that how to send ACK immediately once I receive input
packet.

Regards,
PraveenKumar.

    _______________________________________________________

Reply to this item at:

  <https://savannah.nongnu.org/bugs/?57976>

_______________________________________________
  Message sent via Savannah
  https://savannah.nongnu.org/


_______________________________________________
lwip-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-devel