★ wanayoo — archive 1999 http://linux-decnet.sourceforge.net/lat.htmlNouvelle recherche | Portail wanayoo
 
DECnet for Linux

A project to provide DECnet phase IV connectivity for Linux
 

LAT
 

LAT

This is a quick guide to using LAT on Linux systems. I am assuming that you already have the latd package installed and that the latcp command is on root's PATH. I'm sorry all the terminal server examples are for the (very obsolete) DECserver 200 but that's all I have!

In this document I refer to latd as the daemon that is running in the background accepting incoming connections and marshalling outgoing ones, latcp is the LAT control program which is the user interface to latd.

Starting and stopping it

latcp -s starts the lat daemon.
latcp -h stops the daemon.
By default (ie if you haven't customised the startup script) latd will advertise a service which is the hostname of your Linux system. This means that any users that have terminals connected to a terminal service will be able to log in to your system by typing the appropriate connect command to the terminal server. On a DECserver 200 this would be "CONNECT LINUX" if your machine's host name is "linux". Of course, if the users does not have a username on the system they will not be able to get past the login prompt.

When latcp starts the daemon it runs a startup script called /etc/latd.conf and is a conventional shell script. If you want to customise the way LAT works then this is the place to do it. The rest of this document explains the latcp commands that you can use to customise LAT and it is normal to put theses commands in the startup script so that they take effect each time the system is rebooted.

When you stop latd all users are instantly disconnected. They will get no warning and work will not be saved.

Service names

latd can advertise many services, not just one for the host name. So (for example) you could add a new service called LINUX on all linux machines running latd and then users can connect to LINUX and they will be attached to the server with the lowest load average.

To add such a service use the command latcp -A -a LINUX. This tells latd to advertise the new service along with the default one using the same rating.

To remove this service use the command latcp -D -a LINUX.

Services have an optional description associated with them which can show up on some terminal servers if the user issues a SHOW SERVICE command. The description is added to the service with the -i switch. eg: latcp -A -a LINUX -i "Linux login service"
Note that the description must be enclosed in quotes if it contains spaces. To change the description of an existing service use the following command:
latcp -i "Linux is wonderful" -a LINUX

Service ratings

Every advertised service has a rating associated with it. This rating is used in the terminal servers' load balancing algorithm to determine which node to connect to when more than one system advertises the same service name. By default, services advertised by latd are dynamic, that is they vary according to the load on the system. The value you specify on the latcp command line is a maximum, this value is divided by the current load average plus one each time the service is advertised on the LAN.

So, if you create a service with rating of 100 using the following command:
latcp -A -a LINUX -r 100
and the load average is 1.00, then the advertised rating will be 50. If you have several machine advertising the the same service then, to achieve effective load balancing, the rating specified on the command-line should reflect the relative power of the machines offering that service.

In addition, ratings can be static. A static rating does not vary with the system load average. If you create a service with the following command:
latcp -A -a LINUX -r 100 -s
Then the rating will always be 100 regardless of how busy the system is.

Reverse LAT

The "normal" use of LAT is to allow a terminal, connected to a terminal server to log in to a computer. "Reverse-LAT" goes the other way, the computer makes a connection to a port on the terminal server. This has a number of uses: the two most popular are
To do this you first need to create a service on the terminal server. How to do this varies on the model of terminal server you have so consult the documentation for your device. The command for a DECserver 200 is as follows:
DEFINE SERVICE MYVAX PORT 4
This creates a service called MYVAX which is associated with port 4 on the terminal server. Note, you may also have to set the port characteristics to match those of the printer and set the access type to "Remote". Now, assuming you have connected the serial console of your VAX to port 4 of the terminal server and the server is called DS200, you can issue the following command on the linux machine:
latcp -A -p /dev/lat/myvax -Hds200 -Vmyvax
If you now connect a terminal emulator program (say minicom, seyon or microcom) to /dev/lat/myvax you can log in to the console of the VAX and issue commands as if the terminal was local. If it doesn't work then there are a few things to check:

In the case of a printer that is shared by several machines you may want to make it a queued connection. This means that if the printer is busy, any other machine that tries to connect to it will be forced to wait until it is ready. To do this set the port to be queued on the terminal server and specify the reverse-lat port to be queued by adding -Q to the command line as follows:
latcp -A -p /dev/lat/printer -Hds200 -Vprinter -Q

Groups

Groups on LAT are a method of restricting the visible services to a manageable subset. They are not a security feature, merely a method of making a large number of services more manageable.

When a service is advertised on the LAN it can have any number of groups associated with it. A group is a number from 0 to 255. By default all services are in group 0. On the terminal server you can restrict the group numbers that it will listen for services on. So, for example, a terminal server in the sales department could have only group 10 enabled, a terminal service in the production department could have only group 20 enabled. The host machines providing these services would advertise sales service in group 10 and production services in group 20. The computer department servers would probably have all the groups enabled so that they could connect to all the services.

Because latd is both a client and a server it has two sets of group codes. One set (that manipulated by the -G and -g switches) determines the group numbers that the advertised services use. So, if we execute the following latcp commands:
latcp -G 10
latcp -A -a LINUX -i "Linux login service"

Then the service LINUX will be advertised in groups 0 and 10 (group 0 is always on by default). You could remove it from group 0 with the following command: latcp -g 0
Set up like this, only terminal services listening for services in group 10 would see the LINUX service.

The other group set (that manipulated by the -U and -u switches) determines which services can be used by the reverse-LAT ports. So, if you issue the following commands:
latcp -u 0
latcp -U 20

Then you would only be able to connect reverse LAT ports to services that were advertised in group 20 (ie you could not connect to the LINUX service!).

Other things you can fiddle with

Most of the operational parameters of latd can be configured with latcp. I recommend you leave these alone unless you know what you are doing though.

What's happening with the server?

You can show the status of the server with the latcp -d command which produces output something like this:
Node Name:  DOUGHNUT            LAT Protocol Version:       5.2
Node State: On                  LATD Version:               0.8
Node Ident: A Linux box

Service Responder : Disabled

Circuit Timer (msec):     80    Keepalive Timer (sec):     20
Retransmit Limit:         20
Multicast Timer (sec):    30

User Groups:     0
Service Groups:  0

Service Name   Status   Rating  Identification
DONUT          Enabled    12 D  
LINUX          Enabled   100 D  

Port                    Node            Service         Remote Port     Queued
/dev/lat/bacon          BACON           BACON                           No
/dev/lat/lta1           DS200           DECSERVER       PORT_1          Yes

The services show are the services advertised by this machine. If you want to see a list of services that are on the network that have been seen by this machine (remember groups!) then use the command latcp -d -l which gives output like this:
BACON             Available     Welcome to VAX/VMS V5.5    
BALTI             Available    Compaq Tru64 UNIX V5.0A LAT SERVICE
DONUT             Available    Linux 2.2.16
LINUX             Available    Linux 2.2.16

If you really want the full lowdown on the services that latd has seen then the command latcp -d -l -v will tell you everything you wanted to know!

The startup script

The above commands show you how to configure LAT, these commands will very likely be the same every time you boot the system or restart LAT so it makes sense to have some system of executing a series of commands every time you issue the latcp -s command and so there is.

Put your commands into a file called /etc/latd.conf and it will be run every time you start LAT. The only change you should make is to replace the latcp command with the string $LATCP so that the script can find the latcp program regardless of whether it is on the PATH or not.

The reason you should use /etc/latd.conf rather than writing your own script to start LAT and then set the parameters is that latd does not actually advertise any services or accept any network connections until the startup script has completed. This means you can configure all the parameters and make sure that nothing happens with the defaults in place. Here is an example startup script:

# /etc/latd.conf
# This is a sample configuration file for latd
# it is run as s shell script from latcp -s with a minimal
# environment and PATH (though latcp will be available as $LATCP)
#
# You can fiddle with all the latd parameters you like in here, the first
# service announcement will not be made until this script completes.
#
#

# Set the multicast timeout to 30 seconds
$LATCP -m 30 

# Add another login service
$LATCP -A -a LINUX -r 100

# Add a reverse LAT service to BACON
$LATCP -A -p /dev/lat/bacon -Hbacon -Vbacon

# Set up a general purpose port 
$LATCP -A -p /dev/lat/lta1 -Hdecserver -Vds200 -RPORT_1 -Q

exit



Go back to the DECnet for Linux Home Page