Is there a delimiter or some way of telling netcat how many bytes to send per packet from a file? Invoking netcat multiple times in a script is not acceptable as I need to send them out as fast as possible.
I have captured UDP packets with binary data into a file using mnc (multicast netcat) and attempt to play them back as follows:
# start program sending multicast packets to 22.214.171.124 12340>
# start mnc to capture packets:
$mnc -l -i eth1 -p 12340 126.96.36.199 >capturefile
... # playback packets using netcat, sending to 188.8.131.52 12345
$netcat -c -w 1 -u -s 10.20.30.40 184.108.40.206 12345 <capturefile
capturefile appears to have the packets I want to send.
When I play back with netcat the packets are concatenated. UDP packet size is 208 during packet capture and wireshark shows 250 as packet size, I assume that includes ethernet bytes. On replay, wireshark shows packet size of 1016.