Welcome to the HZB Channel Access Gateway documentation

_images/Gateway-Allgemein.png

The Channel Access Gateway configuration at the HZB

In this concept, each gateway has two interfaces. It is connected to a subnet where it is a channel access client, and the ca net, where it is a channel access server. A UDP broadcaster program forwards name resolution broadcasts from the subnet to the ca net. By this, each client in a subnet can find the responsible gateway for each variable in a different subnet.

Note that several gateways can run on a single host provided it has all the necessary network interfaces.

The current state (2018-11-16)

CA Gateways and udp-broadcaster programs are installed and used on these hosts:

  • gwc1c-ca.ca.bessy.de
  • gwc2c-ca.ca.bessy.de

In this configuration, CA gateways are just processes on a host, not separate hosts.

Currently, gwc1c is only used for a few gateway processes that manage gateway statistic records. All other gateway processes run on gwc2c.

Both hosts have a trunk network connection which means that they receive packets from all VLANs. Some of the VLANs do have more than one IP address range which we have to treat here as separate networks each with it’s own CA gateway.

From the perspective of linux administration, both hosts have a network interface defined for each IP range in every VLAN that is used for Channel Access connections.

The software

The udp broadcaster

The udp-broadcaster repository can be found here:

udp-broadcaster.

The CA gateway configuration scripts

The Channel Access gateway connection is managed by a collection of scripts and a JSON configuration file. If you are interested in this, I can make these available under GPL licence, please send me an email at:

Goetz.Pfeiffer _AT_ helmholtz-berlin.de

Scripts

add-key.sh
Adds an SSH key to ~cagw/.ssh/authorized_keys on all gateway hosts.
daemon-command.sh
Used to start and stop the gateways or the udp-broadcaster and to show their status.
distribute.sh
Used to distribute the gateway configuration to all hosts
find-gw.sh
Find a gateway for exporting PVs of a given IOC.
find-interface.sh
Find a network interface on the gateway hosts for a given network.
find-pv.sh
Find the IOC for a given PV.
gateway-logs.sh
Used to display log and report files of gateways
gateway-panel.sh
Starts the main gateway panel. For each gateway you have a button that starts a gateway panel with statistic displays and command buttons.
gw-ip-ports.sh
Identify a gateway when only it’s IP address and port are known.

Data files

params.json
All IP addresses are configured here, this file is a JSON file and read by the script params.py
gateways/GATEWAY/cagateway.access
This is the access security configuration for gateway GATEWAY.
gateways/GATEWAY/cagateway.pvlist
This is the pv configuration for gateway GATEWAY.

Here is an example on how params.json looks like:

{
    "hosts": {
        "gwc1c-ca.ca.bessy.de": {
            "stat-extra": {
                "IP": {
                    "CA_IP": "192.168.16.5",
                    "GW_IGNORE_SUBNET": false,
                    "SUBNET_BCAST": [
                        "192.168.16.255",
                        "193.175.216.255"
                    ]
                },
                "services": [
                    "cagateway"
                ]
            },
        },
        "gwc2c-ca.ca.bessy.de": {
            "acc-192-168-101-0-24": {
                "IP": {
                    "BC_IGNORE": "192.168.101.5",
                    "CA_BCAST": "192.168.16.255",
                    "CA_IP": "192.168.16.6",
                    "GW_EXTRA_ARGS": "-archive",
                    "GW_IGNORE_SUBNET": true,
                    "SUBNET_BCAST": "192.168.101.255",
                    "SUBNET_IP": "192.168.101.6",
                    "SUBNET_MASK": "255.255.255.0"
                },
                "services": [
                    "cagateway",
                    "udp-broadcaster-beacons",
                    "udp-broadcaster-names"
                ]
            },
            "gw-134-30-9-0-24": {
                "IP": {
                    "BC_IGNORE": "134.30.9.5",
                    "CA_BCAST": "192.168.16.255",
                    "CA_IP": "192.168.16.6",
                    "SUBNET_BCAST": "134.30.9.255",
                    "SUBNET_IP": "134.30.9.6",
                    "SUBNET_MASK": "255.255.255.0"
                },
                "services": [
                    "udp-broadcaster-beacons",
                    "udp-broadcaster-names"
                ]
            },
        }
    },
    "hosts-common": {
        "gwc1c-ca.ca.bessy.de": {
            "enabled": true,
            "env": {
                "DAEMON_HOME": "/home/cagw",
                "DAEMON_USER": "cagw",
                "EXTRA_START_ARGS": "--chuid $DAEMON_USER"
            },
            "systemd": true
        },
        "gwc2c-ca.ca.bessy.de": {
            "enabled": true,
            "env": {
                "DAEMON_HOME": "/home/cagw",
                "DAEMON_USER": "cagw",
                "EXTRA_START_ARGS": "--chuid $DAEMON_USER"
            },
            "systemd": true
        }
    },
    "hosts-disabled": {}
}

How to check the gateway status

You see the status of all gateways with the command:

./daemon-command.sh ALL ALL ALL status

The script has some more ways to call it, you get help with:

./daemon-command.sh -h

You can start the gateway statistic panel with:

./gateway-panel.sh

How to generate gateway reports

Since reports are always appended to the report file, you may want to delete a possibly existing report file first, then generate and then show the report. All of this can be done by executing the script gateway-logs.sh.

As with other scripts, this command shows what to use for “HOST” and “GATEWAY” in it’s help text:

./gateway-logs.sh -h

How to create a PV report:

./gateway-logs.sh gwc2c-ca.ca.bessy.de GATEWAY clear pvreport report

How to distribute a new gateway configuration

Simply enter:

./distribute.sh

How to start or stop gateways or udp-broadcasters

You use the script “daemon-command.sh”. Help for this script is displayed with:

./daemon-command.sh -h

This also shows the list of hosts and the gateways running on each host.

Example for restarting the gateway

We want to stop gateway “blc12old-192.168.66.192-26”. A call of “./daemon-command.sh -h” shows that this gateway runs on host gwc1c-ca.ca.bessy.de. We stop it with the command:

./daemon-command.sh gwc1c-ca.ca.bessy.de blc12old-192.168.66.192-26 cagateway stop

We start the gateway with:

./daemon-command.sh gwc1c-ca.ca.bessy.de blc12old-192.168.66.192-26 cagateway start

Example for starting the udp-broadcaster

We want to start the udp-broadcaster-names for gateway “blc12”. We start it with the command:

./daemon-command.sh gwc1c-ca.ca.bessy.de blc12old-192.168.66.192-26 udp-broadcaster-names start

Indices and tables