The MIMIC Time-Of-Day (TOD) Protocol Module is an optional facility that enables retrieving the current time of day through the Time Service ( RFC 868 ) from a Time Server, either through MIMICView at the startup time of an agent instance, or through MIMICshell commands at both startup and running state of an agent.
Time-Of-Day (TOD) 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 TOD module as part of the Cable Modem Simulator. If you prefer to enable TOD by hand, you need to do the following:
INFO - TOD : Loaded protocol from < path-to-DLL > INFO - TOD (CableModem) v7.00 : Individual license #2345
Once TOD is loaded, any agent instance configured to support the TOD protocol will be able to retrieve the current time of day from the Time Server.
If the TOD module is enabled, then Agent->Add, Agent->Configure and Agent->Paste dialogs will display TOD as an additional checkbox in the Advanced pane along with the SNMP protocols. On selecting the checkbox a new TOD pane will appear.
This TOD configuration pane lets the user configure the parameters for a TOD retrieval:
This mandatory parameter specifies the Time 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 TOD client talks to the standard TOD port 37 on the Time Server by default. If the server is configured to use a non-standard port, you can specify it in this option.
If this optional parameter is set, then upon completion of the time of day request, either successfully or unsuccessfully, an action script will be called with the following global variables as input:
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.
If the mandatory parameters are supplied, the agent will automatically initiate a TOD request upon starting.
A few new commands and some enhanced old commands can be used from the MIMICShell to use the TOD 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 TOD get args {{server} {Server} {string} {} {optional} {}} {{port} {Port} {integer} {} {optional} {37}} {{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} {}} {{timeout} {Timeout (sec)} {integer} {} {optional} {5}} {{retries} {Retries} {integer} {} {optional} {5}}
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,TOD mimicsh> mimic agent get protocol snmpv1,snmpv2c,TOD
This command lets the user get the current argument settings. A sample exchange for this command would be:
mimicsh> mimic agent protocol msg TOD get config {server=} {port=37} {script=} {timeout=5} {retries=5}
This command lets the user change the current argument settings of all TOD sessions for an agent. A sample exchange for this command would be:
mimicsh> mimic agent protocol msg TOD set config {server=genesis.gambitcomm.com} mimicsh> mimic agent protocol msg TOD get config {server=genesis.gambitcomm.com} {port=37} {script=} {timeout=5} {retries=5}
This command lets the user change the TOD tracing configuration for an agent. A sample exchange would be:
mimicsh> mimic agent assign 9 mimicsh> mimic agent protocol msg TOD get trace 0 mimicsh> mimic agent protocol msg TOD set trace 1 mimicsh> mimic agent protocol msg TOD get trace 1and the log would show:
INFO 10/01.11:00:12 - agent 9 trace enabled for TOD INFO 10/01.11:00:20 - agent 9 configured at 10.0.0.9,161. INFO 10/01.11:00:20 - agent 9 loading INFO 10/01.11:00:21 - agent 9 loaded device INFO 10/01.11:00:21 - TOD [AGT=9]: sending time request INFO 10/01.11:00:21 - TOD [AGT=9]: time recieved
Returns TOD statistics information:
In order, the statistic values are:
A sample exchange for these commands would be:
mimicsh> mimic protocol msg TOD get stats_hdr {{pktSnt} {PktsSent}} {{pktRcvd} {PktsRcvd}} mimicsh> mimic agent protocol msg TOD get statistics 1 1
This command retrieves the current time of day from the specified server (mandatory) with the specified attributes (optional).