Simulation Assembly
Given all of the simulation components listed in Table 124, Riverbed Modeler provides the modeler with an executable program. This requires assembling the components by ensuring that all references between them are satisfied and by actually establishing “links” between references to data and code and the data and code themselves. This operation is traditionally called linking the program; to avoid confusion with the term “link” which is commonly used to describe objects in the network model, we use the term bind instead.
Binding Approaches
Modeler supports two approaches to binding simulation programs: static and dynamic. These options correspond directly to the alternatives supported by the compiler and linker of the host computer. In static binding, all of the references between component files are resolved in advance and the entire group of files is packaged together into one large file which is the simulation program. The program is ready to run at any time with no further assembly work to be done. Dynamic binding uses a more sophisticated and complex process to assemble the simulation at the time it is executed. Each approach offers its own advantages and disadvantages, as summarized in the table below. See the documentation for your host computer’s compiler and linker for more information on issues related to the underlying static and dynamic linking mechanisms.
Table 125: Static vs. Dynamic Binding of Simulation Programs
| Issue | Details | Advantage |
|---|---|---|
| Portability | Because a dynamically bound simulation is a loose collection of object files, there is no guarantee that all of the files can be located at the time of simulation execution. This particularly represents a concern when transferring simulations to another computing environment (e.g., shipping simulations to another user) because the inclusion of all relevant files must be ensured. Statically bound simulations experience this problem to a lesser degree, but still require the presence of certain model files to execute. | Static |
| Automation and Adaptability | As component object files change (e.g., due to revisions to process models), dynamic simulations can automatically detect the changes and incorporate the new files into the simulation program so that it is “up to date” when executed. Users can save models and run simulations without having to consider the necessity of binding again. In contrast, statically bound simulation programs must be discarded and bound again from scratch if any of their components is no longer up to date. In addition, because the simulation program is entirely self contained, it can accidentally be run without being re-built, and therefore without reflecting the new information embodied within the altered object files. | Dynamic |
| Permanence | The advantage of adaptability presents a simultaneous disadvantage for dynamic simulations. The automatic incorporation of new object files may be undesirable if the behavior of an existing simulation needs to be preserved. For the same underlying reason, if several “versions” of an object file are present in different directories, there may be some confusion on the part of the user concerning which particular files are being loaded into the simulation program. Static simulation programs contain the object files within them and are therefore impervious to future changes to the individual object files | Static |
The advantages and disadvantages of the two approaches should be carefully considered based on the requirements of the simulation project. Modeler’s default approach is to use dynamic binding because the advantages of automation and adaptability are so significant in most applications. The advantage of automation is particularly important when component models are undergoing frequent change, as is typically the case during the development phase of a simulation project. Using dynamic binding, users can “save and run” their models, without having to consider the necessity of a manual binding step. It is important to realize that the binding approach can be changed at any time. So, for example, it is possible to use dynamic binding during the entire development phase and then statically bind a simulation program to send it to a customer.
Modeler’s bias toward dynamic binding is apparent in the fact that its graphical user interface offers no support for static binding of simulations. To statically bind a simulation, the “op_mksim” utility must be used.
Dynamic binding of simulations is implicitly supported by Modeler in the sense that execution of a simulation can automatically trigger the binding process. The underlying utility that automates this process is called “op_runsim”. This utility can be used to execute simulations from the host computer’s “command line”, and the GUI can use it to execute simulations as well. op_runsim is essentially the “starting point” for all dynamically bound simulation programs. Its role is to analyze a network model and determine which component files are needed for the simulation; it then uses the host computer’s linker to load all of the components and bind them together. Finally, it begins executing the simulation.
Repositories
One advantage offered by statically bound simulations over dynamically bound simulations is the fact that static simulations are ready to execute as is, whereas dynamic simulations must still carry out a certain amount of “work” to reach the point where they are ready to execute. This work consists of loading object files and binding. Therefore, dynamic simulations may take slightly longer than static simulations to actually begin executing. To accelerate the dynamic binding process, op_runsim can preserve some of the work that it performs on an initial execution of a simulation. The work that is saved is the binding of the user-defined components (process models, pipeline stages, etc.) into one larger object called a repository. From the linker’s point of view, a repository is implemented as a shared object file. Modeler uses the .nt.so (Linux) and .nt.dll (Windows) suffixes for repository files.
A repository can be maintained for each separate network model that is used for simulation. When op_runsim is invoked to execute a simulation, it examines the network model’s repository to determine if it is still up to date. It is considered to be up to date if its last modification date is more recent than the modification date of each of the source files that correspond to the repository’s object modules. For example, for each process model included in the simulation, op_runsim checks the repository date against the date of the process models’ portable .pr.m file. If so, it can use it to save some portion of the time required to bind the simulation. If not, it reconstructs the repository from scratch and leaves it in place for future executions. Note that this approach partially negates the smaller-size advantage that dynamic simulations have, because a repository file introduces some redundant storage of object files. However, repositories are still significantly smaller than statically-bound simulations because they do not include the Simulation Kernel.
Note: Repositories are essentially interim files that are used for the binding process. They can be deleted without losing model specification information.