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.
TCPware’s FTP implementation is a more complete file transfer facility than TFTP. See Chapter 3, FTP: Transferring Files, for details on FTP.
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.
You interact with TFTP by typing commands at the TFTP> prompt. The TFTP client 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.
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.
CONNECT host [port]
OPEN
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.
Each of these equivalent commands connects to host SIGMA for a file transfer:
tftp>connect sigma
tftp>open sigma
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 the below table. The directory specification is dir and the filename specification with its extension is filename.ext.
UNIX Filename... |
Is Converted to VMS Filename... |
dir/filename.ext |
[.dir]filename.ext |
/dir/filename.ext |
[.dir]filename.ext |
GET remote-file [local-file]
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.
This command transfers the US-DOMAIN-INFO.TXT file from the previously specified host:
tftp>get us-domain-info.txt
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
Displays a brief help message summarizing the commands.
HELP [command]
command
Optional command for which you want help.
This command provides help for the CONNECT and GET commands:
tftp>help connect
connect to remote tftpd
tftp> help
get
receive file
Sets the file transfer mode to type; type may be either ASCII or BINARY. The initial type is ASCII.
MODE type
type
The mode type, either ASCII or BINARY.
This command changes the transfer mode to BINARY:
tftp>mode binary
tftp> status
Connected to SIRIUS.example.com.
Mode:
octet Tracing: off
Rexmt-interval: 5 seconds, Max-timeout: 25 seconds
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 shown below. The directory specification is dir and the filename specification with its extension is filename.ext.
UNIX Filename... |
Is Converted to VMS Filename... |
dir/filename.ext |
[.dir]filename.ext |
/dir/filename.ext |
[.dir]filename.ext |
PUT local-file [remote-file]
local-file
Input file specification on the local host.
remote-file
Output file specification on the remote host. If omitted, TFTP uses the local-file filename and extension.
This command transfers the US-DOMAIN-INFO.TXT file to the previously specified host:
tftp>put us-domain-info.txt
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
Exits the TFTP program. You can also use Ctrl+Z and EXIT to exit the program.
QUIT
Each of these equivalent commands exits from TFTP:
tftp>quit
tftp>exit
tftp>Ctrl+Z
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 the TIMEOUT command for details on Max-timeout recalculation.
REXMT [time]
time
The time value to set the retransmit timer. If omitted, the value is 5 seconds.
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.example.com.
Mode:
octet Tracing: off
Rexmt-interval: 10 seconds, Max-timeout: 50 seconds
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 the TIMEOUT command for an explanation.)
|
STATUS
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 several adjustments. (See the TIMEOUT command for an explanation of the Max-timeout recalculations.)
tftp> connect spica
tftp>stat
Connected to spica.example.com.
Mode: netascii Tracing: off
Rexmt-interval: 5 seconds, Max-timeout: 25 seconds
tftp>rexmt 4
tftp>stat
Connected to spica.example.com.
Mode: netascii Tracing: off
Rexmt-interval: 4 seconds, Max-timeout: 20 seconds
tftp>timeout 40
tftp>stat
Connected to spica.example.com.
Mode: netascii Tracing: on
Rexmt-interval: 4 seconds, Max-timeout: 40 seconds
tftp>timeout 30
tftp>stat
Connected to spica.example.com.
Mode: netascii Tracing: on
Rexmt-interval: 4 seconds, Max-timeout: 28 seconds
Sets the total retransmission period, in seconds. The initial value is 25 seconds.
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 below.)
TIMEOUT [time]
time
The total retransmission period, in seconds. If omitted, the value is 25 seconds.
Note the way in which the retransmission period is adjusted in this example:
tftp>connect spica
tftp>stat
Connected to spica.example.com.
Mode: netascii Tracing: off
Rexmt-interval: 5 seconds, Max-timeout: 25 seconds
tftp>rexmt 4
tftp>stat
Connected to spica.example.com.
Mode: netascii Tracing: off
Rexmt-interval: 4 seconds, Max-timeout: 20 seconds
tftp>timeout 40
tftp>stat
Connected to spica.example.com.
Mode: netascii Tracing: on
Rexmt-interval: 4 seconds, Max-timeout: 40 seconds
tftp>timeout 30
tftp> stat
Connected to spica.example.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.
Toggles the packet trace flag.
TRACE
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.example.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