The OCS simulator is a Diameter server that accepts connections and responds to every Credit-Control-Request with a Credit-Control-Answer.

This simulator supports either Diameter CCA or Diameter Ro depending on which script is used to start the simulator. The differences between the Diameter Ro variant and Diameter CCA variant are:

  • where credit control AVPs must be located (within a Multiple-Services-Credit-Control for Ro and on the message for CCA)

  • the log file name

  • the database properties file name.

Starting the simulator

Use the following command to start the simulator for Diameter Ro:

./ro-simulator.sh

Use the following command to start the simulator for Diameter CCA:

./dcca-simulator.sh
Note You can use the -i switch to set operations to be traced and written out (to the console in the default logging configuration) at the INFO log level.

Starting the simulator without any switches will cause it to use non-persistent mode with the rates and accounts loaded from default file locations.

Simulator modes

The OCS simulator can be run two different modes:

  1. Non-persistent — Rates and accounts are read from a file at startup and never written back to the filesystem. All account updates are lost when the OCS simulator is stopped.

  2. Persistent — A database is used. Data files must be provided to populate the tables with initial data. Account balances persist across simulator restarts.

Starting the simulator

Use the following commands to start the simulator:

Mode Command

Non-persistent

./dcca-simulator.sh

Persistent

First time, to populate database:

./dcca-simulator.sh -db -r config/rates.xml -a config/accounts.xml

With a populated database:

./dcca-simulator.sh -db

Configuring the database

To control whether the database is started in-process or connected to using a socket, see the dcca-database.properties file. This file contains comments that describe how to start and configure the hsqldb database.

Adding artificial latency

The simulator can be configured to introduce a delay before responding to a request, to better simulate a real online charging system. The delays introduced will be generated to have a normal distribution with the specified mean and standard deviation. As a rule of thumb, the standard deviation should be no more than 1/4 of the mean.

Switch What it sets Default

-l

mean value of the artificially introduced latency, in ms

300

-v

standard deviation of the latency, in ms

50

Setting other options

Switch What it sets

-g

Generates an account for every subscriber in the range(s) specified. Use hyphens to specify ranges, commas to separate them. For example: 021320000-021320999,021420000-021420999 will create 2000 accounts.

-b

Sets the initial balance for accounts created using the -g switch.

-i

Sets all charging operations to be traced and written out (to the console in the default logging configuration) at the INFO log level.

Configuring logging

The default logging configuration is write-abbreviated INFO-level output to the console, and DEBUG-level output to a file named dccasimulator.log. To change this configuration, edit the log4j.properties file in the config directory.

Previous page