Shared Code Development Overview

The Shared Code Development functionality lets you write code that can be compiled for use on multiple platforms. For example, the code you develop for a new protocol can be designed for use on both the physical hardware that will host it and in a Riverbed network model.

Traditionally, Modeler users have used behavioral models. These are models that capture the behavior of a system component rather than reproduce the exact internal function of the component. Behavioral models often make simplifying assumptions. They implement a design or algorithm rather than replicate actual code.

Behavioral modeling has many benefits when you are modeling an existing system. For example:

  • You need to model only the key parts of the system.
  • You can write highly readable code and break it into logical pieces.
  • You are not tied to the requirements of a specific, possibly obscure platform.

Behavioral modeling, however, separates the development efforts leading to real code and the corresponding model. Shared code development, on the other hand, uses the same code for both modeling and execution on the real system. This approach

  • Integrates the modeling and development teams, allowing better cooperation and reduced effort
  • Increases confidence that simulation results will match the real world (because the same code is used for both)
  • Allows for better quality assurance, through
    • Automated regression testing as code changes
    • Scalability testing using real code and (with SITL) a mix of real and virtual devices

Shared code will need some modifications to allow it to compile on all targets (system calls, for example). You do not have to use all of the code for modeling—a subset might be sufficient. Also, it is sometimes possible to mix shared code and behavioral modeling.

Shared code is optional functionality for Riverbed solutions. To use it, you must have a Shared Code Development license and enable the functionality via the License > Product Modules menu.

What Does Shared Code Add to Modeler?

Shared Code adds the following components to a standard Modeler installation:

  • An API to facilitate use of shared code in Riverbed models
  • Process model templates for shared code

Workflow for Using Shared Code

The general steps for using shared code with Riverbed Modeler are as follows:

  1. Develop a design that allows the code to be built for multiple targets.
  2. Determine which parts of the design can be simplified for modeling and which parts are implementation-specific.
  3. Decide on a design pattern.
  4. Create a node model that uses the shared code process model and include it in a network model.