13. TFTP: Trivial File Transfers

Introduction

The Trivial File Transfer (TFTP) utility provides the user interface to TFTP. This program allows a user to transfer files to and from a remote host.  TFTP primarily allows remote diskless systems to read bootstrap images over the network. TFTP uses UDP to make transfers. It does not provide user login validation.

See Chapter 4 of the Installation and Configuration Guide for information about configuring the TFTP server.

FTP-OpenVMS is a more complete file transfer facility than TFTP.

See Chapter 3, FTP: Transferring Files, for details on FTP-OpenVMS.

Invoking TFTP

To invoke TFTP, enter at the DCL prompt:

TFTP [host [port]]

If you specify a host name, TFTP uses that host for subsequent file transfers. If you also specify a port number, TFTP uses the specified host and port for subsequent file transfers.

Command Reference

You interact with TFTP by typing commands at the TFTP> prompt. Client-TFTP supports the following OpenVMS-style commands:

CONNECT

MODE

REXMT

TIMEOUT

HELP

GET

PUT

STATUS

TRACE

QUIT

 

TFTP offers 20-line recall on the command level.


 

CONNECT

Sets the host and, optionally, the port number for subsequent file transfers. Note that TFTP uses UDP and, therefore, does not maintain the connection between transfers.

Format

CONNECT host [port]

Synonym

OPEN

Parameters

host

Name of the remote host to which you want to connect. The host must exist on the network.

port

Service name or number of the remote port that you want to connect to. The default port number is 69 for read and write requests. You do not need to specify the port number unless you are connecting to a nonstandard server.

Example

Each of these equivalent commands connects to host SIGMA for a file transfer:

tftp>connect sigma
tftp>open sigma


 

GET

Gets a file from the previously specified remote host. TFTP writes the local file as a STREAM_LF formatted file.

Since TFTP does not authenticate the client, the server allows access only to files in the directory and its subdirectories defined by the TCPWARE_TFTP_ROOT logical.

The server converts UNIX filenames with their directories into VMS filenames as in Table 13-1. The directory specification is dir and the filename specification with its extension is filename.ext.

Table 13-1     TFTP UNIX-to-VMS Filename Conversions

UNIX Filename...

Is Converted to VMS Filename...

dir/filename.ext

[.dir]filename.ext

/dir/filename.ext

[.dir]filename.ext

 

Format

GET remote-file [local-file]

Parameters

remote-file

Input file specification on the remote host.

local-file

Output file specification on the local host. If omitted, Client-TFTP uses the remote-file filename and extension.

Examples

1   This command transfers the US-DOMAIN-INFO.TXT file from the previously specified host:

tftp>get us-domain-info.txt

2   This command transfers the US-DOMAIN-INFO.TXT file from the previously specified host as file LOCALSTUFF.TXT:

tftp> get us-domain-info.txt localstuff.txt


 

HELP

Displays a brief help message summarizing the commands.

Format

HELP [command]

Parameter

command

Optional command for which you want help.

Examples

This command provides help for the CONNECT and GET commands:

tftp>help connect
connect to remote tftpd
tftp> help get
receive file


 

MODE

Sets the file transfer mode to type; type may be either ASCII or BINARY. The initial type is ASCII.

Format

MODE type

Parameter

type

The mode type, either ASCII or BINARY.

Example

This command changes the transfer mode to BINARY (Mode: octet):

tftp>mode binary
tftp> status
Connected to SIRIUS.nene.com.
Mode:
octet Tracing: off
Rexmt-interval: 5 seconds, Max-timeout: 25 seconds


 

PUT

Puts a file to the previously specified remote host.

Since TFTP does not authenticate the client, the server allows access only to files in the directory and its subdirectories defined by the TCPWARE_TFTP_ROOT logical.

The server converts OpenVMS filenames with their directories into UNIX filenames as in Table 13-2. The directory specification is dir and the filename specification with its extension is filename.ext.

Table 13-2     TFTP UNIX-to-VMS Filename Conversions

UNIX Filename...

Is Converted to VMS Filename...

dir/filename.ext

[.dir]filename.ext

/dir/filename.ext

[.dir]filename.ext

Format

PUT local-file [remote-file]

Parameters

local-file

Input file specification on the local host.

remote-file

Output file specification on the remote host. If omitted, Client-TFTP uses the local-file filename and extension.

Examples

1   This command transfers the US-DOMAIN-INFO.TXT file to the previously specified host:

tftp>put us-domain-info.txt

2   This command transfers the US-DOMAIN-INFO.TXT file to the previously specified host as file REMOTESTUFF.TXT:

tftp>put us-domain-info.txt remotestuff.txt


 

QUIT

Exits the TFTP program. You can also use Ctrl/Z and EXIT to exit the program.

Format

QUIT

Synonyms

EXIT

Ctrl/Z

Examples

Each of these equivalent commands exits from TFTP:

tftp>quit
tftp>exit
tftp>Ctrl/Z


 

REXMT

Sets the retransmit timer, in seconds. The initial value is 5 seconds.

The value you enter for REXMT is also used together with the specified maximum timeout (set using the TIMEOUT command) to determine the number of times to try and the actual maximum timeout reported in a status request (STATUS).

If the default 5 seconds retransmit interval is used together with the default 25 seconds maximum timeout, the number of times to try is 5, according to the formula:

Max-timeout = Rexmt-interval x Tries

The REXMT value you enter is always reported (unchanged) on the Rexmt-interval line in a STATUS request. However, the maximum timeout may be recalculated before being reported as Max-timeout.

See theTIMEOUT command for details on Max-timeout recalculation.

Format

REXMT[time]

Parameter

time

The time value to set the retransmit timer. If omitted, the value is 5 seconds.

Example

This command changes the retransmit timer (Rexmt-interval) to 10 seconds (and the subsequent STATUS command shows the result). The Max-timeout is set to five times the Rexmt-interval by default.

tftp> rexmt 10
tftp>status
Connected to SIRIUS.nene.com.
Mode:
octet Tracing: off
Rexmt-interval: 10 seconds, Max-timeout: 50 seconds


 

STATUS

Displays the current status and parameter settings.

The Max-timeout reported is based on the following computation:

Max-timeout = Rexmt-interval x Tries

The number of tries (Tries) is initially 5 unless adjustments are made to the Max-timeout and Rexmt-interval values (see below for an example).

Note!     The total retransmission period (Max-timeout) value displayed may be slightly different from that set using the TIMEOUT command. (See theTIMEOUT command for an explanation.)

Format

STATUS

Examples

This command shows the connection status, file transfer mode (Mode:), packet trace flag status (Tracing:), retransmit timer (Rexmt-interval:), and total retransmission period (Max-timeout:) values over the period of a number of adjustments. (See theTIMEOUT command for an explanation of the Max-timeout recalculations.)

tftp> connect spica
tftp>stat
Connected to spica.nene.com.
Mode: netascii Tracing: off
Rexmt-interval: 5 seconds, Max-timeout: 25 seconds
tftp>rexmt 4
tftp> stat
Connected to spica.nene.com.
Mode: netascii Tracing: off
Rexmt-interval: 4 seconds, Max-timeout: 20 seconds
tftp>timeout 40
tftp> stat
Connected to spica.nene.com.
Mode: netascii Tracing: on
Rexmt-interval: 4 seconds, Max-timeout: 40 seconds
tftp>timeout 30
tftp>stat
Connected to spica.nene.com.
Mode: netascii Tracing: on
Rexmt-interval: 4 seconds, Max-timeout: 28 seconds


 

TIMEOUT

Sets the total retransmission period, in seconds. The initial value is 25 seconds.

Note!     Minor adjustments to the specified retransmission period as reported using STATUS can occur based on concurrent changes made to the retransmit timer setting (REXMT). The retransmission period is calculated based on the following formula:

 Max-timeout = Rexmt-interval x Tries

The Tries value must be an integer value. Thus, if the Max-timeout specified using the TIMEOUT command forms a non-integer ratio with the Rexmt-interval value, the Max-timeout is adjusted accordingly. (See the example.)

Format

TIMEOUT [time]

Parameter

time

The total retransmission period, in seconds. If omitted, the value is 25 seconds.

Examples

Note the way in which the retransmission period is adjusted in this example:

tftp>connect spica
tftp>stat
Connected to spica.nene.com.
Mode: netascii Tracing: off
Rexmt-interval: 5 seconds, Max-timeout: 25 seconds
tftp>rexmt 4
tftp> stat
Connected to spica.nene.com.
Mode: netascii Tracing: off
Rexmt-interval: 4 seconds, Max-timeout: 20 seconds
tftp>timeout 40
tftp>stat
Connected to spica.nene.com.
Mode: netascii Tracing: on
Rexmt-interval: 4 seconds, Max-timeout: 40 seconds
tftp>timeout 30
tftp> stat
Connected to spica.nene.com.
Mode: netascii Tracing: on
Rexmt-interval: 4 seconds, Max-timeout: 28 seconds

  The retransmit timer and number of tries are both set to 5 by default, so that initially the Max-timeout is 25.

  With the retransmit timer (rexmt) reset to 4, the Max-timeout changes to 4 x 5 = 20.

  Doubling the maximum timeout (timeout 40), recalculates the number of retries to 40 / 4 = 10.

  Changing the maximum timeout to 30 (with the rexmt still set to 4) recalculates the retries to 7, and adjusts the Max-timeout to 4 x 7 = 28.


 

TRACE

Toggles the packet trace flag.

Format

TRACE

Example

This command enables packet tracing. A GET operation shows a timeout on a file transfer read request.

tftp>trace
Packet tracing on.
tftp>status
Connected to SIRIUS.nene.com.
Mode: octet Tracing: on
Rexmt-interval: 10 seconds, Max-timeout: 60 seconds
tftp> get rfc999.txt pokertwo.txt
rqst sent RRQ <file=rfc999.txt, mode=octet>
rqst sent RRQ <file=rfc999.txt, mode=octet>
rqst sent RRQ <file=rfc999.txt, mode=octet>
rqst sent RRQ <file=rfc999.txt, mode=octet>
rqst sent RRQ <file=rfc999.txt, mode=octet>
rqst sent RRQ <file=rfc999.txt, mode=octet>
Receive request timed out