0

I am streaming data from 50 devices on one network (one single external IP address) over to a Network load balancer on GCP (Google Cloud Platform) which then distributes the traffic to a group of Node.js TCP socket servers (using net module) that process the data.

Each device sends about 200 kilobits of data per second as a single message, and on the server end the data gets segmented into a stream of buffers like:

[Buffer size 1400]
[Buffer size 1400] 
[Buffer size 525]
[...]

Since I am streaming from 50 separate devices, would the data become entangled and out of order since to the load balancer all the data are coming from a single external IP address?

Would something like this happen?

[Buffer size 1400 with data from device A] 
[Buffer size 1400 with data from device B] 
[Buffer size 1400 with data from device A and B]
[...]

If something like this would happen what can I do to still parse the data from each of the 50 devices even though they are all sent from the same network?

I apologize if my question is stupid because I might have missed something fundamental about how TCP/IP works, but I haven't been able to find an answer to this after hours of searching.

Dave2e
  • 22,192
  • 18
  • 42
  • 50
zsedcx
  • 15
  • 1
  • 5
  • 2
    Your 50 devices each set up one TCP connection, so one TCP stream only carries data for one device, unless you are doing something odd somwhere. (And the GCP load balancer does not merge TCP connections). – nos Nov 05 '18 at 09:08
  • Hey nos, thanks for your response, that really clears up things for me! – zsedcx Nov 06 '18 at 19:17

0 Answers0