6

VxSim

Integrated Simulator and Full Simulator (Optional)



6.1    Introduction

VxSim, the VxWorks simulator, is a port of VxWorks to the various host architectures. It provides a simulated target for use as a prototyping and test-bed environment. In most regards, its capabilities are identical to a true VxWorks system running on target hardware. Users link in applications and rebuild the VxWorks image exactly as they do in any VxWorks cross-development environment using a standard BSP.

The difference between VxSim and the VxWorks target environment is that in VxSim the image is executed on the host machine itself as a host process. There is no emulation of instructions, because the code is for the host's own architecture. A communication mechanism is provided to allow VxSim to obtain an Internet IP address and communicate with the Tornado tools on the host (or with other nodes on the network) using the VxWorks networking tools.

Because target hardware interaction is not possible, device driver development may not be suitable for simulation. However, the VxWorks scheduler is implemented in the host process, maintaining true tasking interaction with respect to priorities and preemption. This means that any application that is written in a portable style and with minimal hardware interaction should be portable between VxSim and VxWorks.

The basic functionality of VxSim is included with the Tornado tools and is preconfigured to allow immediate access to the simulated target. The integrated simulator does not include networking and provides only single instance usage. The VxSim full simulator is an optional product providing for networking and multiple instance usage.

The key differences between VxSim and other BSPs are summarized below. For a detailed discussion of subtle implementation differences which may affect application development, see 6.4 Architecture Considerations.

Integrated Simulator

VxSim has only a few differences from VxWorks:

  • Drivers.  

  • File System.  

  • Networking.  

Full Simulator

The VxSim full simulator provides full network capability for your simulator. This optional product also allows you to run more than one instance of VxSim on your host.

In order to simulate the network IP connectivity of a VxWorks target, the VxSim full simulator includes special drivers that operate using IP addresses. The ULIP network interface is available for Windows hosts.

All interfaces provide an I/O-based interface for IP networking that allows VxSim processes to be addressed at the IP level. When multiple programs are run, they can send packets to each other directly. This is because the host hands the packets back and forth; that is, the host OS effectively becomes a router with multiple interfaces.



6.2    Integrated Simulator

All the functionality of the integrated simulator is available with the optional full simulator. All the information in this section applies to both versions of VxSim. For information specific to the full simulator product, see 6.5 Configuring the VxSim Full Simulator.

Installation and Configuration

Tornado 2.2 comes configured with basic VxSim on all hosts. Installing and starting Tornado as described in the Tornado Getting Started Guide installs the integrated VxSim.

Starting VxSim

VxSim automatically starts when you request a function that requires a connection to a target. For example, when you request download of a module, if you have not started a target server VxSim and a target server are automatically started.

You can also start VxSim from the VxSim icon in Tornado environment or from the command line or the Start>Run dialog box using the command vxWorks. Available options are:

-p[rocessorNumber]

-r[am bytes]


*      
WARNING: On real targets, you can use bootChange( ) to boot another VxWorks core file on the next reboot. On simulators, changing the core file using bootChange( ) has no effect; in other words, on the next reboot, the simulator will not start with the core file set in the boot line.

Changing the Simulator Boot Line

Because the hardware environment is different from the simulator environment, bootChange( ) does not behave the same way on simulators as it does on real targets.

Table 6-1:   Simulator Boot Parameters 


Parameters
Comments

boot device
Do not change.
processor number
Do not change.
host name
Do not change.
file name
Ignored by the simulator.
inet on ethernet (e)
Do not change.
inet on backplane (b)
Do not change.
host inet (h)
Do not change.
gateway inet (g)
Do not change.
user (u)
Do not change.
ftp password (pw)
Refer to description of boot parameters (1)1
flags (f)
Refer to description of boot parameters (1)*
target name (tn)
Refer to description of boot parameters (1)*
startup script (s)
Refer to description of boot parameters (1)*
other (o)
Refer to description of boot parameters (1)*

1:  See 2.5.4 Description of Boot Parameters.


*      
WARNING: The Windows simulator does not simulate non-volatile RAM (NVRAM), so boot parameter modifications are lost on subsequent reboots.

Rebooting VxSim

As with other targets, you can reboot VxSim by typing CTRL+X in the VxSim window.

Exiting VxSim

Exit VxSim by closing the VxSim window.

Back End

The integrated simulator uses the pipe back end (INCLUDE_WDB_COMM_PIPE), which is configured by default, to communicate with the target session.

System-Mode Debugging

System-mode debugging allows developers to suspend the entire VxWorks operating system.1 One notable application of system mode is to debug ISRs, which--because they run outside any task context--are not visible to debugging tools in the default task mode. For more discussion of system mode, see the chapters 7. Shell and 10. Debugger.

The Windows integrated simulator is configured by default for system mode debugging.

Symbols

Particular care must be taken when using absolute symbols from loaded object modules in the simulators. The VxWorks simulators execute within the memory space of a host operating system. Their actual execution address space is more constrained than is the case for the real VxWorks operating system. Absolute references to addresses must be carefully chosen in order to point to memory areas actually existing and allocated to the simulator. The values of absolute symbols defined within object modules are not modified by the loader so these values (in other words, addresses) must be set correctly by the code developers.

File Systems

VxSim can use any VxWorks file system.

The default file system is the pass-through file system, ntPassFs, which is unique to VxSim. ntPassFs allows direct access to any files on the host. Essentially, the VxWorks functions open( ), read( ), write( ), and close( ) eventually call the host equivalents in the host library libc.a. With ntPassFs, you can open any file available on the host, including NFS-mounted files. By default, the INCLUDE_NTPASSFS macro is enabled to cause this file system to be mounted on startup.

In the target shell, a path name should be prefixed by host: to prevent the Windows disk device from interpreting it as a VxWorks device. Moreover, you can use both / and \ in the path; be careful when using \ in a string as the next character will be interpreted as a special character. For example, all these usages yield expected results:

-> ld < host:c:/test/testFile.o 
-> ld < host:c:\test\testFile.o 
 
-> cd "host:c:/test" 
-> cd "host:c:\\test"

However, the following does not work:

-> cd "host:c:\test"

In WindSh, do not use the host: prefix in the path name.

For more information on ntPassFs, see the reference entry for ntPassFsLib. For more information on other VxWorks file systems, see the VxWorks Programmer's Guide: Local File Systems.



6.3    Building Applications

The following sections describe how to use the VxSim compilers. The recommended way to build VxSim modules is to use the project tool. For complete information on this tool, see 4. Projects. If you are using manual methods in your project, the information required for manual builds and loading is summarized below.

This information applies to using manual methods on both the integrated version of VxSim and the full simulator product.

Defining the CPU Type

Setting the preprocessor variable CPU ensures that VxWorks and your applications build with the appropriate features enabled. Define this variable to SIMNT for all Windows hosts.

The Toolkit Environment

All VxWorks simulators use the GNU C/C++ compiler.


*      
CAUTION: The compiler used by the Tornado tools to compile VxSim applications for Windows is the GNU C/C++ compiler rather than any MicroSoft tools. This provides for greater compatibility between VxSim and VxWorks environments.

Compiling C and C++ Modules

Only the GNU compiler is supported for SIMNT: the Diab compiler is not supported. If you compile using the IDE build facilities, default build settings are already in place. If you wish to modify the defaults, or if you wish to build from the command line, the following information may be helpful.

The following is an example of a compiler command line for VxSim development. The file to be compiled in this example has a base name of applic.

% ccsimpc -g -mpentium -ansi -DRW_MULTI_THREAD -D_REENTRANT -fno-builtin -fno-defer-pop -I. -IinstallDir/target/h/ -DCPU=SIMNT -DTOOL_FAMILY=gnu -DTOOL=gnu -c applic.c
Option Definitions

The options shown in the example and other compiler options are detailed in the online version of the GNU ToolKit User's Guide. Wind River supports compiler options used in building Wind River software; see the Guide for a list. Other options are not supported, although they are available with the tools as shipped.

Linking an Application to VxSim

Linking and loading for VxSim are identical to other BSPs. See the VxWorks Programmer's Guide: Configuration and Build.



6.4    Architecture Considerations

The information in this section highlights differences between VxSim (both the integrated and full versions) and other VxWorks BSPs. These differences should be taken into consideration as you develop applications on VxSim that will eventually be ported to another target architecture.

VxSim uses the VxWorks scheduler, which behaves the same way as for any other VxWorks architecture (see the VxWorks Programmer's Guide: Basic OS). The BSP is extensible; for example, pseudo-drivers can be written for additional timers, serial drivers, and so forth.

The rest of this section discusses some details of the VxSim implementation. Differences between VxSim and other VxWorks environments are noted where appropriate.

Supported Configurations

Most of the optional features and device drivers for VxWorks are supported by VxSim. The few that are not are hardware devices (SCSI, Ethernet), ROM configurations, and so on. The BSP makefile builds only the images vxWorks and vxWorks.st (standalone VxWorks).

Endianess

The Windows simulator uses a little-endian environment.

Simulator Timeout

Occasionally a simulator session loses its target server connection due to the many things competing for CPU time on the host. If you find that your application is frequently losing its target server connection, adjust the back end timeout (-Bt) and back end retry (-Br) parameters when starting the target server with Tornado. To do this from the Configure Target Servers dialog, select Miscellaneous and set the appropriate options using the Other Options field. For example, you may want to increase the back end timeout from 1 to 3 and the resend parameter from 3 to 4:

-Bt 3 -Br 4

You can also add this string to the tgtsvr command when you start the target server from the command line.

The BSP Directory

Aside from the following exceptions, the VxSim BSP is the same as a VxWorks BSP:

  • The sysLib.c module contains the same essential functions: sysModel( ), sysHwInit( ), and sysClkConnect( ) through sysNvRamSet( ). Because there is no bus, sysBusToLocalAdrs( ) and related functions have no effect.

  • The file winSio.c ultimately calls the host OS read( ) and write( ) routines on the process's standard input and output. Nevertheless, it supports all the functionality provided by tyLib.c.

  • The simpcDrv.a file is the library for simpc BSP drivers.

  • The configuration header config.h is minimal:

  • It does not reference a bspname.h file.

  • Most network devices are excluded.

  • The boot line has no fixed memory location. Instead, it is stored in the variable sysBootLine in sysLib.c.

  • The Makefile is the standard version for VxWorks BSPs. It does not build boot ROM images (although the makefile rules remain intact); it can only build vxWorks and vxWorks.st (standalone) images. The final linking does not arrange for the TEXT segment to be loaded at a fixed area in RAM, but follows the usual loading model. The makefile macro MACH_EXTRA is provided so that users can easily link their application modules into the VxWorks image if they are using manual build methods.

The BSP file sysLib.c can be extended to emulate the eventual target hardware more completely.

Interrupts

Windows messages are used to simulate hardware interrupts. For example, VxSim uses messages 0xc000 - 0xc010 to simulate interrupts from ULIP, the pipe back end, and so forth. The messages are the VxSim equivalent to Interrupt Service Routines (ISRs) on other VxWorks targets. You can install ISRs in VxSim to handle these "interrupts." Not all VxWorks functions can be called from ISRs; see the VxWorks Programmer's Guide: Basic OS. To run ISR code during a future system clock interrupt, use the watchdog timer facilities. To run ISR code during auxiliary clock interrupts, use the sysAuxClkxxx( ) functions.

Table 6-2 shows how the message table is set up.

Table 6-2:   Interrupt Assignments


Interrupts
Assigned To

0xc000-0xc010
host messages
0xc011 on
available for user messages

Pseudo-drivers can be created to use these interrupts. Interrupt code must be connected with the standard VxWorks intConnect( ) mechanism.

For example, to install an ISR that logs a message whenever host message WM_TIMER_CLOCK arrives, execute the following:

-> intConnect (0xc011, logMsg, "Help!\n")

Then send message 0xc011 to VxSim from a host task. Every time the message is received, the ISR (logMsg( ) in this case) runs.

If a VxSim task reads from a host device, the task would normally block while reading; however, this would stop the VxSim process entirely until data is ready. Instead the device is put into asynchronous mode so that a message is sent whenever data becomes ready. In this case, an input ISR reads the data, puts it in a buffer, and unblocks some waiting task.

Since VxSim uses the task's stack when taking interrupts, the task stacks are artificially inflated to compensate. You may notice this if you spawn a task of a certain size and then examine the stack size.

Clock and Timing Issues

The execution times of VxSim functions are not, in general, the same as on a real target. For example, the VxWorks intLock( ) function is normally very fast because it just writes to the processor status register. However, under VxSim, intLock( ) is relatively slow because it takes a host semaphore, allowing other processes to run.

The clock facilities are provided by the Windows API SetTimer( ) for both the system and auxiliary clocks. The problem with using SetTimer( ) for the target system clock is that it produces inaccurate timings when VxSim is swapped out as a host process. On the other hand, the timing of VxSim is, in general, different than on an actual target, so this is not really a problem.


*      
NOTE: Because VxSim is a host process, it shares resources with all other processes and is swapped in and out. In addition, the kernel's idle loop has been modified to suspend VxSim until a signal arrives (rather than busy waiting), thus allowing other processes to run.

The spy( ) facility is built on top of the auxiliary clock. The task monitoring occurs during each interrupt of the auxiliary clock to see which task is executing or if the kernel is executing. Because the profiling timer includes host system time and user time, discrepancies can occur, especially if intensive host I/O occurs.

WindView Instrumentation on the Windows Simulator

Due to some specifics of the Windows emulator, there is a critical section at the end of the intUnlock( ) routine where interrupts can occur but scheduling is forbidden. If a reschedule is necessary at the end of the interrupt, it is not done when the interrupt is exited but is delayed until the end of the critical section of the intUnlock( ) routine.

This behavior can have an impact on a WindView graph. If a high priority task is made ready within an interrupt handler, this task may not be run when the interrupt is exited but instead may run slightly later.


*      
NOTE: This delay of the rescheduling has no impact on the relative scheduling between VxWorks tasks.



6.5    Configuring the VxSim Full Simulator

This section contains information pertaining only to the VxSim full simulator. (All information in previous sections also pertains to that product, as well as to the integrated version.) The VxSim full simulator provides networking facilities. Most of the special considerations associated with it are network considerations.

If you purchase the VxSim optional full simulator for networking, you must take additional configuration steps.

  • Install the VxSim full simulator using SETUP, either when you install Tornado 2.2 or at a later time. (For more information, see theTornado Getting Started Guide.)


*      
WARNING: Project facility configuration and building of projects is independent of the methods used for configuring and building applications prior to Tornado 2.x (which included manually editing config.h and configAll.h). Use of the project facility is the recommended, and is much simpler. However, the manual method may still be used (see 5. Command Line Configuration and Build for details). Avoid using the two methods together for the same project except where specific BSP and driver macros are not available in the project facility.

  • Be sure to correctly set target server options for the full simulator:

  • Click the Launch Simulator icon. Select Custom-built simulator and set the path to a full simulator project directory. Click OK. The VxSim Launch: Launch Target Server window pops up. Click on Details. Select Full simulator to set default target server options for the full simulator. Finally, click OK to launch a target server.

  • Click on Tools>TargetServer>Configure. In the Configure Target Servers window, select wdbrpc in the Available Back Ends list, and set the IP address of the simulator in the Target Name/IP Address field. Set the target server name to vxsim. The target server command line should be:

    tgtsvr.exe 192.168.255.1 -n vxsim -V -B wdbrpc

(By default you should also see WindView options)

Installing VxSim Network Drivers

The SETUP tool writes the appropriate host drivers on your disk, but they must be installed on your host operating system.

For Windows hosts, the simpc BSP includes an NDIS driver called the ULIP driver. Follow these steps to add the ULIP driver to your Windows host.


*      
WARNING: The full simulator requires administrator privileges to successfully initialize a Ulip connection. Check that your account has administrator privileges before you begin. For more information contact your local system administrator

Installing ULIP on a Windows NT Host
  1. From the Start menu select Settings>Control Panel>Network.
  1. Click the Adapters tab in the Network window, click the Add button, click Have Disk in the Select Network Adaptor window, select the host\x86-win32\bin directory of your Tornado installation, and click OK.
  1. Click on Ulip Virtual Adapter and click OK. ULIP is added to the network adapters list.
  1. Enter an IP address of the form nn.nn.nn.254 (for example,192.168.255.254).
  1. Then select Show bindings for all adapters from the Bindings tab, select Ulip Virtual Adapter>WINS Client (TCP/IP)>NetBIOS Interface, and click Disable and OK.
  1. If you want to enable network communication between simulators and the outside world, select Settings>Control Panel>Network from the Start menu, then click the Protocols tab and double-click on TCP/IP Protocol. From the Routing tab of the TCP/IP Properties window, check Enable IP Forwarding. Click OK and Close.
  1. Restart the computer so the new settings take effect.
Installing ULIP on a Windows 2000 Host
  1. From the Start menu, select Settings>Control Panel>Add/Remove hardware. This launches the driver installation wizard.
  1. Click the Next button. Then click the subsequent Next button. This displays the Choose a Hardware Device dialog box.
  1. From the dialog box, select the line Add a new device and click the Next button.
  1. Select the option, No, I want to select the hardware from a list, and click again on the Next button.
  1. Select Network adapters, and click on Next. This stage can take several minutes.
  1. The Select Network Adapter dialog box appears. Click on the Have disk button, and select the host\x86-win32\bin directory of your Tornado installation and click OK.
  1. Then select the line WindRiver Ulip, and click on Next. A new dialog box appears, click again on Next.
  1. Select Yes from the Digital Signature Not Found dialog box.
  1. When the next dialog box appears, ensure it confirms that the installation completed without errors, and finally, click on the Finish button.
  1. Starting again from the Windows desktop, right click on My Network Places, and select Properties.
  1. Right click on the last Local Area Connection # icon and select Properties. (You can rename this Local Area Connection # title with WindRiver Ulip by selecting Rename instead of Properties).
  1. Select the line Internet Protocol (TCP/IP) and click on Properties. (If the TCP/IP protocol is not installed, refer to the MS Windows help for information on installing it).
  1. Enter an IP address of the form nnn.nnn.nnn.254 (for example, 192.168.255.254) and 255.255.255.0 as subnet mask, and click on Advanced.
  1. In the WINS tab, select Disable NetBIOS over TCP/IP and click OK to properly close all the remaining windows.
  1. If you want to enable network communication between simulators and the outside world, select Setting>Control Panel>Administrative tools from the Start menu, double-click on Services, then search for the Routing and Remote access service. If it is disabled, right-click on it and change the startup type to Automatic so it will be started when Windows starts. Click OK to validate your change. The service can now be started using the play icon on the main service window.
Installing ULIP on a Windows XP Host
  1. From the Start menu select Settings>Control Panel>Add Hardware. This launches the driver installation wizard. Click Next.
  1. The wizard searches for recently connected hardware; this stage can take several minutes. Then select Yes, I have already connected the hardware, and click Next.
  1. From the Installed hardware list, select Add a new hardware device, and click Next.
  1. Select Install the hardware that I manually select from a list [Advanced], click Next.
  1. From the Common hardware types list, select Network adapters, click Next.
  1. Click Have Disk, and select the host\x86-win32\bin directory of your Tornado installation.
  1. Select WindRiver ULIP, and click Next twice
  1. The Hardware Installation dialog reports that "WindRiver ULIP has not passed Windows Logo testing to verify its compatibility with Windows XP. You can safely ignore this warning and click Continue Anyway.
  1. Then, from the Control Panel, launch Network Connections and right-click WindRiver ULIP connection (You can rename this connection).
  1. From the WindRiver ULIP Properties panel, select Internet Protocol (TCP/IP), and click Properties.
  1. Check Use the following IP address, and enter an IP address of the form nnn.nnn.nnn.254 (for example, 192.168.255.254), and 255.255.255.0 as Subnet mask, and click on Advanced.
  1. In the WINS tab, select Disable NetBIOS over TCP/IP and click OK to properly close all the remaining windows.
  1. If you want to enable network communication between simulators and the outside world, select Setting>Control Panel>Administrative tools from the Start menu, double-click on Services, then search for the Routing and Remote access service. If it is disabled, right-click on it and change the startup type to Automatic so it will be started when Windows starts. Click OK to validate your change. The service can now be started using the play icon on the main service window.

Uninstalling VxSim Network Drivers

Uninstalling ULIP on a Windows NT Host
  1. From the Start menu select Settings>Control Panel>Network.
  1. Click the Adapters tab in the Network window.
  1. Select Ulip Virtual Adapter, and click Remove.
Uninstalling ULIP on a Windows 2000 or XP Host
  1. From the Start menu select Settings>Control Panel>System.
  1. From the Hardware tab of the System Properties window, click the Device Manager button.
  1. From the Device manager window, right-click on Network adapters>WindRiver ULIP, and select Uninstall.

Configuring VxSim for Networking

As with any other BSP, adding components to VxWorks requires including them, rebuilding VxWorks, the downloading and restarting it. The easiest method for doing this is to use the project facility. However, if you have used manual methods in your project, you should continue to use those methods.

For a discussion of networking as it relates to VxSim, see 6.5 Configuring the VxSim Full Simulator.

Using the Project Facility

Use the Create Project facility to create a bootable VxWorks image.

  • On the VxWorks tab in the Project Workspace window, select the folder called network components.

  • Right click and select Include `network components' from the pop-up menu. Click OK to accept the defaults.

  • Change WDB connection from WDB simulator pipe connection to WDB END driver connection or to WDB network connection. Then rebuild and download VxWorks.

For more information on using the configuration tool, see 4. Projects.

Using Manual Techniques

Edit target/config/simpc/config.h, and replace:

#if TRUE 
#undef INCLUDE_NETWORK 
<...>

With:

#if FALSE 
#undef INCLUDE_NETWORK 
<...>

Then rebuild and download VxWorks.

You must also change your target server configuration from wdbpipe to wdbrpc.

  • If you are launching your target server from the command line:

Replace -B wdbpipe by -B wdbrpc in the target server command line, and add the IP address of the simulator. The target server launch options should include the following:

-V -B wdbrpc RW 192.168.255.1   

  • If you are configuring and launching your target server from the GUI:

  • Click the Launch Simulator icon. Select Custom-built simulator and set the path to a full simulator project directory. Click OK. In the Launch Target Server window. click on Details. Select Full simulator to enable the default target server options and click OK to launch the target server.

  • Click on Tools>TargetServer>Configure. In the Configure Target Servers window, select wdbrpc in the Available Back Ends list, set the IP address of the simulator in the Target Name/IP Address field, and set the target server name to vxsim.

The target server command line should be:

tgtsvr.exe 192.168.255.1 -n vxsim1 -V -B wdbrpc

For additional information on configuring BSPs using manual methods, see the VxWorks Network Programmer's Guide.

Running Multiple Simulators

When you install the optional VxSim component, your system is automatically configured to run up to 16 simulators. When you start VxSim from the GUI, you can specify the processor number to use from the VxSim Launch window. The processor number must be a positive number ranging from 0 (first instance: vxsim0) to 15 (last instance: vxsim15).

To start VxSim from the command line, the command takes the following form (where n is the processor number):

c:\> installDir\target\proj\fullSimulator\default> vxWorks -p n 

System Mode Debugging

The full simulator does not support system mode debugging because of an incompatibility between the END and RPC back ends.

IP Addressing

All of the networking facilities available under VxWorks--for example, sockets, RPC, NFS--are available with VxSim. For VxSim to communicate with the outside world, it must have its own target IP address as provided through a network interface.

Internet addressing is handled slightly differently among the available network interfaces. For each VxSim process, there are three associated IP addresses:

  • Target IP - the address of each VxSim process, internal to your host.
  • Local IP - your host's address on the VxSim network, internal to your host.
  • Host IP - your host's address according to the network at your site.

The target IP address and the local IP address communicate according to the protocol of the chosen network interface. The host IP address is not directly relevant to the VxSim network.  

Figure 6-1:   VxSim IP Addressing

Addressing is according to processor number, such that when you run VxSim with processor number n (using the command vxWorks -p n), the network addresses packets as shown:

Target IP

192.168.255.n+1

Local IP

host IP addr as described below

  

192.168.255.254 is the default host IP addr for the ULIP adapter; this configuration assigns IP addresses 192.168.255.1 through 192.168.255.16 to sixteen devices. If those IP addresses are not suitable, the address of the ULIP adapter may be changed, but do not use 127.n.n.n, which is reserved for other purposes on Windows. No change is necessary in the simulator configuration, since it gets its address dynamically from the ULIP adapter.

Aliases can be defined to assign names to simulator addresses, by adding the entries to the appropriate file:

Windows NT

C:\WINNT\system32\drivers\etc\hosts

Windows 2000

C:\WINNT\system32\drivers\etc\hosts

Windows XP

C:\Windows\system32\drivers\etc\hosts

The following example shows a typical hosts file:

192.168.255.1   vxsim0 
192.168.255.2   vxsim1 
...             ... 
192.168.255.16  vxsim15 
Choosing Processor Numbers for Distinct Devices

When you run VxSim with ULIP and specify processor number n (with the command vxWorks -p n), VxSim for Windows attaches to the IP number you specified when installing ULIP, which must not be 127.n.n.n.

Only one process at a time can open the same ULIP device; this is enforced in the ULIP driver. Thus, if you want multiple VxSim targets to use ULIP, you must give each of them a distinct processor number. If another VxSim process is already running with the same processor number, then the ULIP device cannot be opened (ulip0 corresponds to processor 0), and the following message is displayed during the startup of VxSim:

Error: There is already a simulator running with this processor number. 
Please restart with a different number (/p <number> option). 
Hit Any Key to Exit

When you run VxSim on NT, host entries are not automatically created until a simulator is started.


*      
WARNING: The VxSim ULIP driver will not attach to a network interface if it is already in use, that is, ul0 can be used by only one VxSim process. Use the -p flag to run VxSim with a different processor number; see Starting VxSim.

Setting Up Remote Access

You can add host-specific routing entries to the local host to allow remote hosts to connect to a local VxSim "target." IP addresses are set up only for the host where the network simulation software is installed. The network interface does not have to be installed remotely; the remote host uses the local host as the gateway to the VxSim target.

In the example shown in Figure 6-2, host1 can communicate with vxsim0 or vxsim1 if IP forwarding is enabled. (See Installing VxSim Network Drivers for more information on how to enable IP forwarding.)

Contrast Figure 6-2 below with Figure 6-1 to see the way addresses are set up, paying particular attention to the addressing algorithm described in IP Addressing.

Figure 6-2:   Example of VxSim IP Addressing (PPP on Solaris)

To communicate from host1 to vxsim0 and vxsim1, type the following commands from host1 (requires administrative privilege):

c:\> route ADD 192.168.255.1 90.0.0.1 METRIC 1 
c:\> route ADD 192.168.255.2 90.0.0.1 METRIC 1

Verify the success of the above commands by pinging vxsim0 from host1:

% ping 192.168.255.1


*      
NOTE: If the remote host (host1) is a UNIX host, use the following commands (as root): on Solaris: % route add host 192.168.255.1 90.0.0.1 1
            on Linux:   % route add -host 192.168.255.1 gw 90.0.0.1 metric 1

To allow a VxSim process on one host to communicate with a VxSim process on a different host, you must make sure that the two VxSim processes have different IP addresses. You must also make additional host-specific routes using unique addresses for each process.

For example, to ping vxsim2 from host0 above, you must add an additional route from host0 as follows:

c:\> route ADD 192.168.255.3 90.0.0.2 METRIC 1


*      
NOTE: You assign addresses for the Windows simulator when you install ULIP. You can use 192.168.255.n or any other number except 127.n.n.n+1;127 is reserved for other purposes on Windows.

To enable remote access to a simulator, IP forwarding must be enabled. For more information on how to enable IP forwarding, see Installing VxSim Network Drivers.


1:  System mode is sometimes also called external mode, reflecting that the target agent operates externally to the VxWorks system in this mode.