user_docs/Network Configuration.md

CTP7 Network Service Requirements

The CTP7 firmware requires a specific set of services available on the crate network to provide all features. These services enable various different aspects of CTP7 operation, and while the card can function without any given service, various capabilities will be unavailable. These are:

  • System Manager
    • Required for geographic address assignment
    • Required for both on and off card logging of various events and service activity
  • DHCP
    • Required for non-geographic address assignment
    • Required for linux to be aware of the correct time
  • DNS
    • Required for a card to be aware of its own name
    • Recommended for accessing cards by geographic or fixed names
  • rdate
    • Required for linux to be aware of the correct time
  • syslog
    • Required for off-card logging of various events and service activity

System Manager

The CTP7 firmware relies on the System Manager for the assignment of geographic IP addresses and the location of the syslog server. It is not designed to function properly without the system manager.

When the system manager delivers the configuration payload, the geographic IP address is activated and the system log service is started.

Configuration

  1. Install the system manager from the link above.

  2. Configure the system manager according to its documentation.

    The CTP7 is configured using the GenericUW card module, which is included in the system manager distribution by default. You can configure this module using a configuration directive similar to the one below.

    cardmodule {
        module = "GenericUW.so"
        config = {
            "ivtable=ipconfig.xml",
            "support=WISC CTP-7",
        }
    }
    
  3. Supply the appropriate ip address configuration for each possible card-slot combination in the file /etc/sysmgr/ipconfig.xml specified above. Read the example configuration file included with the system manager for more details.

    The CTP7 configuration record structure is as follows:

    <Card type="WISC CTP-7">
        <FPGA id="0">1 192 168 1 41 255 255 0 0 192 168 1 4 192 168 1 4 0 0</FPGA>
    </Card>

    That is:

    Byte Value
    0 Slot Number
    1-4 IP Address
    5-8 Network Mask
    9-12 Default Gateway
    13-16 Syslog Server Address
    17-18 0

DHCP

The CTP7 relies on DHCP to provide its non-geographic IP address assignment and the address of the time server that it will set its clock from.

Configuration

The DHCP server should be configured normally, and the CTP7s should be assigned fixed addresses on the crate network.

The ntp-servers option in the subnet declaration should be set to the address of a network time server supporting the rdate protocol (not NTP). See the rdate section for further information on how to configure this service.

option ntp-servers 192.168.1.4;

Example Configuration

The Wisconsin lab configuration is:

subnet 192.168.0.0 netmask 255.255.0.0 {
    range 192.168.250.200 192.168.250.254;
    option routers 192.168.1.4;
    option ntp-servers 192.168.1.4;
    option domain-name "utca.hep.wisc.edu";
}

with specific entries for each CTP7 similar to

host eagle1 {
    hardware ethernet 00:1e:c0:85:ef:ad;
    fixed-address 192.168.250.9;
}

DNS

The CTP7 relies on the DNS service only to determine its own hostname after receiving DHCP address configuration. To do this it uses a reverse DNS lookup on the DHCP supplied address. DNS is also useful for accessing cards by geographic and nongeographic names from the control PC or other cards or systems.

Configuration

The CTP7 requires only a standard DNS server with PTR (reverse address lookup) records for the non-geographic IP addresses assigned to the card.

Accessing CTP7s by name, in either a geographic or non-geographic fashion requires only a standard DNS server with A (standard forward lookup) records for the relevant addresses.

rdate

The CTP7 relies on an rdate-compatible network time service to set the linux system time to the real world time. This is relevant to accurate and comprehensible logging and desirable for the basic operation of the linux system.

Note that the CTP7 uses an rdate time server, not an NTP time server.

Configuration

  1. Install the standard xinetd Scientific Linux package
  2. Enable the time-stream service by editing /etc/xinetd.d/time-stream and setting disable = no.
  3. Allow access to this service from the crate network by adding time: 192.168.0.0/255.255.0.0 to the file /etc/hosts.allow. Replace the given address and subnet mask by whatever address range is used on your crate network.

syslog

The CTP7 relies on an external syslog server to store its log information off card in a persistent manner. As long as the system manager has serviced the card, a short log history is stored in a volatile location on the card itself, however this log file does not serve as a persistent record.

Configuration

A standard unix syslog server must be configured to receive log messages from the crate network via UDP on port 514.

Any further details of log organization and rotation are at the user's discretion.

Example Configuration

Logging

In the Wisconsin lab, the syslog server has been configured by creating a file /etc/rsyslog.d/ctp7, with the following contents:

$UDPServerAddress 192.168.1.4
$UDPServerRun 514

$template RemoteLog,"/var/log/remote/%HOSTNAME%/messages.log"
:fromhost-ip, startswith, "192.168." ?RemoteLog

The directory /var/log/remote has been created to support this.

This configuration will listen to syslog messages on the address 192.168.1.4:514, and store all messages received from an ip address starting with 192.168. (to differentiate from messages local to the control PC) in a folder under /var/log/remote dedicated to the specific card by hostname.

Log Rotation

Log rotation has been configured by creating a file /etc/logrotate.d/ctp7 with the following contents: /etc/logrotate.d/ctp7

/var/log/remote/*/messages.log {
    sharedscripts
    missingok
    create 0644 root wheel
    compress
    dateext
    weekly
    rotate 4
    lastaction
        /bin/kill -HUP `cat /var/run/syslogd.pid 2> /dev/null` 2> /dev/null || true
        /bin/kill -HUP `cat /var/run/rsyslogd.pid 2> /dev/null` 2> /dev/null || true
    endscript
}

This configuration rotates the log files weekly, preserving old logs for 4 weeks, and makes them world readable by creating a new log file with mode 0644 after rotation.