Junos Space SDK > Device Simulator Guide

Simulating Different Device Families

By default, the Device Simulator supports devices in the Juniper Networks MX device family. Other device families are also supported in the simulator. These device families are listed in the file /home/admin/dmiSim/conf/setup/common/deviceTypes.txt.

In addition, you can create simulator instances for new device families that are not currently listed in the deviceTypes.txt file.

Simulator Instances for Existing Device Families

To create a simulator instance of a device that is already supported by the simulator:

  1. Find the desired device family type as it is listed in deviceTypes.txt
  2. In the .conf files under the /home/admin/dmiSim/devices folder, replace the current values for devType and devConfig to the new device family value as listed in deviceTypes.txt.

Simulator Instances for New Device Families

To create a simulator instance of a device whose family is not currently supported by the simulator:

    In the /home/admin/dmiSim directory, run the addDeviceFamily script. Its interface is:



    DEVICE_FAMILY_NAME The new device family name to be added to the simulator.
    DEVICE_PLATFORM_NAME The specific platform for the device family to be added to the simulator.

After running addDeviceFamilySdk, a new directory is created under /home/admin/dmiSim/conf/setup for the new device family. Also, the mandatory RPC reply files for the new device family are created with default RPC data entered in each file.

For a better simulation of the device in Junos Space, replace the default RPC reply data in these files with actual responses generated by a real device from the device family. The RPC response files are listed in the Creating Request and Response Elements for Device Config and Type topic. Refer to the description of each file for the specific RPC request call to use to generate the accurate RPC response. For example:

  1. Log into the new device you want to support.
  2. Open a netconf channel by entering:

    junoscript interactive netconf

  3. Copy the RPC request as shown in the topic for that request in this guide, and paste the RPC request code into the netconf channel. For example, for the system-info.xml file, copy and paste <rpc><get-system-information/></rpc>. Copy the resulting RPC response code generated by the real device into the system-info.xml RPC response file.

Support for New show RPCs

New "show" RPCs can be supported in the simulator without making any code changes, by following this procedure:

  1. Create a .xml file under the respective device family directory under dmiSim/conf/setup. If the same RPC reply is applicable to all device families, then place the new file under dmiSim/conf/setup/common. The file name and the RPC name must be identical. For example: For a <get-system-information> RPC, the corresponding response file must be named get-system-information.xml.
  2. Populate the .xml file with a sample RPC response from a real device, using the junoscript procedure described above in the Simulator Instances for New Device Families section.