Modeling External Systems

An external system in Modeler lets you integrate external code (such as a model from another simulator) into a node model. In Modeler, an esys module represents the external system. When developing an external system, you must be sure that the external code will understand the input from the ESD’s esys interfaces and can also send data to those esys interfaces.

The following sections give techniques for using esys interfaces with Riverbed models and simulations:

Using Process Models as an External System-to-Modeler Interface

Each esys module in the Node Editor can specify an ESD model, which you build in the External System Definition Editor. The esys module’s process model is what actually controls how and when data is sent to and read from the external system. A variety of Kernel Procedures let you control data transmission as well as data transformation. For more information on placing and retrieving data from an external system’s esys interfaces, see “External System Interface Resources” on page 179.

Although the data transformations you will need depend on your specific circumstances, often you will need to transform objects (such as packets) to a form usable in the external system’s domain. Conversely, you will then need to take values received from the external system and convert them back into objects that Modeler can use. There are general mechanisms that can assist you with these conversions. You can apply value vectors, which are essentially arrays with a variable number of elements, directly to esys interfaces. For esys interfaces of type “bit” and “stdlogic”, you also can call Kernel Procedures that automatically convert a scalar value into its bit representation.

Passing Data to Esys Interfaces

An esys interface acts as a communication channel between Modeler and the external system. An esys interface can contain one value at any given time; when you specify a new value for the esys interface, the old one is replaced. If, however, you have set up the external system to accommodate input from vector interfaces, you can use them to send groups of data together as one unit.

Each esys interface has a “type” attribute that you can use to set the data type of the values that the esys interface can hold. Each esys interface can handle only one data type. Therefore, when the external system’s process model places a value on the esys interface, that value must be of the correct type. You can set esys interfaces to most of the standard C/C++ data types.

You can use the KPs of the “External System Package” (Esys) to have a process model write a value to an esys interface. When one of these KPs is invoked, it writes the value to the esys interface and notifies the external system.

Retrieving Data from Esys Interfaces

Like Modeler, the external system can also place values onto esys interfaces. When it does, it places an interrupt in Modeler’s event list announcing the arrival of the new value. As you build your esys module, you must decide how the associated process model handles data arrival interrupts. Modeler itself has no way of knowing the meaning or context of data that arrives from an external simulation. As the modeler, you must interpret the incoming data and convert it to internal variables or data structures (such as packets and ICIs).

The KPs of the “External System Package” (Esys) include procedures to read data from esys interfaces. You can either copy the value on an esys interface to a variable or, if the incoming data is on a vector interface, copy the entire contents of the vector interface to an array or a value vector.

Placing Probes on Esys Interfaces

You can use node statistic probes to track the value of esys interfaces over time. These statistics can provide you with information about the state of the other simulator as it relates to Modeler, or they can present you with information on esys interface values throughout the simulation.

本站文档由 北京智网畅联科技有限公司 整理、翻译并提供 · Documentation compiled and provided by Beijing ZNetLink Technology Co., Ltd.

交流群 · QQ Group:OPNET/智网妙算网络仿真交流群(群号 486383494)

原文档 © 2017 Riverbed Technology · 本站为公益翻译,由 AI 辅助完成,请仔细甄别

Original documentation © 2017 Riverbed Technology. Community translation, AI-assisted. Contact: jiazequn@znetlink.com