PseudoThing is KnowThings’s pre-release prototype bringing our fancy math algorithms to IoT. We are working on making virtual devices that you can use to build your software before physical devices are ready, test your software at scale, and predict the interactions of real devices before field testing.
Theoretically, PseudoThing should work on any platform with Java 8. We’ve currently tested:
Oracle or Open JDK 8. We suggest using Oracle JDK.
Ensure that JDK is installed on the system and path is set to java executable. Unzip the PseudoThing.zip into a directory and you are done.
PseudoThing creates a simulation using a 3 step process.
Generate a PCAP file with the transactions that you want (we use Wireshark).
Filter out non device traffic using this code:
(ip.addr== xx tcp.port==xx)
In most use cases, you have a server and a device. Only one of these things is instantiating a communication, the other is listening for a communication. Use the IP address and TCP port of the thing that is listening, whether it is a server or a device is irrelevant.
If you are using Wireshark, make sure you save your capture as a PCAP file as that is the only format we support. If you get a pcapng file, you can Save As .pcap file format and it should work.
The fun part! Here you will create your first AVD (adaptive virtual device) Create your PseudoThing by running this command:
Unix, Linux or Mac:
Windows Operating Systems:
Run the command inside the bin directory inside the PseudoThing directory. If you want to run it anywhere else, set the classpath according to the PseudoThing jar file and set the path per environment variable as needed.
modelAVD supports the following arguments:
Displays this help text.
Specifies the path of the pcap file to create a model from.
Name of the model, referred as adaptive virtual device (AVD).
IP Address of system under test (SUT)
Port number of the system under test (SUT)
./modelAVD.bat -f C:\Users\MyIoT\PseudoThing\bin\exampleLocal.pcap -a MyFirstAVD -i 192.168.0.0 -p 3000
./modelAVD.bat --pcapFile=exampleLocal.pcap --avdName=MyFirstAVD --ip=172.16.0.0 --port=3000
./modelAVD.sh --pcapFile=/home/myIoT/PseudoThing/bin/exampleLocal.pcap --avdName=llAVD2 --ip=000.000.000.000 --port=3000
./modelAVD.sh -f /home/myIoT/PseudoThing/bin/exampleLocal.pcap -a lsAVD1 -i 000.000.000.000 -p 3000
You’ll get the following message if everything was successful:
Adaptive Virtual Device created: MyFirstAVD
Once you have your PseudoThing AVD model, you can play it back and have it stand in for the device you recorded.
On Mac, Linux, and Linux Operating Systems use:
On Windows Operating Systems:
It also must be run from the bin directory of your PseudoThing directory.
runAVD.sh takes the following parameters:
runAVD supports the following arguments:
Displays this help text.
C:\Users\MyIoT\PseudoThing\bin>runAVD.bat -a MyTestAVD -i 172.16.0.0 -p 3000
C:\Users\MyIoT\PseudoThing\bin>runAVD.bat --avdName=MyTestAVD --ip=172.16.0.0 --port=3000
runAVD.sh -a MyTestAVD -i 172.16.0.0 -p 3000
runAVD.sh --avdName=MyTestAVD --ip=172.16.0.0 --port=3000
A requestor device is a device that initiates contact with the software. It is awake and keeps a port open while it is requesting information and getting a response back.
To run the AVD as a requester/client device:
A responder client device is a device that respondes to a request from software. It is alseep and awakens when it is pinged.Windows Example
runAVD.bat -a MyTestAVD -r -s 30001
runAVD.bat --avdName=MyTestAVD --responder --respPort=30001Linux or Mac Example
./runAVD.sh -a MyTestAVD -r -s 30001