Why is Udcast is many times faster than Netcat?

kerrreem

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.

LawrenceC

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.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Why is multiplied many times faster than taking the square root?

From Dev

Why @autoreleasepool is 6 times faster than NSAutoreleasePool?

From Dev

Why is Matlab 11 times faster than C++

From Dev

Why is the second execution of this combinator 10 times faster than the first?

From Dev

MSSQL: Why is this index 10 times faster than the other one?

From Dev

Why is VC++ matrix times vector faster with openMP than async?

From Dev

Why is setting a field many times slower than getting a field?

From Java

Why is [] faster than list()?

From Dev

Why ReferenceEquals() is faster than ==

From Dev

Why is A* faster than Dijkstra

From Dev

why < is much faster than !=?

From Java

Why is String.strip() 5 times faster than String.trim() for blank string In Java 11

From Dev

Why simple Scala tailrec loop for fibonacci calculation is faster in 3x times than Java loop?

From Dev

Plain C++ Code 10 times faster than inline assembler. Why?

From Dev

Why is String.strip() 5 times faster than String.trim() for blank string In Java 11

From Dev

Why is Arrays.equals(char[], char[]) 8 times faster than all the other versions?

From Dev

Why is Arrays.copyOf 2 times faster than System.arraycopy for small arrays?

From Dev

Why is “/dev/rdisk” about 20 times faster than “/dev/disk” in Mac OS X

From Dev

Why is using && 75 times faster than if...fi and how to make code clearer

From Dev

Is appending the html faster than pasting it multiple times?

From Dev

Why is tail file | tr (pipeline) faster than sed or perl with many lines?

From Dev

Why is "if not (a and b)" faster than "if not a or not b"?

From Java

Why is memmove faster than memcpy?

From Dev

Why is epoll faster than select?

From Dev

Why is Emit faster than Reflection

From Dev

Why is Crystal faster than Ruby?

From Dev

Why `try ... except` is faster than `if`?

From Dev

Why is ''.join() faster than += in Python?

From Dev

Why is ''.join() faster than += in Python?

Related Related

  1. 1

    Why is multiplied many times faster than taking the square root?

  2. 2

    Why @autoreleasepool is 6 times faster than NSAutoreleasePool?

  3. 3

    Why is Matlab 11 times faster than C++

  4. 4

    Why is the second execution of this combinator 10 times faster than the first?

  5. 5

    MSSQL: Why is this index 10 times faster than the other one?

  6. 6

    Why is VC++ matrix times vector faster with openMP than async?

  7. 7

    Why is setting a field many times slower than getting a field?

  8. 8

    Why is [] faster than list()?

  9. 9

    Why ReferenceEquals() is faster than ==

  10. 10

    Why is A* faster than Dijkstra

  11. 11

    why < is much faster than !=?

  12. 12

    Why is String.strip() 5 times faster than String.trim() for blank string In Java 11

  13. 13

    Why simple Scala tailrec loop for fibonacci calculation is faster in 3x times than Java loop?

  14. 14

    Plain C++ Code 10 times faster than inline assembler. Why?

  15. 15

    Why is String.strip() 5 times faster than String.trim() for blank string In Java 11

  16. 16

    Why is Arrays.equals(char[], char[]) 8 times faster than all the other versions?

  17. 17

    Why is Arrays.copyOf 2 times faster than System.arraycopy for small arrays?

  18. 18

    Why is “/dev/rdisk” about 20 times faster than “/dev/disk” in Mac OS X

  19. 19

    Why is using && 75 times faster than if...fi and how to make code clearer

  20. 20

    Is appending the html faster than pasting it multiple times?

  21. 21

    Why is tail file | tr (pipeline) faster than sed or perl with many lines?

  22. 22

    Why is "if not (a and b)" faster than "if not a or not b"?

  23. 23

    Why is memmove faster than memcpy?

  24. 24

    Why is epoll faster than select?

  25. 25

    Why is Emit faster than Reflection

  26. 26

    Why is Crystal faster than Ruby?

  27. 27

    Why `try ... except` is faster than `if`?

  28. 28

    Why is ''.join() faster than += in Python?

  29. 29

    Why is ''.join() faster than += in Python?

HotTag

Archive