LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

transfering data with TCP

I send data over TCP in LAN and I noticed strange observations. When I transfer 31kB of data it reaches destinatiom in about 30-35ms, but when I send over 32kB, for example 33kB, delay is about 90-100ms. Could anybody explain it??
0 Kudos
Message 1 of 10
(3,965 Views)
You say that "it reaches the destination in about 30-35 mSec", but how are you measuring the time?

If you are measuring the time it takes the TCP WRITE function to complete, then you've just discovered your buffer size.
Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


LinkedIn

Blog for (mostly LabVIEW) programmers: Tips And Tricks

0 Kudos
Message 2 of 10
(3,965 Views)
Networking is a VERY complicated beast (and I'm no expert). I do know that there are many protocol and hardware layer settings that are used to define packet and frame sizes as well as a slew of other things. Some of these are under the control of your OS (you can find them in the Windows registery), and others exist on the networking hardware and other computers on the LAN/Internet. It may simply be that your larger messages are being split into smaller packets and sent seperately.

That answer may not help speed up your packet times, but it hopefully provides some insight into the problem.

Best of luck,

-Jim
0 Kudos
Message 3 of 10
(3,965 Views)
is there simple way to extend that buffer size or it can't be extended?
0 Kudos
Message 4 of 10
(3,965 Views)
The buffer I speak of is somewhere in your OS - maybe you could change it, maybe not.

But what I'm saying is that it doesn't matter. My hunch is that if you time the TCP WRITE function, you are NOT timing the actual transmission - you are timing how long it takes to transfer the data from your LabVIEW source into the OS buffer. If it's more than 32k, then part of that transfer has to wait for the buffer to empty.
The fact that the data has been transferred out of LabVIEW does NOT mean it's been sent out the wire.
Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


LinkedIn

Blog for (mostly LabVIEW) programmers: Tips And Tricks

0 Kudos
Message 5 of 10
(3,965 Views)
Hi!

Yes! That's right!
I have done with small test and have found, that data, which was transferred over tcp by LabVIEW was splitted into 32K portions! I not fully understood this, but as result transferring 5MB data from one computer to another and back (over Gigabit (!) etehrnet) takes more than 3 seconds! The same situation occured in VI server.
See attachment with charts and screenshots.

With best regards...
0 Kudos
Message 6 of 10
(3,965 Views)
i'm having exactly the same problem. i'd really appreciate it if you are willing to share the dll file and the modified vi's? thanks!
0 Kudos
Message 7 of 10
(3,965 Views)
You can trying to use attached tcp_send.vi instead of original NI TCP Write. This vi seems to be free from "32K" problem.
Message 8 of 10
(3,965 Views)
thanks! tcp_send works perfect. God bless you!
0 Kudos
Message 9 of 10
(3,965 Views)
Gesundheit!
Jason Rolfe
0 Kudos
Message 10 of 10
(3,965 Views)