rtpd2caps

CAPS import module for MRF packets from RTPD server.

Description

The RTPD plugin for CAPS collects DT and MRF packets through the REN protocol. It is supposed to have very low latency suitable for real-time data transmission.

The RTPD plugin needs a configuration file which is usually created by its init script. This configuration files lives under $SEISCOMP_ROOT/var/lib/rtpd2caps.cfg. The init script reads the configuration from $SEISCOMP_ROOT/etc/rtpd2caps.cfg and the bindings from $SEISCOMP_ROOT/etc/key/rtpd2caps/* and prepares the above final configuration file.

The configuration used by rtpd2caps looks like this:

# Number of records to queue if the sink connection is not available
queue_size = 20000

# Define the channel mapping. Each item is a tuple of source id composed
# of stream and channel and target location and stream code. The target code
# can be a single channel code (e.g. HNZ) or a combination of location and
# channel code (e.g. 00.HNZ). In case of DT packets the sampling interval
# must be specified after the channel code separated by '@'
# channels = 1.0:HNZ, 1.1:HN1, 1.2:HN2 MRF

# Starts a particular unit configuration. channel mapping can be overridden
# in a unit section as well.
unit 200B3
  # Defines the output network code for this unit.
  network  = "RT"
  # Defines the output station code for this unit.
  station  = "TEST1"
  # The RTPD server address.
  address  = 1.2.3.4:2543
  # The CAPS server address.
  sink     = localhost:18003

# Another unit.
unit 200B4
  network  = "RT"
  station  = "TEST2"
  address  = 1.2.3.4:2543
  sink     = localhost

A user does not need to create this configuration file manually if using the plugin integrated into SeisComP. The rtpd2caps plugin can be configured as any other SeisComP module, e.g. via scconfig.

An example CAPS configuration to generate the configuration above can look like this:

$SEISCOMP3_ROOT/etc/rtpd2caps.cfg

# RTP server address in format [host]:[port]. If port is omitted, 2543 is
# assumed. This is optional and only used if the address in a binding is
# omitted.
address = 1.2.3.4

# CAPS server address to send data to in format [host]:[port]. If port is
# omitted, 18003 is assumed. This is optional and only used if the sink in a
# binding is omitted.
sink = localhost:18003

# Channel mapping list where each item maps a REFTEK stream/channel id to a
# SEED channel code with optional location code. Format:
# {stream}.{channel}:[{loc}.]{cha}, e.g. 1.0:00.HHZ. This is the default used
# if a station binding does not define it explicitly.
channels = 1.0:HNZ,1.1:HN1,1.2:HN2

# Number of packets that can be queued when a sink is not reachable.
queueSize = 20000

$SEISCOMP3_ROOT/etc/key/rtpd2caps/station_RT_TEST1

# Mandatory REFTEK unit id (hex).
unit = 200B3

$SEISCOMP3_ROOT/etc/key/rtpd2caps/station_RT_TEST2

# Mandatory REFTEK unit id (hex).
unit = 200B4

Test examples

To test a server and check what packages are available, rtpd2caps can be ran in test and verify mode.

$ rtpd2caps -H 1.2.3.4 --verify --test
Requested attributes:
DAS 'mask'             (at_dasid)  = 00000000
Packet mask            (at_pmask)  = 0x00004000
Stream mask            (at_smask)  = 0x0000FFFF
Socket I/O timeout     (at_timeo)  = 30
TCP/IP transmit buffer (at_sndbuf) = 0
TCP/IP receive  buffer (at_rcvbuf) = 0
blocking I/O flag      (at_block)  = TRUE
2013:198-08:32:40 local [2195] Parameters:
2013:198-08:32:40 local [2195]  * queue_size = 10000 records
2013:198-08:32:40 local [2195]  * backfilling_buffer_size = 0s
2013:198-08:32:40 local [2195] Configured 1 source(s) and 0 sink(s)
[RTP 69.15.146.174:2543]
  XX.YYYY  unit 0
2013:198-08:32:40 local [2195] started reading from RTP server at 1.2.3.4:2543
2013:198-08:32:42 local [2195] Commands may not be sent
2013:198-08:32:42 local [2195] connected to 1.2.3.4:2543
Actual parameters:
DAS 'mask'             (at_dasid)  = 00000000
Packet mask            (at_pmask)  = 0x00004000
Stream mask            (at_smask)  = 0x0000FFFF
Socket I/O timeout     (at_timeo)  = 30
TCP/IP transmit buffer (at_sndbuf) = 0
TCP/IP receive  buffer (at_rcvbuf) = 0
blocking I/O flag      (at_block)  = TRUE
200B3 stream 1
   chamap: 7
   chacnt: 3
   cha   : 99
   dtype : 50
   time  : 2013.198 08:33:39.714000
   nsamp : 20
   bytes : 512
   rate  : 100
   chans : 0, 1, 2
200B3 stream 1
   chamap: 7
   chacnt: 3
   cha   : 99
   dtype : 50
   time  : 2013.198 08:33:39.914000
   nsamp : 20
   bytes : 512
   rate  : 100
   chans : 0, 1, 2
200B3 stream 1
   chamap: 7
   chacnt: 3
   cha   : 99
   dtype : 50
   time  : 2013.198 08:33:40.114000
   nsamp : 20
   bytes : 512
   rate  : 100
   chans : 0, 1, 2
200B3 stream 1
   chamap: 7
   chacnt: 3
   cha   : 99
   dtype : 50
   time  : 2013.198 08:33:40.314000
   nsamp : 20
   bytes : 512
   rate  : 100
   chans : 0, 1, 2
...

Configuration

Note

  • rtpd2caps is a standalone module and does not inherit global options.

  • Modules/plugins may require a license file. The default path to license files is @DATADIR@/licenses/ which can be overridden by module configuration of the parameter gempa.licensePath. Example:

    gempa.licensePath = @CONFIGDIR@/licenses
    
etc/defaults/rtpd2caps.cfg
etc/rtpd2caps.cfg
~/.seiscomp/rtpd2caps.cfg
address

Type: string

RTP server address in format [host]:[port]. If port is omitted, 2543 is assumed. This is optional and only used if the address in a binding is omitted.

sink

Type: string

CAPS server address to send data to in format [host]:[port]. If port is omitted, 18003 is assumed. This is optional and only used if the sink in a binding is omitted.

channels

Type: list:string

Channel mapping list where each item maps a REFTEK stream/channel id to a SEED channel code with optional location code. Format: {stream}.{channel}:[{loc}.]{cha}, e.g. 1.0:00.HHZ. This is the default used if a station binding does not define it explicitly.

queueSize

Type: int

Number of packets that can be queued when a sink is not reachable. Default is 10000.

backFillingBufferSize

Type: int

Unit: s

Length of backfilling buffer. Whenever a hole is detected, records will be held in a buffer and not sent out. Records are flushed from front to back if the buffer size is exceeded. Default is 0.

Bindings

unit

Type: string

Mandatory REFTEK unit id (hex).

address

Type: string

RTP server address in format [host]:[port]. If port is omitted, 2543 is assumed.

sink

Type: string

CAPS server address to send data to in format [host]:[port]. If port is omitted, 18003 is assumed.

channels

Type: list:string

Channel mapping list where each item maps a REFTEK stream/channel id to a SEED channel code with optional location code. Format: {stream}.{channel}:[{loc}.]{cha}, e.g. 1.0:00.HHZ.

Command Line

-h, --help

Print program usage and exit.

-H, --host address

RTP server to connect to in format [host]:[port]. If port is omitted, 2543 is assumed.

-S, --sink address

CAPS server to send data to in format [host]:[port]. If port is omitted, 18003 is assumed.

-n, --queue-size arg

Maximum number of packages queued before the sink connection becomes blocking.

-b, --backfilling-buffer-size arg

Buffer size in seconds for backfilling holes.

-s, --syslog

Logs to syslog.

-f, --config-file path

Path to configuration file to be used.

--log-file path

Path to log file.

--verbosity level

Log verbosity, 4=DEBUG, 3=INFO, 2=WARN, 1=ERR, 0=QUIET.

--debug

Set log level to DEBUG and log everything to stderr.

--verify

Dump package contents. This option is only useful for testing and debugging.

--test

Do not send any data to CAPS.