Changes between Initial Version and Version 1 of export_scnl_ack


Ignore:
Timestamp:
02/29/12 16:07:41 (10 years ago)
Author:
branden
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • export_scnl_ack

    v1 v1  
     1[[PageOutline]] 
     2 
     3= [wiki:Earthworm Earthworm] Module: export_scnl_ack = 
     4'''Contributed by: ''' 
     5 
     6== Function == 
     7Exports EARTHWORM messages over Internet (partner to import_generic). 
     8 
     9== Details == 
     10[wiki:Import-Export Import-Export Overview] 
     11 
     12=== EXAMPLE CONFIGURATION FILE === 
     13 
     14{{{ 
     15# 
     16# export_scnl_ack configuration file 
     17# 
     18# Export_scnl_ack expects to receive an acknowledgment packet for every 
     19# packet that is writes to socket. It keeps a SendQueue of messages it has 
     20# sent and their status. The SocketSend thread will not re-use a slot in 
     21# its SendQueue until the SocketRecv thread has marked that slot as ACKed. 
     22# 
     23# Import/Export send heartbeats to each other, as well as into their 
     24# local earthworm systems. If the socket heartbeat from the distant partner 
     25# is not received whithin the expected time period (RcvAliveInt) the link is 
     26# terminated, and an attempt to reconnect is initiated. If things go 
     27# seriously wrong, the heartbeat into the local earthworm system in 
     28# stopped. The expectation is that "restartMe" has been set in the .desc 
     29# file, and we'll be killed and restarted. 
     30# 
     31# Socket heartbeats are not put in either the message stacking queue 
     32# or in the SendQueue, so they do not take up precious space when 
     33# the connection between import/export is down. 
     34# 
     35# All socket operations are performed with a timeout. This is noramlly 
     36# defaulted, but can be set in this file (SocketTimeout). 
     37# 
     38# Export maintains a circular FIFO buffer of messages to be shipped.  
     39# Let's call this the MessageStacking queue. The depth of this queue  
     40# (RingSize) controls the maximum latency of the data. 
     41# 
     42# 
     43# Configuration notes: 
     44# 
     45# "restartMe" should be uncommented in my .desc file. 
     46# 
     47# The period of our local heartbeat (HeartBeatInt) must be safely smaller 
     48# (faster) than our advertised period in our .desc file (tsec:). 
     49# Otherwise we'll get continually restarted for no good reason. 
     50# Note that tsec:0 implies no heartbeats expected, and so we'll never get 
     51# restarted. 
     52# 
     53# The rate at which we send socket heartbeats to our distant partner should 
     54# be considerably faster than the rate at which our partner expects them. 
     55# Otherwise, a heartbeat delayed in transmission will cause our partner to 
     56# conclude that the link is broken, and cause them to break the link and 
     57# reinitialize. Which will cause us to do the same. 
     58# 
     59# For export, the ServerIPAdr is the address of the port to be used in 
     60# the exporting machine.  This is to specify a network card case the 
     61# exporting machine has several network cards.   
     62# Using ServerIPAdr 0.0.0.0 will allow export to answer connections 
     63# on any valid address of the machine. 
     64# 
     65# If SocketTimeout is specified, it should be at least as large as the 
     66# expected period of heartbeats from our distant partner. 
     67 
     68# Basic Earthworm setup 
     69#---------------------- 
     70 MyModuleId     MOD_EXPORT_SCNL_ACK # module id for this program 
     71 RingName       PICK_RING           # transport ring to use for input/output 
     72 HeartBeatInt   30                  # EW internal heartbeat interval (sec) 
     73                                    #   Should be >= RcvAliveInt 
     74# Logging Control 
     75#---------------- 
     76 LogFile        1      # If 0, don't write logfile 
     77                       #    1, write to logfile and stdout 
     78                       #    2, write to module log but not stderr/stdout 
     79#Verbose               # If uncommented, VERY LARGE logfiles will be  
     80                       #   generated with info about queue status of  
     81                       #   each msg, socket alive msgs sent & received. 
     82 
     83# Logos of messages to export to client systems. 
     84#------------------------------------------------ 
     85# Installation and Module can be wildcards. 
     86# Knows how to decipher these message types: 
     87#  w/  location code: TYPE_TRACEBUF2, TYPE_TRACE2_COMP_UA,  
     88#                     TYPE_PICK_SCNL, TYPE_CODA_SCNL 
     89#  w/o location code: TYPE_TRACEBUF, TYPE_TRACE_COMP_UA, 
     90#                     TYPE_PICK2K, TYPE_CODA2K msgs 
     91# 
     92#              Installation       Module       Message Type 
     93#-------------------------------------------------------------- 
     94 GetMsgLogo    INST_UNKNOWN    MOD_WILDCARD     TYPE_TRACEBUF2 
     95 
     96# Set up Message Queues  
     97# Note: socket "alive" messages are not put in either queue 
     98#----------------------------------------------------------  
     99 MaxMsgSize             4096   # maximum size (bytes) for input/output msgs 
     100 RingSize                200   # number of msgs in MessageStacking queue. 
     101                               #  (msgs waiting to be sent to socket) 
     102 SendQueueLength         100   # Optional command: #msgs in SendQueue 
     103                               #  (msgs sent, acknowledgments pending) 
     104                               #  Valid range: 1-254 (default 100)  
     105                               #  shipped on export restarts. 
     106#MaxLatency               60   # Optional command: Packets with delay time 
     107                               #  (i.e., time between present and packet 
     108                               #  start time) greater than this amount will be 
     109                               #  filtered out. Time is in minutes.  0 -> time 
     110                               #  is not checked. System time must be accurate. 
     111                               #  Only works on waveform messages. 
     112  
     113# Set up server/client communications 
     114#------------------------------------ 
     115 ServerIPAdr  aaa.bbb.ccc.dd   # Listen for connections on this IPaddress. 
     116                               #  0.0.0.0 will use any address on machine. 
     117 ServerPort            16005   # Well-known port number to export msgs on 
     118 
     119 SendAliveText      ExpAlive   # string sent to client as heartbeat 
     120 SendAliveInt             30   # seconds between alive msgs sent to client. 
     121                               #  0 => no heartbeat 
     122 RcvAliveText       ImpAlive   # text of client's heartbeat (we get this) 
     123 RcvAliveInt              60   # seconds between client's heartbeats to us. 
     124                               #  0 => no heartbeat 
     125 
     126# Optional Socket commands: 
     127# SocketTimeout defaults to RcvAliveInt + 3  
     128#  If set to -1, all socket calls will block (no timeout). 
     129#  SocketTimeout has no effect in export, unless it is set to -1, 
     130#  because there is no code in export to handle socket timeouts. 
     131#  If set to -1, the program may run slightly more efficiently because 
     132#  timeout checking code will not execute. 
     133#---------------------------------------------------------------------- 
     134#SocketTimeout 200000  # Timeout length in milliseconds for socket calls 
     135 
     136 SocketDebug   0       # if 1, socket_ew debug statements are logged 
     137                       # if 0, socket_ew debug is turned off (default) 
     138 
     139# List of station/channel/network/loc codes to export. 
     140#-------------------------------------------------------- 
     141# NOTE: Send_scn and Send_scn_remap commands are now obsolete, and  
     142# have been replaced with Send_scnl and Send_scnl_remap (which  
     143# include the location code field).  If the old commands are used,  
     144# export_scn sets the location code field to * (wildcard). 
     145# 
     146# Use any combination of Send_scnl (to send data as-is) and  
     147#   Send_scnl_remap (to change the SCNL on the fly) commands. 
     148# Use * as a wildcard for any field. A wildcard in the 
     149#   "map to" fields of Send_scnl_remap means that field will 
     150#   not be renamed. 
     151#-------------------------------------------------------- 
     152#                  send SCNL     map to SCNL 
     153 Send_scnl       JMP ASZ NC 01                # send this specific channel 
     154 Send_scnl       JPS *   NC *                 # send all components of JPS NC 
     155 Send_scnl_remap JGR VHZ NC --   *   EHZ * *  # change component code only 
     156 Send_scnl_remap CAL *   NC *    ALM *   * *  # send all component of CAL, but 
     157                                              # change the site code to ALM 
     158}}} 
     159 
     160== Helpful Hints ==