1.Introduction #

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.

2.Known Platforms #

Theoretically, PseudoThing should work on any platform with Java 8. We’ve currently tested:

  • Linux
  • Mac
  • Raspbian
  • Windows 7 and Windows 10

3.Prerequisites #

Oracle or Open JDK 8. We suggest using Oracle JDK.

4.Install #

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.

5.Use #

Creating a simulation is a three-step process:

  1. Capture
  2. Model
  3. Playback

5.1.Step 1 -- Capture #

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’re using Wireshark, be sure to save your capture as a PCAP file. That format is the only one we support. If you inadvertently save the capture in the pcapng file format, you can do a Save As to convert it to the pcap file format and it should work.

5.2.Step 2 -- Model #

The fun part! Here you will create your first AVD (adaptive virtual device).

On Unix, Linux, or Mac operating systems use:


On Windows operating systems use:


Run the command inside the bin directory inside the PseudoThing directory.

Note: 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:

   -h, --help
          Displays this help text.
   -f <PCAP file>, --pcapFile=<PCAP file>
          The path of the pcap file to create a model from.
   -a <AVD Name>, --avdName=<AVD Name>
          Name of the model, referred as adaptive virtual device (AVD). 
   -i <Server IP Address>, --ip=<Server IP Address>
          IP address of the system under test (SUT)
   -p <Server Port>, --port=<Server Port>
          Port number of the system under test (SUT)

Windows Examples

modelAVD.bat -f C:\Users\MyIoT\PseudoThing\bin\exampleLocal.pcap -a MyFirstAVD -i -p 3000

modelAVD.bat --pcapFile=exampleLocal.pcap --avdName=MyFirstAVD --ip= --port=3000


Mac and Linux Examples

./modelAVD.sh --pcapFile=/home/myIoT/PseudoThing/bin/exampleLocal.pcap --avdName=llAVD2 --ip= --port=3000

./modelAVD.sh -f /home/myIoT/PseudoThing/bin/exampleLocal.pcap -a lsAVD1 -i -p 3000

You’ll get the following message if everything was successful:

Adaptive Virtual Device created: MyFirstAVD

5.3.Step 3 -- Playback #

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 use:


It also must be run from the bin directory of your PseudoThing directory.

runAVD.sh takes the following parameters:

runAVD.sh <AVD name> <Server IP Address> <Server Port>


runAVD supports the following arguments:

   -h, --help
          Displays this help text.
   -a <AVD Name>, --avdName=<AVD Name>
          Name of the AVD to playback
   -i <Server IP Address>, --ip=<Server IP Address>
          IP Address of system under test (SUT)
   -p <Server Port>, --port=<Server Port>
          Port number of the SUT to which this AVD would connect
   -r, --responder
          Run this AVD as responder. SUT IP and Port are NOT REQUIRED for 
          this mode.
   -s <Responder Port>, --respPort=<Responder Port>
          Port number at which the AVD responder would run, and "serve" 
          the responses from. Only used if running as responder, but is 
          OPTIONAL. If not provided, the default port used is 8111.

Windows Examples

C:\Users\MyIoT\PseudoThing\bin>runAVD.bat -a MyTestAVD -i -p 3000 

C:\Users\MyIoT\PseudoThing\bin>runAVD.bat --avdName=MyTestAVD --ip= --port=3000


Mac and Linux Examples

runAVD.sh -a MyTestAVD -i -p 3000

runAVD.sh --avdName=MyTestAVD --ip= --port=3000

6.Run AVD as a Requester Client Device #

A requester 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 device:

runAVD.sh -a <AVD name> -i <Server IP Address> -p <Server Port>

runAVD.sh --avdName=<AVD name> --ip=<Server IP Address> --port=<Server Port>

7.Run AVD as a Responder Client Device #

A responder device is a device that responds to a request from software. It is asleep and awakens when it is pinged.

To run the AVD as a responder device:


Windows Example
runAVD.bat -a <AVD name> -r -s <Responder Port>

runAVD.bat -a MyTestAVD -r -s 30001

runAVD.bat --avdName=<AVD name> --responder --respPort=<Responder Port>

runAVD.bat --avdName=MyTestAVD --responder --respPort=30001


Linux or Mac Example

runAVD.sh -a <AVD name> -r -s <Responder Port>

./runAVD.sh -a MyTestAVD -r -s 30001

runAVD.sh --avdName=<AVD name> --responder --respPort=<Responder Port>