H.5   VxSim Networking Component

This section contains information that pertains only to the VxSim optional product. All information in previous sections also pertains to that product. The VxSim optional product provides networking facilities. Most of the special considerations associated with it are network considerations.

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


*


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.

Loading ULIP on a Solaris 2 Host

Two network interfaces, ULIP and PPP, are available for Solaris 2 hosts. ULIP is provided as the default network interface. Due to its non-portable nature, we provide PPP as an alternative. At some point in the future, ULIP may no longer be supported for VxSim on Solaris hosts.


*

CAUTION: ULIP and PPP are not compatible with each other; you must uninstall one before using the other. If PPP is already installed on your Solaris host, be sure to remove it (or at least stop service with /etc/init.d/asppp stop) before loading ULIP.

Follow these steps to add the ULIP driver to your Solaris 2 host (replace the leading path segment installDir with the path to your installed Tornado tree):

% su root 
password: 
# cd installDir/host/sun4-solaris2/bin 
# ./installUlipSolaris 
# exit 
%

The installUlipSolaris script copies ULIP resources to system directories, installs the loadable ULIP driver into the Solaris kernel, and creates symbolic links which allow /etc/init.d/ulip to start and stop ULIP upon changes to the system run level1 .


*

NOTE: installUlipSolaris calls a program called configUlipSolaris and copies it to /etc/init.d/ulip (in other words, configUlipSolaris and /etc/init.d/ulip are the same program). If you have questions about the ULIP installation procedure, see the reference entry for configUlipSolaris as well as for installUlipSolaris in the VxWorks Reference Manual or the HTML online reference.

installUlipSolaris creates sixteen ULIP devices, /dev/ulip0 through /dev/ulip15, and uses the host command ifconfig to configure the devices with default IP numbers 127.0.1.0 through 127.0.1.15. You will most likely want to match these IP addresses with host names in /etc/hosts: for example, vxsim0 through vxsim15.

You can also use the following commands to start or stop the Solaris ULIP driver after the driver has been installed (you must have root privileges):

# /etc/init.d/ulip start
# /etc/init.d/ulip stop


*

CAUTION: Make sure all VxSim sessions are closed before running installUlipSolaris or /etc/init.d/ulip.

installUlipSolaris allows two optional arguments:

installUlipSolaris [ basic | uninstall ] 

Using installUlipSolaris with no argument sets ULIP to be installed automatically when Solaris reboots.

basic
Do not set ULIP to be installed automatically when Solaris reboots. If you install the ULIP driver using the basic option, you must stop and start ULIP services each time you reboot your Solaris workstation by invoking /etc/init.d/ulip manually as shown above.

uninstall
Remove the files and symbolic links created by installUlipSolaris. This script stops the ULIP driver before uninstalling.

Loading PPP on a Solaris 2 Host

PPP is provided as a portable alternative to ULIP.


*

WARNING: The VxWorks Networking Guide states that "the PPP link can serve as an additional network interface apart from the existing default network interface." This is not the case with VxSim when ULIP is used. ULIP and PPP are not compatible with each other; you must uninstall one before using the other. If you wish to use PPP and you have already installed ULIP, you must first uninstall ULIP using installUlipSolaris uninstall (see Loading ULIP on a Solaris 2 Host).

Follow these steps to add PPP support to VxSim on your Solaris host.

First, use the command pkginfo to check whether the following packages are installed on your host:

SUNWapppr

PPP/IP Asynchronous PPP daemon configuration files

SUNWapppu

PPP/IP Asynchronous PPP daemon and PPP login service

SUNWpppk

PPP/IP and IPdialup Device Drivers

SUNWbnur

Networking UUCP Utilities, (Root)

SUNWbnuu

Networking UUCP Utilities, (Usr)

For example:

% pkginfo | egrep 'ppp|bnu' 
system        SUNWapppr            PPP/IP Asynchronous PPP daemon configuration files 
system        SUNWapppu            PPP/IP Asynchronous PPP daemon and PPP login service 
system        SUNWpppk            PPP/IP and IPdialup Device Drivers 
system        SUNWbnur            Networking UUCP Utilities, (Root) 
system        SUNWbnuu            Networking UUCP Utilities, (Usr) 
% 

If they are not already installed, mount the Solaris installation disk and change your working directory to the location of these packages (for example, on a Solaris 2.5.1 CD-ROM they can be found in /cdrom/solaris_2_5_1_sparc/s0/Solaris_2.5.1) and install them with the following commands:

% su root 
Password: 
# pkgadd -d `pwd` SUNWbnur SUNWbnuu SUNWpppk SUNWapppr SUNWapppu

Next, as root, copy installDir/target/config/solaris/asppp.cf to the /etc directory as follows (replace the leading path segment installDir/target/ with the path to your installed Tornado tree):

# cp installDir/target/config/solaris/asppp.cf /etc


*

CAUTION: If you already have aspppd running, stop it with asppp stop before proceeding.

Finally, start the PPP daemon aspppd by typing the following as root:

# /etc/init.d/asppp start

The PPP driver is now installed and running on your Solaris system, and will be restarted automatically when Solaris reboots.

The PPP configuration assigns IP addresses 127.0.1.0 through 127.0.1.15 to sixteen devices, and associates with them the peer system names vxsim0 through vxsim15, respectively.

You can also use the following commands to start or stop the Solaris PPP driver after the driver has been installed (you must have root privileges):

# /etc/init.d/asppp start
# /etc/init.d/asppp stop
Loading SLIP on a HP-UX Host

Some additional configuration of your system is required to complete the connection. Perform the following steps to configure SLIP:

  1. Update your ppl.remotes file.

HP-UX uses ppl to configure pty lines for SLIP (see the HP-UX man page for ppl). Each SLIP line requires a ppl process. When a ppl process is initiated, its configuration parameters are read from the configuration file /etc/ppl/ppl.remotes.

  1. If you use none of your SLIP lines for other applications, you may replace /etc/ppl/ppl.remotes with the provided configuration file installDir/target/config/hpux/ppl.remotes.hpux10:

% su 
# cd /etc/ppl 
# mv ppl.remotes ppl.remotes.bak 
# cp installDir/target/config/hpux/ppl.remotes.hpux10 ppl.remotes

  1. If your system is already using SLIP, /etc/ppl/ppl.remotes contains working data, not just comments and a template for future additions.

Edit /etc/ppl/ppl.remotes and import the entries from installDir/target/config/hpux/ppl.remotes.hpux10. Be sure to adhere to the format restrictions of the ppl.remotes file, or the PPL software can not parse the entries.

See your system administrator with any concerns.

  1. Start the ppl process.

% su 
# ppl -o -t /dev/ptym/ptyrn 192.168.1.n 
Each simulator should have a unique pseudo-terminal device, the second argument of the ppl command, in the range ptyr0 to ptyr9. If one of these pseudo-terminals is already in use, choose another set of pseudo-terminals to use, such as ptyq0 to ptyq9. (Examine the directory /dev/ptym for the complete collection of pseudo-terminal devices.)


*

NOTE: If you use a pty group other than the default, you must redefine SLIP_PSEUDO_TTY_PATH in config.h. This macro can not be configured using the project facility. For this reason, while you must configure it manually, doing so does not prevent you from using the project facility to configure the rest of your project.

The last argument to ppl is the IP address of the VxWorks target. In the case shown above, n corresponds to the VxWorks processor number. Each simulator must have its own ppl process. For example, to add a PPL connection for VxWorks processor number 5, use the following command:

# ppl -o -t /dev/ptym/ptyr5 192.168.1.5 


*

CAUTION: HP-UX kernels allow only two SLIP network interfaces to operate at one time. If you want to run more than two simulators, you must rebuild your HP-UX kernel. The parameter that sets the number of interfaces is NNI in /usr/conf/master.d/net. Do not configure more than 10 network interfaces, as this is the maximum number allowed according to the file /usr/conf/net/if_ni.h.

  1. Enable IP packet forwarding.

By default, the VxSim BSP is built to use SLIP over the network on an HP-UX host. To ping( ) two VxSim targets, IP packet forwarding must be enabled.

To view the current ip_forwarding flag status, use the following command:

% ndd /dev/ip ip_forwarding
To enable IP packet forwarding, set the parameter ip_forwarding in the IP driver to one:

% ndd -set /dev/ip ip_forwarding 1


*

NOTE: You have to be 'root' to use ndd.

  1. Check your network interface.

# netstat -i
For example, if you started two SLIP connections (0 and 1), you would see the following lines in the network interface table:

Name   Mtu    Network   Address     Ipkts  Ierrs   Opkts  Oerrs  Coll 
ni0    1006   192       192.168.2.0    0      0       0      0     0 
ni1    1006   192       192.168.2.1    0      0       0      0     0
Installing ULIP on a Windows NT Host

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

From the Start menu select Settings>Control Panel>Network. Click the Adapters tab in the Network window, click the Add button, and click Have Disk in the Select Network Adaptor window. Enter the path to the installation file, for example, C:\Tornado\host\x86-win32\bin and click OK. Click on Ulip Virtual Adapter and click OK (see Figure H-1). ULIP is added to the Network Adapters list.

Click OK. The TCP/IP Properties window opens. Select Ulip Virtual Adapter in the Adapter drop-down list. Enter an IP address of the form nn.0.0.255 (for example, 90.0.0.255). For a discussion of network addressing in general and ULIP in particular, see IP Addressing.

Click OK and restart the computer to cause the new settings to take effect.

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 H.5 VxSim Networking Component.

Using the Project Tool

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 context menu. Click OK to accept the defaults. Then rebuild and download VxWorks.

If you want to use multiple simulators simultaneously and you are using ULIP, you must also locate ULIP on the list in the Include Folder and check it before clicking OK. In this case, you must also change your target server configuration from wdbpipe to wdbrpc before connecting it to the new VxWorks image.

If you are using PPP, be sure BSD43 Compatible Sockets is not selected in the Include Folder.

For more information on using the configuration tool, see the Tornado User's Guide: Projects.

Using Manual Techniques

For all hosts, be sure that INCLUDE_NETWORK is defined in config.h. If you want to use multiple simulators simultaneously and you are using ULIP on Solaris, also add the following to config.h:

#undef WDB_COMM_TYPE 
#define WDB_COMM_TYPE   WDB_COMM_NETWORK

If you are using ULIP on Windows NT with multiple simulators, also add the following to config.h:

#define WDB_COMM_END 
#define INCLUDE_NT_ULIP

If you are using PPP, be sure the following is defined in config.h:

#ifdef BSD43_COMPATIBLE 
#undef BSD43_COMPATIBLE 
#endif

Then rebuild and download VxWorks.

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

For additional information on configuring BSPs using manual methods, see the VxWorks Networking 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, vxsim0 starts. To start additional instances, use the command line or the Windows Start>Run facility. The command takes the following forms (where n is the processor number):


UNIX:

vxWorks -p n

Windows:

vxWorks /p n


System Mode Debugging

Including the simulator networking facility means that system mode debugging can be done without using the WDB pipe back end. SLIP, PPP, and ULIP on Windows all allow the network connection to be used for both network packets and host-target communications. However, special considerations apply to using ULIP on Solaris in this way.

Although it is possible to use the network connection for system mode debugging and use a back end other than the WDB pipe back end, the recommended method is to use the default, WDB pipe, even when networking is installed.

ULIP on Solaris Without WDB Pipe Back End

To use system mode debugging with ULIP on Solaris and no WDB pipe back end, you must enable a different ULIP channel for the target agent (the part of Tornado that resides on the target) than is used by the rest of VxWorks. This allows communications with the Tornado tools to proceed independently of the VxWorks operating system.

Changing WDB_COMM_TYPE to WDB_COMM_ULIP enables additional ULIP channels. This can be done either manually or using the project facility (see Tornado User's Guide: Projects).

With no further configuration changes, the target agent uses /dev/ulip14 and the corresponding IP address (127.0.1.14) as its debugging channel to the Tornado host tools. (VxWorks networking calls continue to connect to whatever ULIP channel you specify with the -p option if you start VxSim from the command line.)

Connect the target server to your modified VxSim using the target name vxsim14. In system mode, the target name identifies the debugging ULIP channel.

The ULIP channel corresponding to the -p option (0 by default) also remains in use for the simulated VxWorks session, even in system mode. Thus, the IP address corresponding to the -p option is always the IP address to communicate with applications on the simulated VxWorks target, regardless of whether or not system-mode debugging is in effect. The only VxSim IP traffic that uses a different channel in system mode is between the target agent and the Tornado host tools.

If you wish to arrange another ULIP channel for system-mode debugging, change or override the WDB_ULIP_DEV definition in installDir/target/config/all/configAll.h, and use a target name to match.


*

WARNING: A single Solaris ULIP channel cannot be used for two purposes at one time. Thus, you must not use -p 14 with a VxSim that has system mode enabled on the default channel. Similarly, you can only use system mode (over the default channel) with one VxSim at a time, though you can still debug multiple VxSim processes in task mode at the same time.

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:

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.  

Addressing is according to processor number, such that when you run VxSim with processor number n (with the command vxWorks -p n), the network addresses packets as shown in Table H-4.

Table H-4:  VxSim Network Addressing


Network Interface
Local IP
Target IP

ULIP: Solaris
           Windows 
host IP addr
host IP addr  
127.0.1.n
90.0.0.n1  
PPP  
127.0.1.254 
127.0.1.n  
SLIP  
192.168.2.n 
192.168.1.n  

1:  Note that you can use 90.n.n.n or any other number except 127.n.n.n for a target IP address on a Windows host. 127 is reserved for other purposes on Windows.

Choosing Processor Numbers for Distinct Devices

ULIP (Solaris 2, Windows NT)

When you run VxSim with ULIP and specify processor number n (with the command vxWorks -p n), VxSim for Solaris attaches to /dev/ulipn and uses IP address 127.0.1.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:

Solaris (0xd translates to S_errno_EACCES):

ulipInit failed, errno = 0xd

Windows NT:

Error - 
An Integrated Simulator is already running. 
Only one may be running at a time. 
To run multiple simulators, use the optional Full Simulator. 
Hit Any Key to Exit

When you run VxSim, usrConfig.c creates host entries for vxsim0 through vxsim15 and adds a default route to the host.


*

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.

PPP (Solaris 2)

When you run VxSim with PPP and specify processor number n (with the command vxWorks -p n), VxSim creates a network connection to the IP address 127.0.1.n by communicating through a pipe. Normally, VxWorks uses PPP over a serial device to connect to the host (see VxWorks Networking Guide). The only difference with PPP is that a pipe replaces the physical serial link.

SLIP (HP-UX)

When you run VxSim with SLIP and specify processor number n (with the command vxWorks -p n), VxSim creates a network connection to the IP address specified when you started the ppl process (192.168.1.n) by attaching to a pty device (see Loading SLIP on a HP-UX Host). Normally, VxWorks uses SLIP over a serial device to connect to the host (see VxWorks Networking Guide). The only difference with VxSim is that a pty device replaces the physical serial link.

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 (see Setting Up Remote Access). 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 H-2, host1 can communicate with vxsim0 or vxsim1 if the following steps are taken:

On UNIX, the following commands are issued on host1 (as root):

% route add host 127.0.1.0 90.0.0.1 1 
% route add host 127.0.1.1 90.0.0.1 1

On Windows, the following are added to C:\WINNT\SYSTEM32\drivers\etc\hosts:

90.0.1.0          vxsim0 
90.0.1.1          vxsim1

ULIP is used in this example, but the concept is identical under PPP or SLIP. Contrast Figure H-3 below with Figure H-2, p. 555, to see the way addresses are set up, paying particular attention to the addressing algorithm described in Table H-4.  

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

% ping 127.0.1.0

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:

% route add host 192.168.1.3 90.0.0.2 1


*

NOTE: The Solaris simulator automatically assigns addresses starting with 127. You assign addresses for the HP-UX and Windows simulators when you install SLIP or ULIP. Windows can not use addresses starting with 127.

Setting up the Shared Memory Network (UNIX only)

Many VxWorks users connect multiple CPU boards through a backplane (for example, VMEbus), which allows the boards to communicate through shared memory. VxWorks provides a standard network driver to access this shared memory so that all the higher level network protocols are available over the backplane. In a typical configuration, one of the CPU boards (CPU 0) communicates with the host using Ethernet. The rest of the CPU boards communicate with each other and the host using the shared memory network, using CPU 0 as a gateway to the outside world. For more information on this configuration in a normal VxWorks environment, see VxWorks Networking Guide.

This configuration can be emulated for VxSim. Multiple VxSim processes use a host shared-memory region as the basis for the shared memory network (see Figure H-4).  

To set this up, use a subnet mask of 0xffffff00 to create a 127.0.2.0 subnet (from the 127.0.0.0 network) for the shared memory network. The following steps are required.

  1. Use the bootChange( ) command from the Tornado shell to change the following boot parameter on CPU 0. You must specify the subnet mask, as follows:

inet on backplane (b): 127.0.2.50:ffffff00

  1. Restart VxSim by typing ^X. When VxSim boots, it sets up the shared-memory network and prints the address of the shared memory region it has created (in the VxSim console window, with the other boot messages).

  1. Start CPU 1 (vxWorks -p 1), attach the Tornado target server to it, and then use bootChange( ) to set the following boot parameters on CPU 1. For the boot device parameter, use the address printed in step 2. Leave the "inet on ethernet" parameter blank by typing a period (.).

boot device           :  sm=sharedMemoryRegion 
inet on ethernet (e)  :  . 
inet on backplane (b) :  127.0.2.51:ffffff00 
gateway inet (g)     :  127.0.2.50

  1. Quit CPU 1 and restart it. When it comes up again, it should attach to the shared memory network. To verify that everything is working correctly, ping CPU 1 (from a shell attached to CPU 0) with the following command:

-> ping "127.0.2.51"


*

NOTE: Any time you need to attach a VxSim process within the subnet to the target server, you need to specify it by its new IP address rather than by hostname. All VxSim processors other than 0 are no longer directly accessible to the external network; the processors use vxsim0 as the gateway. The hostnames normally associated with VxSim IP addresses cannot be used, since the routing table entries point to their usual IP addresses. For example, vxsim1 is normally associated with IP address 127.0.1.1; with the shared memory network active, CPU 1 must be addressed through the subnet as 127.0.2.51.

  1. Until you configure your UNIX routing table or Windows hosts file with information on how to reach the new subnet, you will be unable to use network communication between CPU 1 and the host over the shared memory network. To configure the route from UNIX, use the following commands:

% su root 
password: 
# route add net 127.0.2.0 127.0.1.0 1 
# exit 
%

  1. Verify that you can now communicate from the host to CPU 1 over the shared memory network by using ping from the host to CPU 1.

% ping 127.0.2.51
Note that if you attempt to access CPU 1 through its normally associated IP address, it appears to be unavailable:

% ping 127.0.1.1 
ping: no answer

For more information on the shared memory network and network configuration, see VxWorks Networking Guide.


*

NOTE: The optional product VxMP can be used with VxSim. This product provides shared semaphores and other shared memory objects to multiple VxWorks targets over the backplane. VxMP is sold separately. It is not available for the PC simulator.


1:  For more information on run levels, see the Solaris man page for init(1M).