[Winpcap-users] is there any TCP packet order?

Global Cool a1thearchitect at gmail.com
Tue Oct 23 18:14:35 GMT 2007


I am reading tcp packets from a tcp connection using the following code:

//start the capture
     while((res = pcap_next_ex( fp, &header, &pkt_data)) >= 0)
    {

        if(res == 0)
        /* Timeout elapsed */
        continue;
        /* Print the packet */
        // 0 to 53 character seems to have packet information not the data
        for (i=54; i < header->caplen ; i++)
        {
                fprintf(dumpfile,"%c", pkt_data[i]);
        }
        fflush(dumpfile);
    }


///

every thing works OK. but it seems that this code sometime receive packets
in different order. I mean two packet got swap! (1st packet come second and
the 2nd packet come first).
but when i am running this code, at the same time i am running another
software (smartSniff) which can print the packet data in correct order..

So i am wondering is there any way to determine the correct packet order
from tcp header information?

Thanks.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.winpcap.org/pipermail/winpcap-users/attachments/20071023/91fce8db/attachment.htm


More information about the Winpcap-users mailing list