TCP-IN node send data internally

[{"id":"19d8c6fadea93ef9","type":"tab","label":"tcp-in","disabled":false,"info":"","env":[]},{"id":"1787daf384b3888d","type":"tcp in","z":"19d8c6fadea93ef9","name":"","server":"server","host":"","port":"28001","datamode":"stream","datatype":"buffer","newline":"","topic":"","trim":false,"base64":false,"tls":"","x":240,"y":160,"wires":[["741ee8031febd4d5","ace10560e9081352"]]},{"id":"ace10560e9081352","type":"debug","z":"19d8c6fadea93ef9","name":"debug 67","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":480,"y":140,"wires":[]},{"id":"566014e0c80e8a46","type":"tcp out","z":"19d8c6fadea93ef9","name":"","host":"","port":"","beserver":"reply","base64":true,"end":false,"tls":"","x":510,"y":260,"wires":[]},{"id":"741ee8031febd4d5","type":"function","z":"19d8c6fadea93ef9","name":"function 21","func":"","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":330,"y":240,"wires":[["566014e0c80e8a46"]]},{"id":"ccaa2e6ab665534b","type":"debug","z":"19d8c6fadea93ef9","name":"debug 68","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":520,"y":380,"wires":[]},{"id":"592dc0b3b52e8c6d","type":"tcp in","z":"19d8c6fadea93ef9","name":"","server":"client","host":"localhost","port":"28001","datamode":"stream","datatype":"buffer","newline":"","topic":"","trim":false,"base64":false,"tls":"","x":250,"y":360,"wires":[["ccaa2e6ab665534b"]]}]

There are two nodes, First is TCP-IN server, listen 28001, and the second node connected to it.
And the function21 node send nothing.
But the second node will repeatedly received those [72,67,0,202,...] data. But as above image shows, The Tcp:28001 node and following function node send noting.

So where these [72,67,0,202....] comes from?

something is connecting to that end point and sending data. I tried your flow and only got data by injecting data into the endpoint.

For completeness (and other readers) - this post is a continuation of this issue raised on the GitHub repository

Test 1:

If you change all TCP nodes ports to something else e.g 54347, does this still happen?


Test 2:

Open wireshark or TCPdump (or similar) look for TCP data on port 28001 - what is it's source. If you stop node-red, do you still see traffic on port 28001


Test 3:

If you delete everything except the bottom 2 nodes (keep the tcp-in & debug nodes) do you still see this?


Additional info:

Can you tell us what IP addresses this node red server has?

Can you ping iot.mapchant.com from the same machine that this flow is running on (where node-red is installed) - what IP do you get in the response?

Do you have any hidden flows? Try searching your node-red (ctrl-f - look for 28001)

I think what he is asking is why is the data being sent even though the function node is blank.

Yes I know & that is why I asked for the 3 tests and additional info. I am trying to ascertain where the data is coming from. I have my suspicions but need the op to reveal more information.

I think he knows where the data is coming from but he expects the empty function to somehow erase the data.

Really?

The function node being empty literally does nothing.

If you look at the flow, the debug message in this image is ACTUALLY coming from the top TCP-IN (named debug 67) (ignore the ops arrow on the screenshot and inspect the debug msg header).

In the issue the OP did not state he knew where the data was coming from (I did ask).

Tbh, I may well be misreading the intent but to fully understand what is going on we need to understand where the data is coming from.

For example, the fact data is travelling from a tcp-in to a debug is 100% normal. If the op IS sending (or has something like a device or application producing data to port 28001, then we already know why he's getting data)

Have a read through the issue and responses, I suspect there is a misunderstanding on both sides - but ultimately, the OP providing more info will reveal intent, architecture and the cause.

For test1,

I randomly select another port, and create another flow, as follows(For simplicity, This time I use localhost:30111 to connect to the TCP Server):

As it shows, this still happen.
And if I deactive the Server node, and the client node also break connection.

So the new port 30111 surly was created by node red TCP-IN node.

Also tried other port, all of them respond with these HeartBeat-like data.

And I think Test2 may be no use , because the port is nolonger available if I deactive the server node. I will test it later for sure.

I will do test3 in another new nodered environment.

For Test3, In another node red env, the tcp node works fine. These data not happen.

So I guess may be in other flows, there would be a node that will respond to all of the TCP connection with those data.

And after some check, there is a tcp-out NODE in a flow, and it will be activated timerly.

It's wierd that it repond to all tcp node.
After remove this tcp-out node, all tcp server node works fine as it configs。

Thanks very much to all.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.