Statistic Wire Applications

Because statistic wires are capable of transferring arbitrary values under control of user-defined processes, they can be used for a range of applications requiring communication between modules in the same node.

Two common ways of using statistic wires are described in this section:

Using Statistic Wires for Dynamic Monitoring

One of the most common applications of statistic wires is to provide user-defined processes with the ability to sense the state of other modules within the same node. This can be a useful tool for developing adaptive models in which decisions to take particular actions are dependent upon dynamic operating conditions of the surrounding node.

Statistic wires are particularly well-suited to the application of dynamically monitoring other modules due to their ability to provide active notification of changes. This improves efficiency relative to a polling strategy, whereby a monitoring process periodically examines an external condition to determine whether to do an action. In addition, accuracy is improved, because the process can be notified immediately when a condition has changed. Finally, by configuring a statistic wire’s triggers, a monitoring process can be alerted to external changes only when appropriate.

For modules other than processors or queues, statistic wires provide the only means of monitoring activity during the simulation to feed past and present metrics back into the determination of future behavior. For example, by using triggers, “alarms” can be generated for predefined module statistics when they reach particular thresholds. This is commonly done for statistics such as the number of packets held in a queue, the throughput of a receiver channel, or (in the Wireless functionality) the signal-to-noise ratio of a radio receiver.

Using Statistic Wires as Semaphores

Due to the simplicity of the statistic interface from the perspective of processes that use them, statistic wires are commonly used to implement low-level signalling mechanisms between processes in different modules. The term semaphore is used to refer to a variable that is controlled by a source process and observed by a destination process. The destination process makes use of the variable value to control its timing and decision making.

One common type of semaphore is a simple bivalued statistic (e.g., alternating between zero and one) that act as a “lock”, allowing one process to prevent or allow the execution of certain actions by another process. By using the triggers of the statistic wire, semaphores can become active, allowing the destination process to block until a specific “release” signal has been generated by the source process.

本站文档由 北京智网畅联科技有限公司 整理、翻译并提供 · 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