sonata-nfv / tng-industrial-pilot

5GTANGO Smart Manufacturing Pilot
13 stars 17 forks source link

Cannot identify which machine sends the data if we run >1 NS2 connected to NS1 #132

Closed mpeuster closed 5 years ago

mpeuster commented 5 years ago

Notices this today:

If I run 2 instances of NS2 connected to NS1, NS1 receives MQTT messages like these from both NS2 instances:

WIMMS/EM63/DATE 20190613
WIMMS/EM63/TIME 12:34:54
WIMMS/EM63/@ActSimPara1 5
WIMMS/EM63/@ActSimPara2   1.3324
WIMMS/EM63/ActCntCyc 588
WIMMS/EM63/ActCntPrt 587

This does not allow to distinguish which machine sends which message.

So it will make sense to include the source machine name (whatever it is) into the topic, like:

WIMMS/EM63/ActCntPrt/<machine_name>

or

WIMMS/EM63/<machine_name>/ActCntPrt

Using subscribe commands with different wildcards, NS1 can then easily filter by machine etc. e.g.: subscribe WIMMS/EM63/ActTimCyc/+ gets a single metric for all machines. or subscribe WIMMS/EM63/+/m1 gets all metrics for machine m1 etc. etc.

Not sure if I will have time to work on this before the NetSoft demo. Let's see.

mmiiot commented 5 years ago

WIMMS is the , it is a placeholder. WIMMS has to be replaced by the company wide unique machine identifier.

You can subscribe e.g. from machine simulator: WIMMS1/EM63/ActCntPrt/ or real physical machine: IMM2/EM63/ActCntPrt/

or data from additional iot sensors integrated in IMM2: IMM2/sensorX/tempY

mpeuster commented 5 years ago

Ahhhhhhhh ... got it! Perfect.

Than I can make it configurable in the Docker container of the VNF and everything is fine. Many thanks for the clarification.

I'll adapt the Prometheus Exporter VNF as well so that the machine name is correctly translated into a label for the recorded data. That is not the case right now. Then we should be able to easily visualize data for individual machines.

mmiiot commented 5 years ago

Question: Can we set it via FMP before instantiation (during machine adding process) of NS2 and can we manipulate it later via FMP?

mpeuster commented 5 years ago

Puh hard to say for the real SP. We should somehow. I am adding an environment variable MACHINE_NAME to the Docker container (the same as we did for other config options already).

I am focusing on the emulator version of the pilot (NetSoft) right now, but we should be able to set this variable in the K8s case as well.