The MIMIC TFTP Protocol Module is an optional facility that enables client TFTP file downloads (sessions) either through MIMICView at the startup time of an agent instance, or through MIMICshell commands at both startup and running state of an agent. Each of these downloads (sessions) are identified by a unique identifier called session-id.
MIMIC TFTP gives you control whether you want to save the downloaded data in a disk file, process it through an action script, or discard it upon transfer.
TFTP client support is made available in MIMIC as an optional dynamically loadable module. Starting with MIMIC 10.00, you can use the Protocol Wizard to install the TFTP module. If you prefer to enable TFTP by hand, you need to do the following:
INFO - TFTP : Loaded protocol from < path-to-DLL > INFO - TFTP (IOS) v7.00 : Individual license #2345
Once TFTP is loaded, any agent instance configured to support the TFTP protocol will be able to do TFTP transfers from a TFTP server.
If the TFTP module is enabled, then Agent->Add, Agent->Configure and Agent->Paste dialogs will display TFTP as an additional checkbox in the Advanced pane along with the SNMP protocols. On selecting the checkbox a new TFTP pane will appear.
This TFTP configuration pane lets the user configure the parameters for a TFTP session:
This mandatory parameter specifies the TFTP Server IP address, either as "dot-value" notation (e.g., 192.9.200.1), or as a hostname (e.g., gambit), or fully qualified domainname (e.g., gambit.gambitcomm.com) provided that they can be resolved to an address (via /etc/hosts, Yellow Pages or DNS).
The TFTP client talks to the standard TFTP port 69 on the TFTP server by default. If the server is configured to use a non-standard port, you can specify it in this option.
This optional parameter specifies the local IP address, either as "dot-value" notation (e.g., 192.9.200.1), or as a hostname (e.g., gambit), or fully qualified domainname (e.g., gambit.gambitcomm.com) provided that they can be resolved to an address (via /etc/hosts, Yellow Pages or DNS). This address can be a previously configured IP alias, or a temporary address for the duration of the transfer. By default, if it is left empty the main address of the agent is used.
This mandatory parameter specifies the file to be retrieved from the server. This is a server-dependent file path, eg. on Unix a relative path off /tftpboot.
This optional parameter specifies a file path to save the downloaded data in. The file path is relative to the directory specified in the environment variable MIMIC_TMPDIR, or /tmp/ . If the action script parameters is set below, but the destination file is not set, then its name will be auto generated. MIMIC TFTP will not allow more than one session to share the same destination filename (to prevent corruption of data).
If this optional parameter is set, then upon completion of the data transfer, either successfully or unsuccessfully, an action script will be called with the following global variables as input:
If the action script was not set then the data will be discarded.
By default, the transfer mode is "ascii". Else, if you want binary data to be transferred, use the mode "raw". If you want data to be converted to a space-separated hexadecimal representation, use "binary".
This optional parameter specifies the time to wait for a response between successive retransmits in seconds. The default is 5 seconds.
This optional parameter specifies the number of retransmits. The default is 5.
This parameter enables tracing.
If this parameter is set to non zero blocks then the data will be buffered in memory. If the data grows beyond a chosen limit then the buffered data will be moved to the destination file. If no destination file name is set an auto generated temporary file name will be used as the destination file name. The subsequent write will be done on this file.
If the mandatory parameters are supplied, the agent will automatically initiate a TFTP transfer upon starting.
In the case of a DOCSIS CM simulation, when DHCP has completed, the TFTP protocol will take over. To configure TFTP parameters for the agent using the information received from the DHCP offer and loaded into variables above, insert the following into the start.mtcl agent startup action script:
# # configure agent for tftp, set server, filename params set session_id [mimic agent protocol msg TFTP session read $server $file] puts stderr " session_id = $session_id " mimic agent protocol msg TFTP $session_id set dstfile myfile_$session_id mimic agent protocol msg TFTP $session_id set script tftp-rfis-appndx-d-2.1.mtcl mimic agent protocol msg TFTP $session_id set cache 0 # mimic agent protocol msg TFTP $session_id set mode binary mimic agent protocol msg TFTP $session_id start # mimic timer script add dhcp_timer.mtcl -1 [mimic agent assigned]
The script referred to above, tftp-rfis-appndx-d-2.1.mtcl, is a MIMIC TFTP completion script which will run following completion of the file download of the device configuration file. It's purpose is to parse the received configuration file and set the simulated device's operating parameters accordingly.
The tftp-rfis-appndx-d-2.1.mtcl script is available by request from Gambit, either separately or as part of the DOCSIS sample simulation. Many, but not all defined DOCSIS config file TLV's (configuration settings in Type-Length-Value format) are included in this script, along with procedures for parsing different encoding types. This file is user-editable if TLV's not defined in the script are required.
Finally, the "timer script add" statement which is commented out at the end of the start.mtcl fragment above refers to a script which would be used to launch traps or informs following successful completion of the initialization cycle.
A few new commands and some enhanced old commands can be used from the MIMICShell to use the TFTP functionality. Here is a synopsis:
This command lets the user gather the self-defining list of arguments required and their particulars. The parameters are detailed above. A sample exchange for this command would be:
mimicsh> mimic protocol msg TFTP get args {{server} {Server} {string} {} {optional} {}} {{port} {Port} {integer} {} {optional} {69}} {{client} {Client} {string} {} {optional} {}} {{srcfile} {Source File} {string} {} {optional} {}} {{dstfile} {Destination File} {string} {} {optional} {}} {{script} {Action Script} {file} {scripts {{*.mtcl {MIMIC Tcl scripts} {edit yes} {new yes}} {*.tcl {Tcl script files} {edit yes} {new yes}} {*.so {C/C++ DLL files} {edit no} {new no}}} - both} {optional} {}} {{mode} {Transfer Mode} {string} {} {optional} {ascii}} {{timeout} {Timeout (sec)} {integer} {} {optional} {5}} {{retries} {Retries} {integer} {} {optional} {5}} {{trace} {Trace} {string} {} {optional} {off}} {{cache} {Blocks to cache (0 - 10)} {integer} {} {optional} {4}}
This command lets the user look at the protocols currently configured on the agent. A sample exchange for this command would be:
mimicsh> mimic agent get protocol snmpv1,snmpv2c
This command lets the user change the protocol setting for an agent. A sample exchange for this command would be:
mimicsh> mimic agent set protocol snmpv1,TFTP mimicsh> mimic agent get protocol snmpv1,TFTP
This command lets the user get the current argument settings. A sample exchange for this command would be:
mimicsh> mimic agent protocol msg TFTP get config {server=dmb.gambitcomm.com} {port=69} {client=} {srcfile=five-m} {dstfile=uwe123} {script=} {mode=ascii} {timeout=5} {retries=5} {trace=off} {cache=4}
This command lets the user change the current argument settings of all TFTP sessions for an agent. A sample exchange for this command would be:
mimicsh> mimic agent protocol msg TFTP set config {server=genesis.gambitcomm.com} mimicsh> mimic agent protocol msg TFTP get config {server=genesis.gambitcomm.com} {port=69} {client=} {srcfile=five-m} {dstfile=uwe123} {script=} {mode=ascii} {timeout=5} {retries=5} {trace=off} {cache=4}
This command lets the user change the TFTP tracing configuration for an agent. A sample exchange would be:
mimicsh> mimic agent assign 1 mimicsh> mimic agent protocol msg TFTP get trace 0 mimicsh> mimic agent protocol msg TFTP set trace 1 mimicsh> mimic agent protocol msg TFTP get trace 1and the log would show:
INFO - agent 9 trace enabled for TFTP INFO - agent 9 configured at 10.0.0.9,161. INFO - agent 9 loading INFO - agent 9 loaded device INFO - TFTP: starting "read" session 5 for agent 9 INFO - TFTP [AGT=9,SES=5]: sent RRQ <file=foo.10, mode=netascii> INFO - TFTP [AGT=9,SES=5]: received ERROR <code=1, msg= File not found ERROR - TFTP [AGT=9,SES=5]: 7911790 - Error code 101: File not found
Returns TFTP statistics information:
In order, the statistic values are:
A sample exchange for these commands would be:
mimicsh> mimic protocol msg TFTP get stats_hdr {{pktSnt} {PktsSent}} {{pktRcvd} {PktsRcvd}} {{pktDisc} {PktsDiscarded}} {{rexmt} {Retransmits}} {{timeout} {TimeOuts}} {{inter} {Interrupted}} {{errRcvd} {Errors}} {{cmptd} {Completed}} mimicsh> mimic agent protocol msg TFTP get statistics 1 0 0 0 0 0 1 0
TFTP client sessions are created by the session command by passing the mode of operation (read or write), the server address (ip address or host name) and the source file name as arguments. This command returns a non zero session-id if the session got created successfully. A sample exchange for this command would be:
mimicsh> set sessionid [mimic agent protocol msg TFTP session read server srcfile] 5 or mimicsh> set sessionid [mimic agent protocol msg TFTP session write server srcfile] 5
In write mode the source file (srcfile) will be read from the simulation directory for the agent (ie. data/sim/[sim-name]). Many TFTP servers allow TFTP put (write) operation only if a file with the same name exists. If you want to write to a different file on the server, then use
mimic agent protocol msg TFTP $sessionid set dstfile filename
The user can get the attribute values of the session at any time by specifying a valid session id and parameter name. The get command will fail with an error message "Invalid TFTP session id", if the session id is invalid A sample exchange for this command would be:
mimicsh> mimic agent protocol msg TFTP 5 get server genesis.gambitcomm.com mimicsh> mimic agent protocol msg TFTP 5 get port 69
The user can set the attribute values of each session by specifying a valid session id, attribute name and the value. A sample exchange for this command would be:
mimicsh> mimic agent protocol msg TFTP 5 set port 79 mimicsh> mimic agent protocol msg TFTP 5 get port 79
The users can set values to its attributes before the start command is issued. Any set command after start fails with an error message "TFTP session started".
If the session id is invalid then the start command fails with an error message "Invalid TFTP session id".
The TFTP data transfer can be started by start command, provided all the mandatory attributes are set. A sample exchange for this command would be:
mimic agent protocol msg TFTP 5 start
A start command would fail for the following reasons i) if the session is already started. ii) if the session id is not valid.
Note: If no destination file is specified the TFTP client handles it differently for read and write. In case of write, the destination file name will be substituted by source file name. But in case of read the client would auto-generate a temporary file name and use it as destination file name.
Basically this command is to query the status of client session. This command return a space separated string of type:value list. This command will fail with an error message "Invalid session id" if the session id is invalid. A sample exchange for this command would be:
mimic agent protocol msg TFTP 5 status state:running bytes:1628672 in:3.3 seconds
The TFTP data transfer (after start) can be terminated by stop command with a valid session-id. This command will also start the action script by setting the global variable gStatus = interrupted. If the stop command is called before start, then it will just close the TFTP session. A sample exchange for this command would be:
mimic agent protocol msg TFTP 5 stop
This section details interoperability with some widely available TFTP servers.
Download Url | Version | Size |
---|---|---|
http://tftpd32.jounin.net/ | 2.80 | 173 Kb |
Installation and usage
Uninstallation
Download Url | Version | Size |
---|---|---|
http://fedora.redhat.com/ | 3 | (depending on installation) |
Installation and usage
Uninstallation
Download Url | Version | Size |
---|---|---|
http://www.winagents.com/ | 3.0 | 1.66MB |
Installation and usage
Uninstallation