필터 지우기
필터 지우기

Most efficient UDP receive method?

조회 수: 2 (최근 30일)
Benjamin Bloomfield
Benjamin Bloomfield 2019년 5월 2일
I am trying to received radar video (UDP multicast) directly into MATLAB. I initially tried utilising the udp receive functionality within the instrument control toolbox combined with an external C# program that twisted the multicast packets into broadcast (since the instrument control toolbox does not support multicast). This dropped large amounts of packets at data rates over ~10mbit/s.
I next tried utilising a java multicast socket using the script below:
function [Data] = MatlabMulticastCapture(PacketsToCapture,PacketLength,IP,Port)
%Load java library
import java.io.*
import java.net.*
%Define output array for speed and reduced memory useage
Data=zeros(PacketsToCapture,PacketLength,'int8');
%Initiate socket
socket=java.net.MulticastSocket(Port);
%Increase receive buffer s
socket.setReceiveBufferSize(25*1024^2);
socket=java.net.MulticastSocket(Port);
socket.joinGroup(java.net.InetAddress.getByName(IP));
socket.setReuseAddress(1);
packet=java.net.DatagramPacket(zeros(1,PacketLength,'int8'),PacketLength);
for ii=1:PacketsToCapture
socket.receive(packet);
Data(ii,1:PacketLength)=packet.getData;
end
socket.close
end
This works and does not drop any packets to a data rate of approximately 50mbits/s and does not require any external programs so is a big step forward.
I need to receive data at a rate of 110mbit/s without dropping packets (this is perfectly achievable in Wireshark so is an implementation issue rather than an underlying network issue).
Does anyone have any suggestions either for how to improve performance of the java UDP receive or any alternative methods which may prove more efficient. Each packet contains 1440 bytes of data and they are sent at a constant rate.
Many thanks.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Web Services에 대해 자세히 알아보기

제품


릴리스

R2018b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by