<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title></title>
</head>
<body>
<p style="margin: 0px;">Hello,<br/>
<br/>
I would like to ask a question to the mailing list; I apologise if this has been<br/>
answered before I did search the archive but didn't see anything relating to my<br/>
question.<br/>
<br/>
Firstly let me explain what I am trying to achieve...<br/>
<br/>
<br/>
I am writing a Windows application that is targeting Windows 7 64bit<br/>
multiprocessor machines. The basic idea is as follows.... I have a piece of<br/>
hardware (FPGA based) that is delivering layer II packets over a Gbit network;<br/>
each packet is NO more than 1500 bytes. The data rate pushed out of the FPGA is<br/>
typically 50Mbytes per sec or lower.<br/>
<br/>
The purpose of the Windows application is the capture each packet off the<br/>
network, do some quick data integrity checks on the payload and dump it to disk<br/>
ASAP. The FPGA has a 12bit packet counter (0-4095); this count is placed inside<br/>
our bespoke payload so that the data can be reconstituted on the PC. During the<br/>
data integrity checks I check the packet count to ensure the packets are in<br/>
order before I begin reconstituting the data; I also sanity check the timestamp<br/>
of each packet to make sure it too is increasing.<br/>
<br/>
<br/>
Here is my question/problem.....<br/>
On multicore 64 bit machines (with a 64 bit OS) can the packets come out of<br/>
order?<br/>
My justification for the question is as follows. During debug of the windows<br/>
application I report the timestamp and pkt number of each packet. Whilst it<br/>
appears that I do not drop packets I do see packets numbers come out of order. <br/>
Here is a debug trace.<br/>
<br/>
Timestamp Pkt #<br/>
15:38:40:415412 2222<br/>
15:38:40:415413 2223<br/>
15:38:40:415424 2224<br/>
15:38:40:415425 2225<br/>
15:38:40:415426 2226<br/>
15:38:40:415428 2227<br/>
15:38:40:415428 Found Packet: 2236 Expecting Packet: 2228<br/>
15:38:40:415430 2237<br/>
15:38:40:415431 2238<br/>
15:38:40:415433 2239<br/>
15:38:40:415433 Found Packet: 2228 Expecting Packet: 2240<br/>
15:38:40:415434 2229<br/>
15:38:40:415445 2230<br/>
15:38:40:415447 2231<br/>
15:38:40:415447 2232<br/>
15:38:40:415448 2233<br/>
15:38:40:415451 2234<br/>
15:38:40:415452 2235<br/>
15:38:40:415453 Found Packet: 2240 Expecting Packet: 2236<br/>
15:38:40:415454 2241<br/>
15:38:40:415456 2242<br/>
15:38:40:415457 2243<br/>
15:38:40:415467 2244<br/>
15:38:40:415469 2245<br/>
15:38:40:415471 2246<br/>
<br/>
If you follow the trace you can see that I don't drop packets but they are<br/>
indeed out of order. <br/>
I must stress that this situation is NOT frequent but is exacerbated by high<br/>
data rates or heavy disk usage.<br/>
I have spent some time eliminating all the obvious… debug output buffering, <br/>
FPGA output and disk writes all of which have drawn a blank.<br/>
<br/>
I am using WinPCAP in the following manner:<br/>
<br/>
pcap_open:<br/>
snaplen = 1500;<br/>
flags =<br/>
PCAP_OPENFLAG_PROMISCUOUS|PCAP_OPENFLAG_NOCAPTURE_LOCAL|PCAP_OPENFLAG_MAX_RESPONSIVENESS;<br/>
read_timeout = 0;<br/>
<br/>
pcap_setbuff:<br/>
100Mb<br/>
<br/>
pcap_setmintocopy:<br/>
0<br/>
<br/>
<br/>
Thank you in advance<br/>
<br/>
<br/>
<br/>
Neil Powell</p>
</body>
</html>