Adding Shared Code to a Node

After creating a shared code process model, you need to add it to a node model so that you can use it in a simulation. This process is the same for shared code models as for traditional process models.

Picking a Node Model

If a base model with the right number and type of interfaces already exists, you can use it. For example, to add a new application to an Ethernet workstation, edit an Ethernet workstation node and add a module that uses your shared code.

If an appropriate model does not exist, use Device Creator to create a node that is similar to the one you want. In most cases, a device type of Router or Multihomed Host will be the right choice for use with shared code. If you are developing a new MAC protocol, you can either use Ethernet or Wireless LAN interfaces in your device and edit them to use your new protocol, or configure Device Creator to add your new protocol as an available interface.

For help using Device Creator, see “Create Custom Device Model” on page 204.

Adding the Shared Code

Your shared code process model can be added to the node model as a new module or as a replacement of an existing module.

Routing and application layers are common examples of shared code that is added as a new module. For these:

  1. Add a new module in the Node Editor.
  2. Specify your shared code as the process model for the module.
  3. Connect the module via packet streams to the appropriate places (such as TCP/UDP for an application or IP for routing).

For other types of layers (such as MAC), shared code is added by replacing the existing module.

  1. Replace the process model of the appropriate module with the shared code model.
  2. If needed, replace the transmitters and receivers, setting the pipeline stages appropriately.

Renaming the Initialization Attribute

We recommend that you rename the Initialization attribute of your shared code model. This is not required, but doing so makes things easier when you have multiple modules using shared code and you need to identify which module an attribute belongs to.

To rename the Initialization attribute, choose Interfaces > Node Interfaces in the Node Editor and click the Rename/Merge… button. Move the Initialization attribute to the right side of the dialog box and set its Promotion Name and Promotion Group.

Renaming changes the status of the Initialization attribute to “Promoted”. You can change this to “Set” if you won’t need access to the attribute at run time.

For details about using the Rename/Merge Attributes dialog box, see “Structural Grouping of Attributes” on page 476.

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