Why is Udcast is many times faster than Netcat?
Solution 1:
nc
by default uses TCP.
TCP starts with a low "window size" and gains speed during a connection as the maximum window size is determined to be larger. In addition, TCP sends extra traffic to maintain connections, i.e. ACK packets. This is necessary to support the notion of a "connection" and reliable, ordered delivery.
UDP doesn't support connections or reliable delivery so none of that extra baggage exists and thus it is faster.
I have not played with udpcast
much but if it doesn't have any error detection mechanisms then you risk not having a good copy of what you transmitted if your network decides to drop a packet.
nc
has a -u
option IIRC to send/receive using UDP instead of TCP.