2
votes

My FPGA is continuously sending UDP packets on network using 10/100/1000 Mbps Ethernet. I am using Wireshark to capture the packets directly to a .pcap file & then extract & display UDP data in Matlab GUI. FPGA kit is connected to a 1 Gbps switch and then to PC.

Initially i tried using Matlab's built in UDP object instead of .pcap files but using that i was facing packet drop issue at high BW (>1 Mbps) and was only able to achieve drop free reception for very low BW around 110 kbps. That was not acceptable for my case. A link to the problem is given below:

Incorrect UDP data reception in Matlab

Based on these problems i moved towards using Wireshark. I use wireshark to create multiple .pcap files (1 Mb) of UDP data and then start extracting UDP data from these files in Matlab. A link also guided towards this approach i.e. writing packets directly to file(High speed UDP receiver in MATLAB ).

The problem is that i am getting some packets dropped at random intervals. The problem is very frequent when operating at High Ethernet BW - 220 Mbps. So i reduced my BW to around <50 Mbps still i get some packet drops. I tried using some of the tips provided by Wireshark (http://wiki.wireshark.org/Performance) for optimizing performance but still the issue persists.

This seems to be issue with memory as far as i have understood.

Some details about the design:

UDP Data Size = 64 Bytes
Ethernet Frame Size = 110 Bytes 
PCAP File Size = 1 Mb
Wireshark Buffer Size = 1 Gb

Please guide me towards a possible solution.

Regards,

Sameed

2
Some packets could be fragmented in pcap file. This because pcap file stores not packets, it stores frames.Slava Bacherikov
Ive turned off the fragmentation on these UDP packets. Ive checked by opening the pcap file in Wireshark the packets are indeed missing. Not fragmented.SameedSohail92
Try also dump packets with tcpdump -n -s 0 -i INTERFACE -w file.pcap. Also see this.Slava Bacherikov
Also to add, in my case Wireshark doesnt show packet dropped??? I always get 100 percent packets probably because i have a buffer size of 1000MB & i write to a file of 1MB.SameedSohail92

2 Answers

1
votes

I would suggest a larger file size may provide efficiency savings, something like 64MB. Also agree with Slava's suggestion - tcpdump is more efficient/robust than the wireshark GUI.

-1
votes

Try writing to a ram disk

[Padding]