2
1
I use Netcat once in a while to copy files or disk images over the network. While it does the job I always felt like it was always on the slow sluggy side regardless of using ssh, no ssh, compression or no compression.
I have started testing out udpcast (http://www.udpcast.linux.lu/cmd.html) and it seems to be at least 5 times (or more) faster. Udpcast with compressed pipes are sometimes many times faster than netcat with no compressed pipes.Compression with Nc is generally slows down over my local network so I generally avoid it. Because my network is generally running at 1gbs
Here are couple examples without ssh and no compression I use
dd if=somedisk |pv|nc -l -p 9999
nc networkaddr 9999|pv >./disk.img
udp-sender --full-duplex --file /dev/somedisk
udp-receiver --file ./disk.img
These are some basic examples I use. Naturally I use compressed pipes too. In all cases udpcast will out perform min 5x speeds Netcat and I am wondering about why that is the case.
I am even inclined to think that Udpcast with pipes is good compliment for network file transfer.
Here udpcast with tar and untar pipe for 17.5 GiB over the network
real 9m26.186s
user 0m1.247s
sys 0m23.836s
And here is cp over Samba from Linux to Windows
real 9m17.729s
user 0m0.311s
sys 0m11.044s
Is it possible to catch the Udpcast performance with Netcat?
The reason I am asking sometimes some distro might now offer Udpcast.
2Part is the reason is that UDP has significantly less overhead than TCP. So UDP will always be faster on a decent network. ON a network which looses frames of needs frames fragmented into smaller datagrams TCP will rule (you need either TCP or do it yourself in userspace). – Hennes – 2013-12-23T17:45:53.053