J-Sim Official

J-Sim INET Tutorial

December 10, 2003

This tutorial is intended to provide users with an overview of network simulation in the J-Sim environment. Before delving into the details of network simulation, we introduce several terms below.

Components: J-Sim is built upon a component-based software architecture, called the autonomous component architecture (ACA). Every network entity, e.g., a network, an end host, a router, a link, and a protocol, is a component. Components are connected through their ports in the same manner as IC chips are connected through their pins in IC circuit design. The behavior of a component is specified by the contract (which describes, when data arrives at each of its ports, how a component process data and possibly generates outputs at certain ports) in the same manner an IC chip is specified by its specification in the cookbook. Figure 1 depicts the analogy between the autonomous component architecture and the IC design.

FIgure 1: The analogy between components in the autonomous component architecture and an IC chip in the IC design process.

A component may be a composite component. That is, it may be composed of several inner components. In the context of network simulation, a network is a composite component and is composed (at run time) of nodes, links, protocols, and appropriate modules. Figure 2 depicts the notion of composite components.

Figure 2: Composite components.

Scripts: J-Sim is a dual-language environment: Java(TM) is used to implement all the classes and Tcl is used as a "glue" script language to construct, configure, and/or control network simulation at run time. In addition to a few of standard Tcl commands, J-Sim also uses two set of extended Tcl commands:

(1) Tcl/Java: defines the Java extension in Tcl and is the "bridge" between Tcl and Java. Tcl/Java commands make it possible to create and access any Java objects in the Tcl environment. The online manual page of Tcl/Java is available here.

(2) RUV system commands: The notion of composite components in J-Sim makes it possible to organize components in a component hierarchy. The hierarchy is very similar to a file system in a modern operating system. To ease configuration of network simulation, we have developed a set of Runtime Virtual (RUV) system commands to manipulate the component hierarchy in the same fashion as several UNIX commands do to the file system.

First, central to the RUV system commands is the concept of path. Every component and every port in a component hierarchy can be uniquely identified by a path. For example, consider the composite component in Figure 3. The root component has four immediate child components, aaa, b, cc, and d. The component cc, in turn, is a composite component and contains two child components, ee and ff. The path of component cc is expressed as "/cc," and that of component ee is expressed as "/cc/ee." Also, component cc owns a port labeled as x@y, where x@y is a full port ID with x being the port ID, and y being the port group ID. The path of this port is expressed as "/cc/x@y". Similarly, the path of port x@y of component ee is expressed as "/cc/ee/x@y". (The port ID or the port group ID may be an empty string, and hence x@ or @y are valid full port IDs.) As a side effect, the character "@" is used to tell whether the object represented by a path is a component or a port.

RUV supports the wildcard expression in the same way most UNIX shells do. In addition to "*" and "?" which are commonly used in a shell, RUV supports "..." in a path expression. The expression matches all the components under the current path. For example, "/cc/.../x@y" represents both "/cc/x@y" and "/cc/ee/x@y".

Figure 3: An example the illustrates the concept of path in RUV.