lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] Reassemble fragmented TCP packets


From: Baptiste Chaboud-crousaz
Subject: Re: [lwip-users] Reassemble fragmented TCP packets
Date: Thu, 27 Aug 2009 11:25:23 +0200
User-agent: Internet Messaging Program (IMP) H3 (4.1.6)

Hi Fabian,

Thanks for your explanations.

Please find here a more detailed description of my issue. I'm developing an Ethernet card embedding lwip. This card provides a web interface (I use the HTTP server provided by /contrib). From the web interface the user can fill in a form a send it to the card. The data are sent by a HTTP "POST" request to the card.

I face troubleĀ  with Internet Explorer (whatever the version) when my card is directly connectd to my PC. In fact, the "POST" is sent in 2 frames (Please see wireshark traces in the attached archive). At the IP level, the fragmentation is not set. At the TCP level, the sequence number is correct for each frame (that's why wireshark is able to reassemble it). Nevertheless, lwip is not able to reassemble the both frames. As a result, my HTTP server receive it separetely: first frame = the header; second frame=the data. That 's not what it was expected!!!! I want lwip reassemble the both TCP segments before providing it the HTTP server.


This problem does not occur when I use Firefox 3 because the POST request is sent in a single frame.

Could you tell me what is wrong with lwip??? What should I do?

Thanks.
Baptiste Chaboud-Crousaz

Quoting Fabian Koch <address@hidden>:

> address@hidden wrote on 26.08.2009
> 18:20:07:
>
>> Hi all,
>> Is lwip able to reassemble fragmented TCP packets? If yes, how?
>> In fact my stack is supposed to receive a HTTP POST request split
>> into 2 TCP fragments. At the TCP level, both fragments are set with
>> "Position fragment/Fragment offset" = 0 and "More fragment"=0. As a
>> result, ip_reass is never called. At the TCP level, does a mechanism
>> of reassembly exist?
>
> Short answer: yes.
>
> Long answer: You have to be careful with the words here. On the IP Layer
> there is "fragmentation" which is only used when you have an Ethernet
> packet from a medium that a a bigger MTU (maximum transfer size). SO when
> a router gets a big packet and needs to send it on a physical medium that
> cannot handle the size of the packet, it gets fragmented in several IP
> packets with fragmentation flags.
> On the TCP layer, there is "segmentation". Because TCP sees data as a
> stream, it is of course possible to send data that is longer than a single
> Packet is able to handle. The data is then basically just written into
> several packets and the other side puts the data stream back together.
>
> LwIP has both features. For a TCP stream that just travels over Ethernet
> with constant MTU (1500), there will be no IP fragmentaton, only TCP
> segmentation.
>
> When your application does a recv() you just tell it how much data you
> expect and it will return when that ammount has arrived.
>
> regards,
> Fabian

Attachment: wireshark.zip
Description: Zip archive


reply via email to

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