lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] howto put tcp packet together


From: Bernhard 'Gustl' Bauer
Subject: Re: [lwip-users] howto put tcp packet together
Date: Thu, 30 Apr 2009 08:54:31 +0200
User-agent: Thunderbird 2.0.0.21 (Windows/20090302)

address@hidden schrieb:
Data gets parted in 2 ways:
- the remote host may split the data in multiple network packets

This is what happens.

- lwIP may split a received packet into multiple pbufs

There is however nothing unsorted. I.e. the pbufs you receive hold the data in exactly the same order as the remote host sent it. If you don't get the full data in the first call to your receive callback (be sure to check all pbufs you have been passed: check the ->next pointers until NULL), you can just hold on to these pbufs (don't free them yet) and process them all together later when the receive callback is called again.

pbuf is large enough to contain one network packet. So this is not a problem.

The number of packets is not known in advance (as the remote host creates them as it likes); a counter that specifies the order is not needed as they are always *in order*. Basically, you get one call to the receive callback for every packet received. To get an overview over these packets, a network sniffer like wireshark is always interesting.

A wireshark file is attached. My lwip does only get callbacks for packets no. 4, 13, 24, 35, ... Packets no. 14, 25, 36, ... don't generate any callbacks. How can I get the data in these packets? Btw pcb->next and pbuf->next are always 0!

TCP says the network packets may be out of order. There is a sequence number to sort them. Does LWIP take care of this?

TIA

Gustl

Attachment: testsplit.pcap
Description: Binary data


reply via email to

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