This chapter takes you through the process of setting up a Serial Line Internet Protocol (SLIP) interface on a ChorusOS system. SLIP allows the target system to connect to another system using a direct serial line or modem connection in the same way as an Ethernet connection. If your system does not support serial connections, or if you do not plan to use SLIP with your system, you may skip this chapter.
This chapter also describes how to enable SLIP on a host for use with a ChorusOS system during application development.
ChorusOS systems may support multiple SLIP interfaces,
each of which is identified by a unique name such as sl0.
The binary distribution of the ChorusOS 4.0 product provides support for only
one SLIP line. (If you have the source distribution, you
can increase the number of lines possible by modifying the value of NSL
in the sl.h header file.) See the appropriate
guide in the ChorusOS 4.0 Target Family Documentation Collection to verify serial line support for your particular target system
hardware.
The first serial line on the ChorusOS system is reserved for system debug, and for console access using the host workstation tip(1) utility. It cannot be used for SLIP. The console requires a terminal type cable.
If you are unsure what serial lines your system uses, yet you are able to boot the system, you can use the dtree(1M) utility to display devices listed in the target system device tree:
% rsh target dtree |
ChorusOS systems may be used with modems. The chat(1M) utility can help you handle modem connection and configuration.
This document does not provide information about modem configuration commands, nor does it provide information about the cables required for connecting modems to targets.
As described in "Interface Creation", interface creation is usually performed by including commands in the sysadm.ini file that you build into the ChorusOS system image for your target. In order to create a SLIP interface, use the mkdev(1M) utility as follows:
mkdev sl unit
where unit is the number that makes the interface unique. In order to allow the system to use IP, you must also create a loopback interface.
The following example sysadm.ini fragment creates a SLIP interface and the loopback interface needed for IP communication.
# # Set the file creation mask to 0 during system configuration # umask 0 # # Create a SLIP interface # mkdev sl 0 # # Create a loopback interface # mkdev lo 0
Note that the above commands simply create the interface; nothing is configured for use, yet.
SLIP interfaces rely on tty devices to communicate directly with the serial hardware. You must therefore create at least one tty device for each SLIP line you intend to open.
It is also possible that your applications require a BPF device for raw access to network packets.
The following example sysadm.ini fragment creates a SLIP interface and the loopback interface needed for IP communication. Next, it creates a BPF device for any applications that require one.
# # Set the file creation mask to 0 during system configuration # umask 0 # # Create a SLIP interface # mkdev sl 0 # # Create a loopback interface # mkdev lo 0 # # Create a tty device for the second serial port # # The first serial port is reserved for system debug and console access # through the tip(1) utility on the host workstation # # If you do not know the device tree pathname to the second serial port, # note that the device tree path is visible in the output of dtree(1M). # # Note that major number 0 is conventionally reserved for ttys # mkdev tty 0 # takes first available device # Other possibilities include: #mkdev tty 0 /pci/pci-isa/ns16650-2 #mkdev tty 0 /raven/w83c553/ns16650-2 #mkdev tty 0 /sabre/simba-b/ebus/ns16650-2 mknod /dev/tty01 c 0 0 # # Create a Berkeley Packet Filter device and special file # mkdev bpf 0 mknod /dev/bpf c 23 0
See the appropriate document in the ChorusOS 4.0 Target Family Documentation Collection for serial device IDs for other serial line hardware.
This section explains how to configure Serial Line Internet Protocol (SLIP) with the ChorusOS 4.0 product standard interface and drivers. It assumes the serial line or modem is already physically connected.
Systems often have two IP addresses: one for Ethernet, one for SLIP.
This document differentiates between Ethernet Internet addresses and SLIP addresses. As you read, be aware that hostname refers to the Ethernet hostname corresponding to the Ethernet IP address, and that hostname_SLIP refers to the hostname corresponding to the SLIP address.
Before starting SLIP, make sure that the target system SLIP interface is correctly registered on the local network with the correct IP address, in particular for NFS access.
This section also assumes that you have configured your ChorusOS system image to support the SLIP connection and created the SLIP interface at boot time, even if your system image does not include everything necessary to establish a SLIP connection at boot time.
SLIP as implemented in ChorusOS 4.0 handles attaching the SLIP interface to the serial line using the slattach command, and the chat command to handle modem connections and authentication.
Change to the directory where you build system images:
host% cd build_dir |
Ensure that both serial lines and network interfaces are available for SLIP by including the necessary commands in the conf/sysadm.ini that you build into the system image. For example:
mkdev tty 0 /pci/pci-isa/ns16550-2 # Create a tty interface # using the second serial port # because the first is reserved # for the tip line. mkdev sl 0 # Create a SLIP interface that is # not bound to the tty yet. mknod /dev/tty01 c 6 0 # Create a tty special file # Simple initialization of direct serial line connection # Requires slattach in system image # arun /image/sys_bank/slattach -s 38400 -l /dev/tty01 & # Initialization using chat to connect through a modem # Requires slattach.r, chat.r and chat.cmd in system image # #arun /image/sys_bank/slattach -z -r "'/image/sys_bank/chat \ #-f /image/sys_bank/chat.cmd'" /dev/tty01 & # Configure the SLIP interface # Syntax: ifconfig *interface* *target_SLIP* *host_SLIP* netmask *NETMASK* # ifconfig sl0 129.157.197.88 129.157.197.144 netmask 255.255.255.0
See the appropriate document in the ChorusOS 4.0 Target Family Documentation Collection for serial device IDs for other serial line hardware.
Start the ews configuration utility:
host% ews conf/ChorusOS.xml & |
Use the hints in the table below to set system image features and tunables:
Set... |
Comments |
---|---|
VTTY=true |
SLIP requires virtual ttys. |
SLIP=true |
|
iom.nfs.rsize=512 |
Optimizing NFS read and write buffer sizes for use with SLIP by setting them to a maximum of 512 (must be less than the Maximum Transfer Unit size). |
iom.nfs.wsize=512 |
|
Include the slattach.r actor in the system image.
(Optional) If you need chat, include the chat.r actor in the system image.
(Optional) If you need chat and it needs a chat script, modify the conf/chat.cmd file, and include it in the system image. An example chat script follows:
# Abort if we cannot contact the remote system ABORT BUSY ABORT 'NO CARRIER' # Wait seven seconds max. for the remote system to reply TIMEOUT 7 # Reset the modem, enable RTS/CTS '' ATZ OK AT&K3 # Dial the number 1234567890 OK ATDT1234567890 # Wait one minute max. for the connection TIMEOUT 60 CONNECT ECHO OFF # Wait for the reply TIMEOUT 7 # Login as chatuser with pa55worD ogin:-\\r-ogin: chatuser ssword: pa55worD SAY "Logged in successfully."
Rebuild the system image.
Copy the system image to the boot server:
host% rcp system_image_name boot_server:/tftpboot |
Reboot the target system:
host% rsh target reboot |
Start SLIP by running slattach as an actor:
host% rsh target_SLIP arun /bin/slattach [options] |
This section describes how to configure SLIP on a SolarisTM host for use with a ChorusOS system.
The following procedures concern hosts running Solaris 2.6.
You must be root to install and configure SLIP. If you either do not know the root password for the host system or do not feel comfortable with the tasks required, ask your system administrator to perform the tasks below.
Before attempting to configure SLIP, check that the package SUNWpcnfs is installed on the workstation:
host% pkginfo | grep SUNWpcnfs networking SUNWpcnfs PC-NFS Daemons |
The SUNWpcnfs works on systems running Solaris 2.6.
(Optional) If the SUNWpcnfs package is not installed, get the Solstice NFS ClientTM 3.1 product, and install the package.
During installation, reply y ("yes") to the question, "Do you want to install the PC-NFS SLIP driver?", and n to all other questions.
Make sure /etc/hosts or the NIS configuration files include SLIP addresses for both the host and target systems:
# If you are using /etc/hosts, then include the following lines. # Host SLIP address Host SLIP hostname host_SLIP host_name # Target SLIP address Target SLIP hostname target_SLIP target_name
Start admintool.
host% admintool & |
Select Go to expert mode from the serial port configuration menu.
Unset the Service Enable flag.
Start SLIP:
# slattach ttya host target baud_rate |
Make sure the interface is operational:
# netstat -i Name Mtu Net/Dest Address Ipkts Ierrs Opkts Oerrs Collis Queue lo0 8232 loopback localhost 307 0 307 0 0 0 hme0 1500 host host 14720 268 10827 0 507 0 sl0 1006 target_SLIP host_SLIP 0 0 0 0 0 0 |
If you want the SLIP target to be visible from the whole network, you must enable routing on your workstation.
Enable routing:
# ndd -set /dev/ip ip_forwarding 1 |
Use the proxy-arp command to declare the SLIP target as having the same Ethernet address as the workstation:
# ypcat ethers | grep host Ethernet_address host # arp -s target_SLIP Ethernet_address pub |
This section describes how to configure SLIP on a Windows NT 4.0 host for use with a ChorusOS system.
Setting up Windows NT 4.0 as a host for SLIP communications is not easy, because Windows NT 4.0 is officially only able to act as a SLIP client.
Establishing communication between the Windows NT 4.0 system and the ChorusOS system on the serial line is relatively straightforward. However, making the ChorusOS system visible on the LAN to which the Windows NT 4.0 host is connected is difficult and is not currently supported.
Please use PPP for communications if you want full
routing from the target to the LAN through the Windows
NT 4.0 host. The setup of the Windows NT
4.0
host is only explained in order to allow communication
with both the ChorusOS target and the LAN, without
doing routing between them.
To install the Remote Access Service (RAS), also called Dial-Up Networking (DUN):
Double-click the My Computer icon on the desktop.
Double-click the Dial-Up Networking icon.
If the DUN is not yet installed, Windows NT 4.0 proposes to install it. Click the Install button and follow the directions. Install ChorusOS Cable as the modem type. This modem was created during the installation of the ChorusOS environment.
If the DUN is already installed, click Close to close the dialog box.
To configure the serial cable connection:
Open the Control Panel.
Double-click Modems.
Select ChorusOS cable in the Modem list-box.
Click the Properties button.
Select 9600 in the Maximum Speed combo box.
Click the Connection tab.
Click the Advanced... button.
Check the Record Log File checkbox.
Click OK.
Click OK.
Click Close.
Windows NT 4.0 will suggest reconfiguring the RAS because you have changed the modem. If it does not, for example because the DUN was installed earlier, do the following:
Double-click the Network icon in the Control Panel.
Select the Services tab.
Select the Remote Access Service entry in the Network Services listbox.
Click the Properties button.
Select the COMx ChorusOS Cable line from the list.
Click Configure....
Click the Dial-out radio button in the Port usage group.
Click the Network... button.
Click OK.
Clear every check-box except TCP/IP in the Dial-out Protocols group.
Click Continue.
Click OK.
Click Close.
Windows NT 4.0 will reconfigure its network settings and suggest rebooting the machine. Do so.
After the machine has rebooted, you will be able to establish the connection with the ChorusOS 4.0 target:
Double-click the My Computer icon on the desktop.
Double-click the Dial-Up Networking icon.
If Windows NT 4.0
displays
a message box containing The phonebook is empty. Press OK to add
an entry., press OK. If it displays the Dial-Up Networking dialog box directly, skip the next step.
Follow the directions in the New Phonebook Entry Wizard. Leave all fields at their default values. At the end click Finish. This creates an entry named MyDialUpServer.
Select MyDialUpServer from the Phonebook entry to dial combo box.
Click More.
Select the Edit entry and modem properties item from the popup menu.
In the Edit Phonebook Entry dialog box, select the Basic tab.
Make sure that ChorusOS Cable (COM1) is the value set for the Dial using field.
Click Configure.
Make sure the speed displayed in the Initial speed (bps) combo box is the same you have selected for the Modem.
Check the Enable hardware flow control checkbox.
Clear the Enable modem error control and Enable modem compression checkboxes.
Click OK to close the box.
Select the Server tab.
Select SLIP: Internet as the value for the Dial-up server type field.
Make sure TCP/IP is checked.
Click TCP/IP Settings.
Fill the IP Address field with the IP
address you have selected for the serial interface on the Windows NT 4.0
host in the SLIP TCP/IP Settings
dialog box. The SLIP address must be different from the IP address selected on the ChorusOS 4.0 target side. See below for
more information on selecting the IP addresses.
Clear Force IP header compression. You will not be able to communicate with the ChorusOS 4.0 target if Force IP header compression remains checked.
Clear Use default gateway on remote network. If you leave it checked, you lose access to your LAN after the communication with the target is established.
Click OK twice. Doing so returns you to the Dial-Up Networking window.
Click Dial. Doing so opens the Connect to MyDialUpServer dialog box.
Check Save password.
Click OK.
Click Do not display this message again in the Connection Complete dialog box.
Click OK.
You are now connected to the target at the low level. If you have selected addresses which belong to the LAN for your serial line, you must perform a route command, described below, before being able to reach the target from the host.
If the RAS dialer hangs displaying the Connecting to MyDialUpServer message box with All devices connected and a Cancel button which does not do anything, kill both Dial-Up Networking windows from the Applications tab of the Windows NT Task Manager (press Ctrl-Alt-Del to show it), run Dial-Up Networking again, click the Hang Up button, confirm and then click the Dial button again.
Note that the first IP packet sent to the target after the connection is lost because it is used internally to complete the connection.
If the target system is rebooted, and the line is therefore dropped, you will need to Dial again using the Dial-Up Networking window. Alternatively, you can run rasdial MyDialUpServer from the command line.
It is possible to see a detailed modem-level log, which traces what happens until SLIP communications are started. It is located in the %SystemRoot%\ModemLog_ChorusOS_Cable.txt file and is enabled during serial cable connection configuration. The log may be useful if problems are encountered.