MIMIC Time-Of-Day Protocol Module Guide

  1. Table of Contents
  2. Overview
  3. 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.

  4. Installation
  5. 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:

    • Use File->Terminate to stop the any running MIMIC daemon.

    • Copy the TOD library (tod.dll on Windows, tod.so on Unix) from "bin/dynamic/optional" to "bin/dynamic" in the install directory.

    • Install the license keys as detailed in the instructions e-mailed to you.

    • Restart MIMIC. You should see the following type of message in the MIMICLog that confirms that the TOD module was properly loaded :
      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.

  6. Using TOD from MIMICView
  7. 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:

    • Server

      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).

    • Port

      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.

    • Action Script

      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:

      • gCurrentAgent

      • gStatus = [ success | error | timeout ]

      • gServer

      • gServerPort

      • gTimeOfDay - can be parsed using TCL clock command

      • gBuffer - date or error message

      • gTimeout

      • gRetries

      • gErrorCode

    • Timeout

      This optional parameter specifies the time to wait for a response between successive retransmits in seconds. The default is 5 seconds.

    • Retries

      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.

  8. Using TOD from MIMICShell
  9. A few new commands and some enhanced old commands can be used from the MIMICShell to use the TOD functionality. Here is a synopsis:

    • mimic protocol msg TOD get args

      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}}
      
      

    • mimic agent get protocol

      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
      

    • mimic agent set protocol

      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
      

    • mimic agent protocol msg TOD get config

      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} 
      
      

    • mimic agent protocol msg TOD set config config

      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} 
      
      

    • mimic agent protocol msg TOD get trace
      mimic agent protocol msg TOD set trace [0 or 1]

      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
        1
      
      and 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
      

    • mimic protocol msg TOD get stats_hdr
      mimic agent protocol msg TOD get statistics

      Returns TOD statistics information:

      • a list of statistic headers, and
      • current statistics values for the specified server.

      In order, the statistic values are:

      • Total number of TOD packets sent.
      • Total number of TOD packets received.

      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
      

    • mimic agent protocol msg TOD gettime server server-address [port port] [script script-name] [timeout seconds [retries] times]

      This command retrieves the current time of day from the specified server (mandatory) with the specified attributes (optional).