Skip to main content
Visitor II
November 26, 2021
Question

A problem when receiving data with TCP LwIP

  • November 26, 2021
  • 1 reply
  • 1293 views

0693W00000GZ2oXQAT.png0693W00000GZ2vDQAT.jpgI had a problem when receiving data with TCP LwIP: Because TCP max segment size is 1460 so I can not receive the whole response from the server (2.75KB), I just received only 1440 Bytes. Are there any ways to receive full the response data? Can someone help me with this?

    This topic has been closed for replies.

    1 reply

    Visitor II
    December 27, 2021

    Hello @Nguyễn Long​ ,

    Independently from the maximum PDU size, it is possible to send (and receive) an arbitrary data size in TCP using the segmentation mechanism: TCP Segmentation - InetDaemon's IT Tutorial

    To benefit from this mechanism a TCP connection is considered as a stream instead of discrete packets (which is the case by definition). The data needs to be assembled on reception or processed piecewise.

    Therefore, on each packet reception the data is to be assembled instead of considering the data to be fully contained in a single packet.

    Otherwise, could you attach a network capture (using Wireshark for example) of the interaction with the issue?

    BeST Regards,

    Walid