JavaStation Client Software Guide

Chapter 2 JavaStation Boot Process: Theory of Operations

This chapter describes the JavaStation boot sequence and the nature of JavaStation boot services in the Solaris operating environment.

JavaStation Boot Sequence

When the JavaStation computer is powered on, it initiates communication with several different network services to obtain the information and software it requires to operate on the network. The JavaStation boot sequence is accomplished by the following network services:

These services need not reside on the same machine. A DNS service must also be provided on the network for the JavaStation systems to operate correctly, but it is not directly involved in the boot sequence.

The boot sequence can occur in a variety of ways. Essentially, it must accomplish the following tasks:

  1. Lease an IP address to the JavaStation computer. Each JavaStation system must lease an IP address from an address pool managed by a DHCP server. The DHCP server should assign addresses dynamically. The Solaris DHCP server can also assign IP addresses permanently, but this method creates greater administration overhead if many JavaStation computers reside on the network.

  2. Deliver and boot the JavaOS software on the JavaStation computer. The JavaOS image is booted from flash memory if the JavaStation computer has flash memory. Otherwise, the JavaOS image is delivered to the JavaStation computer from a network server via TFTP, NFS, or a combination of TFTP and NFS.

  3. Deliver the main user application to the JavaStation computer. The main user application is either linked directly to the JavaOS boot image or delivered separately to the JavaStation computer via HTTP.

  4. Update the JavaOS image stored in flash memory. This task applies only to JavaStation clients with flash memory ("tower" models). After the JavaStation computer boots, the JavaOS image stored in flash memory is updated if a newer copy of the JavaOS image exists on the network and if flash updating is enabled. If the flash memory is updated, the JavaStation computer immediately reboots with the newer copy of JavaOS.

The following sections describe the JavaStation computer's power-on and boot sequence tasks in detail.

Power On

The JavaStation programmable read-only memory (PROM) includes TFTP, NFS, and DHCP client implementations and is thus able to carry out the boot sequence. At power on, the PROM checks to see if flash memory is present and valid. If so, the PROM loads it into memory and transfers control to it. JavaOS initializes itself and then completes Task 1, described below.

If the above tests fail, the JavaOS image is not loaded from flash into memory, and the PROM proceeds to complete Task 1 itself.

Task 1: Lease an IP Address

Either the PROM or the JavaOS software leases an IP address from the DHCP server by completing the following "handshake" with the JavaStation DHCP server. For simplicity, the description below refers to the PROM or the JavaOS software as "the DHCP client."

  1. The DHCP client broadcasts DHCPDISCOVER packets until a DHCPOFFER is received. The DHCPDISCOVER packet includes the Client Class Identifier option, which identifies the DHCP client as a JavaStation (see "Vendor-Specific Options"). If the broadcast takes an unusually long time, a notice is displayed on the JavaStation screen approximately every minute so the user knows if the server is responding or not.

  2. One or more DHCP servers respond with DHCPOFFER packets. The DHCPOFFER(s) are examined by the DHCP client to determine whether they contain the options required to boot JavaStation computers (see "DHCP").

  3. The DHCP client chooses the best DHCPOFFER it receives that contains the required options. (The best offer is the DHCPOFFER with the most additional options that are applicable to JavaStation computers.) The DHCP client remembers the IP address of the server that sent the offer.

  4. The DHCP client broadcasts a DHCPREQUEST packet. This packet contains the IP address of the server chosen in the previous step. All other DHCP servers that responded in the second step are thus informed that they have not been selected.

  5. The selected server sends a DHCPACK packet back to the DHCP client.

At this point, the JavaStation has received all of its configuration information from the DHCP server. The figure below illustrates the initial handshake.

Figure 2-1 JavaStation Client - DHCP Server Handshake

Graphic

Task 2: Deliver and Boot the JavaOS Software

Task 2 is to pass control of the JavaStation to the JavaOS software. If the JavaOS image has not been loaded from flash memory, it must now be downloaded from the network. The information required for the download was passed to the JavaStation computer in the initial DHCP handshake. Specifically, this information consists of:

The following table shows JavaOS boot information from the DHCP server and the resulting actions taken by the PROM.

Table 2-1 DHCP Information for Booting JavaOS

If the boot protocol is... 

And the DHCP server also delivers... 

The JavaOS software is downloaded and booted as follows  

Not set or TFTP  

The IP address of a server that contains an initial boot program (the "booter") in its TFTP root directory  

The JavaStation PROM downloads the booter from the server using TFTP, then transfers control to it.  

When the booter begins execution, it checks the PROM's device tree for the name and location of the JavaOS image and the name of a server that contains this image in an NFS-exported directory. If the booter does not find this information in the PROM, it obtains it from the DHCP server. The booter mounts this directory using NFS, copies the JavaOS image, and transfers control to it.  

Note that this method of delivery is deprecated in favor of downloading JavaOS directly over NFS.  

 

The IP address of a server that contains the JavaOS image in its TFTP root directory 

The JavaStation PROM downloads JavaOS from the server using TFTP, then transfers control to it.  

Note that this method of delivery is much slower than downloading JavaOS over NFS.  

NFS  

The IP address of a server that contains the JavaOS image in an exported NFS directory 

The JavaStation PROM downloads JavaOS from the server using NFS, then transfers control to it.  

 

The DHCP options used to deliver the above information are described in "The DHCP Service Configuration Table ".

Task 3: Deliver Main Application

The main application can be linked to the JavaOS binary into a single executable that is stored in flash or delivered to the JavaStation computer using either method described in the table above. The method of binding an application to the JavaOS binary is called static linking and is described in Chapter 6, Statically Linking an Application to the JavaOS Image .

Alternatively, a main application is delivered to the JavaStation by a web server (HTTP server) on the network. The URL of the application zip file and other JavaOS application-loading properties are passed to the DHCP client in the initial handshake through the DHCP Vendor-Specific Options, as described in "Vendor-Specific Options". For descriptions of the JavaOS application loading properties, see Chapter 5, Dynamically Loading Applications .

Task 4: Update Flash Memory With New JavaOS Image

Tower model computers may include flash memory to store the JavaOS image. After the JavaOS software finishes its initialization, it determines whether it needs to update the flash memory with a new JavaOS image based on the following criteria:

Both the property and the checksum are delivered by DHCP as Vendor-Specific Options. See "Vendor-Specific Options".

The JavaOS checksum identifies the revision level of the JavaOS image. For more information, see "Managing the JavaOS Checksum".

The results of each possible set of conditions are shown in the table below.

Table 2-2 Conditions for Updating JavaStation Flash Memory

Conditions 

Results  

javaos.alwaysUpdate

Checksum 

 

Not set  

different  

JavaOS software opens a Flash Update dialog box on the JavaStation screen. The user has the option of updating flash memory with the new JavaOS binary. 

Not set  

same  

JavaOS software does not update the flash memory.  

true

different  

JavaOS software updates flash memory without querying the user.  

true

same 

JavaOS software does not update the flash memory.  

false

different  

JavaOS software does not update the flash memory.  

false

same  

JavaOS software does not update the flash memory.  

If the flash memory is updated, the JavaStation computer immediately reboots with the newly updated JavaOS image.

Note that if any of the following conditions exist, flash memory is never updated:

JavaStation Boot Services

This section describes how DHCP, TFTP, NFS, and HTTP services are used to administer JavaStation computers on your network.

DHCP

This section provides a description of DHCP configuration (in files) for JavaStation clients. Complete instructions for setting up a Solaris DHCP server are provided in Chapter 4 of the TCP/IP Data Communication Administration Guide, available at http://docs.sun.com, and in the following Solaris man pages:


Note -

Only experienced Solaris system administrators should set up boot services for JavaStation computers using Solaris commands. Inexperienced Solaris users should use the Netra j software. For information on Netra j, go to http://www.sun.com/netra-j or refer to the Netra j 3.0 Administrator's Guide.


The DHCP server manages a pool of IP addresses for a variety of systems on the subnet, including JavaStation computers. During the boot sequence, the DHCP server delivers to the JavaStation its IP address along with other options that enable the JavaStation computer to operate on the network.

There are three types of configuration information for DHCP in the Solaris operating environment:

The /etc/default/dhcp File

The /etc/default/dhcp file defines where DHCP configuration files are located. The following is a sample dhcp file.


# This file controls the defaults for datastore type and location
# for the DHCP service. Two directives are currently supported,
# RESOURCE and PATH. RESOURCE can be either "files" or "nisplus." 
# PATH can be a UNIX pathname for "files" resources, or a legal 
# NIS+ directory for "nisplus" resources.
#
RESOURCE=files
PATH=/var/dhcp 

The DHCP Network Table

The DHCP network table contains a single entry for each client. Each entry contains the client identifier, the client IP address, the lease time, and other information. The DHCP server updates the network table dynamically as IP addresses are leased or relinquished by the clients.

A full description of the DHCP network table is provided in the dhcp_network(4) man page. The following is an example network table contained in a file named /var/dhcp/192_9_100_0.


# /var/dhcp/192_9_100_0
#
# Client ID|Flags|Client IP Addr|Server IP Addr|Lease Time|Macro
# 
010800208E2091 00 192.9.100.10 129.144.205.69 876425811 elvis 
010060972CF0D6 00 192.9.100.11 129.144.205.69 876432501 elvis
0108002087EC88 00 192.9.100.12 129.144.205.69 876507437 elvis
00 00 192.9.100.13 129.144.205.69 0 elvis
00 00 192.9.100.14 129.144.205.69 0 elvis

The DHCP Service Configuration Table

The DHCP Service Configuration Table contains groups of DHCP options that are delivered to DHCP clients. For a complete description of this table, refer to the dhcptab(4) man page. Throughout this section this table will be called the dhcptab file.

The DHCP options that can be delivered to JavaStation computers are a subset of all the options supported by the DHCP specification. Some DHCP options are required for a successful JavaStation boot; others are optional.

Required DHCP Options

The following table lists the DHCP options required in dhcptab to boot JavaStation computers. The left column gives the option number as defined in the DHCP specification (RFC 2132), if it exists. The middle column gives the symbol name for the option in the Solaris implementation of DHCP (the name used in dhcptab). See "Sample dhcptab File " to see how these names are used.

Table 2-3 DHCP Options Required to Boot JavaStation Computers

DHCP Option Name (Number) 

Symbol Name in Solaris dhcptab File

Definition  

N/A (This symbol is a DHCP field, not an option.) 

BootSrvA

The IP address of the server with the initial boot file (either the booter or the JavaOS image). See Table 2-6 for more information.

IP Address Lease Time (51)  

LeaseTim

The duration (in seconds) of the IP address lease. A value of -1 indicates an infinite lease. After this period of time has expired without being renewed, the JavaOS software shuts down the networking port.

Subnet Mask (1)  

Subnet

The subnet mask. 

Domain Name Server (6)  

DNSserv

The IP addresses of one or more DNS servers. The JavaOS software queries additional DNS servers if the primary server fails to respond.  

DNS Domain Name (40)  

DNSdmain

The DNS domain name. 

Root Path (17)  

Rootpath

The NFS-exported directory containing the JavaOS image. This option is used by the booter to locate the JavaOS binary and by the JavaOS software to locate a newer image to update the flash. This option is required if you are using the booter method or if flash update is enabled. See Table 2-6 for more information.

The options DHCP Message Type (53) and Server Identifier (54) are also required in every DHCP packet. However, these options are provided automatically by the DHCP server and do not need to be specified in dhcptab.

Optional DHCP Options

The following table lists the DHCP options that can be interpreted by the DHCP client during the JavaStation boot sequence but are not necessarily required for the boot sequence.

Table 2-4 Optional DHCP Options for Booting JavaStation Computers

DHCP Option Name (Number)  

Symbol Name in Solaris dhcptab File

Definition  

Bootfile Name (67)  

Bootfile

The path name of the initial boot file, which can be a "booter" file or the JavaOS software. The path name is assumed to be relative to the TFTP root directory.  

If this option is not provided, the name of the booter is assumed to be the same as the Client Class Identifier (SUNW.JDM1 for a brick model; SUNW.JSIIep for a tower model) and is assumed to be in the TFTP root directory. See Table 2-6 for more information.

Broadcast Address (28)  

Broadcst

The network broadcast address.  

Router (3) 

Router

The IP address of the router to be used by the JavaStation clients. If not given, the JavaOS software uses router discovery to locate a router.  

Time Server (4)  

Timeserv

The IP address of a server supporting the RFC 868 time protocol.  

N/A (Solaris-specific flag) 

LeaseNeg

A boolean flag which by its presence tells the DHCP server to renew the leases of clients requesting IP address lease renewal.  

NIS Servers (41) 

NISservs

If the IP address of an NIS server is not given, the JavaOS software broadcasts looking for NIS servers. (This works only if the NIS server is on the same subnet.) 

NIS Domain Name (40) 

NISdmain

The NIS domain name. 

Vendor-Specific Options (43) 

Symbol names are defined by the user. By convention, use JOScmd1 through JOScmd4,

JOSchksm, and JSBproto

A list of vendor-specific options. See "Vendor-Specific Options".

See "Sample dhcptab File " for examples of how these options are set in dhcptab.

Vendor-Specific Options

The DHCP specification enables hardware and software vendors to create their own DHCP options. These options are delivered through the use of the Client Class Identifier option and the Vendor-Specific Options option. If a DHCP client identifies itself as being of a certain class of client, and the DHCP server has been configured to serve that class of clients, then the DHCP server can respond with a set of options specific to that client type.

Vendor-Specific Options can be used to deliver the JavaOS checksum, JavaOS property settings, and the JavaOS boot protocol to the JavaStation computer during the boot sequence.

The delivery of Vendor-Specific Options to JavaStation clients works as follows. The DHCP client on the JavaStation (the PROM or the JavaOS software) includes the JavaStation hardware's Client Class Identifier (DHCP Option #60) in every packet sent to the DHCP server. When the DHCP server receives the Client Class Identifier, it will deliver the JavaOS checksum, boot protocol, and/or property settings in the Vendor-Specific Options if it has been configured to do so.

The JavaStation hardware's Client Class Identifier is specified in the PROM. The table below lists the Client Class Identifiers for each JavaStation model.

Table 2-5 JavaStation Client Class Identifiers

JavaStation Model 

Client Class Identifier 

Brick model 

SUNW.JDM1

Tower model 

SUNW.JSIIep

Examine the sample dhcptab file below for examples of setting the JavaOS checksum and JavaOS properties in dhcptab. Note, however, that JavaOS properties can be delivered to the JavaOS software using methods other than the DHCP Vendor-Specific Options. See Chapter 4, JavaOS Properties for more information.

Sample dhcptab File

The following sample dhcptab file supplies DHCP options to a variety of clients on a network. Some options are common to all clients. Other options are specific to clients attached to the server, to classes of JavaStation clients, or to specific JavaStation machines. Note that dhcptab can serve many different clients, not just JavaStation computers.


# /var/dhcp/dhcptab
#
# This file is a sample DHCP server configuration database for 
# JavaStation clients.
#
# Refer to dhcptab(4) for details. This table is generated by
# using the dhcpconfig(1M) command in conjunction with the
# dhtadm(1M) command. It can be administered with the dhtadm
# command.

# The following are symbol definitions for the Vendor-Specific 
# Options. Symbol definitions are used to create dhcptab macros.
# Refer to the dhcptab(4) man page for symbol definition syntax and
# instructions on creating macros. 

# JOScmd1-4 are for JavaOS properties, JOSchksm is for the 
# JavaOS checksum, and JSBproto is for the JavaOS boot protocol. 

JOScmd1				s		Vendor=SUNW.JSIIep SUNW.JDM1,101,ASCII,1,0
JOScmd2				s 		Vendor=SUNW.JSIIep SUNW.JDM1,102,ASCII,1,0
JOScmd3				s 		Vendor=SUNW.JSIIep SUNW.JDM1,103,ASCII,1,0
JOScmd4				s 		Vendor=SUNW.JSIIep SUNW.JDM1,104,ASCII,1,0

JOSchksm 				s 		Vendor=SUNW.JSIIep,128,NUMBER,4,1

JSBproto				s		Vendor=SUNW.JSIIep,129,ASCII,1,0


# Standard macros generated when configured with dhcpconfig(1M). # The first is the time offset from GMT (UTC) time, the second
# applies to all clients serviced by this server, and the third
# applies to all clients attached to one of the nets attached to
# the server.

Locale			m 	:UTCoffst=-25200:

gibson			m 	:Include=Locale:Timeserv=10.146.103.191:\
				:LeaseTim=259200:LeaseNeg:\
				:DNSserv=10.146.1.151 10.146.1.152 10.144.1.57:\
				:DNSdmain=foo.bar.com:
10.146.103.0						m 		:Broadcst=10.146.103.255:\
								:Subnet=255.255.255.0:\
								:MTU=1500:Router=10.146.103.1:\
								:NISdmain=nis.foo.bar.com:\
								:NISservs=10.146.103.22:\
								:BootSrvA=10.146.103.191:

# These are macros used to configure specific classes of clients. 
# In this case the JavaStation tower and brick models respectively.

SUNW.JSIIep						m 		:Rootpath="/export/root/javaos/JSIIep":\
								:JOScmd1="-ihttp://gibson:8080/properties":\
								:JOSchksm=0x13d624be:

SUNW.JDM1				m 			:Rootpath="/export/root/javaos/JDM1":\
							:JOScmd1="-ihttp://gibson:8080/properties.JDM1":

# The macros below contain individual DHCP options for the two
# JavaStation computers whose client ID's (derived from the
# Ethernet address) match the keys. Here each JavaStation gets 
# its boot image from a boot server other than the DHCP server. 
# The first JavaStation uses NFS to directly download the 
# JavaOS image. The second JavaStation computer gets a different
# properties file as well as empty vendor options that override
# any previous default definitions.

0800208E0668						m 			:BootSrvA=10.146.103.11:\
									:JOSchksm=0x13b74098:JSBproto="nfs":

08002087BED4						m 			:BootSrvA=10.146.103.114:\
									:JOScmd1="-ihttp://redwings/properties":\
									:JOScmd2="":JOScmd3="":JOScmd4="":\
									:JOSchksm=0x13dd4e2d:

Managing the JavaOS Checksum

Each time you receive a new copy of the JavaOS software, you can configure the DHCP server to deliver the new copy to JavaStation computers by following the first set of instructions below. To disable JavaOS updating on the JavaStation computers, follow the second set of instructions.

To Configure the DHCP Server for a New JavaOS Binary
  1. Determine the checksum.

    The checksum is contained in the first 4 bytes of the last 12 bytes of the JavaOS binary file.


    % tail -12c  javaos | od -X | nawk '{print "0x" $2}'
    14eb02a1 

  2. Use dhtadm to add the new checksum to the DHCP configuration.


    % dhtadm -M -m SUNW.JSIIep -e JOSchksm=0xchecksum 
    

For example,


% dhtadm -M -m SUNW.JSIIep -e JOSchksm=0x14eb02a1 

When each JavaStation computer boots, its flash memory is updated with the new JavaOS binary and then is rebooted using the new JavaOS binary. This action may be automatic or require user confirmation, depending on other options.

To Disable JavaOS Updating
  1. Set the checksum to zero:


    % dhtadm -M -m SUNW.JSIIep -e JOSchksm=0
    

or

  1. Delete the checksum entirely from the DHCP configuration:


    % dhtadm -M -m SUNW.JSIIep -e JOSchksm= 
    

Note that there is nothing after the equal sign.

TFTP

If a TFTP server will be involved in the boot sequence, set it up using the instructions below. For information on selecting TFTP to be used in the boot sequence, see Table 2-1.


Note -

Only experienced Solaris system administrators should set up boot services for JavaStation computers using Solaris commands. Inexperienced Solaris users should use the Netra j software. For information on Netra j, go to http://www.sun.com/netra-j or refer to the Netra j 3.0 Administrator's Guide.


To Set Up a JavaStation TFTP Server
  1. Follow the instructions in the TCP/IP and Data Communications Administration Guide to configure a server on the network as a TFTP server.

    This guide is available on the Web at http://docs.sun.com.

    Also, refer to the inetd(1M) and in.tftpd(1M) man pages.

  2. Use dhtadm to set the JavaStation boot protocol to TFTP.

    Set the JSBproto vendor-specific option to tftp. See "Vendor-Specific Options" for more information.

  3. Use dhtadm to add other TFTP boot information to the dhcptab file, as described in the following table:

    Table 2-6 DHCP Option Settings for TFTP

    If the TFTP server delivers.. 

    Set the following in dhcptab...

    Relative Performance 

    The booter  

    • Set Bootfile to the path name of the booter file. The path name is assumed to be relative to the TFTP root directory. (If Bootfile is not set, the name of the booter file is assumed to be the Client Class Identifier - SUNW.JDM1 for a brick model; SUNW.JSIIep for a tower model.)

    • Set BootSrvA to the IP address of the TFTP server.

    • Set Rootpath to the directory on the NFS server where the JavaOS image is located.

     Fast

    The JavaOS image 

    • Set Bootfile to the path name of the JavaOS image. The path name is assumed to be relative to the TFTP root directory.

    • Set BootSrvA to the IP address of the TFTP server.

    • To enable flash update after the boot, set Rootpath to the directory on the NFS server where the JavaOS image is located.

    (A case using all three of the above settings would be unusual. Typically, the JavaStation computer boots straight from flash, not the network, before a flash update.)  

    Slow 

NFS

If an NFS server will be involved in the boot sequence, set it up using the instructions below. For information on selecting NFS to be used in the boot sequence, see Table 2-1. Using NFS as the boot protocol is the fastest method for delivering JavaOS software to the JavaStation computers.


Note -

Only experienced Solaris system administrators should set up boot services for JavaStation computers using Solaris commands. Inexperienced Solaris users should use the Netra j software. For information on Netra j, go to http://www.sun.com/netra-j or refer to the Netra j 3.0 Administrator's Guide.


To Set Up a JavaStation NFS Server
  1. Follow the instructions in the NFS Administration Guide to configure a server on the network as an NFS server.

    This guide is available on the Web at http://docs.sun.com.

  2. If a booter file will not be used in the boot process, use dhtadm to set the JavaStation boot protocol to NFS.

    Setting the JSBproto vendor-specific option to nfs. See "Vendor-Specific Options" for more information.

  3. Use dhtadm to set Rootpath to the directory on the NFS server where the JavaOS image is located.

  4. Use dhtadm to set BootSrvA to the directory on the NFS server where the JavaOS image is located.

HTTP

The HTTP (web) server can deliver the user's main application to the JavaStation.


Note -

The user's main application can also be linked to the JavaOS image. For instructions, see Chapter 6, Statically Linking an Application to the JavaOS Image .



Note -

Only experienced Solaris system administrators should set up boot services for JavaStation computers using Solaris commands. Inexperienced Solaris users should use the Netra j software. For information on Netra j, go to http://www.sun.com/netra-j or refer to the Netra j 3.0 Administrator's Guide.


To Set Up a JavaStation Web Server
  1. Follow the vendor's instructions for setting up the web server.

  2. Prepare the application to be delivered to the JavaStation computers.

    See Chapter 5, Dynamically Loading Applications for instructions.

  3. Set JavaOS application loading properties.

    See Chapter 5, Dynamically Loading Applications for instructions.