1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/node/ synced 2025-03-09 00:00:00 +01:00
VILLASnode/etc/example.conf

461 lines
15 KiB
Text
Raw Permalink Normal View History

/** Example configuration file for VILLASnode.
*
* This example includes all valid configuration options for the server.
* Please note, that using all options at the same time does not really
* makes sense. The purpose of this example is to serve as a reference.
*
* The syntax of this file is similar to JSON.
* A detailed description of the format can be found here:
* http://www.hyperrealm.com/libconfig/libconfig_manual.html#Configuration-Files
*
* @author Steffen Vogel <stvogel@eonerc.rwth-aachen.de>
* @copyright 2017, Institute for Automation of Complex Power Systems, EONERC
2017-04-27 12:56:43 +02:00
* @license GNU General Public License (version 3)
*
* VILLASnode
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* any later version.
*
2017-04-27 12:56:43 +02:00
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
2017-04-27 12:56:43 +02:00
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*********************************************************************************/
2016-07-11 11:24:42 +02:00
# Some global settings are used by multiple configuration files
# and therefore defined in separate files
@include "global.conf"
@include "plugins.conf"
2015-05-07 10:38:05 +02:00
############ Dictionary of nodes ############
nodes = {
2015-05-07 10:38:05 +02:00
udp_node = { # The dictionary is indexed by the name of the node.
type = "socket", # For a list of available node-types run: 'villas-node -h'
vectorize = 30, # Receive and sent 30 samples per message (combining).
samplelen = 10 # The maximum number of samples this node can receive
builtin = false, # By default, all nodes will have a few builtin hooks attached to them.
# When collecting statistics or measurements these are undesired.
2017-09-05 15:00:07 +02:00
hooks = (
{
type = "stats",
warmup = 100, # The first 100 samples are used to estimate bounds for the histograms
format = "human", # One of: human, json, matlab
bucket = 30, # The number of buckets for the histograms
verbose = true # Plot histograms during shutdown
}
),
### The following settings are specific to the socket node-type!! ###
layer = "udp", # Layer can be one of:
# - udp Send / receive L4 UDP packets
# - ip Send / receive L3 IP packets
# - eth Send / receive L2 Ethernet frames (IEEE802.3)
format = "gtnet.fake", # For a list of available node-types run: 'villas-node -h'
2017-05-28 19:43:35 +02:00
verify_source = true, # Check if source address of incoming packets matches the remote address.
2015-05-07 10:38:05 +02:00
local = "127.0.0.1:12001", # This node only received messages on this IP:Port pair
2017-05-28 19:43:35 +02:00
remote = "127.0.0.1:12000", # This node sents outgoing messages to this IP:Port pair
2015-05-07 10:38:05 +02:00
netem = { # Network emulation settings
enabled = true,
2015-05-07 10:38:05 +02:00
# Those settings can be specified for each node invidually!
delay = 100000, # Additional latency in microseconds
jitter = 30000, # Jitter in uS
distribution = "normal", # Distribution of delay: uniform, normal, pareto, paretonormal
loss = 10 # Packet loss in percent
duplicate = 10, # Duplication in percent
corrupt = 10 # Corruption in percent
},
multicast = { # IGMP multicast is only support for layer = (ip|udp)
enabled = true,
group = "224.1.2.3", # The multicast group. Must be within 224.0.0.0/4
interface = "1.2.3.4", # The IP address of the interface which should receive multicast packets.
ttl = 128, # The time to live for outgoing multicast packets.
loop = false, # Whether or not to loopback outgoing multicast packets to the local host.
}
2015-05-07 10:38:05 +02:00
},
2017-05-28 19:43:35 +02:00
ethernet_node = {
type = "socket", # See above.
### The following settings are specific to the socket node-type!! ###
layer = "eth",
local = "12:34:56:78:90:AB%eth0:12002",
remote = "12:34:56:78:90:AB%eth0:12002"
},
unix_domain_node = {
type = "socket",
layer = "unix", # Datagram UNIX domain sockets require two endpoints
local = "/var/run/villas-node/node.sock",
remote = "/var/run/villas-node/client.sock"
},
2015-05-07 10:38:05 +02:00
opal_node = { # The server can be started as an Asynchronous process
type = "opal", # from within an OPAL-RT model.
### The following settings are specific to the opal node-type!! ###
2015-05-07 10:38:05 +02:00
send_id = 1, # It's possible to have multiple send / recv Icons per model
recv_id = 1, # Specify the ID here.
reply = true
},
file_node = {
type = "file",
### The following settings are specific to the file node-type!! ###
uri = "logs/input.log", # These options specify the path prefix where the the files are stored
epoch_mode = "direct" # One of: direct (default), wait, relative, absolute
epoch = 10 # The interpretation of this value depends on epoch_mode (default is 0).
2015-10-11 15:00:15 +02:00
# Consult the documentation of a full explanation
rate = 2.0 # A constant rate at which the lines of the input files should be read
2015-10-11 15:00:15 +02:00
# A missing or zero value will use the timestamp in the first column
# of the file to determine the pause between consecutive lines.
},
ngsi_node = {
type = "ngsi",
### The following settings are specific to the ngsi node-type!! ###
endpoint = "http://46.101.131.212:1026",# The HTTP REST API endpoint of the FIRWARE context broker
entity_id = "S3_ElectricalGrid",
entity_type = "ElectricalGridMonitoring",
timeout = 5, # Timeout of HTTP request in seconds (default is 1)
verify_ssl = false, # Verification of SSL server certificates (default is true)
mapping = [ # Format: "AttributeName(AttributeType)"
2016-06-08 22:53:52 +02:00
"PTotalLosses(MW)",
"QTotalLosses(Mvar)"
]
},
websocket_node = {
2017-05-23 14:54:25 +02:00
type = "websocket",
destinations = [
"http://example.com/node-name1",
"https://example.com/another-node"
]
2017-05-23 14:54:25 +02:00
},
nanomsg_node = {
type = "nanomsg",
2017-05-23 14:54:25 +02:00
publish = [
"tcp://*:12000", # TCP socket
"ipc:///tmp/test.ipc", # Interprocess communication
"inproc://test" # Inprocess communication
],
subscribe = [
"tcp://127.0.0.1:12000",
"ipc:///tmp/test.ipc",
"inproc://test"
]
},
zeromq_node = {
type = "zeromq",
pattern = "pubsub", # The ZeroMQ pattern. One of pubsub, radiodish
2017-05-23 09:58:34 +02:00
ipv6 = false, # Enable IPv6 support
filter = "ab184", # A filter which is prefix matched
curve = { # Z85 encoded Curve25519 keys
enabled = true,
public_key = "Veg+Q.V-c&1k>yVh663gQ^7fL($y47gybE-nZP1L",
secret_key = "HPY.+mFuB[jGs@(zZr6$IZ1H1dZ7Ji*j>oi@O?Pc"
}
subscribe = "tcp://*:1234" # The subscribe endpoint.
# See http://api.zeromq.org/2-1:zmq-bind for details.
publish = [ # The publish endpoints.
"tcp://localhost:1235", # See http://api.zeromq.org/2-1:zmq-connect for details.
2017-05-23 09:58:34 +02:00
"tcp://localhost:12444"
],
},
signal_node = {
type = "signal",
2017-09-01 07:50:35 +02:00
signal = "sine", # One of: sine, square, ramp, counter, constant, triangle, random, mixed, constant"
values = 4, # Number of values per sample
amplitude = 2.3, # Amplitude of generated signals
frequency = 10, # Frequency of generated signals
stddev = 2, # Standard deviation of random signals (normal distributed)
rate = 10.0, # Sample rate
offset = -4.5 # DC bias / Offset
},
loopback_node = {
type = "loopback", # A loopback node will receive exactly the same data which has been sent to it.
# The internal implementation is based on queue.
queuelen = 1024 # The queue length of the internal queue which buffers the samples.
2017-07-06 23:48:19 +02:00
samplelen = 64 # Each buffered sample can contain up to 64 values.
},
shmem_node = {
type = "shmem",
in_name = "sn1_in", # Name of shared memory segment for receiving side
out_name = "sn1_in", # Name of shared memory segment for sending side
queuelen = 1024, # Length of the queues
polling = true, # We can busy-wait or use pthread condition variables for synchronizations
# Execute an external process when starting the node which
# then starts the other side of this shared memory channel
# Usually we also pass the shmem names as parameters.
exec = [ "villas-shmem", "sn1_in", "sn1_out" ]
},
2017-09-16 17:21:57 +02:00
stats_node = { # The "stats" node-type streams statistics of a second node
type = "stats",
node = "udp_node",
rate = "2"
2017-09-16 17:21:57 +02:00
},
rtt_node = { # The "test_rtt" node-type runs a set of test cases for varying
type = "test_rtt", # sending rates, number of values and generates statistics.
cooldown = 2, # The cooldown time between each test case in seconds
prefix = "test_rtt", # An optional prefix in the filename
output = "/tmp/results/testA", # The output directory for all results
# The results of each test case will be written to a seperate file.
format = "villas.human", # The output format of the result files.
2017-09-16 17:21:57 +02:00
cases = ( # The list of test cases
# Each test case can specify a single or an array of rates and values
# If arrays are used, we will generate multiple test cases with all
# possible combinations
{
2017-10-15 22:03:40 +02:00
rates = 55.0, # The sending rate in Hz
values = 5, # The number of values which should be send in each sample
limit = 100 # The number of samples which should be send during this test case
2017-09-16 17:21:57 +02:00
},
{
2017-10-15 22:03:40 +02:00
rates = [ 5, 10, 30 ], # An array of rates in Hz
values = [ 2, 10, 20 ],# An array of number of values
duration = 5 # The duration of the test case in seconds (depending on the sending rate)
2017-09-16 17:21:57 +02:00
}
)
2017-10-15 22:02:43 +02:00
},
influxdb_node = {
type = "influxdb",
server = "localhost:8089",
key = "villas",
out = {
signals = ( # The signal name will be used as fields for the InfluxDB
{ name = "a" },
{ name = "b" },
{ name = "c" },
}
}
2017-11-18 01:03:16 +01:00
},
amqp_node = {
type = "amqp",
format = "json",
# Use 'amqps://' to enable SSL/TLS
uri = "amqp://guest:guest@localhost:5672//",
# Alternatively connection settings can be specified individually
username = "guest",
password = "guest",
host = "localhost",
vhost = "/",
port = 5672,
2017-11-18 01:03:16 +01:00
exchange = "mytestexchange",
routing_key = "abc",
ssl = {
verify_hostname = true,
verify_peer = true,
ca_cert = "/path/to/ca.crt",
client_cert = "/path/to/client.crt",
client_key = "/path/to/client.key"
}
},
2017-11-17 17:27:01 +01:00
sampled_values_node = {
type = "iec61850-9-2",
2017-11-18 01:42:25 +01:00
2017-11-17 17:27:01 +01:00
interface = "lo",
2017-11-18 01:42:25 +01:00
dst_address = "01:0c:cd:01:00:01",
publish = {
fields = [
"float32",
"float64",
"int8",
"int32"
],
svid = "test1234",
smpmod = "samples_per_second",
confrev = 55
},
subscribe = {
fields = [
"float32",
"float64",
"int8",
"int32"
]
}
2018-01-17 01:22:26 +01:00
},
mqtt_node = {
type = "mqtt",
format = "protobuf",
2018-04-18 11:31:53 +02:00
username = "guest",
password = "guest",
2018-01-17 01:22:26 +01:00
host = "localhost",
port = 1883,
keepalive = 5, # Send ping every 5 seconds to keep connection alive
retain = false,
qos = 0,
publish = "test-topic",
subscribe = "test-topic",
ssl = {
enabled = false,
insecure = true,
cafile = "/etc/ssl/certs/ca-bundle.crt",
certfile = "/etc/ssl/certs/my.crt",
keyfile = "/etc/ssl/keys/my.key"
}
2017-11-18 01:03:16 +01:00
}
};
2015-05-07 10:38:05 +02:00
############ List of paths ############
paths = (
{
2015-05-19 16:56:19 +02:00
enabled = true, # Enable this path (default: true)
reverse = true, # Setup a path in the reverse direction as well (default: false)
2015-05-19 16:56:19 +02:00
in = "acs", # Name of the node we receive messages from (see node dictionary)
out = "sintef", # Name of the node we send messages to.
2015-05-19 16:56:19 +02:00
rate = 100, # Send message over this path with a fixed (constant) rate (default: 0).
# Setting this value to 0 will disable this feature.
2017-10-18 12:50:13 +02:00
queuelen = 128,
mode = "all", # When this path should be triggered
# - "all": After all masked input nodes received new data
# - "any": After any of the masked input nodes received new data
mask = [ "acs" ], # A list of input nodes which will trigger the path
rate = 10.0 # A rate at which this path will be triggered if no input node receives new data
2015-05-07 10:38:05 +02:00
},
{
enabled = false,
reverse = false,
in = [ # Multiple source nodes are multiplexed
"opal_node.data[0-4]",
"signal_node.data[0-4]"
],
out = [ # Multiple destination nodes are supported too.
"udp_node", # All destination nodes receive the same sample
"zeromq_node" # Which gets constructed by the 'in' mapping.
]
},
{
in = "socket_node",
out = "file_node", # This path includes all available example hooks.
builtin = false, # By default, all paths will have a few builtin hooks attached to them.
# When collecting statistics or measurements these are undesired.
# A complete list of supported hooks
2017-05-07 22:50:50 +02:00
hooks = (
{
type = "print"
2017-05-07 22:50:50 +02:00
output = "stdout"
priority = 0
},
{
type = "ts"
2017-05-07 22:50:50 +02:00
priority = 1
},
{
type = "decimate"
2017-05-07 22:50:50 +02:00
ratio = 2 # Only forward every 2nd message
},
{
type = "convert"
mask = 0x1 # only convert the first value
mode = "fixed" # Convert all values to fixed precission. Use 'float' to convert to floating point.
scale = 1.0
},
{
type = "skip_first"
2017-05-07 22:50:50 +02:00
seconds = 10 # Skip the first 10 seconds of this path
# samples = 1000 # Skip the first 1000 samples
},
{
type = "shift"
mode = "origin", # Shift origin timestam of samples by +10 seconds
offset = 10 # Seconds
},
{ # Remap values within a sample.
type = "map", # The values of the new samples are constructed
# from a concatenation of the following mapping entries.
map = [
"data[0]", # The first value of the original sample
"data[2-5]", # Values 3-6 of the original sample
"hdr.sequence", # The sequence no of the original sample
"hdr.length", # The number of values of the original sample
"hdr.id", # The id of the original sample
"hdr.format", # A bitmask of the format of each value
"ts.origin", # The timestamp as sent by the origin simulator
"ts.received", # The timestamp of the arrival time of the original sample
"ts.send", # The timestamp when this sample was sent (does not work)
# Statistics of the current path. Allowed stats are:
# owd One-way-delay (OWD) of received messages
# gap_sample Inter-message timestamps (as sent by remote)
# gap_received Inter-message arrival time (as seen by this instance)
# reordered Reordered samples and the distance between them
# skipped Skipped samples by hooks and the distance between them
# For each stats the following details are available:
"stats.owd.last", # The last ovserved value
"stats.owd.highest", # The highest observed value
"stats.owd.lowest", # The lowest observed value
"stats.owd.mean", # The average observed value
"stats.owd.var", # The variance of the observed value
"stats.owd.stddev", # The standard deviation of the observed value
"stats.owd.total" # The total number ob observed values
]
2017-05-07 22:50:50 +02:00
}
)
}
);