I think that without this flag out of order packets are dropped, TCP stream with out of order packets will be completely unusable.
Regards, Krzysztof Wesołowski On Wed, Sep 10, 2014 at 8:43 AM, Richner Simon <simon.rich...@psi.ch> wrote: > I think I found the answer in the lwip options: > > /** > * TCP_QUEUE_OOSEQ==1: TCP will queue segments that arrive out of order. > * Define to 0 if your device is low on memory. > */ > > I didn't analyze the code, but to my understanding this means: If this > flag is set (default), then lwip will queue out of order segments and wait > for the missing segment, before calling tcp_recv. In this case the > application doesn't need to worry about out of order packets. > > Please let me know if I'm mistaken. > > Cheers, Simon > > > -----Ursprüngliche Nachricht----- > Von: lwip-users-bounces+simon.richner=psi...@nongnu.org [mailto: > lwip-users-bounces+simon.richner=psi...@nongnu.org] Im Auftrag von > Radouch, Zdenek > Gesendet: Dienstag, 9. September 2014 19:20 > An: Mailing list for lwIP users > Betreff: Re: [lwip-users] packet order with tcp_recv > > > Packets will be received in the order they were sent. > > No, TCP packets are IP datagrams that can be lost, duplicated, or that can > arrive out of order. That is, they won't necessarily arrive in the order > they were sent. The TCP input module (tcp_in.c) does the necessary ordering > (it either passes the packet to the user or queues it to be passed in > later) and Simon's question is whether the tcp_recv callback is delivering > packets in order they were received or in a sorted order (the reconstructed > data stream). > > Unfortunately I am not familiar with that callback so I don't know the > answer :-(. > > Cheers, > -Z > > > > -----Original Message----- > > From: lwip-users-bounces+zradouch=irobot....@nongnu.org [mailto:lwip- > > users-bounces+zradouch=irobot....@nongnu.org] On Behalf Of Noam > > weissman > > Sent: Tuesday, September 09, 2014 11:49 AM > > To: Mailing list for lwIP users > > Subject: Re: [lwip-users] packet order with tcp_recv > > > > Hi, > > > > In TCP there should not be such an issue. Packets will be received in > > the order they were sent. > > > > TCP is a stream. > > > > BR, > > Noam. > > > > -----Original Message----- > > From: lwip-users-bounces+noam=silrd....@nongnu.org > > [mailto:lwip-users-bounces+noam=silrd....@nongnu.org] On Behalf Of > > Richner Simon > > Sent: Tuesday, September 09, 2014 3:30 PM > > To: Mailing list for lwIP users > > Subject: [lwip-users] packet order with tcp_recv > > > > Hi all, > > > > I have a basic question about tcp_recv: > > > > Let's say I have some MBs of data I send to the lwip stack. If (for > > whatever reason) tcp packets arrive out of order, will the stack sort > > this out for me and call the tcp_recv callback with packets sorted in > > correct order? Or do I have to check the sequence number myself to > > make sure I put data back together in correct order? > > > > Thanks for your help > > Simon > > > > _______________________________________________ > > lwip-users mailing list > > lwip-users@nongnu.org > > https://lists.nongnu.org/mailman/listinfo/lwip-users > > > > > > > > ********************************************************************** > > * > > * > > ************ > > This footnote confirms that this email message has been scanned by > > PineApp Mail-SeCure for the presence of malicious code, vandals & > > computer viruses. > > ********************************************************************** > > * > > * > > ************ > > > > > > > > > > > > > > ********************************************************************** > > * > > ************* > > This footnote confirms that this email message has been scanned by > > PineApp Mail-SeCure for the presence of malicious code, vandals & > > computer viruses. > > ********************************************************************** > > * > > ************* > > > > > > > > > > _______________________________________________ > > lwip-users mailing list > > lwip-users@nongnu.org > > https://lists.nongnu.org/mailman/listinfo/lwip-users > > _______________________________________________ > lwip-users mailing list > lwip-users@nongnu.org > https://lists.nongnu.org/mailman/listinfo/lwip-users > > _______________________________________________ > lwip-users mailing list > lwip-users@nongnu.org > https://lists.nongnu.org/mailman/listinfo/lwip-users >
_______________________________________________ lwip-users mailing list lwip-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/lwip-users